/* ==========================================================================
   Alkalmazás
   ========================================================================== */

html, body { height: 100%; }
body { overflow: hidden; background: var(--bg); }
[hidden] { display: none !important; }

.screen { position: fixed; inset: 0; }
.boot { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg); z-index: 100; transition: opacity 0.4s; }
.boot .app-icon { animation: pulse 1.4s ease-in-out infinite; }
.boot.gone { opacity: 0; pointer-events: none; }
@keyframes pulse { 50% { transform: scale(0.94); opacity: 0.8; } }

/* ---------- Belépőkód ---------- */
.gate {
  display: grid; place-items: center; padding: 24px 16px;
  background:
    radial-gradient(900px 500px at 15% -10%, color-mix(in srgb, #0a84ff 16%, transparent), transparent 60%),
    radial-gradient(800px 500px at 110% 110%, color-mix(in srgb, #bf5af2 14%, transparent), transparent 60%),
    var(--bg-2);
}
.gate-card {
  width: min(420px, 100%); text-align: center; display: grid; justify-items: center; gap: 10px;
  background: var(--glass-strong); backdrop-filter: blur(30px) saturate(180%); -webkit-backdrop-filter: blur(30px) saturate(180%);
  border-radius: 32px; padding: 44px 32px 28px; box-shadow: var(--shadow-3); border: 1px solid var(--sep);
}
.gate-card .app-icon { margin-bottom: 10px; }
.gate-card .title { font-size: 30px; }
.gate-card p { margin: 0; }
.code-field { position: relative; width: 100%; margin-top: 14px; }
.code-input { text-align: center; font-size: 20px; letter-spacing: 0.18em; padding: 14px 56px; border-radius: 16px; }
.code-input::placeholder { letter-spacing: 0; font-size: 17px; }
.code-go {
  position: absolute; right: 7px; top: 50%; transform: translateY(-50%); width: 38px; height: 38px; border-radius: 50%;
  border: 0; background: var(--accent); color: #fff; display: grid; place-items: center; cursor: pointer; transition: transform 0.15s, background 0.2s;
}
.code-go:hover { background: var(--accent-hover); }
.code-go:active { transform: translateY(-50%) scale(0.92); }
.code-go svg { width: 18px; height: 18px; }
.gate-error, .profiles-error { color: var(--red); min-height: 20px; margin: 4px 0 6px !important; }

/* ---------- Profilok ---------- */
.profiles { display: grid; place-items: center; overflow-y: auto; padding: 40px 16px; background: var(--bg); }
.profiles-inner { width: min(860px, 100%); display: grid; justify-items: center; gap: 36px; text-align: center; }
.profile-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 28px; }
.profile-tile { border: 0; background: none; cursor: pointer; display: grid; justify-items: center; gap: 12px; width: 112px; padding: 0; color: var(--label-2); transition: color 0.2s; }
.profile-tile:hover { color: var(--label); }
.profile-tile .avatar { width: 96px; height: 96px; font-size: 38px; transition: transform 0.3s var(--spring), box-shadow 0.3s; }
.profile-tile:hover .avatar { transform: scale(1.06); box-shadow: var(--shadow-2); }
.profile-tile span.n { font-size: 15px; font-weight: 500; max-width: 112px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar.add { background: var(--fill-2); color: var(--label-2); }
.avatar.add svg { width: 34px; height: 34px; }
.new-profile { display: flex; gap: 10px; width: min(480px, 100%); flex-wrap: wrap; justify-content: center; }
.new-profile .input { flex: 1 1 220px; }

.avatar {
  --c1: #5ac8fa; --c2: #007aff;
  width: 30px; height: 30px; border-radius: 50%; flex: none; display: grid; place-items: center;
  color: #fff; font-weight: 600; font-size: 13px; letter-spacing: 0;
  background: linear-gradient(145deg, var(--c1), var(--c2));
}
.avatar[data-c="1"] { --c1: #ffb340; --c2: #ff7a00; }
.avatar[data-c="2"] { --c1: #63e6a1; --c2: #1fa45a; }
.avatar[data-c="3"] { --c1: #ff8a9b; --c2: #ff375f; }
.avatar[data-c="4"] { --c1: #c49bff; --c2: #8e44ff; }
.avatar[data-c="5"] { --c1: #66d4cf; --c2: #0c9a94; }
.avatar[data-c="6"] { --c1: #a3a8b8; --c2: #5f6373; }
.avatar[data-c="7"] { --c1: #ffd60a; --c2: #f0a500; }

/* ---------- Fő elrendezés ---------- */
.main { display: grid; grid-template-columns: 272px minmax(0, 1fr) auto; grid-template-rows: minmax(0, 1fr); height: 100%; }
.main.sb-collapsed { grid-template-columns: 0 minmax(0, 1fr) auto; }
.main.sb-collapsed .sidebar { transform: translateX(-100%); visibility: hidden; }

/* Oldalsáv */
.sidebar {
  background: var(--bg-2); border-right: 1px solid var(--sep); display: flex; flex-direction: column; min-width: 0; height: 100%;
  transition: transform 0.35s var(--spring), visibility 0.35s; z-index: 30;
}
.sb-top { display: flex; align-items: center; justify-content: space-between; padding: 14px 12px 6px 16px; }
.sb-brand { display: inline-flex; gap: 10px; align-items: center; font-weight: 600; font-size: 17px; color: var(--label); text-decoration: none !important; }
.sb-brand .app-icon { width: 26px; height: 26px; border-radius: 7px; }
.sb-new {
  margin: 8px 12px 6px; height: 40px; border-radius: 12px; border: 1px solid var(--sep); background: var(--elev);
  display: flex; align-items: center; gap: 8px; padding: 0 12px; font-size: 15px; font-weight: 500; cursor: pointer; box-shadow: var(--shadow-1);
  transition: transform 0.15s, background 0.2s;
}
.sb-new:hover { background: color-mix(in srgb, var(--elev) 94%, var(--label)); }
.sb-new:active { transform: scale(0.98); }
.sb-new svg { width: 18px; height: 18px; color: var(--accent); }
.sb-nav { display: grid; gap: 1px; padding: 6px 8px; }
.sb-item {
  display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border: 0; background: none; border-radius: 9px;
  font-size: 15px; cursor: pointer; text-align: left; color: var(--label);
}
.sb-item:hover { background: var(--fill-2); }
.sb-item svg { width: 19px; height: 19px; color: var(--label-2); flex: none; }
.sb-item span:first-of-type { flex: 1; }
.sb-count { font-size: 12px; color: var(--label-3); font-variant-numeric: tabular-nums; }
.sb-search { margin: 6px 12px 4px; position: relative; }
.sb-search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--label-3); }
.sb-search input {
  width: 100%; height: 34px; border-radius: 10px; border: 0; background: var(--fill-2); padding: 0 10px 0 32px; font: inherit; font-size: 14px; color: var(--label); outline: none;
}
.sb-search input:focus { box-shadow: 0 0 0 3px var(--accent-soft); }
.sb-list { flex: 1; overflow-y: auto; padding: 4px 8px 12px; overscroll-behavior: contain; }
.sb-group { font-size: 12px; font-weight: 600; color: var(--label-3); padding: 14px 10px 4px; letter-spacing: 0; }
.conv-item {
  display: flex; align-items: center; gap: 6px; width: 100%; height: 34px; padding: 0 10px; border: 0; border-radius: 9px;
  background: none; cursor: pointer; font-size: 14px; color: var(--label); text-align: left; position: relative;
}
.conv-item span { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.conv-item:hover { background: var(--fill-2); }
.conv-item.active { background: var(--fill); font-weight: 500; }
.conv-item .star { width: 13px; height: 13px; color: #ff9f0a; flex: none; }
.conv-item .live { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); flex: none; animation: pulse 1.2s infinite; }
.sb-empty { color: var(--label-3); font-size: 14px; padding: 16px 10px; }
.sb-foot { position: relative; padding: 8px; border-top: 1px solid var(--sep); }
.sb-profile { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border: 0; background: none; border-radius: 12px; cursor: pointer; text-align: left; }
.sb-profile:hover { background: var(--fill-2); }
.sb-profile-name { flex: 1; font-size: 15px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sb-profile .chev { width: 16px; height: 16px; color: var(--label-3); }

/* Menük */
.menu {
  position: absolute; left: 8px; right: 8px; bottom: calc(100% - 4px); z-index: 60; padding: 6px;
  background: var(--glass-strong); backdrop-filter: blur(30px) saturate(180%); -webkit-backdrop-filter: blur(30px) saturate(180%);
  border: 1px solid var(--sep); border-radius: 14px; box-shadow: var(--shadow-2); animation: pop 0.22s var(--spring);
}
.menu button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 8px; font-size: 14px; cursor: pointer; color: var(--label); }
.menu button:hover { background: var(--accent); color: #fff; }
.menu button.danger { color: var(--red); }
.menu button.danger:hover { background: var(--red); color: #fff; }
.menu hr { border: 0; border-top: 1px solid var(--sep); margin: 4px 6px; }
.menu-top { left: auto; right: 12px; top: 48px; bottom: auto; width: 190px; }
@keyframes pop { from { opacity: 0; transform: scale(0.96) translateY(4px); } to { opacity: 1; transform: none; } }

.scrim { display: none; }

/* ---------- Chat ---------- */
.chat { display: flex; flex-direction: column; min-width: 0; min-height: 0; height: 100%; position: relative; background: var(--bg); }
.topbar {
  height: 52px; display: flex; align-items: center; gap: 6px; padding: 0 12px; position: relative; flex: none;
  border-bottom: 1px solid transparent; transition: border-color 0.2s;
}
.topbar.scrolled { border-bottom-color: var(--sep); }
#sbOpen { display: none; }
.main.sb-collapsed #sbOpen { display: inline-grid; }
.conv-title {
  flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: 15px; font-weight: 600; color: var(--label);
  padding: 6px 8px; border-radius: 8px; outline: none; text-overflow: ellipsis;
}
.conv-title:hover { background: var(--fill-3); }
.conv-title:focus { background: var(--fill-2); }
.demo-pill { cursor: pointer; border: 0; font-size: 12px; font-weight: 600; color: var(--orange); background: var(--orange-soft); padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
#starBtn.on { color: #ff9f0a; }
#starBtn.on svg { fill: currentColor; }

.messages { flex: 1; min-height: 0; overflow-y: auto; padding: 8px 16px 24px; overscroll-behavior: contain; scroll-behavior: smooth; }
.thread { width: min(760px, 100%); margin: 0 auto; display: flex; flex-direction: column; gap: 28px; padding-top: 12px; }

/* Üres állapot */
.empty { width: min(760px, 100%); margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; justify-content: center; padding: 24px 0 40px; gap: 28px; }
.empty h1 { font-size: clamp(32px, 4.6vw, 44px); letter-spacing: -0.035em; margin: 0; line-height: 1.1; }
.empty h1 .grad { background: linear-gradient(92deg, #0a84ff, #5e5ce6 60%, #bf5af2); -webkit-background-clip: text; background-clip: text; color: transparent; }
.empty p { margin: 8px 0 0; }
.suggest { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.suggest button {
  text-align: left; border: 1px solid var(--sep); background: var(--elev); border-radius: 18px; padding: 16px; cursor: pointer;
  display: grid; gap: 6px; transition: transform 0.2s var(--spring), box-shadow 0.2s, border-color 0.2s; box-shadow: var(--shadow-1);
}
.suggest button:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); border-color: transparent; }
.suggest b { font-size: 15px; letter-spacing: -0.015em; }
.suggest span { font-size: 13px; color: var(--label-2); line-height: 1.4; }
.suggest .ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 4px; }
.suggest .ic svg { width: 17px; height: 17px; }
@media (max-width: 720px) { .suggest { grid-template-columns: 1fr; } }

/* Üzenetek */
.msg { display: flex; flex-direction: column; gap: 10px; min-width: 0; animation: msgIn 0.4s var(--spring); }
@keyframes msgIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.msg.user { align-items: flex-end; }
.bubble-user {
  background: var(--fill-2); border-radius: 22px 22px 6px 22px; padding: 11px 16px; max-width: min(85%, 620px);
  white-space: pre-wrap; word-wrap: break-word; font-size: 16px; line-height: 1.5;
}
.bubble-user.long { max-height: 240px; overflow: hidden; mask-image: linear-gradient(#000 70%, transparent); -webkit-mask-image: linear-gradient(#000 70%, transparent); cursor: pointer; }
.msg-meta { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.att {
  display: inline-flex; align-items: center; gap: 10px; padding: 8px 12px 8px 8px; border-radius: 14px; background: var(--elev);
  border: 1px solid var(--sep); font-size: 13px; max-width: 280px;
}
.att .ficon { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; color: #fff; font-size: 10px; font-weight: 700; flex: none; background: #1d8f4e; }
.att .ficon.pdf { background: #e5383b; }
.att .ficon.img { background: #8e44ff; }
.att .ficon.txt { background: #6e6e73; }
.att div { min-width: 0; display: grid; }
.att b { font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.att small { color: var(--label-3); }
.att .x { border: 0; background: var(--fill-2); width: 20px; height: 20px; border-radius: 50%; cursor: pointer; color: var(--label-2); display: grid; place-items: center; font-size: 13px; line-height: 1; }

.msg.ai { gap: 12px; }
.ai-head { display: flex; align-items: center; gap: 10px; font-size: 14px; font-weight: 600; }
.ai-head .app-icon { width: 24px; height: 24px; border-radius: 7px; }
.typing { display: inline-flex; gap: 4px; padding: 6px 0; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--label-3); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: 0.2s; }
.typing i:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.25; transform: scale(0.85); } 40% { opacity: 1; transform: none; } }

/* Lépések */
.steps { border: 1px solid var(--sep); border-radius: 16px; overflow: hidden; background: var(--bg-3); }
.steps-head { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 14px; border: 0; background: none; cursor: pointer; text-align: left; font-size: 14px; color: var(--label-2); }
.steps-head .cur { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--label); }
.steps-head .count { font-variant-numeric: tabular-nums; font-size: 12px; }
.steps-head .chev { width: 14px; height: 14px; transition: transform 0.25s var(--spring); }
.steps.open .steps-head .chev { transform: rotate(180deg); }
.steps-list { display: none; padding: 2px 14px 12px; max-height: 360px; overflow-y: auto; }
.steps.open .steps-list { display: grid; gap: 2px; }
.step-row { display: grid; grid-template-columns: 18px 1fr; gap: 10px; align-items: start; font-size: 13px; padding: 5px 0; color: var(--label-2); }
.step-row .ic { width: 16px; height: 16px; margin-top: 2px; display: grid; place-items: center; }
.step-row .ic svg { width: 15px; height: 15px; }
.step-row .ic .spinner { width: 13px; height: 13px; }
.step-row.progress { color: var(--label); font-style: normal; }
.step-row.error { color: var(--red); }
.step-row .d { display: block; color: var(--label-3); font-size: 12px; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step-row.done .ic { color: var(--green); }
.step-row.search .ic, .step-row.fetch .ic { color: var(--accent); }

/* Markdown */
.md { font-size: 16px; line-height: 1.6; overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p { margin: 0 0 12px; }
.md h1, .md h2, .md h3, .md h4 { letter-spacing: -0.02em; line-height: 1.25; margin: 22px 0 8px; }
.md h1 { font-size: 22px; } .md h2 { font-size: 19px; } .md h3 { font-size: 17px; } .md h4 { font-size: 16px; }
.md ul, .md ol { margin: 0 0 12px; padding-left: 22px; }
.md li { margin: 3px 0; }
.md strong { font-weight: 600; }
.md code { font-family: var(--mono); font-size: 0.88em; background: var(--fill-2); padding: 1px 5px; border-radius: 5px; }
.md pre { background: var(--bg-2); padding: 14px; border-radius: 12px; overflow-x: auto; font-size: 13px; }
.md pre code { background: none; padding: 0; }
.md blockquote { margin: 0 0 12px; padding: 4px 14px; border-left: 3px solid var(--sep-strong); color: var(--label-2); }
.md hr { border: 0; border-top: 1px solid var(--sep); margin: 18px 0; }
.md a { word-break: break-all; }
.md .tbl { overflow-x: auto; margin: 4px 0 14px; border: 1px solid var(--sep); border-radius: 12px; }
.md table { border-collapse: collapse; width: 100%; font-size: 14px; font-variant-numeric: tabular-nums; }
.md th, .md td { padding: 9px 12px; border-bottom: 1px solid var(--sep); text-align: left; vertical-align: top; }
.md th { background: var(--bg-2); font-weight: 600; font-size: 13px; color: var(--label-2); white-space: nowrap; }
.md tr:last-child td { border-bottom: 0; }
.md td.r, .md th.r { text-align: right; }
.md td.c, .md th.c { text-align: center; }
.cursor::after { content: ""; display: inline-block; width: 8px; height: 17px; background: var(--accent); border-radius: 2px; margin-left: 2px; vertical-align: -3px; animation: blink 1s infinite; }

/* Eredmény-kártyák */
.file-card {
  border: 1px solid var(--sep); border-radius: 20px; background: var(--elev); box-shadow: var(--shadow-1); overflow: hidden;
  display: grid;
}
.fc-top { display: flex; align-items: center; gap: 12px; padding: 14px 16px; }
.fc-icon { width: 42px; height: 42px; border-radius: 11px; background: linear-gradient(145deg, #34c759, #1d8f4e); display: grid; place-items: center; color: #fff; flex: none; }
.fc-icon svg { width: 22px; height: 22px; }
.fc-name { flex: 1; min-width: 0; display: grid; }
.fc-name b { font-size: 15px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.fc-name span { font-size: 13px; color: var(--label-2); }
.fc-actions { display: flex; gap: 8px; }
.fc-stats { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--sep); }
.fc-stats > div { padding: 12px 16px; display: grid; gap: 2px; border-right: 1px solid var(--sep); min-width: 0; }
.fc-stats > div:last-child { border-right: 0; }
.fc-stats small { color: var(--label-2); font-size: 12px; }
.fc-stats b { font-size: 17px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.abc-bar { display: flex; height: 6px; border-radius: 6px; overflow: hidden; background: var(--fill-2); margin-top: 6px; }
.abc-bar i { display: block; height: 100%; }
.abc-bar .a { background: #34c759; } .abc-bar .b { background: #ff9f0a; } .abc-bar .c { background: #ff453a; }
@media (max-width: 640px) {
  .fc-stats { grid-template-columns: 1fr 1fr; }
  .fc-stats > div:nth-child(2) { border-right: 0; }
  .fc-stats > div:nth-child(-n+2) { border-bottom: 1px solid var(--sep); }
  .fc-top { flex-wrap: wrap; }
  .fc-actions { width: 100%; }
  .fc-actions .btn { flex: 1; }
}

.mem-note { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--label-2); background: var(--fill-3); border-radius: 10px; padding: 6px 10px; align-self: flex-start; cursor: pointer; border: 0; }
.mem-note svg { width: 15px; height: 15px; color: var(--violet); }
.err-box { border-radius: 14px; background: var(--red-soft); color: var(--red); padding: 12px 14px; font-size: 14px; }
.msg-tools { display: flex; gap: 2px; opacity: 0; transition: opacity 0.2s; }
.msg:hover .msg-tools, .msg:focus-within .msg-tools { opacity: 1; }
.msg-tools .icon-btn { width: 30px; height: 30px; }
.msg-tools .icon-btn svg { width: 16px; height: 16px; }
.chips-row { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.chips-row .chip { height: 24px; font-size: 12px; }

/* ---------- Beviteli mező ---------- */
.composer-wrap { padding: 0 16px calc(10px + env(safe-area-inset-bottom)); flex: none; }
.composer {
  width: min(760px, 100%); margin: 0 auto; position: relative; background: var(--elev); border: 1px solid var(--sep);
  border-radius: 26px; box-shadow: var(--shadow-2); padding: 10px 10px 8px 16px; display: grid; gap: 6px; transition: border-color 0.2s, box-shadow 0.2s;
}
.composer:focus-within { border-color: color-mix(in srgb, var(--accent) 45%, var(--sep)); }
.composer.drag { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow-2); }
.drop-hint { display: none; position: absolute; inset: 0; border-radius: inherit; background: color-mix(in srgb, var(--accent-soft) 70%, var(--elev)); color: var(--accent); font-weight: 600; place-items: center; z-index: 3; }
.composer.drag .drop-hint { display: grid; }
.composer textarea {
  border: 0; outline: none; resize: none; background: transparent; font: inherit; font-size: 16px; line-height: 1.5; color: var(--label);
  max-height: 38vh; min-height: 26px; padding: 6px 4px 2px 0;
}
.composer textarea::placeholder { color: var(--label-3); }
.att-row { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 4px; }
.detected { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 12px; color: var(--label-3); }
.detected .chip { height: 24px; font-size: 12px; }
.composer-bar { display: flex; align-items: center; gap: 6px; }
.composer-bar .spacer { flex: 1; }
.chip.pick { height: 32px; background: transparent; border: 1px solid var(--sep); color: var(--label-2); }
.chip.pick:hover { background: var(--fill-2); color: var(--label); }
.chip.pick.on { background: var(--accent-soft); border-color: transparent; color: var(--accent); }
.send {
  width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; cursor: pointer; display: grid; place-items: center;
  transition: transform 0.15s, background 0.2s, opacity 0.2s;
}
.send:disabled { background: var(--fill); color: var(--label-3); cursor: default; }
.send:not(:disabled):active { transform: scale(0.9); }
.send svg { width: 18px; height: 18px; }
.send.stop { background: var(--label); color: var(--bg); }
.composer-note { text-align: center; margin: 8px 0 0; }

/* Felugró listák a beviteli mező fölött */
.popover {
  position: absolute; left: 8px; bottom: calc(100% + 8px); width: min(400px, calc(100% - 16px)); max-height: min(440px, 60vh); overflow-y: auto; z-index: 20;
  background: var(--glass-strong); backdrop-filter: blur(30px) saturate(180%); -webkit-backdrop-filter: blur(30px) saturate(180%);
  border: 1px solid var(--sep); border-radius: 18px; box-shadow: var(--shadow-3); padding: 8px; animation: pop 0.22s var(--spring);
}
.pop-head { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px 8px; }
.pop-head b { font-size: 15px; }
.pop-item { display: flex; align-items: flex-start; gap: 10px; width: 100%; text-align: left; border: 0; background: none; padding: 9px 8px; border-radius: 10px; cursor: pointer; }
.pop-item:hover { background: var(--fill-2); }
.pop-item div { flex: 1; min-width: 0; display: grid; gap: 1px; }
.pop-item b { font-size: 14px; font-weight: 600; }
.pop-item span { font-size: 12px; color: var(--label-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.check { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--sep-strong); flex: none; display: grid; place-items: center; margin-top: 1px; transition: background 0.15s, border-color 0.15s; }
.pop-item.on .check { background: var(--accent); border-color: var(--accent); }
.pop-item.on .check::after { content: ""; width: 9px; height: 5px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.pop-empty { padding: 14px 10px; font-size: 14px; color: var(--label-2); }
.pop-foot { border-top: 1px solid var(--sep); margin-top: 6px; padding-top: 6px; }
.pop-search { width: 100%; height: 34px; margin: 0 0 6px; border: 0; border-radius: 10px; background: var(--fill-2); padding: 0 10px; font: inherit; font-size: 14px; color: var(--label); outline: none; }

/* ---------- Táblázat panel ---------- */
.panel {
  width: min(56vw, 900px); border-left: 1px solid var(--sep); background: var(--elev); display: flex; flex-direction: column; min-width: 0; height: 100%;
  animation: panelIn 0.4s var(--spring);
}
@keyframes panelIn { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.panel-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 16px; border-bottom: 1px solid var(--sep); }
.panel-title { flex: 1; min-width: 0; display: grid; gap: 2px; }
.panel-name { margin: 0; font-weight: 600; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ver-select { justify-self: start; border: 0; background: none; color: var(--label-2); font: inherit; font-size: 12px; padding: 0; cursor: pointer; }
.approve { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; color: var(--label-2); }
.approve .switch { transform: scale(0.82); margin: -4px; }
.pv-kpis { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--sep); }
.pv-kpis div { padding: 10px 16px; border-right: 1px solid var(--sep); display: grid; min-width: 0; }
.pv-kpis div:last-child { border-right: 0; }
.pv-kpis small { font-size: 11px; color: var(--label-2); }
.pv-kpis b { font-size: 16px; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-tabs { display: flex; gap: 4px; padding: 10px 12px 0; overflow-x: auto; scrollbar-width: none; }
.pv-tabs::-webkit-scrollbar { display: none; }
.pv-tab { border: 0; background: none; font-size: 13px; padding: 7px 12px; border-radius: 9px; cursor: pointer; white-space: nowrap; color: var(--label-2); font-weight: 500; }
.pv-tab:hover { background: var(--fill-2); color: var(--label); }
.pv-tab[aria-selected="true"] { background: var(--fill); color: var(--label); font-weight: 600; }
.pv-tab.sum { color: var(--accent); }
.pv-tools { display: flex; gap: 8px; align-items: center; padding: 10px 12px; flex-wrap: wrap; }
.pv-search { position: relative; flex: 1 1 180px; }
.pv-search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; color: var(--label-3); }
.pv-search input { width: 100%; height: 32px; border: 0; border-radius: 9px; background: var(--fill-2); padding: 0 10px 0 30px; font: inherit; font-size: 13px; color: var(--label); outline: none; }
.pv-filters { display: flex; gap: 4px; flex-wrap: wrap; }
.pv-filters .chip { height: 28px; font-size: 12px; }
.pv-table-wrap { flex: 1; overflow: auto; position: relative; border-top: 1px solid var(--sep); }
.pv-empty { padding: 40px; text-align: center; color: var(--label-2); }
.pv-table { border-collapse: separate; border-spacing: 0; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.pv-table th, .pv-table td {
  border-right: 1px solid var(--sep); border-bottom: 1px solid var(--sep); padding: 0 8px; height: 30px; max-width: 360px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--elev);
}
.pv-table thead th {
  position: sticky; top: 0; z-index: 2; background: var(--bg-2); font-weight: 600; color: var(--label-2); font-size: 11.5px;
  white-space: normal; line-height: 1.25; height: auto; padding: 6px 8px; vertical-align: bottom; text-align: left;
}
.pv-table thead th .hd { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.pv-table thead th .col { display: block; font-size: 10px; color: var(--label-3); font-weight: 500; margin-bottom: 2px; }
.pv-table .rn { position: sticky; left: 0; z-index: 1; background: var(--bg-2); color: var(--label-3); text-align: right; font-size: 11px; min-width: 40px; width: 40px; }
.pv-table thead .rn { z-index: 3; }
.pv-table td.n { text-align: right; }
.pv-table td.ai { background: var(--cell-ai); }
.pv-table td.us { background: var(--cell-user); }
.pv-table td.f { color: var(--label); }
.pv-table td.edit { padding: 0; }
.pv-table td.edit input { width: 100%; height: 30px; border: 0; outline: 2px solid var(--accent); outline-offset: -2px; padding: 0 8px; font: inherit; background: var(--elev); color: var(--label); }
.pv-table tr.hl td:not(.rn) { box-shadow: inset 0 0 0 9999px color-mix(in srgb, var(--accent) 6%, transparent); }
.pv-table tr.total td { font-weight: 700; }
.pv-table .gr { display: inline-grid; place-items: center; min-width: 20px; height: 18px; border-radius: 5px; font-size: 11px; font-weight: 700; }
.pv-table .gr.a { background: var(--green-soft); color: var(--green); }
.pv-table .gr.b { background: var(--orange-soft); color: var(--orange); }
.pv-table .gr.c { background: var(--red-soft); color: var(--red); }
.pv-table.summary td { border-right-color: transparent; }
.pv-table.summary thead { display: none; }
.pv-legend { padding: 8px 16px calc(8px + env(safe-area-inset-bottom)); margin: 0; border-top: 1px solid var(--sep); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.lg { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -2px; }
.lg.ai { background: var(--cell-ai); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }
.lg.user { background: var(--cell-user); border: 1px solid color-mix(in srgb, var(--violet) 30%, transparent); margin-left: 8px; }

/* ---------- Lapok (modális) ---------- */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 80; background: rgba(0, 0, 0, 0.32); display: grid; place-items: center; padding: 20px;
  animation: fade 0.25s var(--ease);
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.sheet {
  width: min(680px, 100%); max-height: min(86vh, 900px); background: var(--elev); border-radius: 24px; box-shadow: var(--shadow-3);
  display: flex; flex-direction: column; overflow: hidden; animation: sheetIn 0.45s var(--spring);
}
.sheet.wide { width: min(780px, 100%); }
@keyframes sheetIn { from { transform: translateY(24px) scale(0.98); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 18px 18px 12px 24px; }
.sheet-head h2 { flex: 1; margin: 0; font-size: 22px; letter-spacing: -0.025em; }
.sheet-head .back { margin-left: -10px; }
.sheet-sub { margin: -6px 24px 12px; color: var(--label-2); font-size: 14px; }
.sheet-body { flex: 1; overflow-y: auto; padding: 4px 24px 24px; display: grid; gap: 18px; align-content: start; }
.sheet-foot { display: flex; gap: 10px; align-items: center; padding: 14px 24px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--sep); background: var(--bg-3); }
.sheet-foot .spacer { flex: 1; }
.tabs-row { padding: 0 24px 12px; }

.group { background: var(--fill-3); border-radius: 16px; overflow: hidden; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--sep); }
.row:last-child { border-bottom: 0; }
.row .grow { flex: 1; min-width: 0; display: grid; gap: 2px; }
.row .grow b { font-size: 15px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .grow span { font-size: 13px; color: var(--label-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row.click { cursor: pointer; }
.row.click:hover { background: var(--fill-3); }
.row .chev { width: 14px; height: 14px; color: var(--label-3); flex: none; }
.list-empty { padding: 28px 16px; text-align: center; color: var(--label-2); font-size: 15px; display: grid; gap: 12px; justify-items: center; }
.list-empty .big { width: 56px; height: 56px; border-radius: 16px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.list-empty .big svg { width: 28px; height: 28px; }
.tpl-row { display: flex; gap: 8px; flex-wrap: wrap; }
.tpl { border: 1px solid var(--sep); background: var(--elev); border-radius: 14px; padding: 10px 14px; cursor: pointer; text-align: left; display: grid; gap: 2px; flex: 1 1 180px; transition: border-color 0.2s, transform 0.2s var(--spring); }
.tpl:hover { border-color: var(--accent); transform: translateY(-1px); }
.tpl b { font-size: 14px; }
.tpl span { font-size: 12px; color: var(--label-2); }

/* Szűrő-szerkesztő elemek */
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 600px) { .two { grid-template-columns: 1fr; } }
.tags { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; background: var(--fill-2); border-radius: var(--r-sm); padding: 7px 8px; min-height: 46px; border: 1px solid transparent; cursor: text; }
.tags:focus-within { background: var(--elev); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.tags .chip { height: 28px; background: var(--elev); box-shadow: var(--shadow-1); }
.tags .chip button { border: 0; background: none; padding: 0; margin-left: 2px; cursor: pointer; color: var(--label-3); font-size: 15px; line-height: 1; }
.tags input { flex: 1; min-width: 120px; border: 0; background: none; outline: none; font: inherit; font-size: 15px; color: var(--label); padding: 4px; }
.pct { display: grid; gap: 10px; }
.pct-main { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stepper { display: inline-flex; align-items: center; background: var(--fill-2); border-radius: 12px; overflow: hidden; }
.stepper button { width: 42px; height: 44px; border: 0; background: none; font-size: 22px; cursor: pointer; color: var(--label); }
.stepper button:hover { background: var(--fill-2); }
.stepper input { width: 76px; height: 44px; border: 0; background: none; text-align: center; font: inherit; font-size: 20px; font-weight: 600; color: var(--label); outline: none; font-variant-numeric: tabular-nums; }
.pct-value.pos { color: var(--green); }
.pct-value.neg { color: var(--red); }
.quick { display: flex; gap: 6px; flex-wrap: wrap; }
.quick .chip { height: 30px; }
.example { font-size: 14px; color: var(--label-2); background: var(--fill-3); border-radius: 12px; padding: 10px 12px; }
.example b { color: var(--label); }
.cat-rules { display: grid; gap: 8px; }
.cat-rule { display: grid; grid-template-columns: 1fr 110px 34px; gap: 8px; align-items: center; }
.cat-rule .input { padding: 9px 12px; }
.radio-cards { display: grid; gap: 8px; }
.radio-card { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--sep); cursor: pointer; background: var(--elev); }
.radio-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.radio-card input { margin-top: 3px; accent-color: var(--accent); }
.radio-card b { display: block; font-size: 14px; }
.radio-card span { font-size: 13px; color: var(--label-2); }
.effort-card .ec-body { display: grid; gap: 3px; flex: 1; min-width: 0; }
.effort-card .ec-head { display: flex; align-items: center; gap: 8px; }
.effort-card .ec-head b { font-size: 15px; letter-spacing: -0.01em; }
.effort-card .ec-tag { font-style: normal; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 99px; background: var(--fill); color: var(--label-2); }
.effort-card .ec-desc { color: var(--label); }
.effort-card .ec-cost { font-size: 12px; color: var(--label-3); font-variant-numeric: tabular-nums; }
.effort-card .ec-cost b { font-size: 12px; display: inline; color: var(--label-2); }
.effort-card .ec-why { font-size: 12.5px; line-height: 1.45; color: var(--label-2); margin: 4px 0 2px; }
.effort-card .ec-why b { display: inline; font-size: 12.5px; color: var(--label); }
.effort-card.top .ec-head b { background: linear-gradient(120deg, #2f8cff, #4b3fd8); -webkit-background-clip: text; background-clip: text; color: transparent; }
.effort-card.top .ec-tag { background: var(--accent-soft); color: var(--accent); }
.level-note { font-size: 13px; color: var(--label-2); margin-top: -6px; }
.section-label { font-size: 13px; font-weight: 700; color: var(--label-3); letter-spacing: 0.02em; text-transform: uppercase; margin: 8px 0 -6px; }
.mem-item { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-bottom: 1px solid var(--sep); }
.mem-item:last-child { border-bottom: 0; }
.mem-item p { flex: 1; margin: 0; font-size: 15px; outline: none; border-radius: 6px; padding: 2px 4px; margin: -2px -4px; }
.mem-item p:focus { background: var(--elev); box-shadow: 0 0 0 3px var(--accent-soft); }
.theme-seg { justify-self: start; }

/* Értesítés */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); z-index: 120; opacity: 0; pointer-events: none;
  background: var(--label); color: var(--bg); padding: 11px 18px; border-radius: 14px; font-size: 14px; font-weight: 500; box-shadow: var(--shadow-3);
  transition: opacity 0.25s, transform 0.35s var(--spring); max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--red); color: #fff; }

/* ---------- Reszponzív ---------- */
@media (max-width: 1180px) {
  .panel { position: fixed; inset: 0 0 0 auto; width: min(100%, 860px); z-index: 50; box-shadow: var(--shadow-3); }
}
@media (max-width: 900px) {
  .main, .main.sb-collapsed { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: min(300px, 86vw); transform: translateX(-100%); visibility: hidden; box-shadow: var(--shadow-3); z-index: 40; }
  .main.sb-open .sidebar { transform: none; visibility: visible; }
  .main.sb-open .scrim { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.3); z-index: 35; animation: fade 0.25s; }
  #sbOpen, .main.sb-collapsed #sbOpen { display: inline-grid; }
  .sheet-backdrop { padding: 0; place-items: end center; }
  .sheet, .sheet.wide { width: 100%; max-height: 92vh; border-radius: 24px 24px 0 0; }
  .pv-kpis { grid-template-columns: 1fr 1fr; }
  .pv-kpis div:nth-child(2) { border-right: 0; }
  .pv-kpis div:nth-child(-n+2) { border-bottom: 1px solid var(--sep); }
  .approve .small { display: none; }
}
@media (max-width: 520px) {
  .messages { padding: 4px 12px 16px; }
  .composer-wrap { padding: 0 8px calc(8px + env(safe-area-inset-bottom)); }
  .composer { border-radius: 22px; padding-left: 12px; }
  .chip.pick span { display: none; }
  .chip.pick { width: 32px; padding: 0; justify-content: center; }
  .sheet-body { padding: 4px 16px 20px; }
  .sheet-head { padding: 16px 12px 10px 16px; }
  .sheet-foot { padding: 12px 16px calc(14px + env(safe-area-inset-bottom)); }
  .cat-rule { grid-template-columns: 1fr 92px 34px; }
}

/* Megnyitás Excelben */
.xl-btn { gap: 6px; }
.xl-ico { width: 18px; height: 18px; border-radius: 5px; background: #107c41; color: #fff; font-size: 11px; font-weight: 800; display: inline-grid; place-items: center; letter-spacing: 0; }
@media (max-width: 1320px) { .panel-head .xl-btn { font-size: 0; padding: 0 9px; gap: 0; } .panel-head .xl-btn .xl-ico { font-size: 11px; } }

/* Élő kitöltés */
.pv-progress { height: 3px; background: var(--fill-2); position: relative; overflow: hidden; }
.pv-progress i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--accent); border-radius: 0 3px 3px 0; transition: width 0.5s var(--ease); }
.pv-live { display: flex; align-items: center; gap: 8px; padding: 6px 16px; font-size: 12.5px; color: var(--label-2); border-bottom: 1px solid var(--sep); background: var(--bg-3); }
.pv-live .spacer { flex: 1; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 50%, transparent); animation: livePulse 1.6s var(--ease) infinite; }
@keyframes livePulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent); } 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.pv-table td.flash { animation: cellIn 1.2s var(--ease); }
@keyframes cellIn { 0% { background: color-mix(in srgb, var(--accent) 32%, var(--elev)); } 100% { background: var(--cell-ai); } }
.pv-table tr.live-row td.rn { color: var(--accent); font-weight: 600; }
.pv-kpis b.tick { transition: color 0.4s; color: var(--accent); }

/* Ajánlat-irányítópult */
:root { --st-good: #0ca30c; --st-warn: #fab219; --st-crit: #d03b3b; }
.dash { border-top: 1px solid var(--sep); }
.dash > summary { list-style: none; cursor: pointer; padding: 10px 16px; font-size: 13px; font-weight: 600; color: var(--label-2); display: flex; align-items: center; gap: 6px; }
.dash > summary::-webkit-details-marker { display: none; }
.dash > summary::after { content: "›"; transform: rotate(90deg); transition: transform 0.25s var(--spring); font-size: 16px; }
.dash:not([open]) > summary::after { transform: none; }
.dash-grid { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: 20px; padding: 2px 16px 14px; }
@media (max-width: 720px) { .dash-grid { grid-template-columns: 1fr; } }
.dash-h { margin: 0 0 10px; font-size: 12px; font-weight: 600; color: var(--label-2); }
.stack { display: flex; gap: 2px; height: 22px; border-radius: 6px; overflow: hidden; }
.stack .seg { display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #1d1d1f; min-width: 3px; cursor: default; }
.stack .seg.a { background: var(--st-good); }
.stack .seg.b { background: var(--st-warn); }
.stack .seg.c { background: var(--st-crit); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 12.5px; color: var(--label); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend em { font-style: normal; color: var(--label-2); }
.sw { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.sw.a { background: var(--st-good); } .sw.b { background: var(--st-warn); } .sw.c { background: var(--st-crit); }
.bars { display: grid; gap: 7px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(60px, 0.9fr) auto; align-items: center; gap: 10px; font-size: 12.5px; cursor: default; }
.bar-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--label); }
.bar-track { height: 10px; position: relative; }
.bar-track i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); border-radius: 0 4px 4px 0; transition: width 0.6s var(--ease); }
.bar-row:hover .bar-track i { filter: brightness(1.12); }
.bar-val { color: var(--label-2); white-space: nowrap; font-size: 12px; }
.dash-note { margin: 10px 0 0; font-size: 12px; color: var(--label-2); }
.dash-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; padding: 0 16px 16px; }
.tile { border-radius: 14px; background: var(--fill-3); padding: 12px 14px; display: grid; gap: 2px; }
.tile small { font-size: 12px; color: var(--label-2); }
.tile b { font-size: 22px; letter-spacing: -0.02em; }
.tile span { font-size: 12.5px; color: var(--label-2); }
.tile em { font-style: normal; font-size: 11.5px; color: var(--label-3); margin-top: 4px; }
.meter { height: 6px; border-radius: 6px; background: var(--fill); margin-top: 8px; overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--accent); border-radius: 0 4px 4px 0; }
.viz-tip { position: fixed; z-index: 200; pointer-events: none; background: var(--label); color: var(--bg); font-size: 12px; line-height: 1.45; padding: 7px 10px; border-radius: 9px; box-shadow: var(--shadow-2); white-space: pre-line; max-width: 280px; }

/* Piaci pozíció a táblázatban */
.pv-table .mk { display: inline-block; margin-left: 6px; font-size: 10.5px; font-weight: 700; padding: 1px 6px; border-radius: 5px; }
.pv-table .mk.cheaper { background: var(--green-soft); color: var(--green); }
.pv-table .mk.pricier { background: var(--red-soft); color: var(--red); }

/* „Mi lenne, ha” csúszka */
.pv-whatif { display: flex; align-items: center; gap: 12px; padding: 8px 16px; border-bottom: 1px solid var(--sep); font-size: 13px; flex-wrap: wrap; }
.pv-whatif label { color: var(--label-2); font-weight: 600; }
.pv-whatif input[type="range"] { flex: 1 1 160px; max-width: 280px; accent-color: var(--accent); }
.pv-whatif b { min-width: 52px; }
.whatif-delta { color: var(--label-2); }

/* Diktálás */
.icon-btn.mic.rec { color: #fff; background: var(--red); animation: micPulse 1.4s var(--ease) infinite; }
@keyframes micPulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--red) 45%, transparent); } 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* Napi összefoglaló */
.insight { border: 1px solid var(--sep); border-radius: 18px; background: var(--elev); padding: 14px 16px; display: grid; gap: 8px; box-shadow: var(--shadow-1); }
.ins-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; }
.ins-head .muted { margin-left: auto; }
.ins-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.ins-text { margin: 0; font-size: 14px; }
.ins-list { display: grid; }
.ins-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 70px; gap: 12px; align-items: center; padding: 7px 0; border-top: 1px solid var(--sep); font-size: 13px; color: var(--label); text-decoration: none !important; }
.ins-row:hover .ins-name { color: var(--link); }
.ins-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ins-name small { margin-left: 8px; color: var(--label-3); }
.mk-chg { font-size: 11.5px; font-weight: 700; text-align: right; }
.mk-chg.up { color: var(--red); }
.mk-chg.down { color: var(--green); }
.ins-aff { display: flex; flex-wrap: wrap; gap: 6px; }

/* Bevezető */
.intro { position: fixed; inset: 0; z-index: 150; display: grid; place-items: center; padding: 24px 16px;
  background: color-mix(in srgb, var(--bg) 97%, transparent); backdrop-filter: blur(28px) saturate(180%); -webkit-backdrop-filter: blur(28px) saturate(180%);
  opacity: 0; transition: opacity 0.42s var(--ease); }
.intro.on { opacity: 1; }
.intro-bars { position: absolute; top: max(18px, env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); display: flex; gap: 6px; width: min(420px, calc(100% - 140px)); }
.intro-bars span { flex: 1; height: 3px; border-radius: 3px; background: var(--fill); overflow: hidden; position: relative; }
.intro-bars span.done { background: var(--label-2); }
.intro-bars span.now::after { content: ""; position: absolute; inset: 0; background: var(--label-2); transform-origin: left; animation: introBar var(--t) linear forwards; }
@keyframes introBar { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.intro-skip { position: absolute; top: max(10px, env(safe-area-inset-top)); right: 16px; border: 0; background: none; color: var(--label-2); font-size: 14px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.intro-skip:hover { background: var(--fill-2); color: var(--label); }
.intro-stage { width: min(620px, 100%); text-align: center; }
.intro-scene { display: grid; justify-items: center; gap: 10px; animation: sceneIn 0.7s var(--spring); }
@keyframes sceneIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.intro-kicker { margin: 0; font-size: 15px; font-weight: 600; color: var(--accent); }
.intro-title { margin: 0; font-size: clamp(36px, 6vw, 56px); line-height: 1.05; letter-spacing: -0.035em; font-weight: 700; }
.intro-text { margin: 4px 0 0; font-size: clamp(17px, 2.2vw, 21px); color: var(--label-2); max-width: 520px; line-height: 1.4; }
.intro-visual { margin-top: 30px; min-height: 200px; display: grid; justify-items: center; align-content: start; gap: 14px; width: 100%; }
.intro-icon { animation: iconIn 0.9s var(--spring); }
@keyframes iconIn { from { opacity: 0; transform: scale(0.86); } to { opacity: 1; transform: none; } }
.intro-table { width: min(460px, 100%); border: 1px solid var(--sep); border-radius: 16px; background: var(--elev); box-shadow: var(--shadow-2); text-align: left; overflow: hidden; }
.it-row { display: grid; grid-template-columns: 1fr auto 26px; gap: 14px; align-items: center; padding: 11px 16px; border-bottom: 1px solid var(--sep); font-size: 14px; }
.it-row:last-child { border-bottom: 0; }
.it-row .it-price, .it-row .badge { opacity: 0; animation: priceIn 0.5s var(--ease) forwards; animation-delay: var(--d); }
.it-row .it-price { background: var(--cell-ai); padding: 2px 6px; border-radius: 6px; }
@keyframes priceIn { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.intro-abc { display: grid; gap: 10px; text-align: left; font-size: 16px; }
.intro-abc div { display: flex; align-items: center; gap: 12px; opacity: 0; animation: priceIn 0.5s var(--ease) forwards; }
.intro-abc div:nth-child(1) { animation-delay: 0.3s; } .intro-abc div:nth-child(2) { animation-delay: 0.6s; } .intro-abc div:nth-child(3) { animation-delay: 0.9s; }
.intro-abc .badge { height: 24px; min-width: 24px; justify-content: center; font-size: 12px; }
.intro-chips { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; max-width: 460px; }
.intro-chips .chip { height: 34px; font-size: 14px; opacity: 0; animation: priceIn 0.5s var(--ease) forwards; }
.intro-chips .chip:nth-child(1) { animation-delay: 0.25s; } .intro-chips .chip:nth-child(2) { animation-delay: 0.4s; } .intro-chips .chip:nth-child(3) { animation-delay: 0.55s; }
.intro-chips .chip:nth-child(4) { animation-delay: 0.7s; } .intro-chips .chip:nth-child(5) { animation-delay: 0.85s; } .intro-chips .chip:nth-child(6) { animation-delay: 1s; }
.intro-hint { margin: 0; font-size: 13px; color: var(--label-3); }
.intro-nav { position: absolute; bottom: max(20px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); display: flex; gap: 8px; }
.intro-nav .icon-btn { width: 40px; height: 40px; border-radius: 50%; background: var(--fill-2); }
.intro-nav .icon-btn:disabled { opacity: 0.35; }

/* Jóváhagyás: finom pipa */
.approve-check { width: 0; height: 18px; color: var(--green); overflow: visible; transition: width 0.25s var(--ease); }
.approve.ok .approve-check { width: 18px; }
.approve.ok .approve-check path { stroke-dasharray: 22; stroke-dashoffset: 22; animation: checkDraw 0.45s 0.05s var(--ease) forwards; }
@keyframes checkDraw { to { stroke-dashoffset: 0; } }
