/* Komento — dashboard v7, graphite + petrol.
   Same world as the dark homepage (public/home.css): near-black canvas, layered graphite surfaces,
   hairline borders instead of shadows, one petrol accent (#0C7F8E fill with white text, #3FB6C4 as text),
   Geist + IBM Plex Sans Hebrew. Precise, restrained: small radii, tight rhythm, big crisp numerals.
   Dark is the default; light mirrors the structure. Landing/privacy also load this file for tokens,
   .btn and .brand — keep those names. */

/* ---------- type ---------- */
@font-face {
  font-family: "Geist";
  src: url("/fonts/Geist-Variable.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2190-2199, U+2212, U+FEFF;
}
@font-face {
  font-family: "Geist Mono";
  src: url("/fonts/GeistMono-Variable.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}
:root {
  --font-hebrew: "IBM Plex Sans Hebrew";
  --font-sans: "Geist", var(--font-hebrew), system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: var(--font-sans);
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* radius: soft cards 24 · inner cards 16 · inputs 12 · controls, search, segmented nav, icon buttons = pill/round */
  --r-panel: 24px;
  --r-l: 16px;
  --r-m: 12px;
  --r-s: 8px;
  --r-xs: 6px;
  --r-pill: 999px;

  /* type scale — one role each:
     12 counters/badges · 13 meta, tags, timestamps · 14 UI text, hints, buttons, labels
     16 primary content, row titles, inputs · 20 section/step titles, stat numbers · 28 page titles, KPI numbers */
  --fs-xs: 12px;
  --fs-s: 13px;
  --fs-m: 14px;
  --fs-l: 16px;
  --fs-xl: 20px;
  --fs-2xl: 28px;

  /* spacing 4/8/12/16/24/32 · controls: 36 small, 40 default & inputs, 44 large/touch */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px; --sp-6: 32px;
  --ctl-s: 36px;
  --ctl-m: 40px;
  --ctl-l: 44px;

  --ease-out: cubic-bezier(.23, 1, .32, 1);
  --ease-drawer: cubic-bezier(.32, .72, 0, 1);
  --t-fast: 140ms;
  --t-med: 200ms;

  --side-w: 84px;
  --gutter: 32px;
  --content-max: 1240px;
}

/* ---------- tokens: dark (default) ---------- */
:root {
  --bg: #0a0a0b;
  --canvas: #0a0a0b;
  --surface: #161618;
  --surface-2: #1d1d20;
  --surface-3: #26262a;
  --surface-4: #313135;
  --panel-line: rgb(255 255 255 / .05);
  --tint-sage: rgb(150 190 165 / .11);
  --tint-mist: rgb(130 185 195 / .11);
  --tint-sand: rgb(215 185 140 / .11);
  --tint-petrol: rgb(63 182 196 / .14);
  --bar-tint: rgb(63 182 196 / .22);
  --on-tint-btn: #26262a;
  --line: rgb(255 255 255 / .06);
  --line-2: rgb(255 255 255 / .1);
  --line-3: rgb(255 255 255 / .18);
  --text: #f2f2f1;
  --text-2: #bfbfc0;
  --muted: #8e8e91;
  --accent: #3fb6c4;
  --accent-fill: #0c7f8e;
  --accent-hover: #0a6f7c;
  --accent-ink: #ffffff;
  --accent-wash: rgb(63 182 196 / .1);
  --accent-line: rgb(63 182 196 / .32);
  --bad: #ff6b6b; --bad-wash: rgb(255 107 107 / .1);
  --hold: #f2b84b; --hold-wash: rgb(242 184 75 / .1);
  --bar: var(--bar-tint);
  --bar-hover: rgb(63 182 196 / .34);
  --bubble-them: #232325;
  --phone-bg: #0a0a0b;
  --phone-frame: #1a1a1c;
  --tip-bg: #f2f2f1;
  --tip-ink: #0a0a0b;
  --av-text-mix: 62%;
  --av-text-base: #ffffff;
  --av-bg-mix: 16%;
  --av-bg-base: #1a1a1c;
  --shadow-pop: 0 1px 0 rgb(255 255 255 / .04) inset, 0 24px 64px -16px rgb(0 0 0 / .8);
  --scrim: rgb(0 0 0 / .66);
  --glass: rgb(10 10 11 / .78);
  color-scheme: dark;
}
/* ---------- tokens: light ---------- */
:root[data-theme="light"] {
  --bg: #f3f2ef;
  --canvas: #f3f2ef;
  --surface: #ffffff;
  --surface-2: #f6f5f2;
  --surface-3: #ecebe7;
  --surface-4: #dfded9;
  --panel-line: transparent;
  --tint-sage: #e6eee9;
  --tint-mist: #e3eef0;
  --tint-sand: #f1e9dd;
  --tint-petrol: #dceff1;
  --bar-tint: #cfe6e9;
  --on-tint-btn: #ffffff;
  --line: rgb(10 10 11 / .07);
  --line-2: rgb(10 10 11 / .11);
  --line-3: rgb(10 10 11 / .22);
  --text: #0f0f10;
  --text-2: #3d3d40;
  --muted: #67676b;
  --accent: #0a6c79;
  --accent-fill: #0c7f8e;
  --accent-hover: #0a6f7c;
  --accent-ink: #ffffff;
  --accent-wash: rgb(12 127 142 / .08);
  --accent-line: rgb(12 127 142 / .35);
  --bad: #c0262d; --bad-wash: rgb(192 38 45 / .07);
  --hold: #8a5a00; --hold-wash: rgb(170 112 0 / .1);
  --bar: var(--bar-tint);
  --bar-hover: #b9dce0;
  --bubble-them: #efefee;
  --phone-bg: #ffffff;
  --phone-frame: #e4e4e3;
  --tip-bg: #0f0f10;
  --tip-ink: #ffffff;
  --av-text-mix: 78%;
  --av-text-base: #000000;
  --av-bg-mix: 11%;
  --av-bg-base: #ffffff;
  --shadow-pop: 0 24px 64px -20px rgb(10 10 11 / .25);
  --scrim: rgb(10 10 11 / .4);
  --glass: rgb(255 255 255 / .82);
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root[data-theme="system"] {
    --bg: #f3f2ef; --canvas: #f3f2ef; --surface: #ffffff; --surface-2: #f6f5f2; --surface-3: #ecebe7; --surface-4: #dfded9;
    --panel-line: transparent; --tint-sage: #e6eee9; --tint-mist: #e3eef0; --tint-sand: #f1e9dd; --tint-petrol: #dceff1; --bar-tint: #cfe6e9; --on-tint-btn: #ffffff;
    --line: rgb(10 10 11 / .07); --line-2: rgb(10 10 11 / .11); --line-3: rgb(10 10 11 / .22);
    --text: #0f0f10; --text-2: #3d3d40; --muted: #67676b;
    --accent: #0a6c79; --accent-fill: #0c7f8e; --accent-hover: #0a6f7c; --accent-ink: #ffffff; --accent-wash: rgb(12 127 142 / .08); --accent-line: rgb(12 127 142 / .35);
    --bad: #c0262d; --bad-wash: rgb(192 38 45 / .07); --hold: #8a5a00; --hold-wash: rgb(170 112 0 / .1);
    --bar: var(--bar-tint); --bar-hover: #b9dce0; --bubble-them: #efefee; --phone-bg: #ffffff; --phone-frame: #e4e4e3;
    --tip-bg: #0f0f10; --tip-ink: #ffffff;
    --av-text-mix: 78%; --av-text-base: #000000; --av-bg-mix: 11%; --av-bg-base: #ffffff;
    --shadow-pop: 0 24px 64px -20px rgb(10 10 11 / .25);
    --scrim: rgb(10 10 11 / .4); --glass: rgb(255 255 255 / .82);
    color-scheme: light;
  }
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  background: var(--bg); color: var(--text);
  font: 400 16px/1.55 var(--font-sans);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden; min-height: 100dvh;
}
.theme-anim, .theme-anim * { transition: background-color var(--t-med) var(--ease-out), color var(--t-med) var(--ease-out), border-color var(--t-med) var(--ease-out) !important; }
::selection { background: var(--accent-fill); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
a { color: inherit; text-underline-offset: 3px; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.015em; text-wrap: balance; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
.num, .tnum { font-variant-numeric: tabular-nums; }
.ltr { direction: ltr; unicode-bidi: isolate; }
.mono { font-family: var(--font-mono); font-size: .9em; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; inset-inline-start: 12px; top: -60px; z-index: 100; background: var(--text); color: var(--bg); padding: 10px 14px; border-radius: var(--r-m); text-decoration: none; }
.skip:focus { top: 12px; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: var(--fs-m); line-height: 1.5; }
.ambient { display: none; }
* { scrollbar-width: thin; scrollbar-color: var(--surface-4) transparent; }

/* ---------- brand ---------- */
.brand { display: flex; align-items: center; gap: 10px; white-space: nowrap; text-decoration: none; color: var(--text); }
.brand b { font-size: var(--fs-l); font-weight: 650; letter-spacing: -.02em; }
.brand small { font-size: var(--fs-m); color: var(--muted); font-weight: 450; }
/* the homepage mark: a petrol ring with a petrol core */
.brand-dot { width: 16px; height: 16px; border-radius: 50%; background: var(--accent-fill); box-shadow: inset 0 0 0 4px var(--accent-fill), inset 0 0 0 7px var(--bg); flex: none; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--ctl-m); padding: 0 18px; border-radius: var(--r-pill);
  border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text);
  font-size: var(--fs-m); font-weight: 560; text-decoration: none; cursor: pointer; white-space: nowrap; letter-spacing: -.005em;
  transition: background-color var(--t-fast) var(--ease-out), border-color var(--t-fast) var(--ease-out), transform var(--t-fast) var(--ease-out), opacity var(--t-fast);
}
.btn svg { width: 16px; height: 16px; flex: none; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.primary, .btn.signal { background: var(--accent-fill); color: var(--accent-ink); border-color: transparent; font-weight: 600; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.danger { color: var(--bad); }
.btn.small { min-height: var(--ctl-s); padding: 0 12px; font-size: var(--fs-m); }
.btn.large { min-height: var(--ctl-l); padding: 0 20px; font-size: var(--fs-l); font-weight: 600; }
.btn.quiet { background: transparent; border-color: var(--line-2); color: var(--text-2); }
.btn.block { width: 100%; }
.btn.icon { width: var(--ctl-m); padding: 0; }
.btn.busy { position: relative; color: transparent !important; pointer-events: none; }
.btn.busy::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--text); border-inline-end-color: transparent; animation: spin .7s linear infinite; }
.btn.primary.busy::after { border-color: #fff; border-inline-end-color: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (hover: hover) and (pointer: fine) {
  .btn:hover { background: var(--surface-3); border-color: var(--line-3); }
  .btn.primary:hover, .btn.signal:hover { background: var(--accent-hover); border-color: transparent; }
  .btn.ghost:hover { background: var(--surface-3); border-color: transparent; }
}
.linkish { background: none; border: 0; padding: 8px 0; min-height: 32px; color: var(--accent); cursor: pointer; font-size: var(--fs-m); font-weight: 500; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--accent-line); }
.more { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: var(--fs-m); font-weight: 500; text-decoration: none; white-space: nowrap; transition: color var(--t-fast); }
.more svg { width: 15px; height: 15px; }
.more:hover { color: var(--text); }
.icon-btn { width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 50%; border: 0; background: transparent; color: var(--muted); cursor: pointer; flex: none; }
.icon-btn:hover { background: var(--surface-3); color: var(--text); }
.icon-btn svg { width: 16px; height: 16px; }

/* ---------- app shell ---------- */
.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100dvh; }
.side {
  position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; align-items: center;
  padding: 22px 0 18px; gap: 6px; border-inline-end: 1px solid var(--panel-line); background: var(--bg);
}
.side .mark { display: grid; place-items: center; width: 44px; height: 44px; margin-bottom: 18px; text-decoration: none; border-radius: var(--r-m); }
.side .mark .brand-dot { width: 20px; height: 20px; box-shadow: inset 0 0 0 5px var(--accent-fill), inset 0 0 0 9px var(--bg); }
.nav { display: flex; flex-direction: column; gap: 2px; align-items: center; }
.nav a {
  display: flex; flex-direction: column; align-items: center; gap: 5px; width: 72px; padding: 9px 0 8px;
  border-radius: var(--r-m); color: var(--muted); text-decoration: none; font-size: var(--fs-m); font-weight: 500; line-height: 1.2;
  transition: background-color var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out);
}
.nav a .ic {
  display: grid; place-items: center; width: 52px; height: 32px; border-radius: var(--r-pill);
  transition: background-color var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out), transform var(--t-fast) var(--ease-out);
}
.nav a svg { width: 22px; height: 22px; }
.nav a:hover { color: var(--text); }
.nav a:hover .ic { background: var(--nav-hover); --ic-du: var(--nav-du-soft); }
.nav a:active .ic { transform: scale(.96); }
.nav a:focus-visible { outline: none; }
.nav a:focus-visible .ic { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent-line); }
.nav a[aria-current="page"] { color: var(--text); font-weight: 600; }
.nav a[aria-current="page"] .ic { background: var(--nav-pill); color: var(--nav-ink); --ic-du: var(--nav-du); --ic-so: currentColor; }

/* nav + header icon set (app.js N()): duotone body + solid accent, both transparent until a state sets them */
:root {
  --nav-pill: var(--tint-petrol);
  --nav-ink: var(--accent);
  --nav-du: color-mix(in srgb, var(--accent) 26%, transparent);
  --nav-du-soft: color-mix(in srgb, var(--text) 7%, transparent);
  --nav-hover: color-mix(in srgb, var(--text) 7%, transparent);
}
.ni .du { fill: var(--ic-du, transparent); stroke: none; transition: fill var(--t-fast) var(--ease-out); }
.ni .so { fill: var(--ic-so, transparent); transition: fill var(--t-fast) var(--ease-out); }
.side-end { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.theme-btn { width: var(--ctl-m); height: var(--ctl-m); border-radius: 50%; border: 1px solid var(--line-2); background: var(--surface); color: var(--text-2); display: grid; place-items: center; cursor: pointer; transition: background-color var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out), transform var(--t-fast) var(--ease-out); }
.theme-btn svg { width: 20px; height: 20px; }
.theme-btn:hover { background: var(--surface-3); color: var(--text); --ic-du: var(--nav-du-soft); }
.theme-btn:active { transform: scale(.96); }
/* side-nav toggle: looks like a nav item, labelled, under a hairline */
.side-end { width: 100%; padding-top: 12px; border-top: 1px solid var(--line); }
.theme-btn.labeled { width: 72px; height: auto; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 0; border: 0; background: transparent; color: var(--muted); font-size: var(--fs-s); font-weight: 500; line-height: 1.2; }
.theme-btn.labeled .ic { display: grid; place-items: center; }
.theme-btn.labeled svg { width: 22px; height: 22px; }
.theme-btn.labeled:active { transform: none; }
.theme-btn.labeled .ic { width: 52px; height: 32px; border-radius: var(--r-pill); transition: background-color var(--t-fast) var(--ease-out), transform var(--t-fast) var(--ease-out); }
.theme-btn.labeled:hover .ic { background: var(--nav-hover); }
.theme-btn.labeled:active .ic { transform: scale(.96); }
.theme-btn.labeled:hover { background: transparent; color: var(--text); }

/* top bar: account · live status … trial · bell */
.topbar { display: flex; align-items: center; gap: 8px; min-height: var(--ctl-m); margin-bottom: 24px; }
.topbar .spacer { flex: 1; }
.m-only { display: none !important; }
.st-short { display: none; }
.status-pill { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); color: var(--text-2); font-size: var(--fs-m); font-weight: 560; text-decoration: none; white-space: nowrap; min-width: 0; transition: border-color var(--t-fast) var(--ease-out); }
.status-pill:hover { border-color: var(--line-3); color: var(--text); }
.status-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent-fill); box-shadow: 0 0 0 3px var(--accent-wash); flex: none; }
.status-pill.tone-hold { color: var(--hold); border-color: color-mix(in srgb, var(--hold) 35%, transparent); }
.status-pill.tone-hold .dot { background: var(--hold); box-shadow: 0 0 0 3px var(--hold-wash); }
.status-pill.tone-bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); background: color-mix(in srgb, var(--bad-wash) 60%, var(--surface)); }
.status-pill.tone-bad .dot { background: var(--bad); box-shadow: 0 0 0 3px var(--bad-wash); }

/* content column: max 1240px + gutters, centred in the space beside the side rail (margin-inline:auto — without it the
   grid item sat at the inline start = the right edge in RTL, leaving the whole extra width empty on the left) */
.main { min-width: 0; padding: 20px var(--gutter) 64px; max-width: calc(var(--content-max) + 2 * var(--gutter)); width: 100%; margin-inline: auto; }
.view-in { animation: view-in .24s var(--ease-out) both; }
@keyframes view-in { from { opacity: 0; transform: translateY(4px); } }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head h1 { font-size: var(--fs-2xl); line-height: 1.2; letter-spacing: -.02em; font-weight: 620; }
.page-head .sub { color: var(--muted); font-size: var(--fs-m); margin-top: 4px; max-width: 64ch; }
.head-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }

.acct { display: inline-flex; align-items: center; gap: 8px; min-height: var(--ctl-m); padding: 0 6px; padding-inline-end: 14px; border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--line-2); max-width: 260px; position: relative; }
.acct .av { width: 28px; height: 28px; font-size: var(--fs-xs); border-radius: 50%; }
.acct b { font-size: var(--fs-m); font-weight: 560; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct select { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.acct .chev { width: 14px; height: 14px; color: var(--muted); flex: none; }
.acct:hover { border-color: var(--line-3); }
.acct:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.trial { display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 12px; border-radius: var(--r-pill); border: 1px solid color-mix(in srgb, var(--hold) 35%, transparent); color: var(--hold); font-size: var(--fs-m); font-weight: 560; white-space: nowrap; }
.trial::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.alert {
  --tone: var(--bad); --tone-wash: var(--bad-wash);
  display: flex; align-items: center; gap: 8px 16px; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 24px;
  border-radius: var(--r-l); background: color-mix(in srgb, var(--tone-wash) 70%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--tone) 28%, transparent); border-inline-start: 3px solid var(--tone);
  color: var(--text); font-size: var(--fs-m); line-height: 1.5;
}
.alert > b { color: var(--text); font-weight: 600; }
.alert > b::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--tone); margin-inline-end: 8px; vertical-align: 1px; }
.alert > span { color: var(--text-2); }
.alert .btn { margin-inline-start: auto; }

/* ---------- panels ---------- */
.panel { background: var(--surface); border: 1px solid var(--panel-line); border-radius: var(--r-panel); padding: 24px; min-width: 0; }
.panel + .panel { margin-top: 16px; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.panel-head h2, .chart-head h2 { font-size: var(--fs-l); font-weight: 600; letter-spacing: -.01em; }
.panel-head .hint, .chart-head .hint { margin-top: 2px; font-size: var(--fs-m); }
.panel > h2 { font-size: var(--fs-l); margin-bottom: 4px; font-weight: 600; letter-spacing: -.01em; }
.panel > h2 + .hint { margin-bottom: 16px; }
.empty-note { color: var(--muted); font-size: var(--fs-m); line-height: 1.55; max-width: 44ch; }
.empty-block { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; padding: 4px 0; }
.empty-block h3 { font-size: var(--fs-l); font-weight: 600; }

/* ---------- overview ---------- */
.ov { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.ov > * { grid-column: span 12; }
.ov .span-7 { grid-column: span 7; }
.ov .span-5 { grid-column: span 5; }
.period { position: relative; display: inline-flex; align-items: center; }
.period select { appearance: none; -webkit-appearance: none; min-height: var(--ctl-m); padding: 0 16px; padding-inline-end: 36px; border-radius: var(--r-pill); border: 1px solid var(--line-2); background: var(--surface-2); font-size: var(--fs-m); font-weight: 550; cursor: pointer; background-image: none; }
.period select:hover { border-color: var(--line-3); }
.period > span { position: absolute; inset-inline-end: 12px; top: 50%; transform: translateY(-50%); display: grid !important; pointer-events: none; color: var(--muted); }
.period svg { width: 14px; height: 14px; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.kpi { position: relative; min-width: 0; display: flex; flex-direction: column; gap: 4px; padding: 20px; border-radius: var(--r-panel); background: var(--surface); min-height: 152px; }
.kpi.tint-petrol { background: var(--tint-petrol); }
.kpi.tint-sage { background: var(--tint-sage); }
.kpi.tint-mist { background: var(--tint-mist); }
.kpi.tint-sand { background: var(--tint-sand); }
.kpi .k { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; font-size: var(--fs-m); color: var(--text-2); font-weight: 560; min-height: 36px; }
.kpi .k > span { padding-top: 6px; }
.kpi .v { font-size: 34px; line-height: 1.05; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; margin-top: auto; direction: ltr; align-self: flex-start; color: var(--text); }
.kpi .foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: var(--fs-s); color: var(--text-2); margin-top: 6px; }
.kpi-go { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--on-tint-btn); color: var(--text); text-decoration: none; transition: transform var(--t-fast) var(--ease-out); }
.kpi-go svg { width: 16px; height: 16px; }
[dir="rtl"] .kpi-go svg { transform: scaleX(-1); }
.kpi-go:hover { transform: scale(1.06); }
.q-row { display: flex; align-items: center; gap: 12px; margin-top: auto; }
.q-row .v { margin-top: 0; }
.q-row .v small { font-size: var(--fs-l); font-weight: 500; color: var(--text-2); letter-spacing: 0; }
.ring { width: 48px; height: 48px; flex: none; display: block; }
.ring svg { width: 100%; height: 100%; display: block; }
.ring circle { fill: none; stroke-width: 6; }
.ring .trk { stroke: color-mix(in srgb, var(--text) 10%, transparent); }
.ring .val { stroke: var(--accent-fill); stroke-linecap: round; }
.quota-tile.near .ring .val { stroke: var(--hold); }
.quota-tile.over .ring .val { stroke: var(--bad); }
.legend { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 0; }
.legend .lg { display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 12px; border-radius: var(--r-pill); background: var(--surface-2); font-size: var(--fs-s); color: var(--text-2); }
.legend .sw { width: 10px; height: 10px; border-radius: 50%; background: var(--bar); }
.legend .sw.best { background: var(--accent-fill); }
.delta { display: inline-flex; align-items: center; gap: 3px; height: 24px; padding: 0 8px; border-radius: var(--r-pill); font-size: var(--fs-s); font-weight: 600; color: var(--text-2); background: var(--surface-3); white-space: nowrap; direction: ltr; font-variant-numeric: tabular-nums; }
.delta svg { width: 12px; height: 12px; }
.delta.up { color: var(--accent); background: var(--accent-wash); }

/* chart */
.chart-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 8px; }
.chart-total { text-align: end; }
.chart-total b { display: block; font-size: var(--fs-xl); line-height: 1; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.chart-total span { font-size: var(--fs-m); color: var(--muted); }
.bars { --h: 150px; position: relative; display: flex; align-items: flex-end; gap: 8px; height: calc(var(--h) + 30px + 40px); padding-top: 40px;
  background-image: linear-gradient(var(--line) 1px, transparent 1px); background-size: 100% calc(var(--h) / 3); background-position: 0 40px; background-repeat: repeat-y; background-clip: content-box; }
.bars.dense { gap: 3px; }
.bar { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 10px; height: 100%; background: none; border: 0; padding: 0; cursor: pointer; position: relative; }
.bar .col { width: 100%; max-width: 28px; border-radius: 8px; background: var(--bar); min-height: 3px; transition: background-color var(--t-fast) var(--ease-out), height .5s var(--ease-out); }
.bars.dense .bar .col { border-radius: 4px; }
.bar .lbl { font-size: var(--fs-s); color: var(--muted); line-height: 1; height: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.bar.best .col, .bar.sel .col { background: var(--accent-fill); }
.bars.has-sel .bar.best:not(.sel) .col { background: var(--bar); }
.bar:hover .col { background: var(--bar-hover); }
.bar.sel .col { background: var(--accent-fill); }
.bar.sel .lbl, .bar.best .lbl { color: var(--text); font-weight: 600; }
.bars.has-sel .bar.best:not(.sel) .lbl { color: var(--muted); font-weight: 400; }
.bar:focus-visible { outline: none; }
.bar:focus-visible .col { outline: 2px solid var(--accent); outline-offset: 2px; }
.tip { position: absolute; left: 50%; bottom: calc(var(--ch, 0px) + 32px); background: var(--tip-bg); color: var(--tip-ink); font-size: var(--fs-s); font-weight: 600; padding: 5px 9px; border-radius: var(--r-xs); white-space: nowrap; pointer-events: none; z-index: 2; font-variant-numeric: tabular-nums; }
.tip small { font-weight: 450; opacity: .7; margin-inline-start: 6px; font-size: var(--fs-s); }
.chart-empty { position: absolute; inset: 40px 0 30px; display: grid; place-items: center; text-align: center; padding: 0 16px; }
.chart-empty div { background: var(--surface); padding: 12px 16px; border-radius: var(--r-l); border: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.chart-empty p { color: var(--text-2); font-size: var(--fs-m); }

/* who commented today */
.today-count { display: flex; align-items: baseline; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.today-count b { font-size: var(--fs-2xl); line-height: 1; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.today-count span { font-size: var(--fs-m); color: var(--text-2); }
.faces { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 14px 8px; }
.face { display: flex; flex-direction: column; align-items: center; gap: 7px; min-width: 0; }
.face .av { width: 44px; height: 44px; font-size: var(--fs-m); position: relative; overflow: visible; }
.face .name { font-size: var(--fs-s); color: var(--muted); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.face .got { position: absolute; bottom: -3px; inset-inline-end: -3px; width: 18px; height: 18px; border-radius: 50%; background: var(--accent-fill); color: #fff; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--surface); }
.face .got svg { width: 10px; height: 10px; }
.panel-foot { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: var(--fs-m); color: var(--muted); }

/* avatars: tinted initials, not candy circles */
.av {
  --c: #6d4ae8;
  width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; font-weight: 600; font-size: var(--fs-s); letter-spacing: .01em; overflow: hidden;
  color: color-mix(in srgb, var(--c) var(--av-text-mix), var(--av-text-base));
  background: color-mix(in srgb, var(--c) var(--av-bg-mix), var(--av-bg-base));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 28%, transparent);
}
.av img { width: 100%; height: 100%; object-fit: cover; }
.av.me { color: var(--text); background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--line-2); }
.av .glyph { display: grid; place-items: center; width: 100%; height: 100%; }
.av .glyph svg { width: 50%; height: 50%; }

/* top posts */
.tops { display: flex; flex-direction: column; }
.tops { gap: 8px; }
.top-row { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto 32px; align-items: center; gap: 14px; padding: 10px 12px; border-radius: var(--r-l); background: var(--surface-2); text-decoration: none; color: inherit; transition: background-color var(--t-fast) var(--ease-out); }
.top-row:hover { background: var(--surface-3); }
.row-go { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--text-2); }
.row-go svg { width: 16px; height: 16px; }
.thumb-sm { width: 48px; height: 60px; border-radius: var(--r-s); overflow: hidden; background: var(--surface-3); display: grid; place-items: center; color: var(--muted); flex: none; box-shadow: inset 0 0 0 1px var(--line); }
.thumb-sm img { width: 100%; height: 100%; object-fit: cover; }
.thumb-sm svg { width: 20px; height: 20px; }
.top-row .t { min-width: 0; }
.top-row .t b { display: block; font-size: var(--fs-l); font-weight: 580; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-row .t p { font-size: var(--fs-m); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 1px; }
.top-row .t .meta { display: flex; align-items: center; gap: 10px; margin-top: 6px; flex-wrap: wrap; }
.top-row .n { text-align: end; }
.top-row .n b { display: block; font-size: var(--fs-xl); line-height: 1; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.top-row .n span { font-size: var(--fs-s); color: var(--muted); }

/* tags: quiet status text with a dot */
.tag { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: var(--r-pill); font-size: var(--fs-s); font-weight: 560; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tag.plain::before { display: none; }
.tag.on { background: transparent; color: var(--text-2); padding-inline-start: 0; }
.tag.on::before { background: var(--accent-fill); box-shadow: 0 0 0 3px var(--accent-wash); }
.tag.hold { background: transparent; color: var(--hold); padding-inline-start: 0; }
.tag.bad { background: var(--bad-wash); color: var(--bad); }
.plat { display: inline-flex; align-items: center; gap: 5px; font-size: var(--fs-s); color: var(--muted); white-space: nowrap; }
.plat svg { width: 15px; height: 15px; }

/* recent comments / activity rows */
.feed { display: flex; flex-direction: column; }
.feed { gap: 8px; }
.ev { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; padding: 12px 16px; border-radius: var(--r-l); background: var(--surface-2); }
.ev-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.ev-top .who { font-weight: 580; font-size: var(--fs-m); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-top time { font-size: var(--fs-s); color: var(--muted); white-space: nowrap; flex: none; font-variant-numeric: tabular-nums; }
.ev .txt { font-size: var(--fs-l); color: var(--text); margin-top: 1px; overflow-wrap: anywhere; }
.feed.compact .ev .txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-m); color: var(--text-2); }
.outcome { display: flex; align-items: center; gap: 7px; margin-top: 4px; font-size: var(--fs-m); color: var(--muted); flex-wrap: wrap; }
.outcome .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--line-3); flex: none; }
.outcome.ok { color: var(--text-2); }
.outcome.ok .dot { background: var(--accent-fill); }
.outcome.bad { color: var(--bad); }
.outcome.bad .dot { background: var(--bad); }
.outcome a { color: inherit; text-decoration-color: var(--line-3); }
.ev-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.ev .error { margin-top: 8px; font-size: var(--fs-m); color: var(--bad); background: var(--bad-wash); padding: 8px 10px; border-radius: var(--r-s); overflow-wrap: anywhere; }

/* onboarding */
.start { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; align-items: center; padding: 32px; }
.start h2 { font-size: var(--fs-xl); line-height: 1.15; letter-spacing: -.03em; max-width: 16ch; font-weight: 620; }
.start p.lead { font-size: var(--fs-l); color: var(--text-2); margin-top: 10px; max-width: 42ch; }
.start ol { list-style: none; padding: 0; margin: 24px 0; display: flex; flex-direction: column; counter-reset: s; border-top: 1px solid var(--line); }
.start li { display: flex; align-items: center; gap: 14px; font-size: var(--fs-l); counter-increment: s; padding: 12px 0; border-bottom: 1px solid var(--line); }
.start li::before { content: counter(s); width: 24px; font-weight: 600; font-size: var(--fs-m); color: var(--accent); font-variant-numeric: tabular-nums; flex: none; }
.pick-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.pick-strip button { padding: 0; border: 0; background: var(--surface-3); border-radius: var(--r-l); overflow: hidden; aspect-ratio: 4/5; cursor: pointer; position: relative; box-shadow: inset 0 0 0 1px var(--line); }
.pick-strip img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s var(--ease-out), opacity .2s; }
.pick-strip button:hover img { transform: scale(1.03); }
.pick-strip .go { position: absolute; inset-inline: 8px; bottom: 8px; background: var(--glass); color: var(--text); border-radius: var(--r-s); font-size: var(--fs-s); font-weight: 560; padding: 6px 8px; text-align: center; }

/* ---------- content grid ---------- */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.seg { display: inline-flex; padding: 4px; border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--line-2); position: relative; isolation: isolate; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg button { border: 0; background: none; min-height: 32px; padding: 0 14px; border-radius: var(--r-pill); font-size: var(--fs-m); font-weight: 550; color: var(--muted); cursor: pointer; white-space: nowrap; position: relative; z-index: 1; transition: color var(--t-fast) var(--ease-out); }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { color: var(--text); }
.seg:not(.has-ind) button[aria-pressed="true"] { background: var(--surface-3); }
.seg-ind { position: absolute; top: 4px; bottom: 4px; left: 0; right: auto; border-radius: var(--r-pill); background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--line-2); z-index: 0; transition: transform var(--t-med) var(--ease-out), width var(--t-med) var(--ease-out); }
.seg.soft { background: var(--surface-2); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.post { display: flex; flex-direction: column; gap: 10px; padding: 0 0 14px; background: var(--surface); border-radius: var(--r-panel); border: 1px solid var(--panel-line); text-align: start; cursor: pointer; color: inherit; text-decoration: none; overflow: hidden; transition: border-color var(--t-med) var(--ease-out), transform var(--t-med) var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .post:hover { border-color: var(--line-3); } .post:hover .thumb img { transform: scale(1.02); } }
.post .thumb { position: relative; aspect-ratio: 4/5; overflow: hidden; background: var(--surface-3); }
.post .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease-out); }
.post .kind { position: absolute; top: 10px; inset-inline-end: 10px; width: 26px; height: 26px; border-radius: 50%; background: rgb(0 0 0 / .45); color: #fff; display: grid; place-items: center; }
.post .kind svg { width: 12px; height: 12px; }
.post .state { position: absolute; inset-inline: 8px; bottom: 8px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 10px; border-radius: var(--r-s); background: rgb(10 10 11 / .82); color: #f2f2f1; font-size: var(--fs-s); font-weight: 560; }
.post .state.live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #3fb6c4; flex: none; }
.post .state.paused::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #f2b84b; flex: none; }
.post .state .lab { flex: 1; }
.post .state .n { font-weight: 500; color: #bfbfc0; font-variant-numeric: tabular-nums; }
.post .state.none { justify-content: center; gap: 6px; }
.post .state svg { width: 14px; height: 14px; }
.post-body { padding: 0 14px; display: flex; flex-direction: column; gap: 6px; }
.post .caption { font-size: var(--fs-m); line-height: 1.45; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-meta { display: flex; align-items: center; gap: 7px; font-size: var(--fs-s); color: var(--muted); flex-wrap: wrap; }
.post-meta .sep { width: 2px; height: 2px; border-radius: 50%; background: currentColor; }
.sk-kpis { height: 128px; padding: 0; overflow: hidden; }
.sk-chart { height: 300px; }
.sk-kpis .skeleton, .sk-chart .skeleton { height: 100%; }
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.4s ease-in-out infinite; border-radius: var(--r-s); }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- automations list ---------- */
.ablock + .ablock { margin-top: 16px; }
.ablock .panel-head { margin-bottom: 6px; }
.ablock .count { color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.alist { display: flex; flex-direction: column; gap: 8px; }
.arow { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 16px; padding: 12px 16px; border-radius: var(--r-l); background: var(--surface-2); }
.arow > a { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: center; text-decoration: none; color: inherit; min-width: 0; }
.arow > a:hover h3 { text-decoration: underline; text-decoration-color: var(--line-3); text-underline-offset: 4px; }
.arow h3 { font-size: var(--fs-l); font-weight: 580; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.arow .t { display: flex; align-items: center; gap: 10px; min-width: 0; }
.kw { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.kwt { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: var(--r-pill); background: var(--surface-2); border: 1px solid var(--line-2); font-size: var(--fs-m); font-weight: 500; }
.nums { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 8px; font-size: var(--fs-m); color: var(--muted); align-items: center; }
.nums b { color: var(--text); font-weight: 600; margin-inline-end: 5px; font-variant-numeric: tabular-nums; }
.nums .f b, .nums .f { color: var(--bad); }

/* switch */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: var(--fs-m); user-select: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 38px; height: 22px; border-radius: 999px; background: var(--surface-4); position: relative; flex: none; transition: background-color var(--t-fast) var(--ease-out); }
.switch .track::after { content: ""; position: absolute; top: 3px; inset-inline-start: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform var(--t-med) var(--ease-out); }
.switch input:checked + .track { background: var(--accent-fill); }
.switch input:checked + .track::after { transform: translateX(-16px); }
[dir="ltr"] .switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.field[hidden], #security form[hidden], #security .btn[hidden] { display: none !important; }
.label { font-size: var(--fs-m); font-weight: 560; color: var(--text-2); display: flex; align-items: baseline; gap: 8px; }
.label small { font-weight: 450; color: var(--muted); font-size: var(--fs-m); }
input[type="text"], input[type="email"], input[type="password"], input[type="url"], input[type="search"], input[type="tel"], select, textarea {
  width: 100%; min-height: var(--ctl-m); padding: 8px 12px; border-radius: var(--r-m); border: 1px solid var(--line-2); background: var(--surface-2); font-size: var(--fs-l); color: var(--text);
  transition: border-color var(--t-fast) var(--ease-out), box-shadow var(--t-fast) var(--ease-out);
}
textarea { min-height: 120px; resize: vertical; line-height: 1.55; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input[type="search"] { border-radius: var(--r-pill); padding-inline: 16px; }
input:hover, select:hover, textarea:hover { border-color: var(--line-3); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent-fill); box-shadow: 0 0 0 3px var(--accent-wash); }
select { appearance: none; -webkit-appearance: none; padding-inline-end: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238e8e91' stroke-width='2' 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: left 13px center; }
[dir="ltr"] select { background-position: right 13px center; }
.err { color: var(--bad); font-size: var(--fs-m); }
.err:empty { display: none; }
.notice { padding: 12px 16px; border-radius: var(--r-l); background: var(--hold-wash); border: 1px solid color-mix(in srgb, var(--hold) 25%, transparent); color: var(--text); font-size: var(--fs-m); margin-bottom: 16px; }
.notice.info { background: var(--accent-wash); border-color: var(--accent-line); }
.fail { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); padding: 28px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.fail h3 { font-size: var(--fs-l); }
.fail p { color: var(--muted); }
.loading-line { color: var(--muted); padding: 10px 0; }

/* ---------- editor (guided flow) ---------- */
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); text-decoration: none; font-size: var(--fs-m); font-weight: 500; margin-bottom: 10px; }
.back svg { width: 16px; height: 16px; }
.back:hover { color: var(--text); }
.ed-title { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.ed-title h1 { font-size: var(--fs-2xl); letter-spacing: -.025em; line-height: 1.2; font-weight: 620; }
.steps { display: flex; margin-bottom: 16px; overflow-x: auto; scrollbar-width: none; border: 1px solid var(--panel-line); border-radius: var(--r-pill); background: var(--surface); padding: 4px; gap: 2px; }
.steps button { flex: 1 1 0; display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-height: 40px; padding: 0 12px; border-radius: var(--r-pill); border: 0; background: transparent; color: var(--muted); font-size: var(--fs-m); font-weight: 550; cursor: pointer; white-space: nowrap; }
.steps button:hover:not(:disabled) { color: var(--text); background: var(--surface-2); }
.steps button .n { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: var(--fs-s); font-weight: 600; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line-3); font-variant-numeric: tabular-nums; }
.steps button .n svg { width: 12px; height: 12px; }
.steps button.done { color: var(--text-2); }
.steps button.done .n { color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent-line); background: var(--accent-wash); }
.steps button[aria-current="step"] { color: var(--text); background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--line-2); }
.steps button[aria-current="step"] .n { background: var(--accent-fill); color: #fff; box-shadow: none; }
.steps button:disabled { cursor: not-allowed; opacity: .5; }
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.step-panel { padding: 28px 32px; }
.step-panel h2.q { font-size: var(--fs-xl); letter-spacing: -.025em; line-height: 1.2; font-weight: 620; }
.step-panel .q-hint { color: var(--muted); font-size: var(--fs-m); margin-top: 6px; margin-bottom: 24px; max-width: 58ch; }
.step-foot { display: flex; align-items: center; gap: 8px; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.step-foot .spacer { flex: 1; }
.step-foot .err { flex-basis: 100%; order: -1; }
.sub-h { font-size: var(--fs-m); font-weight: 600; margin: 24px 0 10px; color: var(--text-2); }

/* step 1: targets */
.targets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.target { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: var(--r-l); border: 1px solid var(--line-2); background: var(--surface-2); text-align: start; cursor: pointer; color: inherit; transition: border-color var(--t-fast) var(--ease-out), background-color var(--t-fast) var(--ease-out); }
.target .ti { width: 40px; height: 40px; border-radius: var(--r-m); background: var(--surface-3); display: grid; place-items: center; flex: none; color: var(--text-2); }
.target .ti svg { width: 20px; height: 20px; }
.target b { display: block; font-size: var(--fs-l); font-weight: 580; }
.target span.s { display: block; font-size: var(--fs-m); color: var(--muted); margin-top: 1px; }
.target:hover { border-color: var(--line-3); }
.target[aria-pressed="true"] { border-color: var(--accent-fill); background: var(--accent-wash); box-shadow: inset 0 0 0 1px var(--accent-fill); }
.target[aria-pressed="true"] .ti { background: var(--accent-fill); color: #fff; }
.media-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.mp { position: relative; padding: 0; border: 0; background: var(--surface-3); border-radius: var(--r-m); overflow: hidden; aspect-ratio: 4/5; cursor: pointer; }
.mp img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s var(--ease-out), opacity .2s; }
.mp:hover img { transform: scale(1.03); }
.mp::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow var(--t-fast) var(--ease-out); }
.mp[aria-pressed="true"]::after { box-shadow: inset 0 0 0 2px var(--accent-fill), inset 0 0 0 4px rgb(10 10 11 / .6); }
.mp .check { position: absolute; top: 8px; inset-inline-start: 8px; width: 22px; height: 22px; border-radius: 50%; background: var(--accent-fill); color: #fff; display: none; place-items: center; z-index: 1; }
.mp[aria-pressed="true"] .check { display: grid; }
.mp .check svg { width: 12px; height: 12px; }
.mp .has { position: absolute; bottom: 6px; inset-inline: 6px; background: rgb(10 10 11 / .82); color: #f2f2f1; font-size: var(--fs-s); font-weight: 560; border-radius: var(--r-xs); padding: 4px 6px; text-align: center; }
.mp .kind { position: absolute; top: 8px; inset-inline-end: 8px; width: 22px; height: 22px; border-radius: 50%; background: rgb(0 0 0 / .45); color: #fff; display: grid; place-items: center; }
.mp .kind svg { width: 10px; height: 10px; }

/* step 2: words */
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 7px; min-height: 54px; border-radius: var(--r-l); border: 1px solid var(--line-2); background: var(--surface-2); cursor: text; transition: border-color var(--t-fast), box-shadow var(--t-fast); }
.chips:focus-within { border-color: var(--accent-fill); box-shadow: 0 0 0 3px var(--accent-wash); }
.chip { display: inline-flex; align-items: center; gap: 2px; height: 36px; padding-inline: 12px 2px; border-radius: var(--r-s); background: var(--surface-4); color: var(--text); font-size: var(--fs-l); font-weight: 580; box-shadow: inset 0 0 0 1px var(--line-2); }
.chip button { width: 32px; height: 32px; border-radius: var(--r-xs); border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.chip button:hover { color: var(--text); background: var(--surface-3); }
.chip button svg { width: 12px; height: 12px; }
.chips input { flex: 1; min-width: 140px; border: 0 !important; box-shadow: none !important; padding: 0 8px; min-height: 36px; font-size: var(--fs-l); background: transparent; }
.opt { margin-top: 14px; }
.tester { margin-top: 24px; padding: 18px; border-radius: var(--r-l); background: var(--surface-2); border: 1px solid var(--line); }
.tester h3 { font-size: var(--fs-m); margin-bottom: 10px; color: var(--text-2); }
.tester input { background: var(--surface); }
.verdict { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: var(--fs-m); font-weight: 560; min-height: 24px; color: var(--muted); }
.verdict svg { width: 16px; height: 16px; flex: none; }
.verdict.yes { color: var(--accent); }
.examples { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.examples .ex { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 10px; border-radius: var(--r-s); background: var(--surface); border: 1px solid var(--line); font-size: var(--fs-m); color: var(--text); }
.examples .ex svg { width: 13px; height: 13px; color: var(--accent); }
.examples .ex.no, .examples .ex.no svg { color: var(--muted); }
.examples-lbl { font-size: var(--fs-m); color: var(--muted); margin-top: 14px; }

/* step 3/4 rows */
.list-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) 36px; align-items: center; gap: 8px; margin-bottom: 8px; }
.list-row .idx { font-size: var(--fs-m); font-weight: 600; color: var(--muted); text-align: center; font-variant-numeric: tabular-nums; }
.add { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: var(--r-pill); border: 1px dashed var(--line-3); background: transparent; color: var(--text-2); font-size: var(--fs-m); font-weight: 550; cursor: pointer; }
.add:hover { background: var(--surface-2); color: var(--text); }
.add svg { width: 16px; height: 16px; }
.counter { font-size: var(--fs-s); color: var(--muted); text-align: end; margin-top: -2px; font-variant-numeric: tabular-nums; }
.counter.over { color: var(--bad); }
.btn-edit { display: grid; grid-template-columns: minmax(0, 1fr) 36px; gap: 8px; align-items: center; margin-bottom: 8px; padding: 8px; border-radius: var(--r-l); background: var(--surface-2); border: 1px solid var(--line); }
.btn-edit .fields { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: 8px; }
.btn-edit input { background: var(--surface); }

/* step 5: summary */
.sum { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.sum-row { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.sum-row .k { font-size: var(--fs-m); color: var(--muted); font-weight: 500; }
.sum-row .v { min-width: 0; font-size: var(--fs-l); }
.sum-row .v .kw { margin-top: 0; }
.sum-row .v p { overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.sum-row .v .with-thumb { display: flex; align-items: center; gap: 12px; }
.sum-row .v .with-thumb .thumb-sm { width: 36px; height: 45px; border-radius: var(--r-xs); }
.launch { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px 20px; align-items: end; margin-top: 20px; padding: 16px; border-radius: var(--r-l); background: var(--surface-2); border: 1px solid var(--line); }
.launch .field { margin: 0; }
.launch input { background: var(--surface); }
.launch .switch { min-height: 44px; }
.perf { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 20px; border: 1px solid var(--line); border-radius: var(--r-l); }
.perf div { padding: 14px 16px; }
.perf div + div { border-inline-start: 1px solid var(--line); }
.perf b { display: block; font-size: var(--fs-xl); font-weight: 600; letter-spacing: -.02em; line-height: 1.05; font-variant-numeric: tabular-nums; }
.perf span { font-size: var(--fs-s); color: var(--muted); }
.perf-note { margin: -8px 0 18px; font-size: var(--fs-m); }
.perf-note a { color: var(--bad); }

/* phone preview */
.preview-col { position: sticky; top: 24px; }
.pv-label { display: flex; align-items: baseline; justify-content: space-between; margin: 2px 4px 10px; }
.pv-label h2 { font-size: var(--fs-m); font-weight: 600; color: var(--text-2); }
.pv-label span { font-size: var(--fs-s); color: var(--muted); }
.phone { border-radius: 40px; padding: 8px; background: var(--phone-frame); box-shadow: inset 0 0 0 1px var(--line-2), var(--shadow-pop); }
.phone-screen { border-radius: 33px; background: var(--phone-bg); color: var(--text); min-height: 580px; padding: 38px 16px 20px; position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 10px; box-shadow: inset 0 0 0 1px var(--line); }
.notch { position: absolute; top: 11px; left: 50%; transform: translateX(-50%); width: 88px; height: 24px; border-radius: 999px; background: #000; }
.pv-sec { font-size: var(--fs-s); font-weight: 600; color: var(--muted); margin-top: 6px; }
.pv-post { display: flex; align-items: center; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.pv-post .thumb-sm { width: 32px; height: 40px; border-radius: 6px; }
.pv-post p { font-size: var(--fs-s); color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pv-thread { display: flex; flex-direction: column; gap: 12px; }
.cm { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; font-size: var(--fs-m); line-height: 1.4; }
.cm .av { width: 30px; height: 30px; font-size: var(--fs-xs); }
.cm.reply { margin-inline-start: 32px; }
.cm .who { font-weight: 650; }
.cm .muted { font-size: var(--fs-s); margin-top: 3px; }
.dm-head { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.dm-head .av { width: 30px; height: 30px; font-size: var(--fs-xs); }
.dm-head b { display: block; font-size: var(--fs-m); }
.dm-head small { font-size: var(--fs-s); color: var(--muted); }
.convo { display: flex; flex-direction: column; gap: 8px; padding-top: 6px; }
.convo .ctx { font-size: var(--fs-s); color: var(--muted); text-align: center; margin: 2px 0 4px; }
.bubble { max-width: 82%; padding: 9px 13px; border-radius: 18px; font-size: var(--fs-m); line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble.in { background: var(--bubble-them); align-self: flex-start; border-end-start-radius: 5px; }
.bubble.own { background: var(--accent-fill); color: #fff; align-self: flex-end; border-end-end-radius: 5px; }
.tmpl { align-self: flex-start; width: 82%; border-radius: 18px; overflow: hidden; background: var(--bubble-them); }
.tmpl .t { padding: 11px 13px; font-size: var(--fs-m); line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.tmpl .b { display: block; padding: 10px 13px; text-align: center; font-size: var(--fs-m); font-weight: 600; color: var(--accent); border-top: 1px solid var(--line-2); text-decoration: none; }
.placeholder-bubble { align-self: flex-start; padding: 11px 14px; border-radius: 18px; border: 1px dashed var(--line-3); font-size: var(--fs-s); color: var(--muted); }
.pop-in { animation: pop-in .28s var(--ease-out) both; }
@keyframes pop-in { from { opacity: 0; transform: translateY(4px); } }
.mode-seg { display: none; }

/* ---------- connect / settings ---------- */
.acct-card { display: flex; align-items: center; gap: 14px; padding: 4px 0 18px; }
.acct-card .av { width: 44px; height: 44px; font-size: var(--fs-l); border-radius: var(--r-m); }
.acct-card b { font-size: var(--fs-l); font-weight: 600; }
.acct-card .meta { font-size: var(--fs-m); color: var(--muted); margin-top: 1px; }
.kv { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 13px 0; border-top: 1px solid var(--line); min-height: 56px; }
.kv .k { font-size: var(--fs-m); font-weight: 500; }
.kv .v { font-size: var(--fs-m); color: var(--muted); margin-top: 1px; overflow-wrap: anywhere; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.copy { display: flex; gap: 8px; align-items: center; }
.copy code { flex: 1; min-width: 0; padding: 10px 12px; border-radius: var(--r-m); background: var(--surface-2); border: 1px solid var(--line); font-family: var(--font-mono); font-size: var(--fs-s); direction: ltr; text-align: left; overflow-x: auto; white-space: nowrap; }
code { font-family: var(--font-mono); font-size: .88em; background: var(--surface-3); padding: 1px 6px; border-radius: 5px; }
ul.plain { margin: 8px 0 0; padding-inline-start: 20px; color: var(--text-2); font-size: var(--fs-m); }
.pages { display: flex; flex-direction: column; gap: 8px; margin-top: 24px; }
.page-pick { display: flex; align-items: center; gap: 16px; width: 100%; min-height: 72px; padding: 12px 16px; border-radius: var(--r-l); border: 1px solid var(--line-2); background: var(--surface-2); cursor: pointer; text-align: start; color: inherit; font: inherit; transition: border-color var(--t-fast) var(--ease-out), background-color var(--t-fast) var(--ease-out); }
.page-pick:hover { border-color: var(--line-3); }
.page-pick .av { width: 44px; height: 44px; font-size: var(--fs-l); border-radius: var(--r-m); }
.page-pick .pp-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.page-pick b { font-size: var(--fs-l); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page-pick .meta { font-size: var(--fs-m); color: var(--muted); }
.pp-radio { width: 22px; height: 22px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--line-3); flex: none; transition: box-shadow var(--t-fast) var(--ease-out); }
.page-pick[aria-checked="true"] { border-color: var(--accent-fill); background: var(--accent-wash); box-shadow: inset 0 0 0 1px var(--accent-fill); }
.page-pick[aria-checked="true"] .pp-radio { box-shadow: inset 0 0 0 7px var(--accent-fill); }
.fb-btn { background: #1464d8; color: #fff; border-color: transparent; }
@media (hover: hover) and (pointer: fine) { .fb-btn:hover { background: #1157bd; border-color: transparent; } }
.fb-btn svg { width: 18px; height: 18px; }

/* focused one-step card: first connect, back-from-Facebook, empty states */
.connect-step, .empty-hero { max-width: 600px; margin: 24px auto 0; padding: 32px; }
.empty-hero { margin-top: 0; }
.connect-step .eyebrow { font-size: var(--fs-s); font-weight: 600; color: var(--accent); letter-spacing: .01em; margin-bottom: 8px; }
.connect-step h1 { font-size: var(--fs-2xl); line-height: 1.2; letter-spacing: -.02em; font-weight: 620; }
.empty-hero h2 { font-size: var(--fs-xl); font-weight: 620; letter-spacing: -.015em; }
.connect-step .sub, .empty-hero .sub { color: var(--text-2); font-size: var(--fs-l); margin-top: 8px; line-height: 1.55; }
.empty-hero .hint { margin-top: 16px; }
.empty-hero .hint a { color: var(--accent); }
.cs-list { margin: 24px 0 0; padding: 0; list-style: none; counter-reset: s; border-top: 1px solid var(--line); }
.cs-list li { counter-increment: s; display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: var(--fs-m); color: var(--text-2); }
.cs-list li::before { content: counter(s); font-weight: 600; color: var(--accent); width: 16px; flex: none; font-variant-numeric: tabular-nums; }
.cs-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 24px; }
.connect-step .hint.fine { margin-top: 16px; }
.cs-icon { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 20px; background: var(--surface-3); color: var(--text-2); }
.cs-icon svg { width: 22px; height: 22px; }
.cs-icon.ok { background: var(--accent-wash); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent-line); }
.cs-icon.bad { background: var(--bad-wash); color: var(--bad); }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-3); border-top-color: var(--accent); animation: spin .8s linear infinite; }
.connect-error { max-width: none; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.settings-grid .panel + .panel { margin-top: 0; }
.settings-grid .wide { grid-column: 1 / -1; }

/* ---------- activity ---------- */
.filters { display: grid; grid-template-columns: minmax(0, 1fr) 190px 190px; gap: 8px; margin-bottom: 16px; }
.filter-note { display: flex; align-items: center; gap: 12px; margin: -4px 0 14px; font-size: var(--fs-m); }
.filter-note a { color: var(--accent); }
.day-h { font-size: var(--fs-s); font-weight: 600; color: var(--muted); padding: 16px 4px 0; }
.feed > .day-h:first-child { padding-top: 0; }

/* ---------- simulator sheet ---------- */
.overlay { position: fixed; inset: 0; z-index: 50; background: var(--scrim); display: grid; place-items: center; padding: 20px; animation: fade .18s var(--ease-out) both; overflow-y: auto; }
.overlay.closing { animation: fade .18s var(--ease-out) reverse both; }
@keyframes fade { from { opacity: 0; } }
.sheet { width: min(540px, 100%); max-height: calc(100dvh - 40px); overflow-y: auto; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-panel); padding: 24px; box-shadow: var(--shadow-pop); animation: sheet-in .26s var(--ease-drawer) both; }
@keyframes sheet-in { from { opacity: 0; transform: translateY(10px); } }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.sheet-head h2 { font-size: var(--fs-xl); font-weight: 620; }
.sheet-head .hint { margin-top: 2px; }
.sheet .actions { display: flex; gap: 8px; margin-top: 4px; }
.result { margin-top: 20px; padding: 18px; border-radius: var(--r-l); background: var(--surface-2); border: 1px solid var(--line); }
.result h3 { font-size: var(--fs-l); margin-bottom: 6px; }
.trace { list-style: none; padding: 0; margin: 14px 0; display: flex; flex-direction: column; gap: 12px; }
.trace .lbl { display: flex; align-items: center; gap: 8px; font-size: var(--fs-m); font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.trace .quote { padding: 9px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-m); font-size: var(--fs-m); }
.trace .tmpl { width: 100%; background: var(--surface); border: 1px solid var(--line); }

/* ---------- toast ---------- */
#toast { position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 16px); background: var(--tip-bg); color: var(--tip-ink); padding: 10px 16px; border-radius: var(--r-m); font-size: var(--fs-m); font-weight: 560; opacity: 0; pointer-events: none; z-index: 60; transition: opacity var(--t-med) var(--ease-out), transform var(--t-med) var(--ease-out); box-shadow: var(--shadow-pop); max-width: calc(100vw - 32px); }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- login ---------- */
/* hero2.js paints its backdrop from the root --bg; while the login shows, --bg is the art panel's near-black and the page keeps --canvas. */
html.login-mode:root { --bg: #050607; }
html.login-mode, html.login-mode body { background: var(--canvas); }
.login { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; padding: 16px; }
.login-art-panel { position: relative; border-radius: var(--r-panel); overflow: hidden; background: #050607; color: #f2f2f1; display: flex; flex-direction: column; justify-content: space-between; padding: 32px; min-height: 260px; isolation: isolate; border: 1px solid rgb(255 255 255 / .06); }
.login-art { position: absolute; inset: 0; z-index: -1; }
.login-art .hero2-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.login-art-panel .brand { color: #f2f2f1; }
.login-art-panel .brand-dot { box-shadow: inset 0 0 0 4px #0c7f8e, inset 0 0 0 7px #050607; }
.login-art-panel blockquote { margin: 0; font-size: clamp(28px, 2.8vw, 42px); line-height: 1.1; letter-spacing: -.03em; font-weight: 620; max-width: 15ch; text-wrap: balance; }
.login-art-panel blockquote em { font-style: normal; color: #3fb6c4; }
.login-art-panel .foot { font-size: 15px; color: rgb(242 242 241 / .7); margin-top: 14px; }
.login-main { display: grid; place-items: center; }
.login-card { width: min(400px, 100%); }
.login-card h1 { font-size: var(--fs-2xl); letter-spacing: -.03em; font-weight: 620; }
.login-card .sub { color: var(--muted); margin: 6px 0 26px; font-size: var(--fs-l); }
.login-card form .btn { margin-top: 6px; min-height: var(--ctl-l); font-size: var(--fs-l); }
.login-card .err { margin: 2px 0 8px; }
.login-links { display: flex; flex-direction: column; align-items: flex-start; margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--line); }


/* ---------- features v1: follow-gate / lead capture / rewind / leads ---------- */
.lock-tag { gap: 5px; color: var(--muted); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line-2); }
.lock-tag svg { width: 12px; height: 12px; }
.before-link { margin-top: 8px; }
.opt-card { padding: 14px 16px; border-radius: var(--r-l); background: var(--surface-2); border: 1px solid var(--line); margin-bottom: 10px; }
.opt-card .hint { font-size: var(--fs-m); margin: 6px 0 0; }
.opt-card .seg { margin-top: 12px; }
.opt-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 28px; }
.opt-head b { font-size: var(--fs-m); font-weight: 600; }
.opt-fields { margin-top: 14px; }
.opt-fields .field:last-child, .opt-card > .field.opt-fields { margin-bottom: 0; }
.opt-card input, .opt-card textarea { background: var(--surface); }
textarea.short { min-height: 64px; }
.switch input:disabled + .track { opacity: .45; }
.switch:has(input:disabled) { cursor: not-allowed; }
.seg button:disabled { opacity: .4; cursor: not-allowed; }

.rewind { margin-top: 20px; padding: 16px; border-radius: var(--r-l); border: 1px solid var(--line-2); background: linear-gradient(180deg, var(--accent-wash), transparent 70%), var(--surface-2); }
.rw-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.rw-head h3 { font-size: var(--fs-l); font-weight: 600; }
.rw-head .hint { font-size: var(--fs-m); margin-top: 2px; }
.rw-count { display: flex; align-items: baseline; gap: 10px; margin: 4px 0 10px; }
.rw-count b { font-size: var(--fs-2xl); font-weight: 600; letter-spacing: -.02em; line-height: 1; }
.rw-count span { color: var(--text-2); font-size: var(--fs-m); }
.rw-sample { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.rw-sample .kwt { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-block; line-height: 24px; }
.rewind .switch.opt { margin: 12px 0 14px; }
.rw-bar { height: 8px; border-radius: 999px; background: var(--surface-4); overflow: hidden; }
.rw-bar span { display: block; height: 100%; background: var(--accent-fill); border-radius: inherit; transition: width .4s var(--ease-out); }
.rw-line { font-size: var(--fs-m); margin: 10px 0 12px; font-variant-numeric: tabular-nums; }

.leads-filters { grid-template-columns: minmax(0, 1fr); }
.leads-table { display: flex; flex-direction: column; }
.leads-table { gap: 8px; }
.lt-row { display: grid; grid-template-columns: 96px minmax(0, 1.1fr) minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr) 36px; gap: 12px; align-items: center; padding: 10px 16px; border-radius: var(--r-l); background: var(--surface-2); font-size: var(--fs-m); }
.lt-head { font-size: var(--fs-s); font-weight: 600; color: var(--muted); background: transparent; padding-block: 0; }
.lt-row > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lt-row a { color: inherit; text-decoration: none; }
.lt-row a:hover { color: var(--accent); }
.lt-who { display: flex; align-items: center; gap: 8px; }
.lt-who .plat { flex: none; }
.lt-when { color: var(--muted); font-size: var(--fs-m); }
.lt-mail, .lt-phone { text-align: start; }
.lt-rule { color: var(--text-2); font-size: var(--fs-m); }

.hook-panel { margin-top: 16px; }
.secret-box { padding: 14px 16px; border-radius: var(--r-l); background: var(--hold-wash); border: 1px solid color-mix(in srgb, var(--hold) 30%, transparent); margin-bottom: 4px; }
.secret-box .hint { font-size: var(--fs-m); margin: 2px 0 10px; }
.secret-box code { background: var(--surface); }
.deliveries { display: flex; flex-direction: column; }
.dl-row { display: grid; grid-template-columns: 96px 110px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); font-size: var(--fs-m); }
.dl-row > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
details.help { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 16px; }
details.help summary { cursor: pointer; font-weight: 600; font-size: var(--fs-m); color: var(--text); list-style: none; display: flex; align-items: center; gap: 8px; }
details.help summary::-webkit-details-marker { display: none; }
details.help summary::before { content: "+"; display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: var(--r-xs); background: var(--surface-3); font-weight: 600; }
details.help[open] summary::before { content: "−"; }
.steps-list { margin: 14px 0; padding-inline-start: 20px; color: var(--text-2); font-size: var(--fs-m); display: flex; flex-direction: column; gap: 6px; }
.code-block { position: relative; border-radius: var(--r-l); border: 1px solid var(--line-2); background: var(--canvas); overflow: hidden; }
.code-tools { display: flex; justify-content: flex-end; padding: 8px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.code-block pre code { background: none; padding: 0; border: 0; font-size: inherit; }
.code-block pre { margin: 0; padding: 14px; overflow-x: auto; max-height: 360px; font-family: var(--font-mono); font-size: var(--fs-s); line-height: 1.6; color: var(--text-2); text-align: left; }

.tmpl .as-btn { width: 100%; border: 0; background: transparent; font: inherit; cursor: pointer; }
.tmpl .as-btn:hover:not(:disabled) { background: var(--accent-wash); }
.tmpl .as-btn:disabled { opacity: .55; cursor: default; }
.sim-reply { display: flex; gap: 8px; }
.sim-reply input { flex: 1; min-width: 0; }

@media (max-width: 767px) {
  .lt-head { display: none; }
  .lt-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "who act" "mail mail" "phone phone" "rule when"; gap: 4px 10px; padding: 12px 0; }
  .lt-who { grid-area: who; } .lt-act { grid-area: act; } .lt-mail { grid-area: mail; } .lt-phone { grid-area: phone; }
  .lt-rule { grid-area: rule; font-size: var(--fs-m); } .lt-when { grid-area: when; text-align: end; }
  .lt-mail .muted, .lt-phone .muted { display: none; }
  .dl-row { grid-template-columns: auto minmax(0, 1fr) auto; }
  .dl-row > span.muted { grid-column: 1 / -1; order: 5; white-space: normal; }
  .rw-count b { font-size: var(--fs-2xl); }
  .opt-card { padding: 12px; }
}

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .ov .span-7, .ov .span-5 { grid-column: span 12; }
  .editor { grid-template-columns: minmax(0, 1fr) 320px; }
}
@media (max-width: 960px) {
  .editor { grid-template-columns: minmax(0, 1fr); }
  .editor[data-mode="edit"] .preview-col { display: none; }
  .editor[data-mode="preview"] .form-col { display: none; }
  .preview-col { position: static; max-width: 380px; margin: 0 auto; width: 100%; }
  .mode-seg { display: inline-flex; margin-bottom: 14px; }
  .start { grid-template-columns: minmax(0, 1fr); }
  .settings-grid { grid-template-columns: minmax(0, 1fr); }
  .login { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .login-art-panel { min-height: 220px; }
  .login-art-panel blockquote { font-size: 26px; }
}
@media (max-width: 767px) {
  :root { --gutter: 16px; }
  .app { grid-template-columns: minmax(0, 1fr); }
  .side {
    position: fixed; top: auto; bottom: 0; inset-inline: 0; height: auto; z-index: 40; flex-direction: row; justify-content: center;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: var(--surface);
    border-inline-end: 0; border-top: 1px solid var(--line-2);
  }
  .side .mark, .side-end { display: none; }
  .nav { flex-direction: row; gap: 2px; width: 100%; justify-content: space-around; }
  .nav a { width: auto; flex: 1; min-width: 0; min-height: 52px; padding: 6px 0 5px; font-size: 11.5px; font-weight: 500; gap: 3px; justify-content: center; -webkit-tap-highlight-color: transparent; }
  .nav a .ic { width: 56px; height: 30px; }
  .nav a svg { width: 22px; height: 22px; }
  .nav a[aria-current="page"] { background: transparent; box-shadow: none; font-weight: 600; }
  .nav a:hover .ic { background: transparent; --ic-du: transparent; }
  .nav a[aria-current="page"]:hover .ic { background: var(--nav-pill); --ic-du: var(--nav-du); }
  .main { padding: 12px 16px calc(96px + env(safe-area-inset-bottom)); }
  .m-only { display: inline-flex !important; }
  .topbar { gap: 6px; margin-bottom: 16px; }
  .topbar .brand { flex: none; width: 32px; height: 40px; justify-content: center; }
  .topbar .acct { max-width: 132px; min-width: 0; flex: 0 1 auto; }
  .topbar .trial, .topbar .bell, .topbar .theme-btn { flex: none; }
  .st-long { display: none; }
  .st-short { display: inline; }
  .status-pill { padding: 0 10px; gap: 6px; }
  .page-head { margin-bottom: 16px; align-items: flex-start; }
  .connect-step, .empty-hero { margin-top: 8px; padding: 24px 16px; }
  .connect-step h1 { font-size: 24px; }
  .cs-actions .btn { flex: 1 1 100%; }
  .alert { margin-bottom: 16px; }
  .page-head h1, .ed-title h1 { font-size: 24px; }
  .head-tools { width: 100%; justify-content: flex-start; }
  .head-tools .btn { flex: 1; }
  .head-tools .btn.icon { flex: none; }
  .head-tools .period { flex: 1 1 100%; }
  .head-tools .period select { width: 100%; }
  .panel { padding: 18px 16px; }
  .ov { gap: 12px; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 16px; min-height: 132px; border-radius: 20px; }
  .kpi .v { font-size: 28px; }
  .kpi .foot > span:last-child { display: none; }
  .quota-tile { grid-column: 1 / -1; min-height: 0; }
  .kpi.odd-last { grid-column: 1 / -1; min-height: 0; }
  .quota-tile .foot > span:last-child { display: inline; }
  .top-row { grid-template-columns: 44px minmax(0, 1fr) auto; }
  .row-go { display: none; }
  .ev, .arow, .lt-row { padding: 12px; }
  .chart-total b { font-size: var(--fs-xl); }
  .bars { --h: 160px; gap: 5px; }
  .bars.dense { gap: 2px; }
  .today-count b { font-size: 24px; }
  .faces { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .top-row .thumb-sm { width: 44px; height: 55px; }
  .top-row .n b { font-size: var(--fs-xl); }
  .start { padding: 20px 16px; gap: 20px; }
  .start h2 { font-size: var(--fs-xl); }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .post { border-radius: var(--r-l); padding-bottom: 12px; }
  .post .state { inset-inline: 6px; bottom: 6px; padding: 6px 8px; font-size: var(--fs-s); }
  .post .state .n { display: none; }
  .post-body { padding: 0 10px; }
  .post .caption { font-size: var(--fs-m); }
  .filters { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .filters .q { grid-column: 1 / -1; }
  .steps button { flex: 0 0 auto; padding: 0 10px; }
  .steps button:not([aria-current="step"]) .lbl { display: none; }
  .steps button[aria-current="step"] { flex: 1 0 auto; }
  .step-panel { padding: 20px 16px; }
  .step-panel h2.q { font-size: var(--fs-xl); }
  .targets { grid-template-columns: minmax(0, 1fr); }
  .media-pick { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .mp .has { font-size: var(--fs-s); inset-inline: 4px; bottom: 4px; padding: 3px 4px; }
  .btn-edit .fields { grid-template-columns: minmax(0, 1fr); }
  .sum-row { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; }
  .sum-row .k { grid-column: 1 / -1; }
  .launch { grid-template-columns: minmax(0, 1fr); }
  .perf { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .perf div:nth-child(3) { border-inline-start: 0; }
  .perf div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .perf b { font-size: var(--fs-xl); }
  .step-foot .btn { flex: 1; }
  .step-foot .spacer { display: none; }
  .sheet { padding: 20px 16px; }
  .overlay { padding: 10px; align-items: end; }
  #toast { bottom: calc(92px + env(safe-area-inset-bottom)); }
  .login { padding: 10px; gap: 10px; }
  .login-art-panel { padding: 22px; min-height: 190px; }
  .login-art-panel blockquote { font-size: 23px; }
  .login-main { padding: 12px 8px 24px; }
  .login-card h1 { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .nav a:active .ic, .theme-btn:active, .theme-btn.labeled:active .ic { transform: none; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ---------- phase 2: notifications + AI ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.h-ic { display: inline-grid; vertical-align: -3px; margin-inline-end: 8px; color: var(--accent); }
.h-ic svg { width: 18px; height: 18px; }
.hint.fine { font-size: var(--fs-s); margin-top: 10px; }
.big-n { font-size: var(--fs-l); font-weight: 600; font-variant-numeric: tabular-nums; }

/* AI entry buttons in the editor */
.ai-btn svg { color: var(--accent); }
.btn.primary .ai-btn svg, .btn.primary svg { color: inherit; }
.ai-entry { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.ai-entry .hint { font-size: var(--fs-m); }
.ai-box { position: relative; margin-bottom: 18px; padding: 14px 16px 16px; border-radius: var(--r-l); background: linear-gradient(180deg, var(--accent-wash), transparent 70%), var(--surface-2); border: 1px solid var(--accent-line); }
.ai-box-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.ai-box-head b { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-m); font-weight: 600; }
.ai-box-head b svg { width: 16px; height: 16px; color: var(--accent); }
.ai-box textarea, .ai-box input { background: var(--surface); }
.ai-controls { justify-content: space-between; }
.ai-results { margin-top: 14px; display: flex; flex-direction: column; gap: 12px; }
.ai-part { padding: 12px; border-radius: var(--r-m); background: var(--surface); border: 1px solid var(--line); }
.ai-part-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.ai-part-head b { font-size: var(--fs-m); font-weight: 600; }
.ai-part textarea { min-height: 96px; }
.ai-replies .list-row { grid-template-columns: 28px minmax(0, 1fr); margin-bottom: 6px; }
.ai-replies .list-row input, .ai-part textarea, .ai-part input { background: var(--surface-2); }

/* keyword ideas */
.ai-kw { margin: 12px 0 4px; }
.ai-kw-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ai-kw-head .hint { font-size: var(--fs-m); }
.ai-kw-list { display: flex; flex-direction: column; gap: 8px; margin: 12px 0 8px; }
.ai-kw-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sug { display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 12px; border-radius: var(--r-pill); border: 1px dashed var(--line-3); background: transparent; color: var(--text-2); font-size: var(--fs-m); cursor: pointer; }
.sug:hover { background: var(--surface-2); color: var(--text); border-style: solid; }
.sug svg { width: 13px; height: 13px; }
.sug.sug-key { border-style: solid; border-color: var(--accent-line); color: var(--text); font-weight: 600; background: var(--accent-wash); }
.sug.have { border-style: solid; border-color: var(--line); color: var(--muted); cursor: default; }

/* notification channels */
.chan-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.chan-grid .opt-card { margin: 0; }
.chan-name { display: inline-flex; align-items: center; gap: 10px; }
.chan-ic { width: 28px; height: 28px; border-radius: var(--r-s); display: inline-grid; place-items: center; background: var(--surface-3); color: var(--text-2); flex: none; }
.chan-ic svg { width: 15px; height: 15px; }
.chan-ic.push { background: var(--accent-wash); color: var(--accent); }
.chan-ic.wa { background: rgb(37 211 102 / .12); color: #3ccf72; }
.chan.soon .opt-head b { color: var(--text-2); }
.chan.soon input { margin-top: 12px; max-width: 260px; }
.chan .row input { flex: 1; min-width: 180px; max-width: 260px; }
.notify-panel .kv select { min-height: 34px; padding-block: 0; width: auto; }

/* AI settings */
.ai-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.ai-grid textarea { min-height: 180px; }
.ai-log { display: flex; flex-direction: column; }
.ai-log-row { display: grid; grid-template-columns: 108px minmax(0, 1fr) auto auto; gap: 12px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); font-size: var(--fs-m); }
.ai-log-row p { margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bubble-ai { padding: 9px 12px; border-radius: var(--r-m); background: var(--accent-wash); border: 1px solid var(--accent-line); font-size: var(--fs-m); }
.trace .lbl svg { width: 14px; height: 14px; color: var(--accent); }
.ai-li { list-style: none; }

@media (max-width: 767px) {
  .chan-grid, .ai-grid { grid-template-columns: minmax(0, 1fr); }
  .ai-log-row { grid-template-columns: auto minmax(0, 1fr); }
  .ai-log-row > :nth-child(n+3) { display: none; }
  .ai-controls { flex-direction: column; align-items: stretch; }
  .ai-controls .btn { width: 100%; }
}

/* ---- circuit breaker banner (auto-pause on Meta restriction) ---- */
.alert.pause { align-items: flex-start; padding: 16px; }
.alert.pause .pause-body { flex: 1 1 320px; min-width: 0; }
.alert.pause p { margin: 0; }
.alert.pause .pause-title { font-size: var(--fs-m); line-height: 1.5; color: var(--text-2); }
.alert.pause .pause-title b { color: var(--text); font-weight: 600; }
.alert.pause .pause-title b::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--tone); margin-inline-end: 8px; vertical-align: 1px; }
.alert.pause .pause-meta { margin-top: 4px; font-size: var(--fs-s); color: var(--muted); word-break: break-word; }
.alert.pause .pause-meta.ltr { text-align: left; }
.alert.pause .pause-what { margin-top: 8px; font-size: var(--fs-m); }
.alert.pause .pause-what b { color: var(--text); }
.alert.pause .pause-steps { margin: 6px 0 0; padding-inline-start: 20px; font-size: var(--fs-m); line-height: 1.55; }
.alert.pause .pause-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-inline-start: auto; }
.alert.pause .pause-actions .btn { margin-inline-start: 0; }
.hint.bad-text { color: var(--bad); }
@media (max-width: 640px) { .alert.pause .pause-actions { width: 100%; } }

/* ---------- MCP v1: token expiry / quota banner, reliability strip, quota meter, AI connections ---------- */
.alert.soon { --tone: var(--hold); --tone-wash: var(--hold-wash); }
.panel.rel { display: flex; align-items: center; gap: 14px 28px; flex-wrap: wrap; padding: 14px 20px; }
.panel.rel .rel-ic { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-wash); color: var(--accent); flex: none; }
.panel.rel .rel-ic svg { width: 16px; height: 16px; }
.panel.rel .rel-item { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.panel.rel .rel-item p { margin: 0; font-size: var(--fs-m); color: var(--text-2); }
.panel.rel .rel-item b { color: var(--text); font-size: var(--fs-l); font-weight: 600; }
.panel.rel .rel-item .hint { font-size: var(--fs-s); }
.panel.rel.catchup .rel-item { flex: 1 1 260px; }
.panel.rel.catchup .rel-item p { font-size: var(--fs-m); }
.panel.rel.catchup .row { display: flex; gap: 8px; flex-wrap: wrap; }
.meter { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin-top: 8px; }
.meter > span { display: block; height: 100%; border-radius: inherit; background: var(--accent-fill); }
.mcp-conns { display: flex; flex-direction: column; }
.mcp-conn { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.mcp-conn:first-child { border-top: 0; padding-top: 4px; }
.mcp-conn b { font-weight: 600; }
.mcp-conn .tags { gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.chan-ic.ai { width: 32px; height: 32px; border-radius: var(--r-s); display: grid; place-items: center; background: var(--accent-wash); color: var(--accent); flex: none; }
.chan-ic.ai svg { width: 17px; height: 17px; }
.mcp-how { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.mcp-how > div { padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--surface-2); }
.mcp-how ol { margin: 6px 0 0; padding-inline-start: 18px; font-size: var(--fs-m); line-height: 1.6; color: var(--text-2); }
@media (max-width: 640px) { .mcp-how { grid-template-columns: minmax(0, 1fr); } .mcp-conn { flex-wrap: wrap; } }
.mcp-panel .dl-row { grid-template-columns: 110px minmax(0, 1.3fr) minmax(0, 1fr) auto; }
@media (max-width: 640px) { .mcp-panel .dl-row { grid-template-columns: auto minmax(0, 1fr) auto; } }

/* ---------- notification center: bell, popover, list (src/inbox.ts) ---------- */
.bell { position: relative; flex: none; }
.bell svg { width: 20px; height: 20px; }
.bell.has-new { --ic-du: var(--nav-du); }
.bell.has-new { color: var(--text); }
.bell-n { position: absolute; top: -5px; inset-inline-end: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad); color: #fff; font-size: var(--fs-xs); font-weight: 700; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums; box-shadow: 0 0 0 2px var(--bg); }
.bell-n[hidden] { display: none; }
.bell-pop { position: fixed; z-index: 60; max-height: min(560px, calc(100dvh - 90px)); display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-l); box-shadow: var(--shadow-pop); overflow: hidden; animation: pop-in var(--t-fast) var(--ease-out); }
@keyframes pop-in { from { opacity: 0; transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .bell-pop { animation: none; } }
.bell-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px 10px; border-bottom: 1px solid var(--line); }
.bell-head b { font-size: var(--fs-m); }
.bell-list { overflow-y: auto; overscroll-behavior: contain; padding: 4px 0; }
.bell-list .loading-line { padding: 12px 14px; }
.bell-empty { padding: 18px 16px; color: var(--muted); font-size: var(--fs-m); line-height: 1.55; }
.bell-all { display: block; padding: 11px 14px; border-top: 1px solid var(--line); text-align: center; font-size: var(--fs-m); font-weight: 550; color: var(--accent); text-decoration: none; }
.bell-all:hover { background: var(--surface-2); }

.ntf { display: grid; grid-template-columns: 32px minmax(0, 1fr) 10px; gap: 12px; align-items: start; width: 100%; text-align: start; padding: 12px 14px; border: 0; background: none; color: var(--text); cursor: pointer; font: inherit; border-radius: 0; }
.ntf:hover, .ntf:focus-visible { background: var(--surface-2); }
.ntf:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.ntf-ic { width: 32px; height: 32px; border-radius: var(--r-s); display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); }
.ntf-ic svg { width: 16px; height: 16px; }
.ntf.tone-good .ntf-ic { background: var(--accent-wash); color: var(--accent); }
.ntf.tone-warn .ntf-ic { background: var(--hold-wash); color: var(--hold); }
.ntf.tone-bad .ntf-ic { background: var(--bad-wash); color: var(--bad); }
.ntf-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ntf-title { font-size: var(--fs-m); font-weight: 560; line-height: 1.4; }
.ntf:not(.unread) .ntf-title { font-weight: 500; color: var(--text-2); }
.ntf-body { font-size: var(--fs-m); color: var(--muted); line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere; }
.ntf.compact .ntf-body { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: normal; }
.ntf-time { font-size: var(--fs-s); color: var(--muted); margin-top: 2px; }
.ntf-dot { width: 8px; height: 8px; margin-top: 8px; border-radius: 50%; background: var(--accent-fill); }
.ntf-panel { padding: 8px 0; }
.ntf-panel .ntf-tools { padding: 10px 16px 12px; border-bottom: 1px solid var(--line); }
.ntf-list .ntf + .ntf { border-top: 1px solid var(--line); }
.ntf-list .empty-block, .ntf-list .loading-line { padding: 22px 18px; }

/* settings: push devices + iOS hint */
.ios-hint { margin-top: 10px; padding: 12px 14px; border-radius: var(--r-m); background: var(--surface); border: 1px dashed var(--line-3); font-size: var(--fs-m); line-height: 1.55; }
.ios-hint ol { margin: 6px 0 4px; padding-inline-start: 20px; }
.devices { margin-top: 14px; }
.dev-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); font-size: var(--fs-m); }
.dev-row > span:first-child { flex: 1; min-width: 0; display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* quota banner: same weight as the auto-pause banner */
.alert.pause.quota .pause-meta b { color: var(--text); }
.alert.soon .btn { margin-inline-start: auto; }

.btn[hidden] { display: none !important; }

/* =====================================================================================================
   v8 unify — the overview's language on every page and flow.
   Warm canvas · borderless white cards (24) · inner soft rows/cards on --surface-2 (16) · inputs 12 ·
   pill controls · round icons · tinted stat tiles · no hairline dividers. Selectors only restyle; JS hooks unchanged.
   ===================================================================================================== */
:root { --panel-line: transparent; }
@media (min-width: 1440px) { :root { --gutter: 40px; } }

/* cards: no borders anywhere, one inner surface */
.fail, .sheet, .bell-pop, .chart-empty div { border: 0; }
.bell-pop { border-radius: var(--r-panel); }
.step-panel { padding: 28px; }
.opt-card, .tester, .launch, .result, .mcp-how > div, .btn-edit, .secret-box, .ios-hint, .code-block {
  border: 0; border-radius: var(--r-l); background: var(--surface-2);
}
.rewind, .ai-box { border: 0; }
.secret-box { background: var(--hold-wash); }
.code-tools { border-bottom: 0; background: transparent; }
.code-block pre { padding-top: 0; }
/* third level (inside an inner card) */
.ai-part, .trace .quote, .trace .tmpl, .examples .ex { border: 0; background: var(--surface); }
.opt-card input, .opt-card textarea, .opt-card select, .tester input, .launch input, .btn-edit input, .ai-box textarea, .ai-box input { background: var(--surface); }
.bubble-ai { border: 0; }

/* notices + banners: tinted, borderless, soft radius */
.notice { border: 0; border-radius: var(--r-l); }
.alert { border: 0; border-radius: var(--r-l); background: color-mix(in srgb, var(--tone-wash) 85%, var(--surface)); }

/* hairline rows → soft rounded rows */
.kv { border-top: 0; margin-top: 8px; padding: 12px 16px; border-radius: var(--r-l); background: var(--surface-2); }
.opt-card .kv, .launch .kv { background: var(--surface); }
.acct-card { padding: 12px 16px; border-radius: var(--r-l); background: var(--surface-2); }
.acct-card .av, .page-pick .av { border-radius: 50%; }
.sum { border-top: 0; gap: 8px; }
.sum-row { border-bottom: 0; padding: 12px 16px; border-radius: var(--r-l); background: var(--surface-2); }
.dl-row, .ai-log-row, .dev-row { border-top: 0; margin-top: 6px; padding: 10px 14px; border-radius: var(--r-m); background: var(--surface-2); }
.opt-card .dev-row { background: var(--surface); }
.mcp-conn { border-top: 0; margin-top: 8px; padding: 12px 16px; border-radius: var(--r-l); background: var(--surface-2); }
.mcp-conn:first-child { padding-top: 12px; margin-top: 0; }
.cs-list, .start ol { border-top: 0; display: flex; flex-direction: column; gap: 8px; }
.cs-list li, .start li { border-bottom: 0; padding: 12px 16px; border-radius: var(--r-l); background: var(--surface-2); align-items: center; }
.cs-list li::before, .start li::before { width: 24px; height: 24px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--accent-wash); font-size: var(--fs-s); }
.panel-foot { border-top: 0; padding-top: 0; }
.step-foot { border-top: 0; padding-top: 0; margin-top: 24px; }
details.help { border-top: 0; margin-top: 20px; padding: 14px 16px; border-radius: var(--r-l); background: var(--surface-2); }
details.help summary::before { border-radius: 50%; width: 24px; height: 24px; background: var(--surface); }
details.help .code-block { background: var(--surface); }
.pv-post, .dm-head { border-bottom: 0; }

/* perf strip in the editor → tinted stat tiles like the overview KPIs */
.perf { border: 0; gap: 12px; }
.perf div { padding: 16px; border-radius: var(--r-l); background: var(--tint-sage); }
.perf div + div { border-inline-start: 0; }
.perf div:nth-child(1) { background: var(--tint-petrol); }
.perf div:nth-child(3) { background: var(--tint-mist); }
.perf div:nth-child(4) { background: var(--tint-sand); }
.perf b { font-size: var(--fs-2xl); }
.perf span { color: var(--text-2); }

/* round icons */
.ntf-ic, .chan-ic, .chan-ic.ai, .target .ti { border-radius: 50%; }
.h-ic { width: 32px; height: 32px; border-radius: 50%; place-items: center; background: var(--accent-wash); vertical-align: middle; }
.h-ic svg { width: 16px; height: 16px; }

/* selectable cards: soft fill, accent ring when chosen */
.target, .page-pick { border-color: transparent; }
.target:hover, .page-pick:hover { border-color: transparent; background: var(--surface-3); }
.target[aria-pressed="true"], .page-pick[aria-checked="true"] { border-color: transparent; box-shadow: inset 0 0 0 2px var(--accent-fill); background: var(--accent-wash); }

/* chips, keyword tags, add buttons, segmented controls */
.kwt { border: 0; background: var(--surface); }
.panel > .kw .kwt, .sum-row .kwt { background: var(--surface); }
.chip { border-radius: var(--r-pill); box-shadow: none; }
.chip button { border-radius: 50%; }
.examples .ex { border-radius: var(--r-pill); }
.add { border: 0; background: var(--surface-2); color: var(--text); }
.add:hover { background: var(--surface-3); }
.lock-tag { box-shadow: none; }
.seg { border: 0; background: var(--surface-2); }
.seg-ind { background: var(--on-tint-btn); box-shadow: 0 1px 2px rgb(0 0 0 / .08); }
.seg:not(.has-ind) button[aria-pressed="true"] { background: var(--on-tint-btn); }
.toolbar .seg { background: var(--surface); }
.toolbar .seg .seg-ind, .toolbar .seg:not(.has-ind) button[aria-pressed="true"] { background: var(--surface-3); box-shadow: none; }
.steps button[aria-current="step"] { box-shadow: none; }

/* thumbnails + post cards */
.thumb-sm { border-radius: var(--r-m); box-shadow: none; }
.pick-strip button, .mp::after { box-shadow: none; }
.mp[aria-pressed="true"]::after { box-shadow: inset 0 0 0 3px var(--accent-fill); }
.post { border: 0; transition: transform var(--t-med) var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .post:hover { border-color: transparent; transform: translateY(-2px); } }
.post .state, .pick-strip .go, .mp .has { border-radius: var(--r-pill); }

/* toolbars sitting on the canvas (filters, search): white pill fields */
.filters input, .filters select { background-color: var(--surface); border-color: transparent; border-radius: var(--r-pill); min-height: var(--ctl-l); padding-inline-start: 18px; }
.filters input:hover, .filters select:hover { border-color: var(--line-2); }
.filters input:focus, .filters select:focus { border-color: var(--accent-fill); }
.copy code { border: 0; }

/* automations list: soft row · thumb on the start · switch + round chevron on the end */
.arow { grid-template-columns: minmax(0, 1fr) auto auto; }
.arow:hover { background: var(--surface-3); }
.arow .row-go { text-decoration: none; }
.arow .thumb-sm { width: 48px; height: 60px; }
.empty-note { max-width: 56ch; }

/* leads: soft rows · avatar + handle first · time + action last */
.lt-row { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr) 88px 36px; padding: 10px 16px; }
.lt-head { padding-block: 0 2px; }
.lt-who .av { width: 32px; height: 32px; font-size: var(--fs-xs); }
.lt-who b { font-weight: 580; overflow: hidden; text-overflow: ellipsis; }
.lt-when { text-align: end; }
.lt-row:not(.lt-head):hover { background: var(--surface-3); }

/* notifications: page list + bell panel = soft rows with round tone icons */
.ntf { grid-template-columns: 36px minmax(0, 1fr) 10px; border-radius: var(--r-l); padding: 12px 14px; }
.ntf-ic { width: 36px; height: 36px; }
.ntf:hover, .ntf:focus-visible { background: var(--surface-3); }
.ntf:focus-visible { outline-offset: 2px; }
.ntf-panel { padding: 20px; }
.ntf-panel .ntf-tools { padding: 0 0 16px; border-bottom: 0; }
.ntf-list { display: flex; flex-direction: column; gap: 8px; }
.ntf-list .ntf { background: var(--surface-2); }
.ntf-list .ntf + .ntf { border-top: 0; }
.ntf-list .empty-block, .ntf-list .loading-line { padding: 8px 4px; }
.bell-head { border-bottom: 0; padding: 16px 18px 8px; }
.bell-head b { font-size: var(--fs-l); font-weight: 600; }
.bell-list { padding: 0 8px; display: flex; flex-direction: column; gap: 4px; }
.bell-all { border-top: 0; margin: 8px; border-radius: var(--r-pill); background: var(--surface-2); padding: 10px 14px; }
.bell-all:hover { background: var(--surface-3); }

/* toast: dark pill */
#toast { border-radius: var(--r-pill); padding: 12px 20px; }

/* login: the form sits in a white card like every other surface */
.login-main { background: var(--surface); border-radius: var(--r-panel); padding: 32px; }
.login-art-panel { border: 0; }
.login-links { border-top: 0; padding-top: 0; }

/* dark: inner surfaces on the card */
:root[data-theme="dark"] .kwt, :root[data-theme="dark"] .examples .ex { background: var(--surface-3); }
@media (prefers-color-scheme: dark) { :root[data-theme="system"] .kwt, :root[data-theme="system"] .examples .ex { background: var(--surface-3); } }

@media (max-width: 767px) {
  .perf div:nth-child(n+3) { border-top: 0; }
  .perf b { font-size: var(--fs-xl); }
  .lt-row { grid-template-columns: minmax(0, 1fr) auto; padding: 12px; }
  .lt-row.lt-head { display: none; }
  .arow { grid-template-columns: minmax(0, 1fr) auto; }
  .arow .row-go { display: none; }
  .login-main { padding: 24px 16px; }
  .ntf-panel { padding: 16px 12px; }
  .step-panel { padding: 20px 16px; }
}
[dir="rtl"] .lt-mail, [dir="rtl"] .lt-phone { text-align: right; }
