/* ============================================================
   MAILEMENT — STYLES
   Single source of truth. Light + dark via [data-theme] on <html>.
   ============================================================ */

/* ---------- TOKENS ---------- */
:root {
  /* Light theme defaults — light-gray app surface, white cards */
  --bg:           #eef0f2;
  --bg-alt:       #e4e7ea;
  --surface:      #ffffff;
  --surface-2:    #f6f7f8;
  --surface-hover:#f0f2f4;
  --border:       #d8dcdf;
  --border-soft:  #e4e7ea;
  --border-strong:#c2c7cb;

  --text:         #1f2225;
  --text-strong:  #111316;
  --text-muted:   #6b7177;
  --text-subtle:  #9aa0a6;
  --text-on-fill: #ffffff;

  --primary:        #111316;
  --primary-hover:  #1f2225;
  --primary-active: #08090b;
  --primary-fg:     #ffffff;

  --danger:        oklch(58% 0.19 25);
  --danger-hover:  oklch(52% 0.20 25);
  --danger-soft:   oklch(96% 0.03 25);
  --danger-border: oklch(86% 0.07 25);
  --danger-fg:     #ffffff;

  --link:          oklch(48% 0.14 252);

  /* Status pills — pairs of fg/bg/border per status */
  --st-draft-fg:        #4d5358;
  --st-draft-bg:        #eef0f2;
  --st-draft-bd:        #d8dcdf;
  --st-scheduled-fg:    oklch(45% 0.10 260);
  --st-scheduled-bg:    oklch(96% 0.02 260);
  --st-scheduled-bd:    oklch(88% 0.05 260);
  --st-sending-fg:      oklch(48% 0.12 70);
  --st-sending-bg:      oklch(96% 0.04 80);
  --st-sending-bd:      oklch(86% 0.10 75);
  --st-sent-fg:         oklch(45% 0.11 155);
  --st-sent-bg:         oklch(96% 0.03 155);
  --st-sent-bd:         oklch(86% 0.08 155);
  --st-bounced-fg:      oklch(50% 0.18 25);
  --st-bounced-bg:      oklch(96% 0.03 25);
  --st-bounced-bd:      oklch(88% 0.07 25);
  --st-unsub-fg:        #6b7177;
  --st-unsub-bg:        #f6f7f8;
  --st-unsub-bd:        #d8dcdf;
  --st-pending-fg:      oklch(50% 0.12 50);
  --st-pending-bg:      oklch(96% 0.03 60);
  --st-pending-bd:      oklch(88% 0.07 55);
  --st-confirmed-fg:    oklch(45% 0.11 155);
  --st-confirmed-bg:    oklch(96% 0.03 155);
  --st-confirmed-bd:    oklch(86% 0.08 155);

  --ring:        0 0 0 3px oklch(80% 0.10 250 / 0.40);
  --ring-danger: 0 0 0 3px oklch(75% 0.15 25 / 0.35);

  --sh-1: 0 1px 0 0 rgb(0 0 0 / 0.02), 0 1px 2px 0 rgb(0 0 0 / 0.04);
  --sh-2: 0 1px 2px 0 rgb(0 0 0 / 0.04), 0 4px 12px -2px rgb(0 0 0 / 0.06);
  --sh-3: 0 8px 24px -6px rgb(0 0 0 / 0.10), 0 2px 6px -1px rgb(0 0 0 / 0.06);
  --sh-modal: 0 24px 64px -12px rgb(0 0 0 / 0.18), 0 8px 16px -6px rgb(0 0 0 / 0.10);

  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
  --s-5: 20px; --s-6: 24px; --s-8: 32px; --s-10: 40px;
  --s-12: 48px;--s-16: 64px;--s-20: 80px;

  --r-xs: 4px; --r-sm: 6px; --r-md: 8px; --r-lg: 12px; --r-pill: 999px;

  --font-sans: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'Geist Mono', ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;

  --sidebar-w: 240px;
  --brand: #6b5cf6;
}

/* ---------- DARK THEME ---------- */
[data-theme="dark"] {
  --bg:           #0c0d10;
  --bg-alt:       #08090b;
  --surface:      #16181c;
  --surface-2:    #1b1e22;
  --surface-hover:#1f2227;
  --border:       #2a2d33;
  --border-soft:  #22252a;
  --border-strong:#3a3e44;

  --text:         #d6d9dd;
  --text-strong:  #f4f6f8;
  --text-muted:   #8a9097;
  --text-subtle:  #5b6168;

  --primary:        #f4f6f8;
  --primary-hover:  #ffffff;
  --primary-active: #d6d9dd;
  --primary-fg:     #0c0d10;

  --danger:        oklch(64% 0.20 25);
  --danger-hover:  oklch(70% 0.21 25);
  --danger-soft:   oklch(28% 0.07 25);
  --danger-border: oklch(38% 0.12 25);

  --link:          oklch(72% 0.14 252);

  --st-draft-fg:        #b5bac0;
  --st-draft-bg:        #1f2227;
  --st-draft-bd:        #2a2d33;
  --st-scheduled-fg:    oklch(78% 0.09 260);
  --st-scheduled-bg:    oklch(28% 0.05 260);
  --st-scheduled-bd:    oklch(38% 0.07 260);
  --st-sending-fg:      oklch(80% 0.11 75);
  --st-sending-bg:      oklch(30% 0.07 75);
  --st-sending-bd:      oklch(42% 0.10 75);
  --st-sent-fg:         oklch(78% 0.12 155);
  --st-sent-bg:         oklch(28% 0.06 155);
  --st-sent-bd:         oklch(38% 0.09 155);
  --st-bounced-fg:      oklch(76% 0.16 25);
  --st-bounced-bg:      oklch(28% 0.07 25);
  --st-bounced-bd:      oklch(40% 0.12 25);
  --st-unsub-fg:        #8a9097;
  --st-unsub-bg:        #1b1e22;
  --st-unsub-bd:        #2a2d33;
  --st-pending-fg:      oklch(78% 0.12 55);
  --st-pending-bg:      oklch(28% 0.06 55);
  --st-pending-bd:      oklch(40% 0.10 55);
  --st-confirmed-fg:    oklch(78% 0.12 155);
  --st-confirmed-bg:    oklch(28% 0.06 155);
  --st-confirmed-bd:    oklch(38% 0.09 155);

  --ring:        0 0 0 3px oklch(60% 0.12 250 / 0.50);
  --ring-danger: 0 0 0 3px oklch(60% 0.18 25 / 0.45);

  --sh-1: 0 1px 0 0 rgb(0 0 0 / 0.40), 0 1px 2px 0 rgb(0 0 0 / 0.30);
  --sh-2: 0 1px 2px 0 rgb(0 0 0 / 0.40), 0 4px 12px -2px rgb(0 0 0 / 0.40);
  --sh-3: 0 8px 24px -6px rgb(0 0 0 / 0.55), 0 2px 6px -1px rgb(0 0 0 / 0.45);
  --sh-modal: 0 24px 64px -12px rgb(0 0 0 / 0.70), 0 8px 16px -6px rgb(0 0 0 / 0.55);

  color-scheme: dark;
}

/* ---------- BASE ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { background: var(--bg); }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'cv11', 'ss01';
  min-height: 100vh;
}
::selection { background: oklch(75% 0.12 250 / 0.4); }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; }
input, textarea, select { font-family: inherit; color: inherit; }

h1, h2, h3, h4 { margin: 0; color: var(--text-strong); font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 24px; line-height: 1.2; letter-spacing: -0.02em; }
h2 { font-size: 18px; line-height: 1.3; }
h3 { font-size: 15px; line-height: 1.35; }
p  { margin: 0; }

/* t-mono used to be Geist Mono; now sans w/ tabular numerals so URLs, emails,
   slugs, and tokens feel like data, not terminal output. */
.t-mono  { font-family: var(--font-sans); font-variant-numeric: tabular-nums; letter-spacing: 0; }
/* t-cap is a small label — sans, tracked, slightly bolder. No more terminal vibes. */
.t-cap   { font-family: var(--font-sans); font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; }
.t-muted { color: var(--text-muted); }
.t-subtle{ color: var(--text-subtle); }
.t-small { font-size: 13px; }

.kbd {
  display: inline-block;
  font-family: var(--font-mono); font-size: 11px;
  color: var(--text-muted); background: var(--surface);
  border: 1px solid var(--border); border-bottom-width: 2px;
  border-radius: 4px; padding: 1px 5px; line-height: 1;
}

/* ---------- APP LAYOUT ---------- */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
  position: relative;
}
.app::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--brand);
  z-index: 100;
  transition: background 200ms ease;
}
.app[data-no-chrome] { grid-template-columns: 1fr; }
.app[data-no-chrome]::before { display: none; }

/* ---------- SITE HEADER (global, sits above app shell) ---------- */
:root { --site-header-h: 56px; --site-footer-h: 64px; }
.site-header {
  height: var(--site-header-h);
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-4);
  padding: 0 var(--s-6);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 1px 0 0 rgb(0 0 0 / 0.02);
}
.site-header .sh-left, .site-header .sh-right { display: flex; align-items: center; gap: var(--s-2); }
.site-header .sh-logo {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--text-strong); text-decoration: none;
  padding: 4px 8px; border-radius: var(--r-sm);
  transition: background 80ms ease;
}
.site-header .sh-logo:hover { background: var(--surface-hover); }
.site-header .sh-logo-img { height: 24px; width: auto; display: block; }

/* Theme-aware logo swap: normal logo on light bg, white logo on dark bg.
   !important so it wins over more specific rules like .site-header .sh-logo-img. */
.brand-swap-light { display: block !important; }
.brand-swap-dark  { display: none !important; }
[data-theme="dark"] .brand-swap-light { display: none !important; }
[data-theme="dark"] .brand-swap-dark  { display: block !important; }
.site-header .sh-mark {
  width: 26px; height: 26px; border-radius: 7px;
  display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 13px;
  background: linear-gradient(135deg, oklch(62% 0.18 280), oklch(58% 0.20 320));
  box-shadow: inset 0 -1px 0 0 rgb(0 0 0 / 0.18), 0 1px 2px rgb(0 0 0 / 0.10);
  letter-spacing: -0.02em;
}
.site-header .sh-word {
  font-size: 14px; font-weight: 600; color: var(--text-strong);
  letter-spacing: -0.01em;
}
.site-header .sh-word .accent { color: oklch(58% 0.20 320); }

/* MAILEMENT wordmark — used in site header, footer, and login. */
.wordmark {
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  display: inline-flex; align-items: baseline; gap: 0;
  font-feature-settings: "ss01";
}
.wordmark .mail { color: var(--text-strong); }
.wordmark .ment {
  background: linear-gradient(135deg, oklch(62% 0.18 280), oklch(58% 0.20 320));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.site-header .wordmark { font-size: 14px; }
.site-footer .wordmark { font-size: 12px; }
.site-header .sh-link {
  font-size: 13px; color: var(--text-muted); font-weight: 500;
  padding: 6px 10px; border-radius: var(--r-sm); text-decoration: none;
}
.site-header .sh-link:hover { color: var(--text-strong); background: var(--surface-hover); text-decoration: none; }
.site-header .sh-link[aria-current="page"] { color: var(--text-strong); background: var(--surface-hover); }
.site-header .sh-divider { width: 1px; height: 18px; background: var(--border); margin: 0 4px; }

/* ---------- SITE FOOTER ---------- */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: var(--s-5) var(--s-6);
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-4);
  font-size: 12px; color: var(--text-muted);
}
.site-footer .sf-left { display: flex; align-items: center; gap: var(--s-3); }
.site-footer .sf-mark {
  width: 22px; height: 22px; border-radius: 6px;
  display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: 11px;
  background: linear-gradient(135deg, oklch(62% 0.18 280), oklch(58% 0.20 320));
  letter-spacing: -0.02em;
}
.site-footer .sf-logo-img { height: 20px; width: auto; display: block; }
.site-footer .sf-copy { color: var(--text-muted); }
.site-footer .sf-links { display: flex; align-items: center; gap: var(--s-1); }
.site-footer .sf-links a { color: var(--text-muted); padding: 4px 10px; border-radius: var(--r-sm); }
.site-footer .sf-links a:hover { color: var(--text-strong); background: var(--surface-hover); text-decoration: none; }
.site-footer .sf-dot { color: var(--text-subtle); }

/* hide global chrome on login page */
body[data-route="/login"] .site-header,
body[data-route="/login"] .site-footer { display: none; }

/* ---------- LANDING (ABOUT) & LEGAL (TERMS/PRIVACY) PAGES ---------- */

/* These three routes are "marketing" pages — hide the app sidebar + topbar
   so they render full-width inside the site-header / site-footer chrome. */
body[data-route="/about"] .sidebar,
body[data-route="/about"] .topbar,
body[data-route="/terms"] .sidebar,
body[data-route="/terms"] .topbar,
body[data-route="/privacy"] .sidebar,
body[data-route="/privacy"] .topbar { display: none; }
body[data-route="/about"] .app,
body[data-route="/terms"] .app,
body[data-route="/privacy"] .app { grid-template-columns: 1fr; }
body[data-route="/about"] .app::before,
body[data-route="/terms"] .app::before,
body[data-route="/privacy"] .app::before { display: none; }
body[data-route="/about"] .page-content,
body[data-route="/terms"] .page-content,
body[data-route="/privacy"] .page-content { padding: 0; gap: 0; }

/* --- shared landing tokens --- */
:root {
  --lp-grad: linear-gradient(135deg, oklch(62% 0.18 280), oklch(58% 0.20 320));
  --lp-grad-soft: linear-gradient(180deg, oklch(98% 0.02 320 / 1), oklch(99% 0.005 320 / 1));
  --lp-ink: #0f1115;
  --lp-ink-soft: #4a5159;
}
[data-theme="dark"] {
  --lp-grad-soft: linear-gradient(180deg, oklch(15% 0.04 320 / 1), oklch(10% 0.01 320 / 1));
  --lp-ink: #f4f6f8;
  --lp-ink-soft: #a8aeb5;
}

.lp-section { padding: var(--s-16) var(--s-6); }
.lp-container { max-width: 1120px; margin: 0 auto; width: 100%; }
.lp-eyebrow {
  font-size: 12px; font-weight: 600; letter-spacing: 0.10em; text-transform: uppercase;
  color: oklch(50% 0.18 320);
  display: inline-flex; align-items: center; gap: 8px;
}
[data-theme="dark"] .lp-eyebrow { color: oklch(78% 0.14 320); }
.lp-eyebrow::before {
  content: ''; display: inline-block;
  width: 18px; height: 1.5px; background: currentColor; border-radius: 2px;
}

/* --- HERO --- */
.lp-hero {
  position: relative;
  padding: var(--s-20) var(--s-6) var(--s-16);
  background: var(--lp-grad-soft);
  overflow: hidden;
}
.lp-hero::before {
  content: '';
  position: absolute; inset: -200px -200px auto auto;
  width: 700px; height: 700px;
  background: radial-gradient(circle at 30% 30%, oklch(75% 0.18 320 / 0.18), transparent 60%);
  filter: blur(40px);
  pointer-events: none;
}
.lp-hero::after {
  content: '';
  position: absolute; left: -200px; bottom: -300px;
  width: 600px; height: 600px;
  background: radial-gradient(circle, oklch(75% 0.18 250 / 0.14), transparent 60%);
  filter: blur(40px);
  pointer-events: none;
}
.lp-hero-grid {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: var(--s-12); align-items: center;
  max-width: 1120px; margin: 0 auto;
}
.lp-hero-copy { display: flex; flex-direction: column; gap: var(--s-5); }
.lp-hero h1 {
  font-size: clamp(40px, 5.5vw, 64px);
  line-height: 1.04; letter-spacing: -0.035em;
  color: var(--lp-ink);
  font-weight: 600;
  text-wrap: balance;
}
.lp-hero h1 .grad {
  background: var(--lp-grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lp-hero .lp-sub {
  font-size: 18px; line-height: 1.55; color: var(--lp-ink-soft);
  max-width: 50ch;
}
.lp-cta-row { display: flex; gap: var(--s-3); flex-wrap: wrap; align-items: center; }
.btn-lp-primary {
  background: var(--lp-ink); color: var(--bg);
  border: 0; padding: 0 22px; height: 48px;
  border-radius: var(--r-sm); font-size: 15px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  text-decoration: none;
  box-shadow: 0 4px 12px -2px rgb(0 0 0 / 0.15);
  transition: transform 80ms ease, box-shadow 80ms ease;
}
.btn-lp-primary:hover { transform: translateY(-1px); box-shadow: 0 8px 16px -4px rgb(0 0 0 / 0.20); text-decoration: none; }
.btn-lp-secondary {
  background: transparent; color: var(--lp-ink);
  border: 1px solid var(--border-strong); padding: 0 18px; height: 48px;
  border-radius: var(--r-sm); font-size: 15px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer; text-decoration: none;
}
.btn-lp-secondary:hover { background: var(--surface-hover); text-decoration: none; }
.lp-trust { display: flex; align-items: center; gap: var(--s-3); font-size: 13px; color: var(--lp-ink-soft); }
.lp-trust .avs { display: flex; }
.lp-trust .av {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid var(--bg);
  background: var(--lp-grad);
  display: grid; place-items: center; color: #fff; font-size: 11px; font-weight: 600;
}
.lp-trust .av + .av { margin-left: -8px; }
.lp-trust .av:nth-child(2) { background: linear-gradient(135deg, oklch(62% 0.16 60), oklch(58% 0.18 30)); }
.lp-trust .av:nth-child(3) { background: linear-gradient(135deg, oklch(62% 0.14 160), oklch(58% 0.16 200)); }
.lp-trust .av:nth-child(4) { background: linear-gradient(135deg, oklch(62% 0.15 240), oklch(58% 0.17 260)); }

/* hero visual — stylized inbox / email preview */
.lp-hero-visual {
  position: relative;
  height: 460px;
  display: flex; align-items: center; justify-content: center;
}
.lp-inbox {
  position: absolute;
  width: 100%; max-width: 480px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 24px 64px -16px rgb(0 0 0 / 0.20), 0 8px 16px -8px rgb(0 0 0 / 0.12);
  overflow: hidden;
  transform: rotate(-2deg);
  transition: transform 200ms ease;
}
.lp-inbox:hover { transform: rotate(-1deg) translateY(-2px); }
.lp-inbox-bar { display: flex; align-items: center; gap: 6px; padding: 12px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border-soft); }
.lp-inbox-bar .d { width: 10px; height: 10px; border-radius: 50%; }
.lp-inbox-bar .d:nth-child(1) { background: #ef6a5a; }
.lp-inbox-bar .d:nth-child(2) { background: #f3bd4f; }
.lp-inbox-bar .d:nth-child(3) { background: #5fc56e; }
.lp-inbox-bar .t { margin-left: 12px; font-size: 11px; color: var(--text-muted); }
.lp-inbox-body { padding: 22px 26px; }
.lp-inbox-from { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.lp-inbox-from .av {
  width: 36px; height: 36px; border-radius: 8px; background: var(--lp-grad);
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 14px;
}
.lp-inbox-from .who .nm { font-size: 13px; font-weight: 600; color: var(--text-strong); }
.lp-inbox-from .who .meta { font-size: 11px; color: var(--text-muted); }
.lp-inbox-body h3 { font-size: 22px; letter-spacing: -0.02em; line-height: 1.2; margin-bottom: 8px; color: var(--text-strong); }
.lp-inbox-body p { font-size: 13px; line-height: 1.6; color: var(--text-muted); margin-bottom: 10px; }
.lp-inbox-cta { display: inline-block; margin-top: 8px; padding: 8px 14px; background: var(--lp-ink); color: var(--bg); border-radius: 6px; font-size: 12px; font-weight: 500; }

.lp-card-stats {
  position: absolute;
  bottom: 20px; left: -10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
  box-shadow: 0 16px 36px -8px rgb(0 0 0 / 0.18);
  transform: rotate(3deg);
  display: flex; flex-direction: column; gap: 4px;
  min-width: 180px;
}
.lp-card-stats .lbl { font-size: 11px; color: var(--text-muted); }
.lp-card-stats .val { font-size: 28px; font-weight: 600; color: var(--text-strong); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.lp-card-stats .chg { font-size: 11px; color: oklch(50% 0.16 155); font-weight: 600; }
.lp-card-stats .spark { display: flex; align-items: flex-end; gap: 3px; height: 24px; margin-top: 4px; }
.lp-card-stats .spark span { flex: 1; background: var(--lp-grad); border-radius: 2px; opacity: 0.7; }

.lp-card-tag {
  position: absolute;
  top: 30px; right: -10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  padding: 8px 14px;
  font-size: 12px; color: var(--text-strong); font-weight: 500;
  box-shadow: 0 8px 20px -4px rgb(0 0 0 / 0.14);
  display: flex; align-items: center; gap: 6px;
  transform: rotate(4deg);
}
.lp-card-tag .dot { width: 8px; height: 8px; border-radius: 50%; background: oklch(60% 0.18 155); box-shadow: 0 0 0 3px oklch(60% 0.18 155 / 0.20); }

/* --- LOGO STRIP --- */
.lp-strip {
  padding: var(--s-8) var(--s-6);
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  background: var(--surface);
}
.lp-strip-inner {
  max-width: 1120px; margin: 0 auto;
  display: flex; align-items: center; justify-content: center;
  gap: var(--s-10); flex-wrap: wrap;
}
.lp-strip-label { font-size: 12px; color: var(--text-muted); font-weight: 500; letter-spacing: 0.04em; }
.lp-strip-logo { font-size: 16px; color: var(--text-subtle); font-weight: 600; letter-spacing: -0.02em; opacity: 0.7; }
.lp-strip-logo.serif { font-family: ui-serif, Georgia, 'Times New Roman', serif; font-style: italic; }
.lp-strip-logo.caps { text-transform: uppercase; letter-spacing: 0.18em; font-size: 12px; }
.lp-strip-logo.bold { font-weight: 800; letter-spacing: -0.04em; }

/* --- FEATURE BLOCKS --- */
.lp-feature {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-12);
  align-items: center;
  max-width: 1120px; margin: 0 auto;
}
.lp-feature.reverse { direction: rtl; }
.lp-feature.reverse > * { direction: ltr; }
.lp-feature-copy { display: flex; flex-direction: column; gap: var(--s-3); }
.lp-feature-copy h2 {
  font-size: clamp(28px, 3vw, 38px);
  letter-spacing: -0.025em; line-height: 1.12;
  color: var(--lp-ink); font-weight: 600;
  text-wrap: balance;
}
.lp-feature-copy p { font-size: 16px; line-height: 1.6; color: var(--lp-ink-soft); max-width: 50ch; }
.lp-feature-list { display: flex; flex-direction: column; gap: var(--s-2); margin-top: var(--s-2); }
.lp-feature-list li { display: flex; gap: 10px; font-size: 14px; color: var(--lp-ink); }
.lp-feature-list .ck {
  flex-shrink: 0; width: 18px; height: 18px; border-radius: 50%;
  background: oklch(94% 0.07 320); color: oklch(48% 0.18 320);
  display: grid; place-items: center;
}
[data-theme="dark"] .lp-feature-list .ck { background: oklch(28% 0.08 320); color: oklch(82% 0.12 320); }

/* feature illustration tiles */
.lp-illus {
  aspect-ratio: 4 / 3;
  border-radius: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: var(--s-6);
  box-shadow: 0 16px 40px -12px rgb(0 0 0 / 0.12);
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: var(--s-3);
}
.lp-illus.tint { background: var(--lp-grad-soft); }
.lp-illus .brand-tile {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--r-sm);
}
.lp-illus .brand-tile.active { border-color: var(--text-strong); box-shadow: 0 0 0 2px oklch(58% 0.20 320 / 0.30); }
.lp-illus .brand-tile .chip { width: 22px; height: 22px; border-radius: 5px; flex-shrink: 0; }
.lp-illus .brand-tile .nm { font-size: 13px; font-weight: 500; color: var(--text-strong); }
.lp-illus .brand-tile .dom { font-size: 11px; color: var(--text-muted); }
.lp-illus .brand-tile .meta { display: flex; flex-direction: column; gap: 1px; flex: 1; min-width: 0; }

.lp-illus.editor { padding: 0; }
.lp-illus.editor .ed-toolbar {
  display: flex; align-items: center; gap: 6px; padding: 10px 14px;
  background: var(--surface-2); border-bottom: 1px solid var(--border-soft);
}
.lp-illus.editor .ed-pill { padding: 3px 8px; border-radius: var(--r-pill); background: var(--surface); border: 1px solid var(--border-soft); font-size: 11px; color: var(--text-muted); }
.lp-illus.editor .ed-pill.on { background: var(--lp-ink); color: var(--bg); border-color: var(--lp-ink); }
.lp-illus.editor .ed-body { padding: var(--s-4); display: flex; flex-direction: column; gap: 10px; }
.lp-illus.editor .ed-block {
  padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: var(--r-sm);
  font-size: 11px; color: var(--text-muted); display: flex; align-items: center; gap: 8px;
}
.lp-illus.editor .ed-block.selected { background: oklch(96% 0.03 320); border-color: oklch(58% 0.20 320); }
[data-theme="dark"] .lp-illus.editor .ed-block.selected { background: oklch(25% 0.06 320); }
.lp-illus.editor .ed-block .ic { width: 16px; height: 16px; border-radius: 4px; background: var(--lp-grad); flex-shrink: 0; }
.lp-illus.editor .ed-block .lines { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.lp-illus.editor .ed-block .ln { height: 5px; background: var(--border); border-radius: 2px; }
.lp-illus.editor .ed-block .ln.s { width: 60%; }
.lp-illus.editor .ed-block .ln.m { width: 85%; }

.lp-illus.metrics .mm-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); }
.lp-illus.metrics .mm-tile { padding: var(--s-3); background: var(--surface-2); border-radius: var(--r-sm); display: flex; flex-direction: column; gap: 2px; }
.lp-illus.metrics .mm-tile .lbl { font-size: 11px; color: var(--text-muted); }
.lp-illus.metrics .mm-tile .val { font-size: 22px; font-weight: 600; color: var(--text-strong); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.lp-illus.metrics .mm-tile .chg { font-size: 11px; font-weight: 600; color: oklch(50% 0.16 155); }
.lp-illus.metrics .mm-tile .chg.down { color: oklch(56% 0.18 25); }
.lp-illus.metrics .chart {
  margin-top: var(--s-3);
  height: 100px;
  background:
    linear-gradient(180deg, oklch(58% 0.20 320 / 0.12), transparent 70%);
  border-radius: var(--r-sm);
  position: relative; overflow: hidden;
}
.lp-illus.metrics .chart svg { width: 100%; height: 100%; }

/* --- STATS --- */
.lp-stats {
  background: var(--lp-ink); color: var(--bg);
  padding: var(--s-12) var(--s-6);
}
[data-theme="dark"] .lp-stats { background: oklch(20% 0.02 280); }
.lp-stats-inner {
  max-width: 1120px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-6);
}
.lp-stat { display: flex; flex-direction: column; gap: 6px; }
.lp-stat .num {
  font-size: clamp(36px, 4vw, 52px);
  font-weight: 600; letter-spacing: -0.03em; line-height: 1;
  font-variant-numeric: tabular-nums;
  background: var(--lp-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lp-stat .lbl { font-size: 13px; color: oklch(85% 0.01 320 / 0.7); line-height: 1.4; }

/* --- TESTIMONIAL --- */
.lp-quote {
  max-width: 880px; margin: 0 auto;
  text-align: center;
  display: flex; flex-direction: column; gap: var(--s-5); align-items: center;
}
.lp-quote blockquote {
  font-size: clamp(22px, 2.4vw, 32px);
  line-height: 1.35; letter-spacing: -0.015em;
  color: var(--lp-ink); font-weight: 500;
  margin: 0; text-wrap: balance;
}
.lp-quote blockquote::before { content: '\201C'; color: oklch(58% 0.20 320); margin-right: 4px; }
.lp-quote blockquote::after { content: '\201D'; color: oklch(58% 0.20 320); margin-left: 4px; }
.lp-quote-by { display: flex; align-items: center; gap: 12px; }
.lp-quote-by .av {
  width: 44px; height: 44px; border-radius: 50%; background: var(--lp-grad);
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 16px;
}
.lp-quote-by .who { text-align: left; }
.lp-quote-by .who .nm { font-size: 14px; font-weight: 600; color: var(--lp-ink); }
.lp-quote-by .who .role { font-size: 12px; color: var(--lp-ink-soft); }

/* --- FINAL CTA --- */
.lp-cta {
  margin: 0 var(--s-6) var(--s-16);
  max-width: 1120px;
  margin-left: auto; margin-right: auto;
  background: var(--lp-grad);
  border-radius: 24px;
  padding: var(--s-12) var(--s-10);
  color: #fff;
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-6);
  position: relative; overflow: hidden;
}
.lp-cta::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 80% 20%, rgb(255 255 255 / 0.20), transparent 50%);
  pointer-events: none;
}
.lp-cta-text { position: relative; }
.lp-cta-text h2 {
  font-size: clamp(28px, 3vw, 40px); color: #fff;
  letter-spacing: -0.025em; line-height: 1.1; font-weight: 600;
  margin-bottom: 8px;
}
.lp-cta-text p { font-size: 16px; color: rgb(255 255 255 / 0.85); max-width: 50ch; }
.lp-cta-actions { position: relative; display: flex; gap: var(--s-2); flex-wrap: wrap; }
.btn-lp-white {
  background: #fff; color: var(--lp-ink);
  border: 0; padding: 0 22px; height: 48px;
  border-radius: var(--r-sm); font-size: 15px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer; text-decoration: none;
}
.btn-lp-white:hover { background: oklch(96% 0.005 280); text-decoration: none; }
.btn-lp-ghost {
  background: transparent; color: #fff;
  border: 1px solid rgb(255 255 255 / 0.40); padding: 0 18px; height: 48px;
  border-radius: var(--r-sm); font-size: 15px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer; text-decoration: none;
}
.btn-lp-ghost:hover { background: rgb(255 255 255 / 0.10); text-decoration: none; }

/* responsive */
@media (max-width: 880px) {
  .lp-hero-grid { grid-template-columns: 1fr; }
  .lp-hero-visual { height: 380px; }
  .lp-feature { grid-template-columns: 1fr; gap: var(--s-6); }
  .lp-stats-inner { grid-template-columns: repeat(2, 1fr); }
  .lp-cta { flex-direction: column; align-items: flex-start; padding: var(--s-8); }
}

/* ============================================================ LEGAL DOC LAYOUT (Terms / Privacy) ============================================================ */
.legal-wrap {
  display: grid; grid-template-columns: 220px minmax(0, 1fr);
  gap: var(--s-10);
  max-width: 1040px; margin: 0 auto;
  padding: var(--s-12) var(--s-6) var(--s-16);
  align-items: flex-start;
}
.legal-toc {
  position: sticky; top: calc(var(--site-header-h) + var(--s-6));
  font-size: 13px;
  display: flex; flex-direction: column; gap: var(--s-3);
}
.legal-toc .toc-label {
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-muted);
  padding-bottom: var(--s-2);
  border-bottom: 1px solid var(--border);
}
.legal-toc ol { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.legal-toc ol li a {
  display: flex; gap: 8px; align-items: baseline;
  padding: 6px 10px; border-radius: var(--r-sm);
  color: var(--text-muted); text-decoration: none;
  border-left: 2px solid transparent;
}
.legal-toc ol li a:hover { color: var(--text-strong); background: var(--surface-hover); text-decoration: none; }
.legal-toc ol li a .n { font-variant-numeric: tabular-nums; color: var(--text-subtle); min-width: 18px; }

.legal-doc { max-width: 720px; }
.legal-doc header { padding-bottom: var(--s-6); border-bottom: 1px solid var(--border); margin-bottom: var(--s-8); }
.legal-doc .legal-eyebrow {
  font-size: 12px; font-weight: 600; letter-spacing: 0.10em; text-transform: uppercase;
  color: oklch(50% 0.18 320);
}
[data-theme="dark"] .legal-doc .legal-eyebrow { color: oklch(78% 0.14 320); }
.legal-doc h1 {
  font-size: clamp(34px, 3.5vw, 44px);
  letter-spacing: -0.025em; line-height: 1.1;
  margin-top: 8px; color: var(--lp-ink); font-weight: 600;
}
.legal-doc .legal-meta {
  display: flex; gap: var(--s-4); margin-top: var(--s-3);
  font-size: 13px; color: var(--text-muted);
}
.legal-doc .legal-meta span { display: inline-flex; gap: 6px; align-items: center; }
.legal-doc .legal-meta strong { color: var(--text-strong); font-weight: 500; }

.legal-doc .legal-intro {
  background: var(--surface-2); border: 1px solid var(--border-soft);
  border-radius: var(--r-md); padding: var(--s-4) var(--s-5);
  font-size: 14px; color: var(--text); line-height: 1.6;
  margin-bottom: var(--s-8);
  border-left: 3px solid oklch(58% 0.20 320);
}

.legal-doc section { padding-bottom: var(--s-8); margin-bottom: var(--s-8); border-bottom: 1px solid var(--border-soft); }
.legal-doc section:last-of-type { border-bottom: 0; }
.legal-doc section h2 {
  font-size: 22px; letter-spacing: -0.015em; color: var(--lp-ink);
  font-weight: 600; line-height: 1.25;
  scroll-margin-top: calc(var(--site-header-h) + 16px);
  display: flex; gap: 12px; align-items: baseline;
}
.legal-doc section h2 .num {
  color: oklch(58% 0.20 320); font-variant-numeric: tabular-nums;
  font-size: 14px; font-weight: 600; letter-spacing: 0.04em;
  min-width: 28px;
}
.legal-doc section p, .legal-doc section li {
  font-size: 15px; line-height: 1.65; color: var(--text);
  margin-top: var(--s-3);
}
.legal-doc section ul { padding-left: var(--s-5); margin: 0; }
.legal-doc section ul li { margin-top: 6px; }
.legal-doc section ul li::marker { color: oklch(58% 0.20 320); }
.legal-doc .legal-foot {
  margin-top: var(--s-10); padding: var(--s-5) var(--s-6);
  background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: var(--r-md);
  display: flex; gap: var(--s-4); align-items: center;
}
.legal-doc .legal-foot .ic {
  width: 44px; height: 44px; flex-shrink: 0; border-radius: var(--r-md);
  background: var(--lp-grad); display: grid; place-items: center; color: #fff;
}
.legal-doc .legal-foot .body { flex: 1; }
.legal-doc .legal-foot .ttl { font-size: 14px; font-weight: 600; color: var(--text-strong); }
.legal-doc .legal-foot .sub { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.legal-doc .legal-foot a { font-weight: 500; }

@media (max-width: 800px) {
  .legal-wrap { grid-template-columns: 1fr; gap: var(--s-5); }
  .legal-toc { position: static; }
}

/* ---------- SIDEBAR ---------- */
.sidebar {
  background: var(--bg);
  border-right: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  padding: 14px var(--s-3) var(--s-3);
  gap: var(--s-2);
  height: calc(100vh - var(--site-header-h));
  position: sticky;
  top: var(--site-header-h);
  overflow-y: auto;
}
[data-theme="dark"] .sidebar { background: var(--bg-alt); }

.brand-switch {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 8px 10px;
  display: flex; align-items: center; gap: var(--s-2);
  cursor: pointer; text-align: left;
  font-size: 13px;
  color: var(--text-strong);
  box-shadow: var(--sh-1);
  position: relative;
}
.brand-switch:hover { border-color: var(--border-strong); }
.brand-switch:focus-visible { outline: none; box-shadow: var(--ring); }
.brand-chip {
  width: 22px; height: 22px;
  border-radius: 5px;
  flex-shrink: 0;
  color: #fff;
  font-size: 11px; font-weight: 600;
  display: grid; place-items: center;
  box-shadow: inset 0 -1px 0 0 rgb(0 0 0 / 0.18);
}
.brand-switch .b-name { font-size: 13px; font-weight: 500; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-switch .chev { color: var(--text-subtle); margin-left: auto; }

.brand-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--sh-3);
  padding: 4px;
  z-index: 60;
  display: none;
}
.brand-menu[data-open="true"] { display: block; }
.brand-menu-item {
  width: 100%;
  display: flex; align-items: center; gap: var(--s-2);
  padding: 6px 8px;
  border-radius: var(--r-sm);
  background: transparent; border: 0;
  cursor: pointer;
  font-size: 13px; color: var(--text);
  text-align: left;
}
.brand-menu-item:hover { background: var(--surface-hover); }
.brand-menu-item .b-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-menu-item .b-domain { font-size: 11px; color: var(--text-muted); }
.brand-menu-item .check { color: var(--text-strong); opacity: 0; flex-shrink: 0; }
.brand-menu-item[aria-selected="true"] .check { opacity: 1; }
.brand-menu-divider { height: 1px; background: var(--border-soft); margin: 4px 0; }

.nav-section { display: flex; flex-direction: column; gap: 1px; }
.nav-section + .nav-section { margin-top: var(--s-3); padding-top: var(--s-3); border-top: 1px solid var(--border-soft); }
.nav-eyebrow {
  font-family: var(--font-sans); font-size: 10px;
  color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.10em; font-weight: 600; padding: 0 8px; margin-bottom: 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 8px;
  border-radius: var(--r-sm);
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  cursor: pointer;
  border: 0;
  background: transparent;
  text-align: left;
  width: 100%;
  transition: background 80ms ease, color 80ms ease;
}
.nav-item:hover { background: var(--surface-hover); color: var(--text-strong); text-decoration: none; }
.nav-item[aria-current="page"] {
  background: var(--surface);
  color: var(--text-strong);
  box-shadow: var(--sh-1);
  border: 1px solid var(--border);
  padding: 5px 7px;
}
.nav-item[aria-current="page"]::before {
  content: '';
  width: 3px; height: 14px;
  background: var(--brand);
  border-radius: 2px;
  margin-right: -3px;
  transition: background 120ms ease;
}
.nav-item .ic { width: 16px; height: 16px; color: var(--text-subtle); flex-shrink: 0; }
.nav-item:hover .ic, .nav-item[aria-current="page"] .ic { color: var(--text); }
.nav-item .count {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  color: var(--text-muted);
  background: var(--surface-hover);
  padding: 1px 6px;
  border-radius: var(--r-pill);
}
[data-theme="dark"] .nav-item .count { background: var(--surface-2); }

.sidebar-foot {
  margin-top: auto;
  padding: var(--s-3) 0 0;
  border-top: 1px solid var(--border-soft);
  display: flex; align-items: center; gap: var(--s-2);
}
.avatar {
  width: 24px; height: 24px;
  border-radius: 999px;
  background: var(--text-subtle);
  color: var(--bg);
  font-size: 11px; font-weight: 600;
  display: grid; place-items: center;
}
.theme-toggle {
  display: inline-flex; align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 2px;
  gap: 0;
  margin-left: auto;
}
.theme-toggle button {
  background: transparent;
  border: 0;
  color: var(--text-muted);
  width: 22px; height: 22px;
  display: grid; place-items: center;
  border-radius: 4px;
  cursor: pointer;
  padding: 0;
}
.theme-toggle button:hover { color: var(--text-strong); }
.theme-toggle button[aria-pressed="true"] {
  background: var(--surface-hover);
  color: var(--text-strong);
}

/* ---------- MAIN PANE ---------- */
.main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding-top: 2px; /* clear stripe */
}
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-4);
  padding: var(--s-4) var(--s-6);
  border-bottom: 1px solid var(--border-soft);
  background: var(--bg);
  position: sticky; top: var(--site-header-h); z-index: 50;
}
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-muted); }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--text-strong); text-decoration: none; }
.breadcrumb .crumb-cur { color: var(--text-strong); font-weight: 500; }
.breadcrumb .sep { color: var(--text-subtle); }

.page-content { padding: var(--s-6); display: flex; flex-direction: column; gap: var(--s-6); flex: 1; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-4); }
.page-head h1 { font-size: 22px; }
.page-head .lede { color: var(--text-muted); font-size: 13px; margin-top: 4px; }

/* ---------- WELCOME / ONBOARDING ROUTE ---------- */
.welcome-hero {
  position: relative;
  background:
    linear-gradient(135deg,
      color-mix(in oklch, var(--brand) 14%, var(--surface)),
      color-mix(in oklch, var(--brand) 4%, var(--surface)));
  border: 1px solid color-mix(in oklch, var(--brand) 18%, var(--border-soft));
  border-radius: 16px;
  padding: var(--s-8) var(--s-8);
  display: flex; flex-direction: column; gap: var(--s-3);
  overflow: hidden;
  isolation: isolate;
}
.welcome-hero::before {
  content: '';
  position: absolute;
  top: -120px; right: -120px;
  width: 380px; height: 380px;
  background: radial-gradient(circle, color-mix(in oklch, var(--brand) 30%, transparent), transparent 60%);
  filter: blur(28px);
  pointer-events: none; z-index: -1;
}
.welcome-hero-eyebrow {
  font-size: 12px; font-weight: 600; letter-spacing: 0.10em; text-transform: uppercase;
  color: color-mix(in oklch, var(--brand) 75%, var(--text-strong));
  display: inline-flex; align-items: center; gap: 8px;
}
[data-theme="dark"] .welcome-hero-eyebrow { color: color-mix(in oklch, var(--brand) 60%, white); }
.welcome-hero-eyebrow::before {
  content: ''; width: 18px; height: 1.5px; background: currentColor; border-radius: 2px;
}
.welcome-hero h1 {
  font-size: 32px; letter-spacing: -0.025em;
  line-height: 1.1; color: var(--text-strong);
  font-weight: 600; max-width: 22ch;
  text-wrap: balance;
}
.welcome-hero p {
  font-size: 15px; line-height: 1.6;
  color: var(--text-muted);
  max-width: 56ch;
}

/* progress strip */
.welcome-progress {
  margin-top: var(--s-4);
  display: flex; align-items: center; gap: var(--s-3);
}
.welcome-progress-bar {
  flex: 1; height: 6px;
  background: color-mix(in oklch, var(--brand) 8%, var(--surface-2));
  border-radius: 999px; overflow: hidden;
  border: 1px solid color-mix(in oklch, var(--brand) 12%, var(--border-soft));
}
.welcome-progress-fill {
  height: 100%;
  background: linear-gradient(90deg,
    color-mix(in oklch, var(--brand) 80%, white 0%),
    var(--brand));
  border-radius: 999px;
  transition: width 240ms ease;
}
.welcome-progress-count {
  font-size: 13px; color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}
.welcome-progress-count strong { color: var(--text-strong); font-weight: 600; }

.welcome-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: var(--s-6);
  align-items: flex-start;
}
@media (max-width: 1020px) {
  .welcome-grid { grid-template-columns: 1fr; }
}

/* step cards stacked vertically */
.welcome-steps { display: flex; flex-direction: column; gap: var(--s-3); }
.welcome-step {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--s-5);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--s-4);
  align-items: center;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.welcome-step[data-status="current"] {
  border-color: color-mix(in oklch, var(--brand) 35%, var(--border));
  box-shadow:
    0 0 0 4px color-mix(in oklch, var(--brand) 8%, transparent),
    0 8px 24px -8px color-mix(in oklch, var(--brand) 25%, transparent);
}
.welcome-step[data-status="done"] { background: var(--surface-2); }

.welcome-step-num {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 14px; font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.welcome-step[data-status="current"] .welcome-step-num {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
  box-shadow: 0 4px 10px -2px color-mix(in oklch, var(--brand) 40%, transparent);
}
.welcome-step[data-status="done"] .welcome-step-num {
  background: oklch(94% 0.08 155);
  color: oklch(40% 0.16 155);
  border-color: oklch(86% 0.10 155);
}
[data-theme="dark"] .welcome-step[data-status="done"] .welcome-step-num {
  background: oklch(28% 0.07 155); color: oklch(78% 0.12 155); border-color: oklch(38% 0.10 155);
}

.welcome-step-body { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.welcome-step-head {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.welcome-step-head .ttl { font-size: 15px; font-weight: 600; color: var(--text-strong); letter-spacing: -0.005em; }
.welcome-step-head .est {
  font-size: 11px; color: var(--text-muted);
  background: var(--surface-2); border: 1px solid var(--border-soft);
  padding: 1px 7px; border-radius: var(--r-pill);
  font-variant-numeric: tabular-nums;
}
.welcome-step-head .done-pill {
  font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: oklch(40% 0.16 155);
  display: inline-flex; align-items: center; gap: 4px;
}
[data-theme="dark"] .welcome-step-head .done-pill { color: oklch(78% 0.12 155); }
.welcome-step-body p {
  font-size: 13px; color: var(--text-muted);
  line-height: 1.55;
  text-wrap: pretty;
}

.welcome-step-actions { display: flex; gap: var(--s-2); flex-shrink: 0; }

/* sidebar widgets */
.welcome-side { display: flex; flex-direction: column; gap: var(--s-3); position: sticky; top: calc(var(--site-header-h) + 80px); }
.welcome-side-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--s-4);
  display: flex; flex-direction: column; gap: var(--s-2);
}
.welcome-side-card .lbl {
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text-muted);
}
.welcome-side-card h3 { font-size: 14px; font-weight: 600; color: var(--text-strong); }
.welcome-side-card p { font-size: 13px; color: var(--text-muted); line-height: 1.5; }
.welcome-side-links {
  display: flex; flex-direction: column; gap: 2px;
  margin: 0 calc(-1 * var(--s-2));
}
.welcome-side-link {
  display: flex; align-items: center; gap: 10px;
  padding: 8px var(--s-2);
  border-radius: var(--r-sm);
  text-decoration: none;
  color: var(--text);
  font-size: 13px;
}
.welcome-side-link:hover { background: var(--surface-hover); color: var(--text-strong); text-decoration: none; }
.welcome-side-link .ic {
  width: 24px; height: 24px; border-radius: 6px;
  background: var(--surface-2);
  display: grid; place-items: center;
  color: var(--text-muted); flex-shrink: 0;
}
.welcome-side-link:hover .ic { color: color-mix(in oklch, var(--brand) 70%, var(--text-strong)); }
.welcome-side-link .arrow { margin-left: auto; color: var(--text-subtle); }

/* ---------- DASHBOARD HERO (brand-aware welcome strip) ---------- */
.dash-hero {
  position: relative;
  /* Quiet brand-tinted accent strip — horizontal wash, no glows. */
  background:
    linear-gradient(90deg,
      color-mix(in oklch, var(--brand) 8%, var(--surface)),
      color-mix(in oklch, var(--brand) 2%, var(--surface)) 60%,
      var(--surface));
  border: 1px solid color-mix(in oklch, var(--brand) 12%, var(--border-soft));
  border-radius: var(--r-md);
  padding: var(--s-3) var(--s-4) var(--s-3) var(--s-3);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--s-3);
  align-items: center;
  transition: background 220ms ease, border-color 220ms ease;
}
.dash-hero-mark {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: grid; place-items: center;
  flex-shrink: 0;
  overflow: hidden;
}
.dash-hero-mark > img {
  width: 100%; height: 100%;
  object-fit: contain;
  display: block;
}
/* Fallback when no <img> child is present: the legacy gradient + first-letter chip. */
.dash-hero-mark:not(:has(> img)) {
  color: #fff; font-weight: 700; font-size: 15px;
  letter-spacing: -0.02em;
  background:
    linear-gradient(135deg,
      color-mix(in oklch, var(--brand) 80%, white 0%),
      var(--brand));
  box-shadow: inset 0 -1px 0 0 rgb(0 0 0 / 0.15);
  transition: background 220ms ease;
}
.dash-hero-copy { display: flex; flex-direction: row; gap: var(--s-2); align-items: baseline; min-width: 0; flex-wrap: wrap; }
.dash-hero-eyebrow {
  font-size: 14px; font-weight: 600;
  color: var(--text-strong);
  letter-spacing: -0.005em;
  text-transform: none;
}
.dash-hero h1 {
  font-size: 14px;
  letter-spacing: 0;
  line-height: 1.4;
  color: var(--text-muted);
  font-weight: 400;
  display: inline;
}
.dash-hero h1 strong {
  color: color-mix(in oklch, var(--brand) 75%, var(--text-strong));
  font-weight: 600;
}
[data-theme="dark"] .dash-hero h1 strong { color: color-mix(in oklch, var(--brand) 60%, white); }
.dash-hero .lede {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}
.dash-hero-actions { flex-shrink: 0; display: flex; gap: var(--s-2); }

@media (max-width: 880px) {
  .dash-hero { grid-template-columns: auto 1fr; }
  .dash-hero-actions { grid-column: 1 / -1; justify-content: flex-start; }
}

/* ---------- BUTTONS ---------- */
.btn {
  --_bg: var(--surface);
  --_fg: var(--text-strong);
  --_bd: var(--border);
  appearance: none;
  border: 1px solid var(--_bd);
  background: var(--_bg);
  color: var(--_fg);
  font-size: 13px; font-weight: 500; line-height: 1;
  padding: 0 12px; height: 32px;
  border-radius: var(--r-sm);
  display: inline-flex; align-items: center; gap: 6px;
  cursor: pointer;
  transition: background 80ms ease, border-color 80ms ease, color 80ms ease, box-shadow 80ms ease;
  box-shadow: var(--sh-1);
  white-space: nowrap;
}
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; box-shadow: none; }
.btn .spin {
  width: 12px; height: 12px;
  border-radius: 999px;
  border: 1.5px solid currentColor;
  border-top-color: transparent;
  animation: spin 0.7s linear infinite;
  opacity: 0.8;
}
@keyframes spin { to { transform: rotate(360deg); } }
.btn-primary { --_bg: var(--primary); --_fg: var(--primary-fg); --_bd: var(--primary); }
.btn-primary:hover { --_bg: var(--primary-hover); --_bd: var(--primary-hover); }
.btn-primary:active { --_bg: var(--primary-active); }
.btn-secondary:hover { --_bg: var(--surface-hover); --_bd: var(--border-strong); }
.btn-ghost { --_bg: transparent; --_fg: var(--text); --_bd: transparent; box-shadow: none; }
.btn-ghost:hover { --_bg: var(--surface-hover); }
.btn-danger { --_bg: var(--danger); --_fg: var(--danger-fg); --_bd: var(--danger); }
.btn-danger:hover { --_bg: var(--danger-hover); --_bd: var(--danger-hover); }
.btn-danger:focus-visible { box-shadow: var(--ring-danger); }
.btn-sm { height: 26px; font-size: 12px; padding: 0 10px; }
.btn-lg { height: 38px; font-size: 14px; padding: 0 16px; }
.btn-icon { width: 32px; padding: 0; justify-content: center; }
.btn-icon.btn-sm { width: 26px; }

/* ---------- INPUTS ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 12px; font-weight: 500; color: var(--text); }
.field-hint  { font-size: 12px; color: var(--text-muted); }
.field-error { font-size: 12px; color: var(--danger); }
.input, .textarea, .select {
  width: 100%;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--surface);
  padding: 0 10px;
  font-size: 13px;
  color: var(--text-strong);
  transition: border-color 80ms ease, box-shadow 80ms ease;
  box-shadow: inset 0 1px 0 0 rgb(0 0 0 / 0.02);
}
.textarea { height: auto; padding: 8px 10px; resize: vertical; min-height: 84px; line-height: 1.5; }
.input::placeholder, .textarea::placeholder { color: var(--text-subtle); }
.input:hover, .textarea:hover, .select:hover { border-color: var(--border-strong); }
.input:focus, .textarea:focus, .select:focus {
  outline: none;
  border-color: var(--text-subtle);
  box-shadow: var(--ring);
}
.input[aria-invalid="true"], .textarea[aria-invalid="true"] { border-color: var(--danger); }
.input:disabled, .textarea:disabled, .select:disabled {
  background: var(--surface-2);
  color: var(--text-muted);
  cursor: not-allowed;
}
.select {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'><path d='M3 4.5L6 7.5L9 4.5' stroke='%236b7177' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}
[data-theme="dark"] .select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12' fill='none'><path d='M3 4.5L6 7.5L9 4.5' stroke='%238a9097' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/></svg>");
}
.input-search { position: relative; }
.input-search input { padding-left: 30px; }
.input-search svg {
  position: absolute; left: 9px; top: 50%; transform: translateY(-50%);
  color: var(--text-subtle); pointer-events: none;
}

.checkbox {
  width: 14px; height: 14px;
  appearance: none;
  border: 1px solid var(--border-strong);
  border-radius: 3px;
  background: var(--surface);
  cursor: pointer;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  vertical-align: middle;
  position: relative;
}
.checkbox:checked { background: var(--primary); border-color: var(--primary); }
.checkbox:checked::after {
  content: '';
  width: 8px; height: 8px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8' fill='none'><path d='M1.5 4l1.7 1.7L6.5 2.5' stroke='white' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/></svg>") center/contain no-repeat;
}
[data-theme="dark"] .checkbox:checked::after {
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8' fill='none'><path d='M1.5 4l1.7 1.7L6.5 2.5' stroke='%230c0d10' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/></svg>") center/contain no-repeat;
}

/* ---------- TOGGLE ---------- */
.toggle {
  --_w: 30px; --_h: 18px; --_p: 2px;
  position: relative;
  width: var(--_w); height: var(--_h);
  border-radius: 999px;
  background: var(--border-strong);
  transition: background 120ms ease;
  cursor: pointer;
  flex-shrink: 0;
  border: 0; padding: 0;
  display: inline-block;
  vertical-align: middle;
}
.toggle::after {
  content: '';
  position: absolute;
  top: var(--_p); left: var(--_p);
  width: calc(var(--_h) - var(--_p) * 2);
  height: calc(var(--_h) - var(--_p) * 2);
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.20);
  transition: left 140ms cubic-bezier(.3,.6,.2,1);
}
.toggle[aria-checked="true"] { background: var(--primary); }
.toggle[aria-checked="true"]::after { left: calc(var(--_w) - var(--_h) + var(--_p)); }
[data-theme="dark"] .toggle[aria-checked="true"]::after { background: var(--bg); }
.toggle:focus-visible { outline: none; box-shadow: var(--ring); }
.toggle:disabled, .toggle[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.toggle-row { display: flex; align-items: flex-start; gap: var(--s-3); }
.toggle-row .lbl { font-size: 13px; color: var(--text-strong); }
.toggle-row .desc { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ---------- STATUS PILLS ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 22px; padding: 0 8px;
  border-radius: var(--r-pill);
  border: 1px solid;
  font-size: 12px; font-weight: 500; line-height: 1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.pill .dot { width: 6px; height: 6px; border-radius: 999px; background: currentColor; }
.pill-draft     { color: var(--st-draft-fg);     background: var(--st-draft-bg);     border-color: var(--st-draft-bd); }
.pill-scheduled { color: var(--st-scheduled-fg); background: var(--st-scheduled-bg); border-color: var(--st-scheduled-bd); }
.pill-sending   { color: var(--st-sending-fg);   background: var(--st-sending-bg);   border-color: var(--st-sending-bd); }
.pill-sent      { color: var(--st-sent-fg);      background: var(--st-sent-bg);      border-color: var(--st-sent-bd); }
.pill-bounced   { color: var(--st-bounced-fg);   background: var(--st-bounced-bg);   border-color: var(--st-bounced-bd); }
.pill-unsub     { color: var(--st-unsub-fg);     background: var(--st-unsub-bg);     border-color: var(--st-unsub-bd); }
.pill-pending   { color: var(--st-pending-fg);   background: var(--st-pending-bg);   border-color: var(--st-pending-bd); }
.pill-confirmed { color: var(--st-confirmed-fg); background: var(--st-confirmed-bg); border-color: var(--st-confirmed-bd); }
.pill-sending .dot { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ---------- CARDS / PANELS ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--sh-1);
}
.card-pad { padding: var(--s-5); }
.card-head {
  padding: var(--s-4) var(--s-5);
  border-bottom: 1px solid var(--border-soft);
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
}
.card-head h2 { font-size: 14px; }
.card-body { padding: var(--s-5); }

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--s-4);
  display: flex; flex-direction: column; gap: 4px;
  box-shadow: var(--sh-1);
}
.stat .lbl { font-size: 12px; color: var(--text-muted); }
.stat .val { font-size: 22px; font-weight: 600; color: var(--text-strong); letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.stat .delta { font-size: 12px; color: var(--st-sent-fg); }
.stat .delta.muted { color: var(--text-muted); }
.stat .delta.warn { color: var(--st-bounced-fg); }

/* ---------- TABLE ---------- */
.tbl-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--sh-1);
}
.tbl-toolbar {
  display: flex; align-items: center; gap: var(--s-2);
  padding: var(--s-3) var(--s-3);
  border-bottom: 1px solid var(--border-soft);
  background: var(--surface);
  flex-wrap: wrap;
}
.tbl-toolbar .input { height: 30px; }
.tbl-toolbar .grow { flex: 1; min-width: 160px; }
table.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
table.tbl th {
  text-align: left; font-weight: 500; font-size: 12px;
  color: var(--text-muted);
  background: var(--surface-2);
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-soft);
  user-select: none;
  white-space: nowrap;
}
table.tbl th.sortable { cursor: pointer; }
table.tbl th.sortable:hover { color: var(--text-strong); }
table.tbl th .sort-ic { display: inline-block; margin-left: 4px; opacity: 0.5; }
table.tbl th[aria-sort] .sort-ic { opacity: 1; color: var(--text-strong); }
table.tbl td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text);
  vertical-align: middle;
}
table.tbl tr:last-child td { border-bottom: 0; }
table.tbl tbody tr:hover { background: var(--surface-2); cursor: pointer; }
table.tbl tbody tr:hover .row-actions { opacity: 1; }
.row-actions { display: inline-flex; gap: 4px; opacity: 0; transition: opacity 80ms ease; }
table.tbl td.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl-foot {
  padding: var(--s-3);
  border-top: 1px solid var(--border-soft);
  display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--text-muted);
}

.skeleton {
  height: 12px; border-radius: 4px;
  background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-hover) 50%, var(--surface-2) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- BRAND CHIP INLINE ---------- */
.b-inline { display: inline-flex; align-items: center; gap: 6px; }
.b-inline .brand-chip { width: 14px; height: 14px; font-size: 9px; border-radius: 3px; }

/* ---------- MODALS ---------- */
.modal-back {
  position: fixed; inset: 0;
  background: rgb(0 0 0 / 0.40);
  z-index: 200;
  display: grid; place-items: center;
  padding: var(--s-6);
}
[data-theme="dark"] .modal-back { background: rgb(0 0 0 / 0.65); }
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-modal);
  width: min(480px, 100%);
  overflow: hidden;
}
.modal-head { padding: var(--s-5) var(--s-5) var(--s-2); }
.modal-title { font-size: 16px; font-weight: 600; color: var(--text-strong); }
.modal-body { padding: var(--s-2) var(--s-5) var(--s-5); color: var(--text); font-size: 13px; line-height: 1.5; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: var(--s-2);
  padding: var(--s-3) var(--s-5);
  border-top: 1px solid var(--border-soft);
  background: var(--surface-2);
}

/* ---------- TOASTS ---------- */
.toast-stack { position: fixed; bottom: var(--s-5); right: var(--s-5); z-index: 300; display: flex; flex-direction: column; gap: var(--s-2); }
.toast {
  display: flex; align-items: flex-start; gap: var(--s-3);
  background: var(--text-strong);
  color: var(--bg);
  padding: var(--s-3) var(--s-4);
  border-radius: var(--r-md);
  box-shadow: var(--sh-3);
  width: 320px;
  font-size: 13px;
  animation: slideIn 200ms ease;
}
@keyframes slideIn { from { transform: translateY(8px); opacity: 0; } }
[data-theme="dark"] .toast { background: var(--surface-2); color: var(--text-strong); border: 1px solid var(--border); }
.toast .ic { width: 16px; height: 16px; flex-shrink: 0; margin-top: 1px; }
.toast .t-title { font-weight: 500; }
.toast .t-body  { opacity: 0.7; margin-top: 2px; }
.toast .x { margin-left: auto; opacity: 0.5; cursor: pointer; background: transparent; border: 0; padding: 0; color: inherit; }
.toast.success .ic { color: oklch(78% 0.13 155); }
.toast.error   .ic { color: oklch(74% 0.16 25); }

/* ---------- EMPTY ---------- */
.empty {
  border: 1px dashed var(--border);
  background: var(--surface-2);
  border-radius: var(--r-md);
  padding: var(--s-10) var(--s-6);
  text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: var(--s-3);
}
.empty .empty-ic {
  width: 40px; height: 40px;
  border-radius: 999px;
  background: var(--surface-hover);
  color: var(--text-muted);
  display: grid; place-items: center;
  margin-bottom: var(--s-2);
}
.empty .empty-title { font-size: 15px; color: var(--text-strong); }
.empty .empty-desc  { font-size: 13px; color: var(--text-muted); max-width: 40ch; text-wrap: pretty; }

/* ---------- LAYOUT HELPERS ---------- */
.row { display: flex; gap: var(--s-3); align-items: center; flex-wrap: wrap; }
.col { display: flex; flex-direction: column; gap: var(--s-3); }
.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4); }
.cols-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-4); }
.cols-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-4); }
.gap-2 { gap: var(--s-2); } .gap-3 { gap: var(--s-3); } .gap-4 { gap: var(--s-4); } .gap-6 { gap: var(--s-6); }
.spacer { flex: 1; }
.divider { height: 1px; background: var(--border-soft); }

/* ---------- ROUTES ---------- */
.route { display: none; flex-direction: column; gap: var(--s-6); }
.route[data-active="true"] { display: flex; }

/* ---------- LOGIN ---------- */
.login-page {
  min-height: 100vh;
  display: grid; place-items: center;
  background: var(--bg);
  padding: var(--s-6);
  position: relative;
}
.login-card {
  width: min(380px, 100%);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-8);
  box-shadow: var(--sh-2);
  display: flex; flex-direction: column; gap: var(--s-4);
}
.login-mark {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--primary);
  color: var(--primary-fg);
  display: grid; place-items: center;
  font-weight: 600;
  font-size: 16px;
  margin-bottom: var(--s-2);
}
.login-card h1 { font-size: 20px; }
.login-card .sub { font-size: 13px; color: var(--text-muted); }
.login-foot { font-size: 12px; color: var(--text-muted); text-align: center; margin-top: var(--s-2); }

/* ---------- COMPOSE STEPPER ---------- */
.stepper {
  display: flex; align-items: center; gap: 6px;
  padding: var(--s-3) 0;
}
.stepper .step {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 10px 4px 6px;
  border-radius: var(--r-pill);
  font-size: 12px; font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
}
.stepper .step .num {
  width: 18px; height: 18px;
  border-radius: 999px;
  background: var(--surface-hover);
  color: var(--text-muted);
  display: grid; place-items: center;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.stepper .step:hover { color: var(--text-strong); }
.stepper .step[data-state="done"] { color: var(--text); }
.stepper .step[data-state="done"] .num { background: var(--st-sent-bg); color: var(--st-sent-fg); }
.stepper .step[data-state="active"] { color: var(--text-strong); background: var(--surface); border-color: var(--border); }
.stepper .step[data-state="active"] .num { background: var(--primary); color: var(--primary-fg); }
.stepper .sep { color: var(--text-subtle); }

/* ---------- COMPOSE LAYOUT ---------- */
.compose-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(380px, 1fr); gap: var(--s-6); align-items: flex-start; }
.compose-side { position: sticky; top: 64px; min-width: 0; }
.preview-frame {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--sh-1);
}
.preview-frame .preview-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px;
  font-size: 11px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-soft);
  background: var(--surface-2);
}
.preview-frame .pdot { width: 8px; height: 8px; border-radius: 999px; background: var(--border-strong); }
.preview-tabs { display: inline-flex; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 2px; }
.preview-tabs button {
  background: transparent; border: 0; cursor: pointer;
  padding: 3px 8px; font-size: 11px; color: var(--text-muted);
  border-radius: 4px;
}
.preview-tabs button[aria-pressed="true"] { background: var(--surface-hover); color: var(--text-strong); }

.email-mock {
  padding: var(--s-5);
  background: #fff;
  color: #1a1a1a;
  font-family: 'Geist', sans-serif;
  font-size: 14px;
  line-height: 1.55;
}
[data-theme="dark"] .email-mock { background: #fafafa; } /* email always renders on white-ish */
.email-mock .e-meta { font-size: 11px; color: #666; padding-bottom: var(--s-3); border-bottom: 1px solid #e5e5e5; margin-bottom: var(--s-4); }
.email-mock .e-logo { width: 28px; height: 28px; border-radius: 6px; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 13px; margin-bottom: var(--s-3); }
.email-mock h2 { color: #111; font-size: 22px; margin-bottom: 8px; }
.email-mock h3 { color: #111; font-size: 16px; margin-top: var(--s-4); margin-bottom: 4px; }
.email-mock p  { margin-top: 8px; color: #2a2a2a; }
.email-mock .e-cta { display: inline-block; margin-top: var(--s-4); padding: 10px 16px; background: #111; color: #fff; border-radius: 6px; font-size: 13px; font-weight: 500; text-decoration: none; }
.email-mock .e-foot { margin-top: var(--s-6); padding-top: var(--s-3); border-top: 1px solid #e5e5e5; font-size: 11px; color: #888; }
.email-mock.mobile { max-width: 320px; margin: 0 auto; }

/* slot inputs */
.slot {
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
  padding: var(--s-3) var(--s-4);
  display: flex; flex-direction: column; gap: 6px;
}
.slot-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); }
.slot-head .name { font-size: 11px; color: var(--text-muted); font-weight: 500; background: var(--surface); padding: 2px 8px; border-radius: var(--r-pill); border: 1px solid var(--border-soft); }
.slot-head .req { font-size: 10px; color: var(--danger); text-transform: uppercase; letter-spacing: 0.06em; }
.slot label { font-size: 13px; font-weight: 500; color: var(--text-strong); }
.slot .input, .slot .textarea { background: var(--surface); }

/* topic chips */
.topic-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--surface);
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}
.topic-chip:hover { border-color: var(--border-strong); }
.topic-chip[aria-pressed="true"] {
  background: var(--primary);
  color: var(--primary-fg);
  border-color: var(--primary);
}
.topic-chip .count { font-variant-numeric: tabular-nums; font-size: 11px; opacity: 0.7; }

/* template picker */
.tpl-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-3); }
.tpl-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  cursor: pointer;
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: border-color 80ms ease, box-shadow 80ms ease;
}
.tpl-card:hover { border-color: var(--border-strong); }
.tpl-card[aria-pressed="true"] { border-color: var(--text-strong); box-shadow: 0 0 0 1px var(--text-strong); }
.tpl-thumb {
  height: 120px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-soft);
  position: relative;
  overflow: hidden;
  padding: 10px;
  display: flex; flex-direction: column; gap: 6px;
}
.tpl-thumb .ln { height: 4px; border-radius: 2px; background: var(--border); }
.tpl-thumb .ln.s { width: 60%; }
.tpl-thumb .ln.m { width: 80%; }
.tpl-thumb .ln.l { width: 100%; }
.tpl-thumb .acc { height: 16px; width: 40px; border-radius: 3px; background: var(--brand); margin-top: 4px; }
.tpl-meta { padding: var(--s-3); display: flex; flex-direction: column; gap: 2px; }
.tpl-meta .nm { font-size: 13px; font-weight: 500; color: var(--text-strong); }
.tpl-meta .sub { font-size: 11px; color: var(--text-muted); }

/* ---------- BRAND CARDS ---------- */
.brand-list-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--s-4);
  display: grid;
  grid-template-columns: 8px 36px 1fr auto auto auto;
  align-items: center;
  gap: var(--s-4);
  cursor: pointer;
  transition: border-color 80ms ease;
}
.brand-list-item:hover { border-color: var(--border-strong); }
.brand-list-item .stripe { width: 4px; height: 32px; border-radius: 2px; }
.brand-list-item .logo {
  width: 36px; height: 36px;
  border-radius: var(--r-sm);
  color: #fff; font-weight: 600; font-size: 15px;
  display: grid; place-items: center;
}
.brand-list-item .nm { font-size: 14px; font-weight: 500; color: var(--text-strong); }
.brand-list-item .domain { font-size: 12px; color: var(--text-muted); }
.brand-list-item .num { font-variant-numeric: tabular-nums; font-size: 13px; color: var(--text); text-align: right; }
.brand-list-item .num .lbl { font-size: 11px; color: var(--text-muted); display: block; }

/* ---------- ANALYTICS CHARTS ---------- */
.chart-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--s-5); box-shadow: var(--sh-1); }
.chart {
  position: relative;
  height: 220px;
  display: flex; align-items: stretch;
  padding: var(--s-2) 0;
}
.chart svg { width: 100%; height: 100%; overflow: visible; }
.chart-grid line { stroke: var(--border-soft); stroke-dasharray: 2 4; }
.chart-axis text { font-size: 10px; fill: var(--text-muted); font-variant-numeric: tabular-nums; }
.chart-line { fill: none; stroke-width: 1.6; }
.chart-area { opacity: 0.10; }
.chart-dot { stroke: var(--surface); stroke-width: 1.5; }

.legend { display: flex; gap: var(--s-3); flex-wrap: wrap; padding-top: var(--s-3); }
.legend .item { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); }
.legend .swatch { width: 10px; height: 10px; border-radius: 2px; }

/* ---------- SETTINGS / FORM ROWS ---------- */
.form-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: var(--s-6);
  padding: var(--s-5) 0;
  border-bottom: 1px solid var(--border-soft);
}
.form-row:last-child { border-bottom: 0; }
.form-row .form-label { font-size: 13px; font-weight: 500; color: var(--text-strong); }
.form-row .form-help  { font-size: 12px; color: var(--text-muted); margin-top: 4px; max-width: 30ch; }
.form-row .form-control { display: flex; flex-direction: column; gap: 6px; max-width: 480px; }

/* ---------- DNS / VERIFY ---------- */
.dns-record {
  display: grid;
  grid-template-columns: 60px 1fr 200px auto;
  gap: var(--s-3);
  padding: 10px 12px;
  border: 1px solid var(--border-soft);
  border-radius: var(--r-sm);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  align-items: center;
  background: var(--surface-2);
}
.dns-record + .dns-record { margin-top: 6px; }
.dns-record .type { color: var(--text-strong); font-weight: 600; }
.dns-record .val { color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- HTML EDITOR ---------- */
.html-editor {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--surface);
  height: 520px;
}
.html-editor .pane { display: flex; flex-direction: column; }
.html-editor .pane + .pane { border-left: 1px solid var(--border-soft); }
.html-editor .pane-head {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border-soft);
  font-size: 12px; color: var(--text-muted); font-weight: 500;
  background: var(--surface-2);
  display: flex; justify-content: space-between; align-items: center;
}
.html-editor textarea {
  flex: 1;
  border: 0;
  background: var(--surface);
  color: var(--text-strong);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.55;
  padding: var(--s-3);
  resize: none;
  outline: none;
  width: 100%;
}
.html-editor .preview-pane { flex: 1; overflow: auto; padding: var(--s-4); background: #fff; }
[data-theme="dark"] .html-editor .preview-pane { background: #fafafa; }

/* ---------- DETAIL HEADER ---------- */
.detail-head {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--s-5);
  display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s-4);
}
.detail-head .meta { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.detail-head h1 { font-size: 20px; }

/* ---------- TIMELINE ---------- */
.timeline { display: flex; flex-direction: column; gap: var(--s-3); padding-left: 14px; position: relative; }
.timeline::before { content: ''; position: absolute; left: 4px; top: 6px; bottom: 6px; width: 1px; background: var(--border); }
.tl-item { position: relative; padding-left: var(--s-3); }
.tl-item::before { content: ''; position: absolute; left: -14px; top: 6px; width: 9px; height: 9px; border-radius: 999px; background: var(--surface); border: 2px solid var(--text-subtle); }
.tl-item.active::before { background: var(--primary); border-color: var(--primary); }
.tl-item .when { font-size: 11px; color: var(--text-muted); font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.tl-item .what { font-size: 13px; color: var(--text-strong); }

/* ---------- UTILITIES ---------- */
.hide { display: none !important; }
.tnum { font-variant-numeric: tabular-nums; }


/* ---------- TEMPLATES — STARTERS ---------- */
.section-title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin: var(--s-2) 0 var(--s-3); }
.starter-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-3); }
.starter-card { display: flex; flex-direction: column; gap: var(--s-2); padding: 0; border: 1px solid var(--border); background: var(--surface); border-radius: var(--r-md); overflow: hidden; cursor: pointer; transition: border-color .12s ease, box-shadow .12s ease, transform .12s ease; text-decoration: none; color: inherit; }
.starter-card:hover { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand-soft) inset, var(--shadow-2); transform: translateY(-1px); }
.starter-thumb { background: var(--surface-2); padding: 14px; display: flex; flex-direction: column; gap: 5px; min-height: 130px; border-bottom: 1px solid var(--border); }
.starter-thumb .b-h { height: 11px; width: 35%; background: var(--text-strong); border-radius: 2px; }
.starter-thumb .b-h2 { height: 8px; width: 50%; background: var(--text-strong); border-radius: 2px; opacity: 0.8; }
.starter-thumb .b-t { height: 4px; width: 100%; background: var(--border-strong); border-radius: 2px; opacity: 0.6; }
.starter-thumb .b-img { height: 24px; background: var(--brand); opacity: 0.25; border-radius: 3px; }
.starter-thumb .b-btn { height: 12px; width: 60px; background: var(--brand); border-radius: 3px; }
.starter-thumb .b-divider { height: 1px; background: var(--border-strong); margin: 2px 0; }
.starter-thumb .b-row { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.starter-thumb .b-row > div { height: 16px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 2px; }
.starter-thumb .b-stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 4px; }
.starter-thumb .b-stats > div { height: 16px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 2px; }
.starter-meta { padding: var(--s-2) var(--s-3) var(--s-3); }
.starter-meta .nm { font-size: 13px; font-weight: 500; color: var(--text-strong); }
.starter-meta .sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ---------- THEMED BLOCK EDITOR ---------- */
.block-editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: var(--s-4); align-items: flex-start; }
.block-canvas-wrap { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); }
.canvas-toolbar { display: flex; justify-content: space-between; align-items: center; padding: var(--s-2) var(--s-3); border-bottom: 1px solid var(--border); }
.block-canvas { padding: var(--s-5) var(--s-4); display: flex; flex-direction: column; align-items: center; min-height: 600px; gap: 0; }
.block-canvas-inner { width: 100%; max-width: 600px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 0; position: relative; }

.bk { position: relative; padding: 14px 28px; transition: background .1s ease, box-shadow .1s ease; cursor: text; }
.bk[data-bg="subtle"] { background: #f5f5f4; }
.bk[data-bg="soft"]   { background: var(--brand-soft); }
.bk[data-bg="brand"]  { background: var(--brand); }
.bk[data-bg="brand"] h1, .bk[data-bg="brand"] h2, .bk[data-bg="brand"] h3, .bk[data-bg="brand"] p, .bk[data-bg="brand"] .name { color: #fff !important; }
.bk[data-bg="brand"] .btn-cta { background: #fff !important; color: var(--brand) !important; }
.bk[data-bg="brand"] .logo { background: rgba(255,255,255,0.2) !important; }
.bk:not([data-bg]):not([data-bg=""]):hover, .bk[data-bg=""]:hover, .bk[data-bg="none"]:hover { background: var(--brand-soft); }
.bk[data-selected="true"] { box-shadow: inset 0 0 0 2px var(--brand); }
.bk[data-selected="true"]:not([data-bg]), .bk[data-selected="true"][data-bg=""], .bk[data-selected="true"][data-bg="none"] { background: var(--brand-soft); }
.block-canvas-inner[data-page-dark="true"] .bk:not([data-bg]) h1, .block-canvas-inner[data-page-dark="true"] .bk:not([data-bg]) h2, .block-canvas-inner[data-page-dark="true"] .bk:not([data-bg]) h3 { color: #f5f5f5; }
.block-canvas-inner[data-page-dark="true"] .bk:not([data-bg]) p, .block-canvas-inner[data-page-dark="true"] .bk:not([data-bg]) .name { color: #c0c0c0; }
.block-canvas-inner[data-page-dark="true"] .bk-footer { color: #888 !important; border-color: #333 !important; }
.bk[contenteditable] { outline: none; }
.bk h1, .bk h2, .bk h3, .bk p { margin: 0; }
.bk h1 { font-size: 28px; font-weight: 700; color: #111; line-height: 1.2; letter-spacing: -0.01em; }
.bk h2 { font-size: 20px; font-weight: 600; color: #111; line-height: 1.3; }
.bk h3 { font-size: 16px; font-weight: 600; color: #111; line-height: 1.4; }
.bk p { font-size: 15px; line-height: 1.6; color: #333; }
.bk-header { display: flex; align-items: center; gap: 10px; padding-top: 24px; padding-bottom: 18px; }
.bk-header .logo { width: 32px; height: 32px; border-radius: 6px; display: grid; place-items: center; color: #fff; font-weight: 600; font-size: 14px; flex-shrink: 0; }
.bk-header .name { font-size: 13px; color: #666; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; }
.bk-image { display: flex; align-items: center; justify-content: center; }
.bk-image .ph { width: 100%; height: 220px; background: repeating-linear-gradient(-45deg, var(--surface-2) 0 8px, var(--surface) 8px 16px); border: 1px dashed var(--border-strong); border-radius: 4px; display: grid; place-items: center; color: var(--text-muted); font-family: var(--font-mono); font-size: 11px; }
.bk-button { display: flex; }
.bk-button .btn-cta { display: inline-block; padding: 10px 18px; background: #111; color: #fff; text-decoration: none; border-radius: 6px; font-weight: 500; font-size: 14px; }
.bk-divider hr { border: 0; border-top: 1px solid #e0e0e0; margin: 8px 0; }
.bk-callout { padding: 16px 18px; background: #fafafa; border-left: 3px solid var(--brand); border-radius: 4px; }
.bk-stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.bk-stats .stat-card { padding: 10px 12px; background: #fafafa; border-radius: 4px; }
.bk-stats .stat-card .v { font-size: 20px; font-weight: 600; color: #111; font-variant-numeric: tabular-nums; }
.bk-stats .stat-card .l { font-size: 11px; color: #666; margin-top: 2px; }
.bk-twocol { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.bk-twocol .col-card { padding: 14px; background: #fafafa; border-radius: 4px; border: 1px solid #eee; }
.bk-twocol .col-card h3 { font-size: 14px; margin-bottom: 6px; }
.bk-twocol .col-card p { font-size: 13px; }
.bk-footer { padding: 18px 28px 28px; border-top: 1px solid #eee; margin-top: 14px; font-size: 11px; color: #888; line-height: 1.5; }

/* hover toolbar */
.bk-toolbar { position: absolute; top: 6px; right: 6px; display: none; gap: 2px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 2px; box-shadow: var(--shadow-1); z-index: 5; }
.bk:hover .bk-toolbar, .bk[data-selected="true"] .bk-toolbar { display: flex; }
.bk-toolbar button { width: 24px; height: 24px; border: 0; background: transparent; color: var(--text-muted); border-radius: 3px; cursor: pointer; display: grid; place-items: center; }
.bk-toolbar button:hover { background: var(--surface-hover); color: var(--text-strong); }
.bk-toolbar button.danger:hover { background: var(--danger-soft); color: var(--danger); }

/* + button between blocks */
.bk-inserter { position: relative; height: 12px; display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .12s ease, height .12s ease; }
.bk-inserter:hover, .bk-inserter[data-open="true"] { opacity: 1; height: 28px; }
.bk-inserter::before { content: ""; position: absolute; left: 28px; right: 28px; top: 50%; height: 1px; background: var(--brand); opacity: 0.5; }
.bk-inserter button.add { width: 24px; height: 24px; border-radius: 50%; background: var(--brand); color: #fff; border: 0; display: grid; place-items: center; cursor: pointer; z-index: 1; box-shadow: 0 0 0 3px var(--surface); }
.bk-add-menu { position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 6px; box-shadow: var(--shadow-3); z-index: 50; display: none; grid-template-columns: repeat(3, 1fr); gap: 2px; width: 360px; }
.bk-inserter[data-open="true"] .bk-add-menu { display: grid; }
.bk-add-menu button { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; background: transparent; border: 0; border-radius: var(--r-sm); cursor: pointer; color: var(--text-strong); font-size: 11px; transition: background .1s ease; }
.bk-add-menu button:hover { background: var(--surface-hover); }
.bk-add-menu button .ic { width: 18px; height: 18px; color: var(--text-muted); }
.bk-add-menu button:hover .ic { color: var(--brand); }

/* inspector */
.block-side { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); position: sticky; top: 64px; }
.block-side-tabs { display: flex; border-bottom: 1px solid var(--border); padding: 0; }
.block-side-tabs button { flex: 1; padding: 10px 12px; background: transparent; border: 0; border-bottom: 2px solid transparent; color: var(--text-muted); font-size: 12px; font-weight: 500; cursor: pointer; }
.block-side-tabs button[aria-pressed="true"] { color: var(--text-strong); border-bottom-color: var(--brand); }
.block-side-body { padding: 0; max-height: calc(100vh - 200px); overflow-y: auto; }
.insp-section { padding: var(--s-3); border-bottom: 1px solid var(--border); }
.insp-section:last-child { border-bottom: 0; }
.insp-section h4 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 8px; font-weight: 600; }
.insp-row { display: grid; grid-template-columns: 80px 1fr; gap: 10px; align-items: center; padding: 6px 0; }
.insp-row label { font-size: 12px; color: var(--text-muted); }
.insp-row .input, .insp-row .select { font-size: 12px; padding: 6px 8px; }
.insp-seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 0; border: 1px solid var(--border); border-radius: var(--r-sm); padding: 2px; background: var(--surface-2); }
.insp-seg button { padding: 5px 8px; background: transparent; border: 0; border-radius: 4px; cursor: pointer; font-size: 11px; color: var(--text-muted); font-weight: 500; }
.insp-seg button[aria-pressed="true"] { background: var(--surface); color: var(--text-strong); box-shadow: var(--shadow-1); }
.insp-help { font-size: 11px; color: var(--text-muted); line-height: 1.5; padding: 10px 0 0; }


.brand-bg-picker { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; max-width: 380px; }
.brand-bg-picker button { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 4px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm); cursor: pointer; color: var(--text-muted); font-size: 11px; transition: border-color .12s ease; }
.brand-bg-picker button:hover { border-color: var(--border-strong); }
.brand-bg-picker button[aria-pressed="true"] { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand) inset; color: var(--text-strong); }
.brand-bg-picker .sw { width: 22px; height: 22px; border-radius: 50%; }


.bg-tone-tabs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; padding: 0 var(--s-1) var(--s-2); }
.bg-tone-tabs button { position: relative; padding: 6px 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); cursor: pointer; font-size: 11px; color: var(--text-muted); font-weight: 500; }
.bg-tone-tabs button[aria-pressed="true"] { background: var(--surface); color: var(--text-strong); border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand) inset; }
.bg-tone-tabs button .dot { position: absolute; top: 4px; right: 5px; width: 5px; height: 5px; border-radius: 50%; }
.bg-swatch-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 4px; padding: 0 var(--s-1) var(--s-2); }
.bg-swatch-grid button { position: relative; aspect-ratio: 1; border: 1px solid var(--border); border-radius: var(--r-sm); cursor: pointer; transition: transform .1s ease; padding: 0; }
.bg-swatch-grid button:hover { transform: scale(1.08); }
.bg-swatch-grid button[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--brand); border-color: transparent; }
.bg-swatch-grid button .brand-dot { position: absolute; top: -3px; right: -3px; width: 8px; height: 8px; border-radius: 50%; box-shadow: 0 0 0 2px var(--surface); }

.brand-bg-fancy { padding: var(--s-2); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); max-width: 520px; }
.brand-bg-fancy .bg-tone-tabs { padding: 0 0 var(--s-2); }
.brand-bg-fancy .bg-swatch-grid { padding: 0 0 var(--s-2); }
.brand-bg-fancy .bg-current { padding-top: var(--s-2); border-top: 1px solid var(--border); align-items: center; font-size: 12px; color: var(--text-muted); }
.brand-bg-fancy .bg-current .preview { width: 28px; height: 28px; border-radius: var(--r-sm); border: 1px solid var(--border); }
.brand-bg-fancy .bg-current .hex { color: var(--text-strong); font-size: 12px; font-variant-numeric: tabular-nums; padding: 2px 8px; background: var(--surface-2); border-radius: var(--r-sm); letter-spacing: 0.02em; }

/* ---------- POP-OUT BUTTON ---------- */
.popout-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface); color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 4px 8px; font-size: 12px; font-weight: 500;
  cursor: pointer;
  transition: color 80ms ease, border-color 80ms ease, background 80ms ease;
}
.popout-btn:hover { color: var(--text-strong); border-color: var(--border-strong); background: var(--surface-hover); }
.popout-btn svg { width: 12px; height: 12px; }

/* ---------- POP-OUT MODAL ---------- */
.popout {
  position: fixed; inset: 0;
  background: var(--bg);
  z-index: 1000;
  display: flex; flex-direction: column;
  animation: popout-in 180ms ease-out;
}
.popout[hidden] { display: none; }
[data-theme="light"] .popout { background: #f3f5f7; }
[data-theme="dark"]  .popout { background: #07080a; }
@keyframes popout-in {
  from { opacity: 0; transform: scale(0.985); }
  to   { opacity: 1; transform: scale(1); }
}
.popout-bar {
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-4);
  padding: 10px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.popout-bar .left, .popout-bar .right { display: flex; align-items: center; gap: var(--s-3); }
.popout-bar .title { font-size: 14px; font-weight: 600; color: var(--text-strong); }
.popout-bar .sub   { font-size: 12px; color: var(--text-muted); }

.popout-stage {
  flex: 1; min-height: 0;
  overflow: auto;
  padding: var(--s-8) var(--s-6);
  display: flex; flex-direction: column; align-items: center; gap: var(--s-3);
}
[data-theme="light"] .popout-stage { background: #f3f5f7; }
[data-theme="dark"]  .popout-stage { background: #07080a; }

/* device frames inside popout */
.po-device {
  background: var(--surface);
  border-radius: 18px;
  box-shadow: var(--sh-3);
  overflow: hidden;
  position: relative;
  transition: width 220ms cubic-bezier(.2,.8,.2,1), max-width 220ms cubic-bezier(.2,.8,.2,1);
  display: flex; flex-direction: column;
}
.po-device.size-desktop { width: min(100%, 920px); border-radius: 12px; }
.po-device.size-tablet  { width: 600px; max-width: 100%; }
.po-device.size-mobile  { width: 380px; max-width: 100%; border-radius: 28px; }
.po-device .po-chrome {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-soft);
  font-size: 12px; color: var(--text-muted);
}
.po-device .po-chrome .pdot { width: 9px; height: 9px; border-radius: 50%; background: var(--border-strong); }
.po-device .po-chrome .pdot:nth-child(1) { background: #ef6a5a; }
.po-device .po-chrome .pdot:nth-child(2) { background: #f3bd4f; }
.po-device .po-chrome .pdot:nth-child(3) { background: #5fc56e; }
.po-device .po-chrome .url {
  flex: 1; text-align: center;
  background: var(--surface);
  padding: 4px 10px; border-radius: var(--r-pill);
  border: 1px solid var(--border-soft);
  font-size: 11px; color: var(--text-muted);
  max-width: 360px; margin: 0 auto;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.po-device .po-body { background: #fff; flex: 1; min-height: 0; overflow: auto; }
[data-theme="dark"] .po-device .po-body { background: #fafafa; }
.po-device.size-mobile .po-chrome { padding: 6px 12px; justify-content: center; }
.po-device.size-mobile .po-chrome .pdot { display: none; }
.po-device.size-mobile .po-chrome::before {
  content: ''; width: 64px; height: 4px; border-radius: 999px; background: var(--border-strong);
}

/* fullscreen view of the email itself (for compose preview) */
.po-mail {
  width: 100%; padding: 28px 32px 48px;
  font-family: 'Geist', sans-serif;
  font-size: 15px; line-height: 1.6; color: #1a1a1a;
}
.po-device.size-mobile .po-mail { padding: 20px 18px 36px; font-size: 14px; }

/* canvas variant — show the 600px design at full bleed on a soft surface */
.po-canvas-stage {
  width: 100%; padding: var(--s-6) 0;
  display: flex; justify-content: center;
}
.po-canvas-stage .block-canvas-inner {
  max-width: 600px; width: 600px;
  box-shadow: var(--sh-3);
}

/* size tabs in popout bar reuse preview-tabs */
.popout-bar .preview-tabs { padding: 3px; }
.popout-bar .preview-tabs button { padding: 5px 12px; font-size: 12px; }

/* hide host containers' padding when content is moved out */
.popout-host-empty { display: none; }

.po-placeholder {
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-4) var(--s-5);
  margin: var(--s-3);
  background: var(--surface-2);
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-md);
  color: var(--text-muted);
}
.po-placeholder-icon {
  width: 36px; height: 36px; flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  color: var(--text-strong);
}
.po-placeholder-text { flex: 1; min-width: 0; }
.po-placeholder-text .ttl { font-size: 13px; font-weight: 500; color: var(--text-strong); }
.po-placeholder-text .sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* When the canvas-inner is moved out, give the host a tall friendly empty state */
#block-canvas:has(> .po-placeholder) { padding: var(--s-12) var(--s-4); min-height: 0; }

/* ---------- LARGE MODAL VARIANT + SEND-SUCCESS + CSV-IMPORT ---------- */
.modal.modal-lg { width: min(640px, 100%); }

.send-success { width: min(560px, 100%); overflow: hidden; padding: 0; }
.send-success .ss-banner {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, oklch(58% 0.18 155), oklch(50% 0.20 160));
  color: #fff;
  padding: var(--s-8) var(--s-6);
  display: flex; flex-direction: column; align-items: center; gap: var(--s-3);
  text-align: center;
}
.send-success .ss-banner::before {
  content: ''; position: absolute; inset: -120px -50px auto auto;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgb(255 255 255 / 0.22), transparent 60%);
  filter: blur(20px); pointer-events: none;
}
.send-success .ss-check {
  width: 56px; height: 56px; border-radius: 14px;
  background: rgb(255 255 255 / 0.18);
  border: 1px solid rgb(255 255 255 / 0.30);
  display: grid; place-items: center; color: #fff;
  position: relative;
  animation: ss-pop 480ms cubic-bezier(.2,.8,.2,1);
}
@keyframes ss-pop {
  from { transform: scale(0.6); opacity: 0; }
  60%  { transform: scale(1.1); opacity: 1; }
  to   { transform: scale(1); }
}
.send-success .ss-banner h2 { font-size: 24px; letter-spacing: -0.02em; color: #fff; font-weight: 600; }
.send-success .ss-banner p { font-size: 14px; color: rgb(255 255 255 / 0.88); line-height: 1.5; }
.send-success .ss-stats {
  display: grid; grid-template-columns: 1fr 1fr 1fr;
  padding: var(--s-4) var(--s-5);
  border-bottom: 1px solid var(--border-soft);
}
.send-success .ss-stat { text-align: center; display: flex; flex-direction: column; gap: 2px; }
.send-success .ss-stat .num { font-size: 22px; font-weight: 600; color: var(--text-strong); letter-spacing: -0.015em; font-variant-numeric: tabular-nums; }
.send-success .ss-stat .lbl { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.send-success .ss-stat + .ss-stat { border-left: 1px solid var(--border-soft); }
.send-success .ss-timeline { padding: var(--s-4) var(--s-5) var(--s-5); }
.send-success .ss-timeline-lbl { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); margin-bottom: var(--s-3); }
.send-success .ss-tl-row {
  display: grid; grid-template-columns: 72px 1fr auto;
  gap: var(--s-3); align-items: center;
  font-size: 13px; padding: 8px 0;
}
.send-success .ss-tl-row + .ss-tl-row { border-top: 1px dashed var(--border-soft); }
.send-success .ss-tl-when { font-size: 11px; color: var(--text-muted); font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.send-success .ss-tl-what { color: var(--text); line-height: 1.4; }
.send-success .ss-tl-what strong { color: var(--text-strong); font-weight: 500; }
.send-success .ss-tl-status {
  font-size: 11px; padding: 2px 8px; border-radius: var(--r-pill);
  background: var(--st-sent-bg); color: var(--st-sent-fg);
  border: 1px solid var(--st-sent-bd); font-weight: 500; white-space: nowrap;
}
.send-success .ss-tl-status.next {
  background: var(--surface-2); color: var(--text-muted);
  border-color: var(--border-soft);
}
.send-success .modal-foot { padding: var(--s-3) var(--s-5); }

/* CSV IMPORT modal */
.csv-import { width: min(720px, 100%); display: flex; flex-direction: column; max-height: 90vh; padding: 0; }
.csv-import .modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--s-4) var(--s-5); border-bottom: 1px solid var(--border-soft);
}
.csv-stepper {
  display: flex; align-items: center;
  padding: var(--s-3) var(--s-5);
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-soft);
  gap: var(--s-2);
}
.csv-step { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-muted); font-weight: 500; }
.csv-step[data-state="active"] { color: var(--text-strong); }
.csv-step[data-state="done"]   { color: var(--text); }
.csv-step .num {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--surface); color: var(--text-muted);
  border: 1px solid var(--border);
  display: grid; place-items: center;
  font-size: 11px; font-weight: 600; font-variant-numeric: tabular-nums;
}
.csv-step[data-state="active"] .num { background: var(--primary); color: var(--primary-fg); border-color: var(--primary); }
.csv-step[data-state="done"] .num { background: var(--st-sent-bg); color: var(--st-sent-fg); border-color: var(--st-sent-bd); }
.csv-stepper .sep { color: var(--text-subtle); margin: 0 4px; }
.csv-pane { display: none; padding: var(--s-5); flex-direction: column; gap: var(--s-4); overflow-y: auto; }
.csv-pane[data-active="true"] { display: flex; }

.csv-drop {
  border: 2px dashed var(--border-strong);
  border-radius: var(--r-md);
  padding: var(--s-10) var(--s-6);
  text-align: center;
  background: var(--surface-2);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  transition: border-color 120ms ease, background 120ms ease;
  cursor: pointer;
}
.csv-drop:hover { border-color: oklch(58% 0.20 320); background: color-mix(in oklch, oklch(58% 0.20 320) 5%, var(--surface)); }
.csv-drop .ic {
  width: 48px; height: 48px; border-radius: 12px;
  background: linear-gradient(135deg, oklch(62% 0.18 280), oklch(58% 0.20 320));
  color: #fff; display: grid; place-items: center;
  margin-bottom: var(--s-2);
  box-shadow: 0 8px 16px -4px oklch(58% 0.20 320 / 0.40);
}
.csv-drop .ttl { font-size: 15px; font-weight: 600; color: var(--text-strong); }
.csv-drop .sub { font-size: 13px; color: var(--text-muted); }
.csv-drop .browse { font-weight: 500; color: oklch(50% 0.18 320); border: 0; background: transparent; padding: 0; cursor: pointer; font-size: inherit; }
.csv-drop .browse:hover { text-decoration: underline; }
.csv-tips { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-2); }
.csv-tip { padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: var(--r-sm); display: flex; flex-direction: column; gap: 4px; font-size: 12px; }
.csv-tip .lbl { font-size: 10px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.csv-tip strong { color: var(--text-strong); font-weight: 500; font-size: 13px; }
.csv-tip span { color: var(--text-muted); line-height: 1.4; }

.csv-file-banner { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3) var(--s-4); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); }
.csv-file-banner .ic { width: 36px; height: 36px; border-radius: 8px; background: oklch(94% 0.05 320); color: oklch(48% 0.18 320); display: grid; place-items: center; flex-shrink: 0; }
[data-theme="dark"] .csv-file-banner .ic { background: oklch(28% 0.07 320); color: oklch(80% 0.13 320); }
.csv-file-banner .nm { font-size: 13px; font-weight: 600; color: var(--text-strong); }
.csv-file-banner .meta { font-size: 12px; color: var(--text-muted); }

.csv-map { display: flex; flex-direction: column; gap: 8px; }
.csv-map-row { display: grid; grid-template-columns: 1fr 20px 220px; gap: var(--s-3); align-items: center; padding: 10px 12px; background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--r-sm); }
.csv-map-row .csv-col { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.csv-map-row .col-name { font-size: 13px; font-weight: 500; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.csv-map-row .col-sample { font-size: 11px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.csv-map-row .csv-arrow { color: var(--text-subtle); text-align: center; }

.csv-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s-2); }
.csv-sum-tile { padding: var(--s-3); background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: var(--r-sm); }
.csv-sum-tile .num { font-size: 20px; font-weight: 600; color: var(--text-strong); letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.csv-sum-tile .lbl { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.csv-sum-tile.good .num { color: oklch(45% 0.16 155); }
.csv-sum-tile.warn .num { color: oklch(50% 0.16 70); }
.csv-sum-tile.danger .num { color: oklch(50% 0.18 25); }

.csv-preview-tbl { width: 100%; border-collapse: collapse; font-size: 12px; }
.csv-preview-tbl th { text-align: left; padding: 8px 10px; background: var(--surface-2); border-bottom: 1px solid var(--border-soft); font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-muted); }
.csv-preview-tbl td { padding: 8px 10px; border-bottom: 1px solid var(--border-soft); color: var(--text); }
.csv-preview-tbl tr:last-child td { border-bottom: 0; }

.csv-opt-row { padding: var(--s-3) var(--s-4); background: color-mix(in oklch, oklch(58% 0.20 320) 4%, var(--surface)); border: 1px solid color-mix(in oklch, oklch(58% 0.20 320) 18%, var(--border)); border-radius: var(--r-md); font-size: 13px; line-height: 1.5; }
.csv-opt-row strong { color: var(--text-strong); font-weight: 500; }
.csv-opt-row a { color: oklch(50% 0.18 320); font-weight: 500; }

/* =====================================================
   Phase 1 multi-page additions (appended 2026-05-13)
   Classes the rebuilt PHP templates introduce on top of
   the prototype's original design system.
   ===================================================== */

/* Dashboard metric strip */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--s-3);
  margin-bottom: var(--s-4);
}
.metric-label {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--s-1);
}
.metric-value {
  font-size: 28px;
  font-weight: 600;
  color: var(--text-strong);
  font-variant-numeric: tabular-nums;
  margin-bottom: var(--s-1);
}

/* Brand chip image (override when an <img> is inside a brand-chip) */
.brand-chip > img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  border-radius: inherit;
}

/* Dashboard brand-list (override prototype's brand-list usage if any) */
ul.brand-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
ul.brand-list li {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  padding: var(--s-2) 0;
  border-bottom: 1px solid var(--border);
}
ul.brand-list li:last-child { border-bottom: 0; }

/* Auth page full-bleed shell */
.auth-body {
  background: var(--surface);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.auth-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--s-5) var(--s-3);
}

/* Flash messages on auth pages */
.flash {
  padding: var(--s-2) var(--s-3);
  border-radius: var(--r-sm);
  font-size: 13px;
  margin-bottom: var(--s-2);
}
.flash-error {
  background: #fde7e3;
  color: #c2410c;
  border: 1px solid #fcc8be;
}

/* ============================================================
   MOBILE / RESPONSIVE ADMIN
   The hamburger + backdrop are hidden on desktop and only come
   alive under the breakpoint below.
   ============================================================ */
.nav-toggle { display: none; }
.nav-backdrop { display: none; }

@media (max-width: 860px) {
  /* --- Shell: single column; sidebar becomes a slide-in drawer --- */
  .app { grid-template-columns: 1fr; }

  .nav-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px; margin-right: 4px;
    background: transparent; border: 1px solid var(--border);
    border-radius: var(--r-sm); color: var(--text-strong); cursor: pointer;
  }
  .nav-toggle:hover { background: var(--surface-hover); }

  .sidebar {
    position: fixed;
    top: var(--site-header-h); left: 0;
    width: 84vw; max-width: 320px;
    height: calc(100vh - var(--site-header-h));
    transform: translateX(-100%);
    transition: transform 220ms ease;
    z-index: 80;
    box-shadow: 0 12px 32px rgb(0 0 0 / 0.18);
  }
  body.nav-open .sidebar { transform: translateX(0); }

  .nav-backdrop {
    display: block;
    position: fixed; inset: var(--site-header-h) 0 0 0;
    background: rgb(0 0 0 / 0.42);
    opacity: 0; pointer-events: none;
    transition: opacity 220ms ease;
    z-index: 70;
  }
  body.nav-open .nav-backdrop { opacity: 1; pointer-events: auto; }

  /* --- Content reflow --- */
  .main { min-width: 0; }
  .page-content { padding: var(--s-4); gap: var(--s-4); }
  .page-head { flex-direction: column; align-items: flex-start; gap: var(--s-3); }
  /* Any header row (incl. inline-flex button groups) goes full width and wraps
     so action buttons like "New template" can't run off the screen edge. */
  .page-head:not(.dash-hero) > div, .page-head .right, .page-head .left { width: 100%; flex-wrap: wrap; }

  /* Topbar stacks: breadcrumb on top, full-width search, then the button.
     Also kills the horizontal overflow from the fixed-width search box. */
  .topbar { flex-direction: column; align-items: stretch; gap: var(--s-3); }
  .topbar .breadcrumb { flex-wrap: wrap; }
  .topbar .row { width: 100%; flex-direction: column; align-items: stretch; gap: var(--s-2); }
  .topbar .input-search { width: 100% !important; }
  .topbar .row .btn { width: 100%; justify-content: center; }

  /* Footer stacks and centers; copyright stays on one line. */
  .site-footer { flex-direction: column; align-items: center; text-align: center; gap: var(--s-2); height: auto; }
  .site-footer .sf-left { flex-wrap: wrap; justify-content: center; }
  .site-footer .sf-copy { white-space: nowrap; }

  /* Multi-column grids collapse to one column */
  .grid-stats, .grid-12, .grid-2, .grid-3,
  .compose-grid, .block-editor-grid, .html-editor, .welcome-grid {
    grid-template-columns: 1fr !important;
    display: grid;
  }
  .compose-side, .welcome-side { position: static; top: auto; }
  .html-editor .pane + .pane { border-left: 0; border-top: 1px solid var(--border-soft); }

  /* Let content shrink so a wide table can't push the whole page sideways. */
  .page-content { min-width: 0; }
  .page-content > * { min-width: 0; max-width: 100%; }

  /* Wide tables scroll horizontally inside their own box instead of breaking
     the layout. Bare tables (not in a .tbl-wrap) become their own scroll box. */
  .tbl-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
  table.tbl { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
  /* Keep columns at real widths (so they don't collapse to one word per line)
     and let the table scroll. The first column (subject/name) may wrap within
     a readable minimum rather than forcing a giant single line. */
  table.tbl th, table.tbl td { white-space: nowrap; }
  table.tbl th:first-child, table.tbl td:first-child { white-space: normal; min-width: 180px; }
  .tbl-toolbar { flex-wrap: wrap; }

  /* --- Composer toolbar on mobile: tidy the wrap ---
     Drop the inter-group divider lines (they leave hanging borders when the
     row wraps), even out the touch targets, and put the Save group on its own
     full-width row. !important beats the per-page <style> in the editors. */
  .tt-toolbar { flex-wrap: wrap !important; gap: 6px !important; position: static !important; }
  /* Dissolve the group boxes so their buttons become direct toolbar items and
     flow to fill each row, instead of each group wrapping as a block. The Save
     group stays intact on its own full-width row. */
  .tt-group:not(.tt-group-save) { display: contents !important; }
  .tt-btn { min-width: 38px !important; min-height: 38px !important; }
  .tt-group-save { margin-left: 0 !important; width: 100%; justify-content: space-between; }
  /* Save controls relocated below the toolbars on mobile (by mobile-nav.js)
     get their own card. Desktop never enters this branch, so it's untouched. */
  .tt-saverow {
    display: flex;
    background: var(--surface);
    border: 1px solid var(--border-soft);
    border-radius: var(--r-md);
    padding: 10px 12px;
    margin: 8px 0;
  }
  .tt-saverow .tt-group-save { width: 100%; }

  /* Buttons in action rows wrap rather than overflow */
  .btn { max-width: 100%; }
}

