/* =====================================================================
   Спілка · AI-асистент — дизайн-система
   Токени → база → компоненти → екрани → адаптив → темна тема
   ===================================================================== */

/* ---------- шрифт Manrope (власний хостинг: жодних запитів до Google) ---------- */
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 200 800; font-display: swap; src: url(/fonts/manrope-cyrillic-ext.woff2) format("woff2"); unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F; }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 200 800; font-display: swap; src: url(/fonts/manrope-cyrillic.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 200 800; font-display: swap; src: url(/fonts/manrope-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Manrope"; font-style: normal; font-weight: 200 800; font-display: swap; src: url(/fonts/manrope-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ---------- токени: світла тема ---------- */
:root {
  color-scheme: light;
  --bg: #f4f4ef; --bg-glow-1: rgba(200, 245, 60, .20); --bg-glow-2: rgba(91, 79, 255, .10);
  --surface: #ffffff; --surface-2: #f8f8f4; --surface-3: #efefe8; --glass: rgba(255, 255, 255, .72);
  --ink: #0f0f14; --ink-2: #2b2b34; --muted: #666672; --subtle: #9a9aa6;
  --line: #e8e8e0; --line-2: #d8d8cf; --hover: #f5f5f0;
  --accent: #5b4fff; --accent-2: #4a3fe0; --accent-soft: #eeecff; --accent-ink: #4338ca;
  --lime: #c8f53c; --lime-2: #b9ea25; --lime-soft: #f0fbc9; --lime-ink: #0f0f14;
  --green: #0f9d58; --green-soft: #e5f6ec; --amber: #b26a00; --amber-soft: #fdf0d3;
  --red: #d92d20; --red-soft: #fdebe9; --blue: #2563eb; --blue-soft: #e7effe;
  --inverse: #0f0f14; --on-inverse: #ffffff;
  --nav-on-bg: #0f0f14; --nav-on-fg: #ffffff; --nav-on-icon: #c8f53c;
  --bubble-user-bg: #0f0f14; --bubble-user-fg: #ffffff;
  --code-bg: #efefe8; --scrim: rgba(12, 12, 16, .5);
  --shadow-sm: 0 1px 2px rgba(15, 15, 20, .04), 0 6px 18px -10px rgba(15, 15, 20, .10);
  --shadow-md: 0 2px 4px rgba(15, 15, 20, .04), 0 14px 34px -14px rgba(15, 15, 20, .18);
  --shadow-lg: 0 30px 80px -24px rgba(15, 15, 20, .45);
  --ring: 0 0 0 4px rgba(91, 79, 255, .16);
  --r-sm: 10px; --r-md: 14px; --r-lg: 20px; --r-xl: 28px;
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --ease: cubic-bezier(.22, .8, .3, 1);
}

/* ---------- токени: темна тема (вручну або за системою) ---------- */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #09090d; --bg-glow-1: rgba(200, 245, 60, .07); --bg-glow-2: rgba(110, 99, 255, .16);
  --surface: #121218; --surface-2: #17171f; --surface-3: #20202a; --glass: rgba(18, 18, 24, .72);
  --ink: #f3f3f7; --ink-2: #d5d5de; --muted: #9d9dac; --subtle: #6e6e7e;
  --line: #25252f; --line-2: #34343f; --hover: #1a1a23;
  --accent: #8f86ff; --accent-2: #a49dff; --accent-soft: rgba(143, 134, 255, .15); --accent-ink: #b7b1ff;
  --lime: #c8f53c; --lime-2: #d6ff55; --lime-soft: rgba(200, 245, 60, .10);
  --green: #3dd68c; --green-soft: rgba(61, 214, 140, .12); --amber: #ffb454; --amber-soft: rgba(255, 180, 84, .12);
  --red: #ff6f66; --red-soft: rgba(255, 111, 102, .12); --blue: #74a5ff; --blue-soft: rgba(116, 165, 255, .12);
  --inverse: #f3f3f7; --on-inverse: #0f0f14;
  --nav-on-bg: rgba(255, 255, 255, .09); --nav-on-fg: #ffffff; --nav-on-icon: #c8f53c;
  --bubble-user-bg: #2a2a37; --bubble-user-fg: #f3f3f7;
  --code-bg: #20202a; --scrim: rgba(0, 0, 0, .64);
  --shadow-sm: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 8px 24px -14px rgba(0, 0, 0, .7);
  --shadow-md: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 16px 40px -16px rgba(0, 0, 0, .8);
  --shadow-lg: 0 40px 100px -30px rgba(0, 0, 0, .9);
  --ring: 0 0 0 4px rgba(143, 134, 255, .25);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #09090d; --bg-glow-1: rgba(200, 245, 60, .07); --bg-glow-2: rgba(110, 99, 255, .16);
    --surface: #121218; --surface-2: #17171f; --surface-3: #20202a; --glass: rgba(18, 18, 24, .72);
    --ink: #f3f3f7; --ink-2: #d5d5de; --muted: #9d9dac; --subtle: #6e6e7e;
    --line: #25252f; --line-2: #34343f; --hover: #1a1a23;
    --accent: #8f86ff; --accent-2: #a49dff; --accent-soft: rgba(143, 134, 255, .15); --accent-ink: #b7b1ff;
    --lime: #c8f53c; --lime-2: #d6ff55; --lime-soft: rgba(200, 245, 60, .10);
    --green: #3dd68c; --green-soft: rgba(61, 214, 140, .12); --amber: #ffb454; --amber-soft: rgba(255, 180, 84, .12);
    --red: #ff6f66; --red-soft: rgba(255, 111, 102, .12); --blue: #74a5ff; --blue-soft: rgba(116, 165, 255, .12);
    --inverse: #f3f3f7; --on-inverse: #0f0f14;
    --nav-on-bg: rgba(255, 255, 255, .09); --nav-on-fg: #ffffff; --nav-on-icon: #c8f53c;
    --bubble-user-bg: #2a2a37; --bubble-user-fg: #f3f3f7;
    --code-bg: #20202a; --scrim: rgba(0, 0, 0, .64);
    --shadow-sm: 0 1px 0 rgba(255, 255, 255, .03) inset, 0 8px 24px -14px rgba(0, 0, 0, .7);
    --shadow-md: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 16px 40px -16px rgba(0, 0, 0, .8);
    --shadow-lg: 0 40px 100px -30px rgba(0, 0, 0, .9);
    --ring: 0 0 0 4px rgba(143, 134, 255, .25);
  }
}

/* ---------- база ---------- */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { min-height: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 14.5px; line-height: 1.55;
  color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  font-feature-settings: "ss01" 0;
}
body::before { /* м'яке світіння фону: лайм зліва, індиго справа */
  content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(900px 520px at -5% -12%, var(--bg-glow-1), transparent 62%), radial-gradient(820px 520px at 105% -8%, var(--bg-glow-2), transparent 62%);
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.02em; text-wrap: balance; }
p { text-wrap: pretty; }
code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
[hidden] { display: none !important; }
::selection { background: var(--lime); color: #0f0f14; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
svg.i { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
svg.i.fill { fill: currentColor; stroke: none; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 99px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--subtle); border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--ink); cursor: pointer; font-weight: 650; font-size: 14px; white-space: nowrap; text-decoration: none !important;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .08s var(--ease), color .15s;
}
.btn:hover { background: var(--hover); border-color: var(--subtle); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--inverse); color: var(--on-inverse); border-color: var(--inverse); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 4px 14px -6px rgba(15, 15, 20, .5); }
.btn.primary:hover { filter: brightness(1.18); }
:root[data-theme="dark"] .btn.primary:hover { filter: brightness(.92); }
.btn.accent { background: linear-gradient(180deg, var(--accent), var(--accent-2)); color: #fff; border-color: var(--accent-2); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 6px 16px -8px var(--accent); }
.btn.accent:hover { filter: brightness(1.08); background: linear-gradient(180deg, var(--accent), var(--accent-2)); }
.btn.lime { background: linear-gradient(180deg, var(--lime-2), var(--lime)); color: var(--lime-ink); border-color: transparent; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5), 0 6px 18px -8px rgba(160, 210, 0, .8); }
.btn.lime:hover { filter: brightness(1.05); background: linear-gradient(180deg, var(--lime-2), var(--lime)); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--hover); border-color: transparent; }
.btn.sm { height: 32px; padding: 0 12px; border-radius: 10px; font-size: 13px; gap: 6px; }
.btn.sm svg.i { width: 16px; height: 16px; }
.btn.danger { color: var(--red); }
.btn.danger:hover { background: var(--red-soft); border-color: var(--red); }
.btn.block { width: 100%; }
.btn.solid.danger { background: var(--red); color: #fff; border-color: var(--red); }
.btn.solid.danger:hover { filter: brightness(1.08); background: var(--red); }
.btn.icon { width: 36px; height: 36px; padding: 0; border-radius: 11px; }
.btn.icon.sm { width: 30px; height: 30px; border-radius: 9px; }

/* ---------- поля ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.input, select.input, textarea.input {
  width: 100%; height: 44px; padding: 0 14px; border-radius: 12px;
  border: 1px solid var(--line-2); background: var(--surface); outline: none;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.input:hover { border-color: var(--subtle); }
.input:focus { border-color: var(--accent); box-shadow: var(--ring); }
.input::placeholder { color: var(--subtle); }
textarea.input { height: auto; padding: 11px 14px; resize: vertical; min-height: 92px; line-height: 1.5; }
select.input {
  appearance: none; -webkit-appearance: none; padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a8a96' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; cursor: pointer; flex: none; }
input[type="checkbox"].switch {
  appearance: none; -webkit-appearance: none; width: 42px; height: 24px; border-radius: 99px; background: var(--line-2); position: relative; cursor: pointer; transition: background .2s; flex: none;
}
input[type="checkbox"].switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .22s var(--ease); }
input[type="checkbox"].switch:checked { background: var(--green); }
input[type="checkbox"].switch:checked::after { transform: translateX(18px); }
input[type="checkbox"].switch:disabled { opacity: .5; cursor: not-allowed; }
.range { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 99px; background: var(--surface-3); outline: none; cursor: pointer; margin: 10px 0; }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); box-shadow: var(--shadow-md); transition: transform .12s; }
.range::-webkit-slider-thumb:hover { transform: scale(1.12); }
.range::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--surface); border: 2px solid var(--accent); }
.range:focus-visible { box-shadow: var(--ring); }

/* ---------- утиліти ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 3px var(--lime-soft); }

/* ---------- бейджі ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px;
  border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap;
  background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line);
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.plain::before { display: none; }
.pill.green { background: var(--green-soft); color: var(--green); border-color: transparent; }
.pill.amber { background: var(--amber-soft); color: var(--amber); border-color: transparent; }
.pill.red { background: var(--red-soft); color: var(--red); border-color: transparent; }
.pill.blue { background: var(--blue-soft); color: var(--blue); border-color: transparent; }
.pill.violet { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; }
.pill.lime { background: var(--lime-soft); color: var(--ink); border-color: transparent; }
.chip { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 7px; background: var(--surface-2); border: 1px solid var(--line); font-size: 11.5px; color: var(--muted); font-weight: 650; }
.demo-badge { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; background: var(--lime); color: #0f0f14; font-size: 11px; font-weight: 800; letter-spacing: .06em; }
.kbd { display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border-radius: 6px; border: 1px solid var(--line-2); border-bottom-width: 2px; background: var(--surface); font-size: 11px; font-weight: 700; color: var(--muted); }

/* ---------- картки ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.card-pad { padding: 22px; }
.card h3 { font-size: 15.5px; font-weight: 800; }
.note { padding: 11px 14px; border-radius: 12px; background: var(--surface-2); border: 1px dashed var(--line-2); color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.note.warn { background: var(--amber-soft); border: 1px solid transparent; color: var(--amber); }
.note.bad { background: var(--red-soft); border: 1px solid transparent; color: var(--red); }
.note.info { background: var(--accent-soft); border: 1px solid transparent; color: var(--accent-ink); }
.box { padding: 14px 16px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.box h4 { font-size: 11.5px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-bottom: 8px; font-weight: 800; }

/* ---------- логотип ---------- */
.brand { display: flex; align-items: center; gap: 12px; font-weight: 800; letter-spacing: -.02em; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none;
  background: linear-gradient(145deg, #dcff62, #bfee2a 55%, #a6dc12); color: #0f0f14;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .6), 0 6px 18px -6px rgba(170, 220, 0, .7);
}
.brand-mark svg { width: 20px; height: 20px; }
.brand small { display: block; font-weight: 600; color: var(--muted); font-size: 11.5px; letter-spacing: 0; margin-top: 1px; }

/* ---------- сторінка входу ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); }
.auth-hero { position: relative; overflow: hidden; isolation: isolate; background: #0a0a0f; color: #fff; padding: 44px 56px; display: flex; flex-direction: column; }
.mesh { position: absolute; inset: 0; z-index: -2; }
.mesh i { position: absolute; border-radius: 50%; filter: blur(90px); animation: drift 20s ease-in-out infinite alternate; }
.mesh i:nth-child(1) { width: 560px; height: 560px; background: #5b4fff; right: -180px; top: -170px; opacity: .6; }
.mesh i:nth-child(2) { width: 440px; height: 440px; background: #c8f53c; left: -150px; bottom: -190px; opacity: .26; animation-duration: 25s; animation-delay: -7s; }
.mesh i:nth-child(3) { width: 320px; height: 320px; background: #22d3ee; left: 38%; top: 34%; opacity: .16; animation-duration: 29s; animation-delay: -3s; }
@keyframes drift { to { transform: translate(60px, 40px) scale(1.12); } }
.auth-hero::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; background-image: radial-gradient(rgba(255, 255, 255, .13) 1px, transparent 1px); background-size: 26px 26px; -webkit-mask-image: radial-gradient(ellipse at 35% 45%, #000 15%, transparent 72%); mask-image: radial-gradient(ellipse at 35% 45%, #000 15%, transparent 72%); }
.auth-hero .brand small { color: rgba(255, 255, 255, .55); }
.hero-body { margin: auto 0; max-width: 560px; padding: 36px 0; }
.hero-badge { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px; border-radius: 99px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .12); font-size: 12.5px; font-weight: 700; color: rgba(255, 255, 255, .85); backdrop-filter: blur(8px); }
.hero-badge i { width: 7px; height: 7px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 3px rgba(200, 245, 60, .25); }
.hero-body h1 { font-size: clamp(34px, 3.8vw, 54px); line-height: 1.04; font-weight: 800; letter-spacing: -.035em; margin-top: 20px; }
.hero-body h1 em { font-style: normal; background: linear-gradient(100deg, #e6ff7a, #c8f53c 45%, #8fe04a); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-body > p { color: rgba(255, 255, 255, .7); font-size: 16.5px; line-height: 1.6; margin: 18px 0 28px; max-width: 480px; }
.hero-demo { position: relative; padding: 18px; border-radius: 22px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12); backdrop-filter: blur(14px); box-shadow: 0 30px 70px -30px rgba(0, 0, 0, .7), inset 0 1px 0 rgba(255, 255, 255, .08); display: flex; flex-direction: column; gap: 12px; max-width: 480px; }
.hd-q { align-self: flex-end; max-width: 82%; padding: 10px 15px; border-radius: 16px 16px 4px 16px; background: rgba(255, 255, 255, .92); color: #0f0f14; font-size: 13.5px; font-weight: 600; }
.hd-a { display: flex; gap: 10px; align-items: flex-start; }
.hd-orb { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; flex: none; background: linear-gradient(145deg, #dcff62, #a6dc12); color: #0f0f14; }
.hd-orb svg { width: 15px; height: 15px; }
.hd-card { flex: 1; padding: 12px 14px; border-radius: 4px 16px 16px 16px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .1); }
.hd-lines { display: grid; gap: 7px; margin-bottom: 12px; }
.hd-lines i { display: block; height: 8px; border-radius: 99px; background: rgba(255, 255, 255, .22); }
.hd-lines i:nth-child(1) { width: 96%; } .hd-lines i:nth-child(2) { width: 88%; } .hd-lines i:nth-child(3) { width: 58%; }
.hd-src { display: inline-flex; align-items: center; gap: 8px; padding: 5px 10px 5px 6px; border-radius: 10px; background: rgba(200, 245, 60, .12); border: 1px solid rgba(200, 245, 60, .22); font-size: 11.5px; font-weight: 700; color: #dcff7a; }
.hd-src b { width: 18px; height: 18px; border-radius: 6px; display: grid; place-items: center; background: var(--lime); color: #0f0f14; font-size: 10.5px; }
.hero-feats { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.hero-feat { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px 0 10px; border-radius: 99px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .1); font-size: 13px; font-weight: 650; color: rgba(255, 255, 255, .86); }
.hero-feat svg { width: 16px; height: 16px; color: var(--lime); }
.hero-foot { color: rgba(255, 255, 255, .42); font-size: 12px; }
.hero-foot a { color: inherit; text-decoration: underline; }
.auth-side { position: relative; display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-side .theme-fab { position: absolute; top: 20px; right: 20px; }
.auth-card { width: 100%; max-width: 420px; padding: 36px; border-radius: 28px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-md); }
.auth-card h2 { font-size: 28px; font-weight: 800; letter-spacing: -.03em; }
.google-btn { height: 52px; gap: 12px; font-size: 15px; font-weight: 700; border-radius: 14px; }
.google-btn:hover { box-shadow: var(--shadow-md); }
.lock-line { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12.5px; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; font-weight: 600; margin: 6px 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line-2); }
.tabs { display: inline-flex; align-self: flex-start; padding: 4px; border-radius: 12px; background: var(--surface-3); gap: 2px; }
.tabs button { height: 34px; padding: 0 14px; border-radius: 9px; border: 0; background: transparent; cursor: pointer; font-weight: 700; color: var(--muted); }
.tabs button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }

/* ---------- каркас: бічна панель + контент ---------- */
.shell { display: grid; grid-template-columns: 288px minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 12px; height: calc(100vh - 24px); height: calc(100dvh - 24px); margin: 12px 0 12px 12px; padding: 16px 12px 12px;
  display: flex; flex-direction: column; gap: 4px; border-radius: 26px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
}
.side .brand { padding: 4px 8px 14px; }
.side-scroll { flex: 1; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.nav-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--subtle); font-weight: 800; padding: 14px 12px 6px; }
.nav a {
  display: flex; align-items: center; gap: 12px; height: 42px; padding: 0 12px; margin: 2px 0; border-radius: 12px;
  color: var(--ink-2); font-weight: 650; position: relative; text-decoration: none; transition: background .15s, color .15s;
}
.nav a svg { color: var(--muted); transition: color .15s, transform .2s var(--ease); }
.nav a:hover { background: var(--hover); text-decoration: none; }
.nav a:hover svg { transform: scale(1.08); color: var(--ink); }
.nav a.on { background: var(--nav-on-bg); color: var(--nav-on-fg); box-shadow: 0 8px 20px -10px rgba(15, 15, 20, .55); }
.nav a.on svg { color: var(--nav-on-icon); transform: none; }
.nav a .count { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; }
.nav a.on .count { background: var(--lime); color: #0f0f14; }
.side-foot { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px 6px 2px; border-top: 1px solid var(--line); }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 13px; background: var(--accent-soft); color: var(--accent-ink); flex: none; letter-spacing: 0; }
.avatar.dark { background: var(--inverse); color: var(--lime); }
:root[data-theme="dark"] .avatar.dark { background: var(--surface-3); }
img.avatar { object-fit: cover; padding: 0; }
.side-foot .who { min-width: 0; flex: 1; }
.side-foot .who b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-foot .who span { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { display: none; }
.page { padding: 30px 40px 48px; max-width: 1280px; width: 100%; margin: 0 auto; animation: page-in .35s var(--ease) both; }
@keyframes page-in { from { opacity: 0; transform: translateY(8px); } }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.page-head h1 { font-size: 30px; font-weight: 800; letter-spacing: -.035em; line-height: 1.15; margin-top: 8px; }
.page-head p { margin: 6px 0 0; color: var(--muted); max-width: 720px; }

/* ---------- чат ---------- */
.chat-page {
  height: calc(100vh - 24px); height: calc(100dvh - 24px); margin: 12px; padding: 0; max-width: none; width: auto;
  display: grid; grid-template-columns: 300px minmax(0, 1fr); overflow: hidden; animation: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--shadow-sm);
}
.rail { display: flex; flex-direction: column; min-height: 0; background: var(--surface-2); border-right: 1px solid var(--line); }
.rail-head { padding: 18px 16px 8px; display: flex; flex-direction: column; gap: 14px; }
.rail-title { display: flex; align-items: center; gap: 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 800; }
.rail-list { flex: 1; overflow-y: auto; padding: 2px 10px 16px; }
.rail-group { font-size: 10.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--subtle); padding: 16px 10px 6px; }
.rail-item { display: flex; align-items: center; gap: 6px; width: 100%; padding: 4px 4px 4px 12px; border-radius: 12px; cursor: pointer; transition: background .15s, box-shadow .15s; border: 0; background: transparent; text-align: left; }
.rail-item:hover { background: var(--hover); }
.rail-item.on { background: var(--surface); box-shadow: 0 0 0 1px var(--line-2), var(--shadow-sm); }
.rail-item .rt { flex: 1; min-width: 0; padding: 6px 0; }
.rail-item .rt b { display: block; font-size: 13.5px; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.rail-item .rt span { display: block; font-size: 11.5px; color: var(--muted); }
.rail-item .del { opacity: 0; transition: opacity .15s; }
.rail-item:hover .del, .rail-item:focus-within .del, .rail-item .del:focus-visible { opacity: 1; }
.rail-close { display: none; }
.rail-empty { padding: 28px 16px; text-align: center; color: var(--muted); font-size: 13px; }
.rail-empty svg { width: 28px; height: 28px; margin-bottom: 8px; color: var(--subtle); }

.chat-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; position: relative; }
.chat-head { display: flex; align-items: center; gap: 14px; padding: 14px 24px; border-bottom: 1px solid var(--line); background: var(--glass); backdrop-filter: blur(12px); }
.ai-orb { width: 42px; height: 42px; border-radius: 14px; display: grid; place-items: center; color: var(--lime); flex: none; position: relative;
  background: radial-gradient(circle at 28% 22%, #7a70ff, #1d1b3b 72%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 8px 20px -8px rgba(91, 79, 255, .7); }
.ai-orb svg { width: 20px; height: 20px; }
.chat-head h1 { font-size: 17px; font-weight: 800; letter-spacing: -.025em; }
.chat-head p { margin: 0; font-size: 12.5px; color: var(--muted); }
.online { display: inline-flex; align-items: center; gap: 6px; }
.online::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px transparent; } }
.chat-scroll { flex: 1; overflow-y: auto; scroll-behavior: smooth; overscroll-behavior: contain; }
.chat-inner { max-width: 820px; margin: 0 auto; padding: 30px 28px 24px; display: flex; flex-direction: column; gap: 26px; min-height: 100%; }
.scroll-down { position: absolute; right: 28px; bottom: 132px; z-index: 5; width: 40px; height: 40px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow-md); display: grid; place-items: center; cursor: pointer; transition: transform .2s var(--ease), opacity .2s; }
.scroll-down:hover { transform: translateY(-2px); }

.empty-chat { margin: auto 0; text-align: center; padding: 3vh 0; }
.empty-chat .ai-orb { width: 88px; height: 88px; border-radius: 30px; margin: 0 auto 22px; }
.empty-chat .ai-orb svg { width: 38px; height: 38px; }
.empty-chat .ai-orb::before { content: ""; position: absolute; inset: -9px; border-radius: 36px; background: conic-gradient(from 0deg, var(--lime), var(--accent), #22d3ee, var(--lime)); -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px)); mask: radial-gradient(farthest-side, transparent calc(100% - 3px), #000 calc(100% - 2px)); animation: spin 8s linear infinite; opacity: .9; }
.empty-chat .ai-orb::after { content: ""; position: absolute; inset: -22px; border-radius: 44px; background: radial-gradient(circle, rgba(91, 79, 255, .35), transparent 65%); z-index: -1; animation: breathe 4s ease-in-out infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 50% { transform: scale(1.12); opacity: .6; } }
.empty-chat h2 { font-size: clamp(28px, 3.4vw, 40px); font-weight: 800; letter-spacing: -.04em; line-height: 1.1; }
.empty-chat h2 em { font-style: normal; background: linear-gradient(100deg, var(--accent), #22a6d3 60%, var(--green)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.empty-chat > p { color: var(--muted); font-size: 15.5px; max-width: 520px; margin: 12px auto 30px; line-height: 1.6; }
.suggest { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; text-align: left; }
.suggest button {
  position: relative; text-align: left; padding: 16px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; display: flex; flex-direction: column; gap: 14px; min-height: 142px;
  transition: transform .2s var(--ease), box-shadow .2s, border-color .2s; animation: rise .5s var(--ease) both;
}
.suggest button:nth-child(2) { animation-delay: .07s; } .suggest button:nth-child(3) { animation-delay: .14s; }
.suggest button:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--line-2); }
.suggest .si { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); }
.suggest button:nth-child(2) .si { background: var(--lime-soft); color: var(--ink); }
.suggest button:nth-child(3) .si { background: var(--blue-soft); color: var(--blue); }
.suggest b { font-size: 13.5px; font-weight: 700; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; letter-spacing: -.005em; }
.suggest span.tp { margin-top: auto; font-size: 11.5px; font-weight: 700; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.suggest span.tp svg { width: 14px; height: 14px; margin-left: auto; opacity: 0; transform: translateX(-4px); transition: all .2s var(--ease); color: var(--ink); }
.suggest button:hover span.tp svg { opacity: 1; transform: none; }

.msg { display: flex; gap: 12px; align-items: flex-start; animation: rise .38s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.msg.user { flex-direction: row-reverse; }
.msg .ai-orb { width: 34px; height: 34px; border-radius: 11px; margin-top: 2px; }
.msg .ai-orb svg { width: 16px; height: 16px; }
.msg-body { min-width: 0; max-width: min(680px, 100%); display: flex; flex-direction: column; gap: 10px; }
.bubble { padding: 14px 18px; border-radius: 6px 20px 20px 20px; background: var(--surface-2); border: 1px solid var(--line); font-size: 15px; line-height: 1.65; overflow-wrap: anywhere; }
.msg.user .bubble { background: var(--bubble-user-bg); color: var(--bubble-user-fg); border: 0; border-radius: 20px 20px 6px 20px; white-space: pre-wrap; padding: 12px 18px; max-width: min(620px, 100%); }
.bubble > * { animation: rise .45s var(--ease) both; animation-delay: calc(var(--i, 0) * 70ms); }
.msg.user .bubble > * { animation: none; }
.msg.still, .msg.still .bubble > * { animation: none; } /* повідомлення відновленого діалогу з'являються без анімації */
.bubble p { margin: 0 0 10px; } .bubble p:last-child { margin: 0; }
.bubble ul, .bubble ol { margin: 4px 0 10px; padding-left: 22px; } .bubble ul:last-child, .bubble ol:last-child { margin-bottom: 0; }
.bubble li { margin: 4px 0; } .bubble li::marker { color: var(--accent); font-weight: 800; }
.bubble h4 { font-size: 15px; font-weight: 800; margin: 12px 0 6px; }
.bubble b, .bubble strong { font-weight: 750; }
.bubble code { background: var(--code-bg); padding: 1px 6px; border-radius: 6px; font-size: .9em; }
.bubble a { text-decoration: underline; text-underline-offset: 3px; }
.bubble .src-line { color: var(--muted); font-size: 12.5px; padding-top: 10px; margin-top: 10px; border-top: 1px dashed var(--line-2); }
.sources-label { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }
.sources-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.src-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; margin-top: 8px; }
.src { min-width: 0; display: flex; gap: 10px; align-items: flex-start; padding: 11px 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); cursor: pointer; text-align: left; width: 100%; transition: transform .18s var(--ease), box-shadow .18s, border-color .18s; }
.src:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--line-2); }
.src .n { width: 24px; height: 24px; border-radius: 8px; background: var(--accent-soft); color: var(--accent-ink); font-size: 12px; font-weight: 800; display: grid; place-items: center; flex: none; }
.src .sb { min-width: 0; flex: 1; }
.src .t { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 12.5px; font-weight: 700; line-height: 1.4; }
.src .s { display: block; margin-top: 5px; font-size: 11.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-actions { display: flex; align-items: center; gap: 2px; margin-top: -2px; color: var(--muted); }
.msg-actions .btn.icon { color: var(--muted); }
.msg-actions .btn.icon:hover { color: var(--ink); }
.msg-actions .btn.on { background: var(--accent-soft); color: var(--accent-ink); }
.msg-actions .btn.on.neg { background: var(--red-soft); color: var(--red); }
.msg-actions time { margin-left: 8px; font-size: 11.5px; color: var(--subtle); }
.handoff { padding: 14px 16px; border-radius: 18px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; border: 1.5px solid transparent;
  background: linear-gradient(var(--surface), var(--surface)) padding-box, linear-gradient(120deg, var(--accent), var(--lime)) border-box; }
.handoff .hi { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); flex: none; }
.handoff p { margin: 0; flex: 1; min-width: 200px; font-size: 13.5px; color: var(--ink-2); line-height: 1.5; }
.handoff.done { background: linear-gradient(var(--surface), var(--surface)) padding-box, linear-gradient(120deg, var(--green), var(--lime)) border-box; }
.handoff.done .hi { background: var(--green-soft); color: var(--green); }
.typing { display: inline-flex; gap: 5px; padding: 6px 2px; vertical-align: middle; }
.typing i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: wave 1.1s ease-in-out infinite; }
.typing i:nth-child(2) { animation-delay: .14s; background: var(--blue); } .typing i:nth-child(3) { animation-delay: .28s; background: var(--green); }
@keyframes wave { 0%, 60%, 100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-5px); opacity: 1; } }
.typing-label { font-size: 13px; color: var(--muted); margin-left: 10px; background: linear-gradient(90deg, var(--muted) 30%, var(--ink) 50%, var(--muted) 70%); background-size: 250% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer-text 2s linear infinite; }
@keyframes shimmer-text { to { background-position: -250% 0; } }

.composer-wrap { padding: 0 24px 16px; background: linear-gradient(to top, var(--surface) 62%, transparent); position: relative; }
.composer { max-width: 820px; margin: 0 auto; display: flex; gap: 10px; align-items: flex-end; padding: 10px 10px 10px 20px; border-radius: 26px; background: var(--surface); border: 1px solid var(--line-2); box-shadow: var(--shadow-md); transition: border-color .2s, box-shadow .2s; }
.composer:focus-within { border-color: var(--accent); box-shadow: var(--shadow-md), var(--ring); }
.composer textarea { flex: 1; border: 0; outline: none; resize: none; background: transparent; padding: 10px 0; max-height: 170px; min-height: 26px; line-height: 1.5; font-size: 15px; }
.composer textarea::placeholder { color: var(--subtle); }
.send { width: 44px; height: 44px; border-radius: 50%; border: 0; background: linear-gradient(180deg, var(--lime-2), var(--lime)); color: #0f0f14; display: grid; place-items: center; cursor: pointer; flex: none; transition: transform .15s var(--ease), opacity .2s, filter .2s; box-shadow: 0 6px 16px -6px rgba(160, 210, 0, .9), inset 0 1px 0 rgba(255, 255, 255, .5); }
.send:hover:not(:disabled) { transform: scale(1.07) rotate(-8deg); }
.send:active:not(:disabled) { transform: scale(.96); }
.send:disabled { background: var(--surface-3); color: var(--subtle); box-shadow: none; cursor: not-allowed; }
.composer-hint { max-width: 820px; margin: 9px auto 0; display: flex; align-items: center; gap: 10px; font-size: 11.5px; color: var(--subtle); }
.composer-hint .spacer { flex: 1; }
.composer-hint .keys { white-space: nowrap; }
.composer-hint .disclaimer { text-align: center; }
.composer-hint .d-short { display: none; }
/* дисклеймер важливіший за підказки клавіатури: коли місця мало, лишається тільки він (а на вузьких — коротка версія) */
.composer-wrap { container-type: inline-size; }
@container (max-width: 760px) {
  .composer-hint { justify-content: center; }
  .composer-hint .keys, .composer-hint .spacer { display: none; }
}
@container (max-width: 480px) {
  .composer-hint .d-long { display: none; }
  .composer-hint .d-short { display: inline; }
}

/* ---------- KPI та графіки ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.kpi { padding: 20px; position: relative; overflow: hidden; transition: transform .2s var(--ease), box-shadow .2s; }
.kpi:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.kpi .l { font-size: 12.5px; color: var(--muted); font-weight: 700; display: flex; align-items: center; gap: 10px; }
.kpi .l .ki { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); }
.kpi .l .ki svg { width: 17px; height: 17px; }
.kpi .v { font-size: 36px; font-weight: 800; letter-spacing: -.04em; margin-top: 14px; font-variant-numeric: tabular-nums; line-height: 1; }
.kpi .v small { font-size: 17px; font-weight: 700; color: var(--muted); letter-spacing: -.01em; margin-left: 2px; }
.kpi .d { font-size: 12px; color: var(--muted); margin-top: 8px; line-height: 1.45; }
.kpi .spark { position: absolute; right: 0; bottom: 0; width: 56%; height: 54px; opacity: .95; pointer-events: none; }
.kpi .ring { position: absolute; right: 18px; top: 18px; width: 52px; height: 52px; }
.kpi.dark { padding-bottom: 68px; background: linear-gradient(150deg, #1d1a4a 0%, #0f0f1a 62%); color: #fff; border-color: #25235a; }
.kpi.dark .l, .kpi.dark .d { color: rgba(255, 255, 255, .62); }
.kpi.dark .l .ki { background: rgba(200, 245, 60, .16); color: var(--lime); }
.kpi.dark .v { color: var(--lime); }
.kpi.green .ki { background: var(--green-soft); color: var(--green); }
.kpi.amber .ki { background: var(--amber-soft); color: var(--amber); }
.kpi.lime .ki { background: var(--lime-soft); color: var(--ink); }
.two { display: grid; grid-template-columns: 1.65fr 1fr; gap: 16px; margin-bottom: 16px; }
.bars { position: relative; display: flex; align-items: stretch; gap: 8px; height: 214px; margin-top: 20px; }
.bars::before { content: ""; position: absolute; left: 0; right: 0; top: 0; bottom: 26px; pointer-events: none;
  background-image: repeating-linear-gradient(to top, transparent 0, transparent calc(25% - 1px), var(--line) calc(25% - 1px), var(--line) 25%); }
.bar { flex: 1; position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; min-width: 0; cursor: default; }
.bar .colwrap { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.bar .col { width: 100%; max-width: 40px; border-radius: 10px 10px 4px 4px; background: var(--accent-soft); position: relative; overflow: hidden; min-height: 4px; transition: transform .2s var(--ease), filter .2s; transform-origin: bottom; animation: grow .7s var(--ease) both; }
.bar .col i { position: absolute; left: 0; right: 0; bottom: 0; background: linear-gradient(180deg, var(--accent), var(--accent-2)); border-radius: 10px 10px 4px 4px; }
.bar:hover .col { transform: scaleY(1.03); filter: brightness(1.08); }
.bar > span { height: 26px; line-height: 26px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.bar.today > span { color: var(--ink); font-weight: 800; }
.bar .tip { position: absolute; bottom: calc(100% - 22px); left: 50%; transform: translate(-50%, 6px); opacity: 0; pointer-events: none; z-index: 3; background: var(--inverse); color: var(--on-inverse); padding: 6px 10px; border-radius: 9px; font-size: 11.5px; font-weight: 700; white-space: nowrap; transition: all .15s var(--ease); box-shadow: var(--shadow-md); }
.bar:hover .tip { opacity: 1; transform: translate(-50%, 0); }
@keyframes grow { from { transform: scaleY(0); } }
.split { height: 8px; border-radius: 99px; background: var(--red-soft); margin-top: 14px; overflow: hidden; }
.split i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--green), #6fd89b); animation: fill-x .8s var(--ease) both; transform-origin: left; }
.split.amber { background: var(--surface-3); } .split.amber i { background: linear-gradient(90deg, #f5a623, var(--lime)); }
.legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 4px; margin-right: 6px; vertical-align: -1px; }
.cat { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.cat:last-child { border: 0; }
.cat .rk { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); font-size: 11px; font-weight: 800; flex: none; }
.cat:nth-child(1) .rk { background: var(--lime); color: #0f0f14; }
.cat .track { flex: 0 0 84px; height: 7px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.cat .track i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), #22a6d3); border-radius: 99px; animation: fill-x .8s var(--ease) both; transform-origin: left; }
@keyframes fill-x { from { transform: scaleX(0); } }

/* ---------- таблиці ---------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.t th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 800; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
.t td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.t tr:last-child td { border-bottom: 0; }
.t tbody tr { transition: background .12s; }
.t tbody tr.click { cursor: pointer; }
.t tbody tr.click:hover td { background: var(--hover); }
.card > .table-wrap:first-child .t th:first-child, .card > .toolbar + .table-wrap .t th:first-child { padding-left: 20px; }
.t td:first-child, .t th:first-child { padding-left: 20px; } .t td:last-child, .t th:last-child { padding-right: 20px; }
.t .q { font-weight: 700; max-width: 480px; line-height: 1.4; }
.t .q .chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.toolbar { display: flex; gap: 12px; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.search { position: relative; flex: 1; min-width: 200px; max-width: 380px; }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search .input { padding-left: 40px; height: 40px; }
.seg { display: inline-flex; padding: 3px; background: var(--surface-3); border-radius: 12px; gap: 2px; }
.seg button { height: 32px; padding: 0 13px; border: 0; background: transparent; border-radius: 9px; font-weight: 700; font-size: 12.5px; color: var(--muted); cursor: pointer; transition: all .15s; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.score { display: inline-flex; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; font-weight: 700; font-size: 12.5px; }
.score .track { width: 64px; height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.score .track i { display: block; height: 100%; border-radius: 99px; }
.log-detail td { background: var(--surface-2); animation: fade .2s; }
.match-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 13px; }
.match-row .t { flex: 1; min-width: 0; }
.match-row.click { cursor: pointer; border-radius: 10px; padding: 8px 10px; margin: 0 -10px; transition: background .12s; }
.match-row.click:hover { background: var(--hover); }

/* ---------- звернення ---------- */
.req-layout { display: grid; grid-template-columns: 400px minmax(0, 1fr); gap: 16px; align-items: start; }
.req-list { overflow: hidden; position: sticky; top: 16px; }
.req-item { display: block; width: 100%; text-align: left; padding: 15px 18px; border: 0; border-bottom: 1px solid var(--line); background: var(--surface); cursor: pointer; transition: background .12s; position: relative; }
.req-item:last-child { border-bottom: 0; }
.req-item:hover { background: var(--hover); }
.req-item.on { background: var(--accent-soft); }
.req-item.on::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.req-item .top { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); margin-bottom: 7px; }
.req-item .qq { font-weight: 700; font-size: 13.5px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.req-detail h2 { font-size: 21px; font-weight: 800; line-height: 1.3; letter-spacing: -.025em; }
.meta { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 18px 0; }
.meta div { padding: 11px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); min-width: 0; }
.meta b { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 800; }
.meta span { font-size: 13.5px; font-weight: 700; overflow-wrap: anywhere; }
.steps { display: flex; gap: 0; margin: 18px 0 6px; }
.step { flex: 1; display: flex; flex-direction: column; gap: 8px; font-size: 12px; color: var(--muted); font-weight: 700; }
.step .dot { display: flex; align-items: center; }
.step .dot i { width: 14px; height: 14px; border-radius: 50%; background: var(--line-2); flex: none; transition: all .3s; }
.step .dot::after { content: ""; height: 3px; border-radius: 3px; flex: 1; background: var(--line-2); margin: 0 8px; }
.step:last-child .dot::after { display: none; }
.step.on { color: var(--ink); }
.step.on .dot i { background: var(--inverse); box-shadow: 0 0 0 5px var(--lime-soft), 0 0 0 1.5px var(--lime); }
.step.on .dot::after { background: var(--inverse); }
.user-req { padding: 22px 24px; }
.user-req + .user-req { margin-top: 14px; }
.answer { margin-top: 14px; padding: 16px 18px; border-radius: 16px; background: var(--green-soft); color: var(--ink-2); white-space: pre-wrap; border: 1px solid transparent; line-height: 1.6; }
.answer b { display: block; font-size: 11.5px; font-weight: 800; margin-bottom: 6px; color: var(--green); text-transform: uppercase; letter-spacing: .06em; }

/* ---------- налаштування, моделі, ключі ---------- */
.set-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 16px; align-items: start; }
.integ { display: flex; gap: 12px; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--line); }
.integ:last-child { border: 0; }
.integ .ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); font-weight: 800; font-size: 13px; flex: none; }
.integ b { display: block; font-size: 13.5px; }
.integ span { font-size: 12px; color: var(--muted); }
.key-row { padding: 12px 0; border-bottom: 1px solid var(--line); }
.key-row:last-child { border-bottom: 0; }
.key-row code, .copy-row code { font-size: 12px; background: var(--code-bg); padding: 2px 7px; border-radius: 6px; word-break: break-all; }
.copy-row { display: grid; grid-template-columns: 1fr auto; gap: 3px 8px; align-items: center; }
.copy-row span { grid-column: 1 / -1; }
.model { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; background: var(--surface); margin-bottom: 8px; transition: border-color .15s, background .15s, box-shadow .15s; }
.model:hover { border-color: var(--line-2); box-shadow: var(--shadow-sm); }
.model.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent); }
.model.off { opacity: .5; cursor: not-allowed; }
.model input[type=radio] { margin-top: 3px; }
.model-body { flex: 1; min-width: 0; }
.model-body code { font-size: 11px; background: var(--code-bg); padding: 1px 6px; border-radius: 5px; }
.model-group { margin-bottom: 8px; }
.dots i { font-style: normal; opacity: .22; font-size: 11px; }
.dots i.on { opacity: 1; }

/* ---------- модальні вікна й тости ---------- */
.modal-bg { position: fixed; inset: 0; background: var(--scrim); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); display: grid; place-items: center; padding: 20px; z-index: 50; animation: fade .18s ease-out; }
@keyframes fade { from { opacity: 0; } }
.modal { width: 100%; max-width: 720px; max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px); overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 26px; box-shadow: var(--shadow-lg); animation: pop .28s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.97); } }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 20px 24px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--surface); z-index: 2; }
.modal-head h3 { font-size: 18px; font-weight: 800; flex: 1; letter-spacing: -.025em; }
.modal-body { padding: 22px 24px; }
.modal-foot { display: flex; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: var(--surface); flex-wrap: wrap; z-index: 2; }
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 60; max-width: calc(100vw - 40px); pointer-events: none; }
.toast { padding: 12px 18px 12px 12px; border-radius: 16px; background: var(--inverse); color: var(--on-inverse); font-size: 13.5px; font-weight: 650; box-shadow: var(--shadow-lg); display: flex; gap: 12px; align-items: center; animation: toast-in .35s var(--ease); max-width: 440px; pointer-events: auto; }
@keyframes toast-in { from { opacity: 0; transform: translateX(24px) scale(.96); } }
.toast .ti { width: 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; flex: none; background: var(--lime); color: #0f0f14; }
.toast .ti.bad { background: var(--red); color: #fff; }
.toast .ti svg { width: 16px; height: 16px; stroke-width: 2.4; }
.dropzone { border: 2px dashed var(--line-2); border-radius: 18px; padding: 32px; text-align: center; cursor: pointer; background: var(--surface-2); transition: border-color .15s, background .15s; }
.dropzone:hover { border-color: var(--accent); background: var(--accent-soft); }
.empty { text-align: center; padding: 56px 20px; color: var(--muted); }
.empty svg { width: 34px; height: 34px; color: var(--subtle); margin-bottom: 6px; }
.empty h3 { color: var(--ink); }
.loading { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 64px 20px; color: var(--muted); font-weight: 600; }
.loading::before { content: ""; width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid var(--line-2); border-top-color: var(--accent); animation: spin .7s linear infinite; }

/* ---------- додаткові ---------- */
.fb { display: flex; align-items: center; gap: 2px; font-size: 12px; color: var(--muted); }
.bubble-lite p { margin: 0 0 8px; }
.bubble-lite ul, .bubble-lite ol { margin: 0 0 8px; padding-left: 20px; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 10px 14px; font-size: 13.5px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 700; }
.role-pill { cursor: default; }

/* ---------- адаптив ---------- */
@media (max-width: 1180px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .two, .set-grid { grid-template-columns: 1fr; }
  .req-layout { grid-template-columns: 1fr; }
  .req-list { position: static; }
  .page { padding: 26px 28px 40px; }
}
@media (max-width: 1100px) {
  .chat-page { grid-template-columns: minmax(0, 1fr); }
  .rail { position: fixed; z-index: 45; top: 0; bottom: 0; left: 0; width: min(320px, 86vw); transform: translateX(calc(-100% - 72px)); /* з запасом на тінь: інакше вона видна смугою біля краю */ transition: transform .28s var(--ease); box-shadow: var(--shadow-lg); border-radius: 0 var(--r-xl) var(--r-xl) 0; border-right: 1px solid var(--line); }
  .rail.open { transform: none; }
  .rail-scrim { position: fixed; inset: 0; z-index: 44; background: var(--scrim); backdrop-filter: blur(3px); animation: fade .2s; }
  .rail .rail-close { display: inline-flex; }
}
@media (min-width: 1101px) { .rail .rail-close, .chat-head [data-rail-toggle], .chat-head .head-new { display: none; } }
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  /* вхід — рівно один екран без прокрутки: svh = видима висота з панелями браузера (100vh на iPhone більша за екран);
     шапка заповнює вільне місце, картка входу внизу — під пальцем */
  .auth { position: relative; display: flex; flex-direction: column; min-height: 100vh; min-height: 100svh; }
  .auth-hero { flex: 1 0 auto; padding: 20px 20px 22px; }
  .hero-body { padding: 16px 0 0; }
  .hero-body h1 { font-size: 28px; margin-top: 0; }
  .hero-body > p { font-size: 14px; line-height: 1.55; margin: 10px 0 0; }
  .hero-badge, .hero-demo, .hero-feats, .hero-foot { display: none; }
  .auth-side { flex: none; position: static; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); align-items: flex-start; }
  .auth-card .brand { display: none; } /* логотип уже є в шапці */
  .auth-side .theme-fab { top: 16px; right: 14px; }
  .auth-side .theme-fab .btn { color: rgba(255, 255, 255, .85); } /* на темній шапці */
  .auth-side .theme-fab .btn:hover { background: rgba(255, 255, 255, .1); color: #fff; }
  .auth-hero .brand { padding-right: 44px; } /* місце для кнопки теми */
  .auth-card { padding: 26px 22px; border-radius: 24px; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; z-index: 40; left: 0; top: 0; bottom: 0; margin: 0; width: min(300px, 86vw); height: auto; border-radius: 0 26px 26px 0; transform: translateX(calc(-100% - 72px)); transition: transform .28s var(--ease); box-shadow: var(--shadow-lg); }
  .shell.menu-open .side { transform: none; }
  .scrim { position: fixed; inset: 0; background: var(--scrim); backdrop-filter: blur(3px); z-index: 39; animation: fade .2s; }
  .topbar { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
  .page { padding: 22px 16px 36px; }
  .page-head h1 { font-size: 26px; }
  .chat-page { height: calc(100vh - 62px); height: calc(100dvh - 62px); margin: 0; border-radius: 0; border: 0; box-shadow: none; }
  .chat-head { padding: 8px 12px; gap: 10px; }
  .chat-head .ai-orb, .chat-head .trust { display: none; }
  .chat-head p { font-size: 12px; } .chat-head p .tail { display: none; }
  .chat-head h1 { font-size: 15.5px; }
  .chat-inner { padding: 18px 14px 12px; gap: 20px; }
  .composer-wrap { padding: 0 12px calc(12px + env(safe-area-inset-bottom)); }
  .composer { padding: 8px 8px 8px 16px; border-radius: 24px; }
  .composer-hint { margin-top: 7px; font-size: 11px; }
  .suggest { grid-template-columns: 1fr; }
  .suggest button { min-height: 0; flex-direction: row; align-items: center; gap: 12px; padding: 13px 14px; }
  .suggest .si { flex: none; } .suggest .tp { display: none; }
  .suggest b { -webkit-line-clamp: 3; }
  .empty-chat .ai-orb { width: 72px; height: 72px; border-radius: 24px; }
  .src-cards { grid-template-columns: minmax(0, 1fr); }
  .scroll-down { bottom: 96px; right: 16px; }
  .grid-2, .meta { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 110px 1fr; }
  .toasts { left: 14px; right: 14px; bottom: 14px; align-items: stretch; }
  .toast { max-width: none; }
  .modal-bg { align-items: end; padding: 0; }
  .modal { max-width: none; border-radius: 26px 26px 0 0; max-height: 92vh; max-height: 92dvh; animation: sheet .32s var(--ease); }
  .modal-body, .modal-head, .modal-foot { padding-left: 18px; padding-right: 18px; }
  .toolbar { padding: 14px; }
  .search { max-width: none; min-width: 100%; }
  .kpi .v { font-size: 30px; }

  /* таблиці → картки */
  .t.stack-m, .t.stack-m tbody { display: block; }
  .t.stack-m thead { display: none; }
  .t.stack-m tr { display: block; padding: 14px 16px; border-bottom: 1px solid var(--line); }
  .t.stack-m tr:last-child { border-bottom: 0; }
  .t.stack-m td, .t.stack-m td:first-child, .t.stack-m td:last-child { display: flex; gap: 12px; justify-content: space-between; align-items: center; padding: 5px 0; border: 0; text-align: right; }
  .t.stack-m td::before { content: attr(data-label); flex: none; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; text-align: left; }
  .t.stack-m td.q { display: block; text-align: left; max-width: none; }
  .t.stack-m td.q::before, .t.stack-m td:not([data-label])::before { display: none; }
  .t.stack-m tr.log-detail { background: var(--surface-2); }
  .t.stack-m tr.log-detail td { display: block; text-align: left; }
  .t.stack-m td[colspan] { display: block; text-align: center; }
}
@keyframes sheet { from { transform: translateY(100%); } }
@media (max-width: 480px) { .kpis { grid-template-columns: 1fr; } }
@media (hover: none) { .rail-item .del { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- шапка сторінки: кнопки лишаються разом ---------- */
.page-head .actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
@media (max-width: 860px) { .page-head .actions { width: 100%; } .page-head .actions .btn { flex: 1; } }

/* ---------- шапка сторінки: кнопки лишаються разом ---------- */
.page-head .actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
@media (max-width: 860px) { .page-head .actions { width: 100%; } .page-head .actions .btn { flex: 1; } }
.t tr.off td { opacity: .55; }
.t tr.off td:last-child, .t tr.off td[data-label="Доступ"] { opacity: 1; }

/* ---------- варіанти вибору (замість радіо в рядку) ---------- */
.opt { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; background: var(--surface); transition: border-color .15s, background .15s, box-shadow .15s; line-height: 1.4; }
.opt:hover { border-color: var(--line-2); }
.opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent); }
.opt input { margin-top: 2px; }
.opt b { font-weight: 700; font-size: 13.5px; }
.range { background: linear-gradient(to right, var(--accent) var(--p, 50%), var(--surface-3) var(--p, 50%)); }
.range::-moz-range-track { background: var(--surface-3); height: 6px; border-radius: 99px; }
.range::-moz-range-progress { background: var(--accent); height: 6px; border-radius: 99px; }
@media (max-width: 860px) {
  .t.stack-m td[data-label="Користувач"] { justify-content: flex-start; }
  .t.stack-m td[data-label="Користувач"]::before { display: none; }
  .t.stack-m td:last-child:not([data-label]) > .row { justify-content: flex-end; width: 100%; }
}
.t.mid td { vertical-align: middle; }
.page-head .actions { margin-left: auto; }

/* ---------- кнопка меню з позначкою нового; причини оцінки ---------- */
.menu-btn { position: relative; }
.menu-btn .dot { position: absolute; top: 6px; right: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--surface); }
.chat-menu { display: none; }
.reasons { display: flex; flex-wrap: wrap; gap: 8px; }
.reason { min-height: 38px; padding: 8px 14px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2); font-size: 13.5px; font-weight: 650; cursor: pointer; text-align: left; transition: background .15s, border-color .15s, color .15s; }
.reason:hover { border-color: var(--subtle); }
.reason[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); }

/* ---------- мобільна версія чату ---------- */
@media (max-width: 860px) {
  /* чат на весь екран: одна шапка (меню, назва, історія, новий діалог) замість двох, без полів сторінки */
  .shell.is-chat .topbar { display: none; }
  .shell.is-chat .page.chat-page { padding: 0; height: 100vh; height: 100dvh; }
  .chat-menu { display: inline-flex; }
  .chat-head { padding: 8px 8px 8px 6px; gap: 4px; }
  .chat-head > div:not(.ai-orb) { margin-left: 4px; }

  /* повідомлення на всю ширину: без значка AI ліворуч, питання — вужчою бульбашкою праворуч */
  .msg .ai-orb { display: none; }
  .msg.ai .msg-body { max-width: 100%; }
  .msg.user .msg-body { max-width: 86%; }
  .bubble { padding: 12px 15px; }
  .msg.user .bubble { padding: 11px 15px; }
  .chat-inner { padding: 16px 12px 12px; gap: 18px; }

  /* 16px — інакше iPhone збільшує сторінку при фокусі на полі */
  .composer textarea { font-size: 16px; }
  /* поки набирають питання (відкрита клавіатура), місце над нею важливіше за рядок-дисклеймер */
  .composer-wrap:focus-within .composer-hint { display: none; }

  /* привітання компактніше, щоб підказки було видно без прокрутки */
  .empty-chat { padding: 2vh 0 0; }
  .empty-chat .ai-orb { width: 56px; height: 56px; border-radius: 19px; margin-bottom: 16px; }
  .empty-chat .ai-orb::before { inset: -7px; border-radius: 25px; }
  .empty-chat .ai-orb svg { width: 26px; height: 26px; }
  .empty-chat h2 { font-size: 26px; }
  .empty-chat > p { font-size: 14.5px; margin: 8px auto 20px; }
  .suggest { gap: 10px; }
  .suggest span.tp { display: none; }
  .suggest b { font-size: 14px; }
}

/* сенсорні екрани: кнопки під палець (не менше 40px) */
@media (pointer: coarse) {
  .msg-actions .btn.icon.sm, .rail-item .del { width: 40px; height: 40px; }
  .msg-actions .btn.sm { height: 40px; }
  .msg-actions { gap: 4px; }
}

/* вхід із повідомленням про помилку: увага на помилці, опис у шапці не потрібен */
@media (max-width: 860px) { .auth:has(.auth-card .note) .hero-body > p { display: none; } }
/* вхід на низьких екранах (iPhone SE тощо): ховаємо опис, щоб кнопка входу вмістилась без прокрутки */
@media (max-width: 860px) and (max-height: 620px) {
  .hero-body > p { display: none; }
  .auth-hero { padding-bottom: 18px; }
  .auth-card { padding: 20px 18px; }
}
/* сторінка входу вміщується в екран — без «пружної» прокрутки на iPhone */
html:has(.auth) { overscroll-behavior: none; }

/* ---------- шухляди й вікна не гортають сторінку під собою ---------- */
/* прокрутка списку в шухляді/вікні, дійшовши до краю, не передається сторінці */
.side-scroll, .rail-list, .modal { overscroll-behavior: contain; }
/* затемнення під шухлядою не має що прокручувати — свайп по ньому теж не гортає сторінку */
.scrim, .rail-scrim { touch-action: none; }
/* поки відкрита шухляда чи вікно (клас ставить app.js), сторінка стоїть на місці.
   Лише там, де шухляди існують: на широкому екрані блокування зсунуло б сторінку на ширину смуги прокрутки */
@media (max-width: 1100px) {
  html.no-scroll, html.no-scroll body { overflow: hidden; overscroll-behavior: none; }
}

/* вхід на комп'ютері — рівно один екран: на невисоких екранах (ноутбуки, масштаб 125–150%) по черзі прибираємо
   декоративне — спершу макет чату, далі значки переваг, далі опис. Повний вміст шапки займає ~870px */
@media (min-width: 861px) and (max-height: 879px) {
  .hero-demo { display: none; }
}
@media (min-width: 861px) and (max-height: 689px) {
  .hero-feats { display: none; }
  .auth-hero { padding-top: 32px; padding-bottom: 32px; }
  .hero-body { padding: 24px 0; }
  .hero-body h1 { font-size: clamp(34px, 3.4vw, 46px); }
}
@media (min-width: 861px) and (max-height: 539px) {
  .hero-body > p { display: none; }
}

/* ---------- довгі списки: порції, лічильники, пошук ---------- */
.more-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 20px; border-top: 1px solid var(--line); }
.seg .n { margin-left: 6px; font-weight: 600; color: var(--subtle); font-variant-numeric: tabular-nums; }
.seg .n:empty { display: none; }
.seg button.on .n { color: var(--muted); }
/* список звернень гортається всередині картки, деталі звернення лишаються поруч */
.req-list { display: flex; flex-direction: column; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); }
.req-list .toolbar { flex: none; padding: 14px 16px; }
.req-list .search { flex: 1 1 100%; max-width: none; }
.req-scroll { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.req-scroll .more-bar { padding: 12px 18px; }
@media (max-width: 1180px) { .req-list { max-height: none; } }
@media (max-width: 860px) { .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; } .seg button { flex: none; } }
