/* ---------- Sugar Night: graphite and champagne gold. Dark by default; «Тема» switches to the light ivory one ---------- */
@font-face { font-family: 'Cormorant Garamond'; font-style: normal; font-weight: 500 600; font-display: swap; src: url('fonts/cormorant-garamond-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: 'Cormorant Garamond'; font-style: normal; font-weight: 500 600; font-display: swap; src: url('fonts/cormorant-garamond-cyrillic.woff2') format('woff2'); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Cormorant Garamond'; font-style: normal; font-weight: 500 600; font-display: swap; src: url('fonts/cormorant-garamond-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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Cormorant Garamond'; font-style: normal; font-weight: 500 600; font-display: swap; src: url('fonts/cormorant-garamond-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; }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 400 700; 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: 400 700; 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: 400 700; 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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Manrope'; font-style: normal; font-weight: 400 700; 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: dark;
  --bg: #0d0e11; --surface: #15171c; --surface-2: #1b1e25; --sidebar: #111317; --line: #252932; --line-2: #333844;
  --ink: #ede9e1; --ink-2: #cfcac0; --muted: #9a968c;
  --accent: #d4b072; --accent-hover: #e3c48d; --accent-ink: #17130b; --accent-soft: rgba(212, 176, 114, .13);
  --ok: #7fc8a0; --ok-soft: rgba(127, 200, 160, .13); --warn: #e2b65b; --warn-soft: rgba(226, 182, 91, .14); --err: #ec8a7f; --err-soft: rgba(236, 138, 127, .14); --info: #8db4e2; --info-soft: rgba(141, 180, 226, .13);
  --series-1: #d4b072; --series-2: #8db4e2; --grid: #23262e; --axis: #3a3f4a;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 14px 34px rgba(0, 0, 0, .28);
  --radius: 16px;
  --gold-text: linear-gradient(135deg, #f3e3c1 0%, #d4b072 50%, #a8843f 100%);
  --btn-primary: linear-gradient(135deg, #ecd6a6 0%, #d4b072 50%, #b8924f 100%);
  --star-tile: transparent;
  --font-ui: Manrope, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Cormorant Garamond", Georgia, "Times New Roman", serif;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f6f3ee; --surface: #ffffff; --surface-2: #faf7f2; --sidebar: #fbf9f5; --line: #e7e0d5; --line-2: #d9d0c2;
  --ink: #1a1815; --ink-2: #3f3a33; --muted: #6e675d;
  --accent: #8a6a2e; --accent-hover: #74581f; --accent-ink: #ffffff; --accent-soft: #f3eadb;
  --ok: #2f7d55; --ok-soft: #e3f2e9; --warn: #9a5b00; --warn-soft: #fbefd9; --err: #b3392f; --err-soft: #fbe7e4; --info: #2f5f96; --info-soft: #e6eef8;
  --series-1: #8a6a2e; --series-2: #2f5f96; --grid: #ece6dc; --axis: #cfc6b8;
  --shadow: 0 1px 2px rgba(40, 30, 15, .05), 0 8px 24px rgba(40, 30, 15, .06);
  --gold-text: linear-gradient(135deg, #b8924f 0%, #8a6a2e 55%, #6b5020 100%);
  --btn-primary: var(--accent);
  --star-tile: #0d0e11;
}
@media (prefers-color-scheme: light) {
  :root[data-theme="auto"] {
    color-scheme: light;
    --bg: #f6f3ee; --surface: #ffffff; --surface-2: #faf7f2; --sidebar: #fbf9f5; --line: #e7e0d5; --line-2: #d9d0c2;
    --ink: #1a1815; --ink-2: #3f3a33; --muted: #6e675d;
    --accent: #8a6a2e; --accent-hover: #74581f; --accent-ink: #ffffff; --accent-soft: #f3eadb;
    --ok: #2f7d55; --ok-soft: #e3f2e9; --warn: #9a5b00; --warn-soft: #fbefd9; --err: #b3392f; --err-soft: #fbe7e4; --info: #2f5f96; --info-soft: #e6eef8;
    --series-1: #8a6a2e; --series-2: #2f5f96; --grid: #ece6dc; --axis: #cfc6b8;
    --shadow: 0 1px 2px rgba(40, 30, 15, .05), 0 8px 24px rgba(40, 30, 15, .06);
    --gold-text: linear-gradient(135deg, #b8924f 0%, #8a6a2e 55%, #6b5020 100%);
    --btn-primary: var(--accent);
    --star-tile: #0d0e11;
  }
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { font: 15px/1.55 var(--font-ui); background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; }
h1 { font-size: 26px; letter-spacing: -.01em; display: flex; align-items: center; gap: 10px; }
h3 { font-size: 16px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
h4 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-top: 8px; }
code, .mono, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13.5px; }
code { background: var(--surface-2); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; }
.muted { color: var(--muted); } .small { font-size: 13.5px; } .nowrap { white-space: nowrap; }
.lead { margin: -8px 0 16px; max-width: 760px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.boot { padding: 40px; color: var(--muted); }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 4px; padding: 18px 12px; background: var(--surface); border-right: 1px solid var(--line); overflow-y: auto; }
.brand img { flex: none; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17.5px; padding: 0 8px 6px; }
.brand.big { font-size: 24px; justify-content: center; padding: 0; }
.agency-name { padding: 0 8px 12px; color: var(--muted); font-size: 13.5px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.nav-list { display: grid; gap: 2px; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--ink-2); text-decoration: none; font: inherit; background: none; border: 0; cursor: pointer; text-align: left; width: 100%; }
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-item.subtle { color: var(--muted); font-size: 14px; padding: 7px 10px; }
.nav-icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: .9; }
.nav-foot { margin-top: auto; display: grid; gap: 2px; border-top: 1px solid var(--line); padding-top: 10px; }
.me { display: grid; padding: 6px 10px; } .me small { color: var(--muted); }
.topbar { display: none; }
.burger { font-size: 21.5px; background: none; border: 0; color: var(--ink); cursor: pointer; padding: 4px 8px; }
.content { min-width: 0; outline: none; }
.page { padding: 28px 32px 48px; max-width: 1360px; display: grid; gap: 18px; align-content: start; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.count { font-size: 14px; font-weight: 600; color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); border-radius: 20px; padding: 1px 9px; }

/* ---------- surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); min-width: 0; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.site-card { display: grid; gap: 8px; } .site-card h3 { margin: 0; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 18px; align-items: start; }
.settings-grid .card { display: grid; gap: 12px; } .settings-grid h3 { margin: 0; } .settings-grid .card > .btn { justify-self: start; }

/* ---------- tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 2px; box-shadow: var(--shadow); border-top: 3px solid var(--line-2); }
.tile.good { border-top-color: var(--ok); } .tile.warn { border-top-color: var(--warn); }
.tile-label { color: var(--muted); font-size: 13.5px; }
.tile-value { font-size: 30px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tile-sub { color: var(--ink-2); font-size: 13.5px; }

/* ---------- chart ---------- */
.chart { margin: 0; display: grid; gap: 8px; }
.chart figcaption { display: flex; justify-content: space-between; align-items: baseline; font-weight: 600; }
.chart figcaption b { font-size: 19.5px; font-variant-numeric: tabular-nums; }
.chart-wrap { position: relative; }
.chart-svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-svg .grid { stroke: var(--grid); stroke-width: 1; }
.chart-svg .axis { stroke: var(--axis); stroke-width: 1; }
.chart-svg .tick { fill: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.chart-svg .hit { fill: transparent; cursor: default; outline: none; }
.chart-svg .hit.on { fill: color-mix(in srgb, var(--ink) 5%, transparent); }
.chart-tip { position: absolute; transform: translate(-50%, calc(-100% - 10px)); background: var(--surface); border: 1px solid var(--line-2); border-radius: 8px; padding: 6px 10px; box-shadow: var(--shadow); font-size: 13.5px; display: grid; pointer-events: none; white-space: nowrap; z-index: 2; }
.chart-tip.flip { transform: translate(-90%, calc(-100% - 10px)); }
.chart-tip span { font-variant-numeric: tabular-nums; }
.chart-table summary { cursor: pointer; color: var(--muted); font-size: 13.5px; }
.chart-table table { margin-top: 8px; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; padding: 0; }
.card.table-wrap > .empty { margin: 18px; }
.card > .table-wrap { margin: 0 -18px -18px; }
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12.5px; text-transform: uppercase; letter-spacing: .04em; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface-2); vertical-align: bottom; }
.table td { padding: 10px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table.compact td, .table.compact th { padding: 5px 8px; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table.hover tbody tr { cursor: pointer; } .table.hover tbody tr:hover { background: var(--surface-2); }
.table td.actions { white-space: nowrap; text-align: right; } .table td.actions .btn + .btn { margin-left: 6px; }
.invite-cell { max-width: 340px; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--ink-2); font-size: 13.5px; }
.person { display: flex; align-items: center; gap: 10px; min-width: 160px; }
.avatar { position: relative; flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; overflow: hidden; }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.key { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13.5px; background: var(--surface-2); border: 1px dashed var(--line-2); border-radius: 6px; padding: 3px 8px; color: var(--ink); cursor: copy; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---------- badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 20px; font-size: 13px; font-weight: 600; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge.err { background: var(--err-soft); color: var(--err); border-color: transparent; }
.badge.info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.badge.accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.badge.muted { color: var(--muted); }

/* ---------- buttons & controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn:hover { background: var(--surface-2); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn.danger { background: var(--err); border-color: var(--err); color: #fff; }
.btn.danger.ghost, .btn.ghost { background: transparent; border-color: transparent; }
.btn.danger.ghost { color: var(--err); } .btn.danger.ghost:hover { background: var(--err-soft); }
.btn.sm { padding: 4px 10px; font-size: 13.5px; }
.btn.block { width: 100%; }
.btn.loading { position: relative; color: transparent !important; }
.btn.loading::after { content: ""; position: absolute; width: 14px; height: 14px; border: 2px solid currentColor; border-color: var(--muted) transparent var(--muted) transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn { background: none; border: 0; color: var(--muted); font-size: 17.5px; cursor: pointer; padding: 4px 8px; border-radius: 6px; }
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.seg-group { display: inline-flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; background: var(--surface); }
.seg { font: inherit; font-size: 14px; border: 0; background: none; padding: 6px 12px; cursor: pointer; color: var(--ink-2); }
.seg + .seg { border-left: 1px solid var(--line-2); }
.seg.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line-2); border-radius: 8px; padding: 8px 10px; width: 100%; min-width: 0; }
textarea { resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.toolbar input, .toolbar select { width: auto; }
.toolbar .search { flex: 1; min-width: 220px; max-width: 420px; }
input[type="checkbox"] { width: 18px; height: 18px; padding: 0; flex: none; accent-color: var(--accent); }
.field { display: grid; gap: 5px; min-width: 0; }
.field label { font-weight: 600; font-size: 14px; }
.hint { color: var(--muted); font-size: 13px; }
.check { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.span-2 { grid-column: 1 / -1; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; }
.form-error { color: var(--err); margin: 0; min-height: 1em; font-size: 14px; }
.row-wrap { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row-wrap.right { margin-left: auto; }

/* ---------- feed / detail ---------- */
.feed { list-style: none; margin: 0; padding: 0; display: grid; }
.feed li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.feed li:last-child { border-bottom: 0; }
.detail { display: grid; gap: 20px; }
.detail-head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.detail-head .avatar { width: 56px; height: 56px; font-size: 24px; }
.detail section { display: grid; gap: 8px; } .detail section h3 { margin: 0; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.stat-row div { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: grid; }
.stat-row b { font-size: 21.5px; font-variant-numeric: tabular-nums; } .stat-row span { color: var(--muted); font-size: 13px; }
.invite-history { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.invite-history li { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: grid; gap: 6px; }
.invite-history p { margin: 0; white-space: pre-wrap; color: var(--ink-2); }
.danger-zone { border-top: 1px solid var(--line); padding-top: 14px; }
.steps { margin: 0; padding-left: 20px; display: grid; gap: 10px; } .tips { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
pre.keys { background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 12px; max-height: 320px; overflow: auto; user-select: all; }
pre.about-text { white-space: pre-wrap; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 12px; max-height: 360px; overflow: auto; font-family: inherit; font-size: 15px; margin: 0; }

/* ---------- empty ---------- */
.empty { text-align: center; color: var(--muted); padding: 32px 16px; display: grid; gap: 12px; justify-items: center; }
.empty p { margin: 0; max-width: 460px; }

/* ---------- modal ---------- */
.overlay { position: fixed; inset: 0; background: rgba(15, 8, 20, .45); display: grid; grid-template-columns: minmax(0, 1fr); place-items: start center; padding: 6vh 16px; overflow-y: auto; z-index: 50; animation: fade .15s; }
.modal { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; width: min(520px, 100%); box-shadow: 0 20px 60px rgba(0, 0, 0, .25); animation: pop .18s; }
.modal.wide { width: min(860px, 100%); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 18.5px; }
.modal-body { padding: 18px 20px; }
.modal-body > p { margin: 0; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 20px; border-top: 1px solid var(--line); }
.modal-foot .left { margin-right: auto; }
@keyframes fade { from { opacity: 0; } } @keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }

/* ---------- toast ---------- */
#toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 100; max-width: min(420px, calc(100vw - 32px)); }
.toast { background: var(--ink); color: var(--surface); padding: 10px 14px; border-radius: 10px; box-shadow: var(--shadow); font-size: 14.5px; transition: opacity .3s, transform .3s; border-left: 4px solid var(--ok); }
.toast.err { border-left-color: var(--err); } .toast.warn { border-left-color: var(--warn); }
.toast.out { opacity: 0; transform: translateY(6px); }

/* ---------- login ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: radial-gradient(ellipse at top, var(--accent-soft), transparent 60%), var(--bg); }
.login-card { width: min(380px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 28px; box-shadow: var(--shadow); display: grid; gap: 14px; }
.login-card > p { margin: -8px 0 4px; text-align: center; }

/* ---------- responsive ---------- */
@media (max-width: 1100px) { .grid-main { grid-template-columns: 1fr; } }
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 40; left: 0; top: 0; width: 260px; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  body.nav-open .sidebar { transform: none; }
  .topbar { display: flex; align-items: center; gap: 8px; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; font-weight: 700; }
  .page { padding: 18px 16px 40px; }
  .grid-2, .form-grid { grid-template-columns: 1fr; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .settings-grid { grid-template-columns: 1fr; }
  .toolbar .search { min-width: 0; max-width: none; width: 100%; }
  .tile-value { font-size: 26px; }
}

/* ---------- prompt editor ---------- */
.settings-grid .span-all { grid-column: 1 / -1; }
.prompt-box { display: grid; gap: 10px; }
.prompt-editor { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13.5px; line-height: 1.55; min-height: 160px; }
.vars { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font: inherit; font-size: 13px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--ink-2); border-radius: 14px; padding: 3px 9px; cursor: pointer; }
.chip:hover { border-color: var(--accent); color: var(--ink); }
.chip code { border: 0; background: none; padding: 0; color: var(--accent); }
.preview-out { border: 1px dashed var(--accent); background: var(--accent-soft); border-radius: 10px; padding: 12px 14px; display: grid; gap: 4px; }
.preview-text { white-space: pre-wrap; margin: 4px 0; font-size: 15px; }
.own-prompt { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.own-prompt summary { cursor: pointer; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.own-prompt[open] summary { margin-bottom: 8px; }
.row-wrap select { width: auto; min-width: 160px; }

/* ---------- first steps + access message ---------- */
.onboarding { border-color: var(--accent); display: grid; gap: 8px; }
.onb-head { display: flex; justify-content: space-between; align-items: center; }
.onb-head h3 { margin: 0; }
.onb-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.onb-list li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; }
.onb-list li.next { background: var(--accent-soft); }
.onb-list li.done { opacity: .55; }
.onb-list li.done b { text-decoration: line-through; font-weight: 500; }
.onb-mark { width: 24px; height: 24px; flex: none; border-radius: 50%; border: 2px solid var(--line-2); display: grid; place-items: center; font-weight: 700; font-size: 14px; color: var(--accent); }
.onb-list li.done .onb-mark { border-color: var(--ok); color: var(--ok); }
.onb-list li.next .onb-mark { border-color: var(--accent); }
.onb-text { flex: 1; min-width: 0; }
.stack { display: grid; gap: 12px; } .stack p { margin: 0; }
.access-text { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 14px; background: var(--surface-2); }

.alert { border-radius: 10px; padding: 12px 16px; display: grid; gap: 4px; border: 1px solid; }
.alert.err { background: var(--err-soft); border-color: var(--err); color: var(--ink); }
.alert.err b { color: var(--err); }

/* ---------- scenario editor, taught buttons ---------- */
.callout { background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); border-radius: var(--radius); padding: 12px 14px; margin: 0 0 16px; color: var(--ink-2); }
.callout b { color: var(--ink); }
.scenario h3 { margin: 18px 0 10px; font-size: 16px; }
.scenario h3:first-of-type { margin-top: 4px; }
.scenario { min-width: 0; }
.steps { display: grid; gap: 10px; justify-items: start; grid-template-columns: minmax(0, 1fr); }
.step-card { grid-template-columns: minmax(0, 1fr); min-width: 0; width: 100%; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 10px; padding: 10px 12px; background: var(--surface-2); display: grid; gap: 8px; }
.step-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.step-head .spacer { flex: 1; }
.action-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.action-row select { width: auto; flex: 1 1 160px; min-width: 0; max-width: 100%; }
.action-row .icon-btn { flex: none; }
.step-card > .btn, .steps > .btn { justify-self: start; }
.step-wait input, .inline input { width: 72px; flex: none; }
.step-card textarea { width: 100%; margin-top: 6px; }
.inline { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; color: var(--ink-2); }
.step-end { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.scenario input, .scenario select, .taught-row input, .taught-row select { font: inherit; padding: 6px 8px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface); color: var(--ink); }
.taught-list { display: grid; gap: 6px; }
.taught-row { display: grid; grid-template-columns: minmax(90px, 1fr) minmax(120px, 2fr) auto auto; gap: 6px; align-items: center; }
.taught-row:not(:has(select)) { grid-template-columns: minmax(90px, 1fr) minmax(120px, 2fr) auto; }
.funnel { display: flex; gap: 14px; flex-wrap: wrap; font-size: 14px; color: var(--ink-2); }
.followup-box { display: grid; gap: 6px; margin-top: 10px; }
.variants { display: grid; gap: 10px; margin: 8px 0; }
.variant { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: grid; gap: 6px; }
.variant.best { border-color: var(--ok, #2f9e44); box-shadow: 0 0 0 1px var(--ok, #2f9e44) inset; }
@media (max-width: 640px) {
  .taught-row, .taught-row:not(:has(select)) { grid-template-columns: 1fr auto; }
  .taught-row .mono, .taught-row select { grid-column: 1 / 2; }
}
.tpl-bar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; background: var(--surface-2); border: 1px dashed var(--line-2); border-radius: 10px; padding: 8px 10px; margin-top: 10px; }
.tpl-bar select { width: auto; flex: 1 1 220px; min-width: 0; }
.templates { margin-top: 18px; display: grid; gap: 8px; }
.templates h3 { margin: 0; }
.right-push { margin-left: auto; }
.tpl-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.tpl-list li { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--surface-2); }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin: 8px 0; }
.media-card { display: flex; gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 8px; background: var(--surface-2); min-width: 0; }
.media-thumb { width: 64px; height: 64px; flex: none; border-radius: 8px; background: var(--surface); display: grid; place-items: center; font-size: 28px; overflow: hidden; }
.media-thumb img { width: 100%; height: 100%; object-fit: cover; }
.media-info { display: grid; gap: 4px; min-width: 0; align-content: start; }
.media-info .check { gap: 4px; font-size: 13px; }
.media-info .btn { justify-self: start; }

.memory-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; }
.memory-list li { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: flex; gap: 12px; justify-content: space-between; align-items: center; }
.memory-list li.off { opacity: .55; }

/* setup wizard */
.setup .progress { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; margin: 4px 0 16px; }
.setup .progress i { display: block; height: 100%; background: var(--ok); transition: width .4s; }
.setup-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.setup-steps > li { border: 1px solid var(--line); border-radius: 12px; background: var(--card, transparent); }
.setup-steps > li.open { border-color: var(--accent, #d6336c); box-shadow: 0 0 0 1px var(--accent, #d6336c) inset; }
.setup-head { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; font-size: 1.05rem; }
.setup-head:focus-visible { outline: 2px solid var(--accent, #d6336c); border-radius: 12px; }
.setup-num { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--line); font-weight: 700; flex: none; }
.setup-steps > li.done .setup-num { background: var(--ok); color: #fff; }
.setup-steps > li.done .setup-head b { opacity: .7; }
.setup-body { padding: 0 16px 16px 58px; display: grid; gap: 12px; }
.setup-body .steps li { line-height: 1.5; }
.setup .waiting { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; } }
.setup-done { border-color: var(--ok); margin-bottom: 12px; }
@media (max-width: 640px) { .setup-body { padding-left: 16px; } }

.tier-list { display: grid; gap: 8px; margin: 8px 0; }
.tier-row { display: flex; gap: 8px; align-items: center; }
.tier-row input { width: 110px; }

/* ---------- registration, team, control panel ---------- */
.center { text-align: center; }
.nav-badge { margin-left: auto; background: var(--accent); color: #fff; border-radius: 20px; font-size: 12px; font-weight: 700; padding: 1px 8px; }
.nav-bot { margin-bottom: 4px; }
.join-done { text-align: center; display: grid; gap: 10px; }
.join-done .big-emoji { font-size: 43px; }
.link-box { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.link-box input { flex: 1 1 260px; font: inherit; font-size: 14px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); color: var(--ink); }
.pending-list { display: grid; gap: 8px; }
.pending-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.pending-row .who { flex: 1 1 200px; }
.pending-row .who small { display: block; color: var(--muted); }
.attention { display: grid; gap: 8px; }
.attention a { display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-radius: 10px; background: var(--warn-soft); color: var(--ink); text-decoration: none; }
.attention a:hover { filter: brightness(0.97); }
.tabs-row { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 14px; }
.tabs-row button { border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); border-radius: 20px; padding: 6px 14px; font: inherit; cursor: pointer; }
.tabs-row button.on { background: var(--accent-soft); color: var(--accent); border-color: transparent; font-weight: 600; }
.caps-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.people-table td { vertical-align: middle; }
.rank-row { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.rank-row:last-child { border-bottom: 0; }
.rank-num { font-weight: 700; color: var(--muted); text-align: center; }
.best-invite { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); display: grid; gap: 6px; }
.best-invite p { margin: 0; white-space: pre-wrap; }
.example-row { display: flex; gap: 8px; align-items: flex-start; }
.example-row textarea { flex: 1; min-height: 60px; }
.alert.info { background: var(--info-soft); border-color: var(--info); color: var(--ink); }
.alert.warn { background: var(--warn-soft); border-color: var(--warn); color: var(--ink); }
.link-alert { display: block; text-decoration: none; }
.link-alert:hover { filter: brightness(0.97); }
details.fold > summary { cursor: pointer; list-style: none; padding: 2px 0; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::before { content: '▸ '; color: var(--muted); }
details.fold[open] > summary::before { content: '▾ '; }
details.fold[open] > summary { margin-bottom: 10px; }
tr.clickable { cursor: pointer; } tr.clickable:hover td { background: var(--surface-2); }
.block-seg { display: flex; width: 100%; } .block-seg .seg { flex: 1; padding: 10px 8px; font-size: 15px; }

/* ---- simple panel: home, AI, settings ---- */
.filters { margin: -4px 0 14px; }
.page > .tiles, .page > .card { margin-bottom: 18px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.choice-list { display: grid; gap: 8px; }
.choice { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; background: var(--surface-2); }
.choice.on { border-color: var(--accent); background: var(--accent-soft); }
.choice input { accent-color: var(--accent); width: auto; flex: none; margin: 0; }
.choice > span { flex: 1; text-align: left; }
.bars { display: grid; gap: 6px; }
.bar-row { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 13.5px; }
.bar { height: 10px; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--accent); border-radius: 5px; }
.bar-day, .bar-num { color: var(--muted); font-variant-numeric: tabular-nums; }
.start-steps .steps li { line-height: 2; }
.photo-row { display: grid; gap: 8px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.photo-row:last-child { border-bottom: 0; }
.photo-strip { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.photo { position: relative; width: 64px; height: 64px; border-radius: 8px; overflow: hidden; background: var(--surface-2); display: grid; place-items: center; font-size: 26px; border: 1px solid var(--line); }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo-x { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: 12px; cursor: pointer; line-height: 20px; padding: 0; }
.photo-ok { position: absolute; bottom: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: rgba(0,0,0,.6); color: #7fc8a0; font-weight: 700; font-size: 12px; line-height: 18px; text-align: center; }
/* ⚙ Налаштування: sections with a title, cards that say whose they are, the settings under a tick */
.settings-section { margin: 0 0 30px; scroll-margin-top: 16px; }
.section-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 0 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.section-head h2 { font-size: 26px; }
.section-head p { margin: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.scope { font-size: 12px; line-height: 1; padding: 5px 9px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--muted); white-space: nowrap; }
.sub { display: grid; gap: 12px; padding: 2px 0 2px 14px; border-left: 2px solid var(--accent-soft); }
.sub[hidden] { display: none; }
.sub h4 { font-family: var(--font-ui); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 6px 0 -4px; }
.sub > p.small { margin-top: -6px; }
.jump { display: flex; gap: 8px; flex-wrap: wrap; margin: -4px 0 22px; }
.jump a { font-size: 14px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-2); text-decoration: none; background: var(--surface); }
.jump a:hover { border-color: var(--accent); color: var(--ink); }
.settings-foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding-top: 4px; }
.settings-foot p { margin: 0; }
.section-cards { display: grid; gap: 18px; min-width: 0; }
.settings-grid .card p { margin: 0; } /* (the card's grid gap spaces its lines) */
.settings-grid textarea { width: 100%; font: 14px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; resize: vertical; }
@media (max-width: 560px) { .pair { grid-template-columns: minmax(0, 1fr); } .settings-grid { grid-template-columns: minmax(0, 1fr); } }

/* notices on top of a page: the shift, what the team lead decided */
.notice { border: 1px solid var(--line); background: var(--surface-2); border-radius: var(--radius); padding: 10px 14px; margin-bottom: 12px; font-size: 14.5px; }
.notice.warn { background: var(--warn-soft); border-color: transparent; color: var(--ink); }
.notice.err { background: var(--err-soft); border-color: transparent; color: var(--ink); }
.notice.info { background: var(--info-soft); border-color: transparent; color: var(--ink); }
.notice.stack { display: grid; gap: 6px; margin-bottom: 0; }
.notice.stack p, .notice.stack ul { margin: 0; }
/* 🧪 a trial: the new side vs. the live side */
.trial-arms { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.trial-arms > div { background: var(--surface-2); border-radius: var(--radius); padding: 8px 12px; display: grid; gap: 2px; }
.trial-arms b { font-size: 19.5px; }
@media (max-width: 560px) { .trial-arms { grid-template-columns: minmax(0, 1fr); } }
/* UA | RU on the login / registration card */
.lang-switch { display: inline-flex; gap: 0; flex: none; }
.lang-switch .seg { padding: 4px 10px; font-size: 13.5px; }
.login-card .row-between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.center.big-emoji { text-align: center; }
.turbo-on { border-color: var(--warn); box-shadow: 0 0 0 2px var(--warn-soft); }

/* 🛠 technical works */
.main-col { min-width: 0; display: flex; flex-direction: column; }
.works-banner { margin: 16px 32px 0; padding: 10px 14px; border-radius: var(--radius); background: var(--warn-soft); color: var(--ink); font-size: 14.5px; }
.works-banner a { font-weight: 600; color: var(--accent); }
.works-card { text-align: center; }
.works-card h2 { margin: 0; }
.works-card > p { margin: 0; }
.works-icon { font-size: 47.5px; line-height: 1; }
@media (max-width: 860px) { .works-banner { margin: 12px 16px 0; } }
.lessons { margin: 0; padding-left: 20px; display: grid; gap: 6px; font-size: 15px; }

/* ======================= Sugar Night — the «Північ» look (graphite + champagne gold) ======================= */
::selection { background: var(--accent-soft); color: var(--ink); }
h1 { font-family: var(--font-display); font-weight: 500; font-size: 39px; letter-spacing: -.005em; line-height: 1.1; }
h2 { font-family: var(--font-display); font-weight: 500; }
h3 { font-family: var(--font-display); font-weight: 600; font-size: 22.5px; letter-spacing: .005em; }
.modal-head h2 { font-size: 26px; }
h4 { letter-spacing: .14em; font-size: 12.5px; }

/* the brand: the star and the wordmark */
.brand { gap: 12px; padding: 2px 10px 10px; font-weight: 500; }
.brand img { width: 30px; height: 30px; background: var(--star-tile); border-radius: 9px; padding: 2px; }
.brand span, .wordmark { font-family: var(--font-ui); font-weight: 500; font-size: 14px; letter-spacing: .32em; text-transform: uppercase;
  background: var(--gold-text); -webkit-background-clip: text; background-clip: text; color: transparent; white-space: nowrap; }
.brand.big { gap: 16px; padding: 0; }
.brand.big img { width: 46px; height: 46px; border-radius: 12px; padding: 3px; }
.brand.big span { font-size: 18.5px; letter-spacing: .36em; }

/* the side menu */
.sidebar { background: var(--sidebar); padding: 26px 16px 18px; gap: 6px; }
.agency-name { padding: 0 10px 16px; margin-bottom: 10px; letter-spacing: .02em; }
.nav-list { gap: 4px; }
.nav-item { min-height: 44px; padding: 0 12px; border-radius: 10px; font-size: 15px; }
.nav-item:hover { background: var(--surface-2); }
.nav-item.active { background: var(--surface-2); color: var(--ink); font-weight: 600; box-shadow: inset 0 0 0 1px var(--line); }
.nav-item.active .nav-icon { color: var(--accent); }
.nav-icon { stroke-width: 1.6; }
.nav-badge { color: var(--accent-ink); }
.nav-foot { padding-top: 14px; gap: 4px; }
.me b { font-weight: 600; }

/* the page */
.page { padding: 40px 48px 56px; gap: 24px; }
.page-head { margin-bottom: 4px; }
.count { font-family: var(--font-ui); font-size: 13px; border-radius: 999px; padding: 2px 10px; }

/* surfaces */
.card { border-radius: 18px; padding: 22px 24px; }
.card > .table-wrap { margin: 0 -24px -22px; }
.tile { border-radius: 18px; padding: 20px 22px; gap: 6px; border-top: 1px solid var(--line); position: relative; overflow: hidden; }
.tile::before { content: ""; position: absolute; left: 22px; right: 22px; top: 0; height: 2px; background: var(--line-2); border-radius: 0 0 2px 2px; }
.tile.good::before { background: var(--ok); } .tile.warn::before { background: var(--warn); }
.tile-label { font-size: 12.5px; letter-spacing: .14em; text-transform: uppercase; }
.tile-value { font-family: var(--font-display); font-weight: 500; font-size: 47.5px; line-height: 1; letter-spacing: 0; }
.stat-row div { border-radius: 14px; padding: 12px 14px; }
.stat-row b { font-family: var(--font-display); font-weight: 500; font-size: 32.5px; line-height: 1.05; }
.chart figcaption b { font-family: var(--font-display); font-weight: 500; font-size: 26px; }
.table th { background: transparent; letter-spacing: .12em; font-size: 12px; padding: 12px 16px; }
.table td { padding: 12px 16px; }
.table.hover tbody tr:hover { background: var(--surface-2); }
.notice { border-radius: 14px; padding: 12px 16px; }

/* buttons and fields */
.btn { min-height: 40px; padding: 8px 18px; border-radius: 999px; background: transparent; border-color: var(--line-2); letter-spacing: .01em; }
.btn:hover { background: var(--surface-2); border-color: var(--line-2); }
.btn.primary { background: var(--btn-primary); border-color: transparent; color: var(--accent-ink); font-weight: 700; }
.btn.primary:hover { background: var(--btn-primary); filter: brightness(1.06); }
.btn.danger { border-radius: 999px; }
.btn.sm { min-height: 32px; padding: 4px 12px; }
.btn.block { min-height: 46px; }
.seg-group { border-radius: 999px; }
input, select, textarea { background: var(--surface-2); border-color: var(--line-2); border-radius: 10px; padding: 9px 12px; }
input[type="checkbox"] { border-radius: 4px; }
.field label { font-size: 13.5px; letter-spacing: .02em; color: var(--ink-2); }

/* modal and toasts */
.overlay { background: rgba(5, 6, 8, .62); backdrop-filter: blur(2px); }
.modal { border-radius: 20px; box-shadow: 0 30px 80px rgba(0, 0, 0, .45); }
.toast { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line-2); border-left: 4px solid var(--ok); }

/* sign in, registration, technical works */
.login-wrap { background: radial-gradient(ellipse 70% 55% at 50% 0%, rgba(212, 176, 114, .10), transparent 70%), var(--bg); }
.login-card { width: min(400px, 100%); border-radius: 22px; padding: 34px 32px; gap: 16px; }
.login-card > p { color: var(--muted); }

@media (max-width: 860px) {
  .page { padding: 22px 16px 40px; }
  .tile-value { font-size: 39px; }
  h1 { font-size: 32.5px; }
}
.login-lang { display: flex; justify-content: flex-end; margin: -10px -6px -4px 0; }
.login-card .brand.big { justify-content: center; margin: 4px 0 2px; }
.login-card > .muted, .login-card > p.muted { text-align: center; }
/* lining figures in the display font (its default «0» looks like «o») */
h1, h2, h3, .tile-value, .stat-row b, .chart figcaption b { font-variant-numeric: lining-nums proportional-nums; font-feature-settings: "lnum" 1; }
.tile-value, .stat-row b { font-variant-numeric: lining-nums tabular-nums; font-feature-settings: "lnum" 1, "tnum" 1; }

/* ---------- 🌙 the monthly recap ---------- */
.recap-teaser { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  background: radial-gradient(120% 140% at 100% 0%, rgba(212, 176, 114, .14), transparent 60%), var(--surface); border-color: rgba(212, 176, 114, .35); }
.recap-teaser-text { display: grid; gap: 4px; }
.recap-teaser-text p { margin: 0; }
.recap { display: grid; gap: 18px; }
.recap-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line-2); color: var(--muted); }
.chip.ok { color: var(--ok, #7fc8a0); border-color: rgba(127, 200, 160, .45); }
.chip.warn { color: var(--warn, #e2b65b); border-color: rgba(226, 182, 91, .45); }
.recap-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.recap-big { display: grid; gap: 2px; padding: 16px 18px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface-2, var(--surface)); }
.recap-icon { font-size: 19.5px; }
.recap-num { font-family: var(--font-display); font-weight: 500; font-size: 43px; line-height: 1.05; font-variant-numeric: lining-nums;
  background: var(--gold-text, linear-gradient(135deg, #f5e7c8, #d4b072 55%, #a8843f)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.recap-name { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.recap-sub { font-size: 13px; color: var(--ink-2, var(--muted)); }
.recap-trends { align-items: center; gap: 8px; }
.recap-crown { display: flex; align-items: center; gap: 18px; padding: 18px 22px; border-radius: 20px; border: 1px solid rgba(212, 176, 114, .45);
  background: radial-gradient(100% 120% at 0% 0%, rgba(212, 176, 114, .2), transparent 65%), var(--surface); }
.recap-crown-icon { font-size: 47.5px; filter: drop-shadow(0 6px 16px rgba(212, 176, 114, .45)); }
.recap-hero { font-family: var(--font-display); font-size: 36.5px; line-height: 1.1; }
.recap-label { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.recap-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.recap-fact { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--line); }
.recap-fact-icon { font-size: 24px; }
.recap-fact-value { font-weight: 700; font-size: 17.5px; }
.recap-me { padding: 14px 16px; border-radius: 16px; border: 1px dashed rgba(212, 176, 114, .55); display: grid; gap: 4px; }
.recap-empty { padding: 24px; text-align: center; }
.recap tr.you td { background: rgba(212, 176, 114, .08); }
.choice .price { color: var(--gold, #d4b072); }

/* a table that is not the last thing in its card keeps its distance from what follows (no overlap) */
.card > .table-wrap:not(:last-child) { margin-bottom: 12px; }
.prompt-preview { white-space: pre-wrap; max-height: 260px; overflow: auto; background: var(--surface-2); border-radius: var(--radius); padding: 10px 12px; margin: 6px 0 0; font: 13.5px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }
/* 🎯/💬 the model of «Шанс» and of «Аллчат» on the same buttons: a little switch inside each, the golden mark flies between them */
.choice.model { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; transition: border-color .25s, background .25s, box-shadow .35s; }
.choice.model:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mode-switch { display: inline-flex; gap: 3px; padding: 3px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.mode-seg { border: 0; background: transparent; color: var(--muted); font: inherit; font-size: 13.5px; line-height: 1; padding: 7px 11px; border-radius: 999px; cursor: pointer; white-space: nowrap; transition: color .2s, background .25s, box-shadow .25s; }
.mode-seg:hover { color: var(--ink); background: var(--accent-soft); }
.mode-seg.on { background: linear-gradient(135deg, var(--accent-hover), var(--accent)); color: var(--accent-ink); box-shadow: 0 2px 10px rgba(212, 176, 114, .35); }
.mode-seg.landing { background: transparent; color: transparent; box-shadow: none; }
.mode-seg.pop { animation: seg-pop .42s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes seg-pop { 0% { transform: scale(.8); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }
.choice.model.glow { animation: card-glow .7s ease-out; }
@keyframes card-glow { 0% { box-shadow: 0 0 0 0 rgba(212, 176, 114, .55); } 100% { box-shadow: 0 0 0 12px rgba(212, 176, 114, 0); } }
.mode-ghost { position: fixed; z-index: 1000; pointer-events: none; display: grid; place-items: center; border-radius: 999px; font-size: 13.5px; line-height: 1; white-space: nowrap;
  background: linear-gradient(135deg, var(--accent-hover), var(--accent)); color: var(--accent-ink); box-shadow: 0 8px 26px rgba(212, 176, 114, .5); will-change: transform; }
.mode-spark { position: fixed; z-index: 999; pointer-events: none; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: var(--accent-hover); box-shadow: 0 0 8px var(--accent); }
@media (max-width: 560px) { .choice.model { grid-template-columns: minmax(0, 1fr); } .mode-switch { justify-self: start; } }
@media (prefers-reduced-motion: reduce) { .mode-seg.pop, .choice.model.glow { animation: none; } }
