/* =========================================================================
   EVEN — Email Centre prototype · "Calm & Focused" direction
   Superhuman × Linear × Stripe. Restraint as luxury.
   ========================================================================= */

:root {
  /* --- Canvas & surfaces --- */
  --canvas:      #fbfbfa;
  --surface:     #ffffff;
  --surface-2:   #f6f6f4;
  --surface-3:   #f1f0ed;
  --hover:       #f4f4f2;

  /* --- Ink --- */
  --ink:         #1a1a18;
  --ink-2:       #4a4a46;
  --muted:       #8a8a85;
  --faint:       #b6b6b0;

  /* --- Hairlines --- */
  --line:        #ececea;
  --line-2:      #e2e2df;
  --line-strong: #d8d8d4;

  /* --- Accent (single, muted indigo) --- */
  --accent:      #4f46e5;
  --accent-ink:  #4338ca;
  --accent-soft: #eef0fe;
  --accent-soft-2:#e3e6fd;
  --accent-ring: rgba(79,70,229,0.16);

  /* --- Signals (used sparingly) --- */
  --green:       #2f8f5b;
  --green-soft:  #e6f4ec;
  --amber:       #b87514;
  --amber-soft:  #fbf1de;
  --red:         #c0392b;
  --red-soft:    #fbeae8;

  /* --- Type --- */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --serif: 'Newsreader', Georgia, serif;

  /* --- Radius --- */
  --r-sm: 8px;
  --r:    12px;
  --r-lg: 16px;
  --r-xl: 22px;

  /* --- Shadow (soft, layered, low) --- */
  --sh-1: 0 1px 2px rgba(20,20,18,0.04), 0 1px 1px rgba(20,20,18,0.03);
  --sh-2: 0 2px 6px rgba(20,20,18,0.05), 0 1px 2px rgba(20,20,18,0.04);
  --sh-3: 0 12px 32px -8px rgba(20,20,18,0.12), 0 4px 12px -4px rgba(20,20,18,0.07);
  --sh-pop: 0 24px 60px -16px rgba(20,20,18,0.22), 0 8px 20px -8px rgba(20,20,18,0.10);

  --nav-w: 244px;
  --ease: cubic-bezier(.22,.61,.36,1);
  --spring: cubic-bezier(.34,1.46,.5,1);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--canvas);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'cv05' 1, 'ss01' 1;
  letter-spacing: -0.006em;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; }
::selection { background: var(--accent-soft-2); }

/* Scrollbars — quiet */
*::-webkit-scrollbar { width: 11px; height: 11px; }
*::-webkit-scrollbar-thumb { background: #dadad6; border-radius: 9px; border: 3px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: #c4c4bf; background-clip: content-box; border: 3px solid transparent; }
*::-webkit-scrollbar-track { background: transparent; }

/* =========================================================================
   APP SHELL
   ========================================================================= */
.app { display: grid; grid-template-columns: var(--nav-w) 1fr; height: 100vh; overflow: hidden; }

/* ---- LEFT NAV ---- */
.nav {
  display: flex; flex-direction: column;
  padding: 18px 14px 14px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, #fbfbfa 0%, #f8f8f6 100%);
}
.nav-brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center;
  background: var(--ink); color: #fff;
}
.brand-word { font-size: 17px; font-weight: 600; letter-spacing: -0.02em; }

.cmdk-trigger {
  display: flex; align-items: center; gap: 9px;
  width: 100%; padding: 9px 11px; margin-bottom: 16px;
  border: 1px solid var(--line-2); border-radius: var(--r);
  background: var(--surface); color: var(--muted);
  font-size: 13px; box-shadow: var(--sh-1);
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease);
}
.cmdk-trigger:hover { border-color: var(--line-strong); box-shadow: var(--sh-2); background: #fff; }
.cmdk-trigger svg { color: var(--faint); flex-shrink: 0; }
.cmdk-trigger span { flex: 1; text-align: left; }

.kbd {
  font-family: var(--font); font-size: 11px; font-weight: 500;
  color: var(--muted); background: var(--surface-2);
  border: 1px solid var(--line-2); border-radius: 6px;
  padding: 1px 6px; min-width: 20px; text-align: center; line-height: 1.5;
}
.kbd-sm { padding: 0 4px; font-size: 10.5px; }

.nav-list { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 11px;
  padding: 8px 11px; border-radius: var(--r-sm);
  color: var(--ink-2); font-size: 13.5px; font-weight: 450;
  text-align: left; position: relative;
  transition: background .14s var(--ease), color .14s var(--ease);
}
.nav-ico { width: 18px; height: 18px; flex-shrink: 0; color: var(--faint); transition: color .14s var(--ease); }
.nav-item:hover { background: var(--hover); color: var(--ink); }
.nav-item:hover .nav-ico { color: var(--muted); }
.nav-item.active { background: var(--surface); color: var(--ink); font-weight: 500; box-shadow: var(--sh-1); }
.nav-item.active .nav-ico { color: var(--accent); }
.nav-count {
  margin-left: auto; font-size: 11.5px; font-weight: 500; color: var(--muted);
  background: var(--surface-2); border-radius: 20px; padding: 1px 8px; min-width: 22px; text-align: center;
}
.nav-item.active .nav-count { background: var(--accent-soft); color: var(--accent-ink); }
.nav-dot { margin-left: auto; width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.nav-sep { height: 1px; background: var(--line); margin: 8px 11px; }

.nav-foot { padding-top: 12px; border-top: 1px solid var(--line); margin-top: 6px; }
.agent-chip { display: flex; align-items: center; gap: 10px; padding: 6px 6px; border-radius: var(--r-sm); transition: background .14s; }
.agent-chip:hover { background: var(--hover); }
.agent-meta { min-width: 0; }
.agent-name { font-size: 13px; font-weight: 500; line-height: 1.3; }
.agent-sub { font-size: 11.5px; color: var(--muted); }

.avatar {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; font-size: 11.5px; font-weight: 600;
  color: #fff; letter-spacing: 0; user-select: none;
}
.avatar-grad { background: linear-gradient(135deg, #5b54ea, #3f37c9); }

/* ---- MAIN ---- */
.main { display: flex; flex-direction: column; min-width: 0; background: var(--canvas); }
.topbar {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px;
  padding: 26px 40px 20px; flex-shrink: 0;
}
.topbar-lead { min-width: 0; }
.page-title { margin: 0; font-size: 23px; font-weight: 600; letter-spacing: -0.025em; line-height: 1.1; }
.page-sub { margin: 5px 0 0; font-size: 13.5px; color: var(--muted); line-height: 1.4; }
.topbar-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

.view-scroll { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 0 40px 56px; }
.view { max-width: 1180px; margin: 0 auto; animation: viewIn .42s var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* =========================================================================
   BUTTONS
   ========================================================================= */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 14px; border-radius: var(--r-sm);
  font-size: 13px; font-weight: 500; letter-spacing: -0.008em;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink);
  box-shadow: var(--sh-1);
  transition: transform .12s var(--ease), box-shadow .16s var(--ease), border-color .16s var(--ease), background .16s var(--ease);
}
.btn svg { width: 15px; height: 15px; }
.btn:hover { border-color: var(--line-strong); box-shadow: var(--sh-2); }
.btn:active { transform: translateY(.5px); box-shadow: var(--sh-1); }
.btn-primary {
  background: var(--accent); color: #fff; border-color: transparent;
  box-shadow: 0 1px 2px rgba(67,56,202,.28), 0 2px 8px -2px rgba(67,56,202,.36);
}
.btn-primary:hover { background: var(--accent-ink); box-shadow: 0 2px 4px rgba(67,56,202,.30), 0 6px 16px -4px rgba(67,56,202,.42); border-color: transparent; }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--ink-2); }
.btn-ghost:hover { background: var(--hover); box-shadow: none; border-color: transparent; }
.btn-sm { padding: 5px 10px; font-size: 12.5px; }
.btn-lg { padding: 11px 20px; font-size: 14px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-icon { padding: 8px; }
.btn-icon svg { width: 16px; height: 16px; }

/* =========================================================================
   CARDS / PRIMITIVES
   ========================================================================= */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--sh-1);
}
.card-pad { padding: 22px 24px; }
.card-hd { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 4px; }
.card-title { font-size: 13px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink); }
.eyebrow { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 500; padding: 2px 9px; border-radius: 20px;
  background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line);
}
.pill .dot { width: 6px; height: 6px; border-radius: 50%; }
.pill-green { background: var(--green-soft); color: var(--green); border-color: transparent; }
.pill-amber { background: var(--amber-soft); color: var(--amber); border-color: transparent; }
.pill-red { background: var(--red-soft); color: var(--red); border-color: transparent; }
.pill-accent { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; }
.dot-green { background: var(--green); }
.dot-amber { background: var(--amber); }
.dot-red { background: var(--red); }

.grid { display: grid; gap: 20px; }

/* =========================================================================
   DASHBOARD
   ========================================================================= */
.dash-grid { grid-template-columns: 1fr; gap: 22px; }

/* Deliverability hero */
.deliv-hero {
  background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
  border: 1px solid var(--line);
  border-radius: var(--r-xl); padding: 26px 28px; box-shadow: var(--sh-2);
  position: relative; overflow: hidden;
}
.deliv-hero::after {
  content: ''; position: absolute; right: -60px; top: -60px; width: 240px; height: 240px;
  background: radial-gradient(circle, rgba(47,143,91,.06), transparent 70%); pointer-events: none;
}
.deliv-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.deliv-id { display: flex; align-items: center; gap: 13px; }
.deliv-shield {
  width: 44px; height: 44px; border-radius: 13px; flex-shrink: 0;
  display: grid; place-items: center; background: var(--green-soft); color: var(--green);
}
.deliv-domain { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.deliv-read { font-size: 13px; color: var(--ink-2); margin-top: 1px; }
.deliv-rep { text-align: right; }
.deliv-rep .pill { font-size: 12.5px; padding: 4px 12px; }

.deliv-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--surface); }
.dm {
  padding: 15px 18px; position: relative;
  border-right: 1px solid var(--line);
}
.dm:last-child { border-right: none; }
.dm-label { font-size: 11.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; margin-bottom: 7px; }
.dm-val { font-size: 21px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.dm-val .unit { font-size: 13px; color: var(--muted); font-weight: 500; margin-left: 1px; }
.dm-foot { font-size: 11px; color: var(--muted); margin-top: 2px; }

.auth-row { display: flex; gap: 8px; margin-top: 18px; }
.auth-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 500; padding: 5px 11px; border-radius: 8px;
  background: var(--green-soft); color: var(--green);
}
.auth-chip svg { width: 13px; height: 13px; }
.auth-chip.amber { background: var(--amber-soft); color: var(--amber); }

/* Headline metrics row */
.metric-row { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 18px; }
.metric-card { padding: 20px 22px; }
.metric-hero .mh-num { font-size: 42px; font-weight: 650; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.metric-hero .mh-num .unit { font-size: 22px; color: var(--muted); font-weight: 500; }
.mh-label { font-size: 12.5px; color: var(--muted); margin-bottom: 14px; font-weight: 500; }
.mh-delta { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 500; color: var(--green); margin-top: 12px; }
.mh-delta svg { width: 13px; height: 13px; }
.metric-sub .ms-num { font-size: 27px; font-weight: 600; letter-spacing: -0.02em; line-height: 1; font-variant-numeric: tabular-nums; margin-top: 4px; }
.opens-note {
  display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--faint);
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line);
}
.opens-note .o-num { color: var(--muted); font-weight: 500; }

/* Two-up: chart + running */
.dash-2up { display: grid; grid-template-columns: 1.55fr 1fr; gap: 22px; }

/* trend chart */
.trend-wrap { position: relative; }
.trend-svg { width: 100%; height: 188px; display: block; overflow: visible; }
.trend-x { display: flex; justify-content: space-between; margin-top: 10px; font-size: 10.5px; color: var(--faint); padding: 0 2px; }
.trend-legend { display: flex; align-items: baseline; gap: 10px; }
.trend-legend .lg-num { font-size: 25px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

/* Running list */
.run-list { display: flex; flex-direction: column; gap: 2px; }
.run-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 6px;
  border-bottom: 1px solid var(--line); transition: background .14s;
}
.run-item:last-child { border-bottom: none; }
.run-item:hover { background: var(--hover); border-radius: 8px; }
.run-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; background: var(--accent-soft); color: var(--accent); }
.run-ico.amber { background: var(--amber-soft); color: var(--amber); }
.run-ico svg { width: 17px; height: 17px; }
.run-main { flex: 1; min-width: 0; }
.run-name { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.run-meta { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.run-tag { font-size: 11px; color: var(--muted); flex-shrink: 0; }

.segments-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.seg-card {
  padding: 16px 18px; border-radius: var(--r); cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--sh-1);
  transition: transform .14s var(--ease), box-shadow .16s var(--ease), border-color .16s;
}
.seg-card:hover { transform: translateY(-2px); box-shadow: var(--sh-2); border-color: var(--line-strong); }
.seg-num { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.seg-name { font-size: 12.5px; color: var(--ink-2); margin-top: 2px; font-weight: 500; }
.seg-bar { height: 4px; border-radius: 4px; background: var(--surface-3); margin-top: 12px; overflow: hidden; }
.seg-bar i { display: block; height: 100%; border-radius: 4px; }

/* =========================================================================
   CONTACTS
   ========================================================================= */
.contacts-layout { display: block; }
.contacts-toolbar {
  display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap;
}
.search-field {
  display: flex; align-items: center; gap: 8px; flex: 1; min-width: 220px;
  padding: 8px 13px; background: var(--surface); border: 1px solid var(--line-2);
  border-radius: var(--r-sm); box-shadow: var(--sh-1);
  transition: border-color .16s, box-shadow .16s;
}
.search-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.search-field svg { color: var(--faint); flex-shrink: 0; }
.search-field input { border: none; outline: none; flex: 1; font-size: 13.5px; background: none; color: var(--ink); }
.search-field input::placeholder { color: var(--faint); }

.seg-tabs { display: flex; gap: 4px; background: var(--surface-2); padding: 3px; border-radius: 10px; border: 1px solid var(--line); }
.seg-tab {
  padding: 6px 13px; border-radius: 7px; font-size: 12.5px; font-weight: 500; color: var(--muted);
  display: flex; align-items: center; gap: 7px; transition: all .14s var(--ease);
}
.seg-tab:hover { color: var(--ink); }
.seg-tab.active { background: var(--surface); color: var(--ink); box-shadow: var(--sh-1); }
.seg-tab .tab-count { font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums; }
.seg-tab.active .tab-count { color: var(--accent-ink); }

.filter-select {
  position: relative;
}
.fs-btn {
  display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px;
  border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface);
  font-size: 12.5px; font-weight: 500; color: var(--ink-2); box-shadow: var(--sh-1);
  transition: border-color .16s, box-shadow .16s;
}
.fs-btn:hover { border-color: var(--line-strong); box-shadow: var(--sh-2); }
.fs-btn svg { width: 13px; height: 13px; color: var(--faint); }
.fs-btn.has-val { color: var(--accent-ink); border-color: var(--accent-soft-2); background: var(--accent-soft); }
.fs-btn.has-val svg { color: var(--accent); }
.fs-menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 40; min-width: 200px;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r);
  box-shadow: var(--sh-pop); padding: 6px; max-height: 320px; overflow-y: auto;
  animation: popIn .16s var(--ease);
}
@keyframes popIn { from { opacity: 0; transform: translateY(-4px) scale(.99); } to { opacity: 1; transform: none; } }
.fs-opt {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 7px 10px; border-radius: 7px; font-size: 13px; color: var(--ink-2); width: 100%; text-align: left;
  transition: background .12s;
}
.fs-opt:hover { background: var(--hover); }
.fs-opt.sel { color: var(--accent-ink); font-weight: 500; }
.fs-opt .ck { color: var(--accent); opacity: 0; }
.fs-opt.sel .ck { opacity: 1; }

/* Contact table */
.ctable { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--sh-1); }
.ct-head, .ct-row {
  display: grid; grid-template-columns: 2.4fr 1.2fr 1fr 1.3fr 0.7fr;
  align-items: center; gap: 16px; padding: 0 22px;
}
.ct-head { height: 42px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.ct-h { font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.ct-row {
  height: 64px; border-bottom: 1px solid var(--line); cursor: pointer;
  transition: background .12s var(--ease);
}
.ct-row:last-child { border-bottom: none; }
.ct-row:hover { background: var(--hover); }
.ct-name-cell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ct-avatar { width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; font-size: 12px; font-weight: 600; color: #fff; }
.ct-name { font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ct-email { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ct-stage { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-2); }
.ct-stage .sdot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.ct-source { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ct-tags { display: flex; gap: 5px; overflow: hidden; }
.tag-chip { font-size: 11px; font-weight: 500; padding: 2px 8px; border-radius: 6px; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); white-space: nowrap; }
.ct-eng { display: flex; justify-content: flex-end; }
.eng-dot { width: 8px; height: 8px; border-radius: 50%; }
.eng-engaged { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.eng-cooling { background: var(--amber); box-shadow: 0 0 0 3px var(--amber-soft); }
.eng-cold { background: var(--faint); box-shadow: 0 0 0 3px var(--surface-3); }

.empty {
  text-align: center; padding: 64px 20px; color: var(--muted);
}
.empty svg { width: 40px; height: 40px; color: var(--faint); margin-bottom: 12px; }
.empty h3 { margin: 0 0 4px; font-size: 15px; font-weight: 600; color: var(--ink-2); }
.empty p { margin: 0; font-size: 13px; }

/* =========================================================================
   SLIDE-OVER
   ========================================================================= */
.overlay {
  position: fixed; inset: 0; z-index: 90; background: rgba(26,26,24,0.28);
  backdrop-filter: blur(2px); opacity: 0; animation: fadeIn .26s var(--ease) forwards;
}
@keyframes fadeIn { to { opacity: 1; } }
.overlay.closing { animation: fadeOut .22s var(--ease) forwards; }
@keyframes fadeOut { to { opacity: 0; } }

.slideover {
  position: fixed; top: 0; right: 0; bottom: 0; width: 480px; max-width: 92vw; z-index: 100;
  background: var(--surface); border-left: 1px solid var(--line);
  box-shadow: var(--sh-pop); transform: translateX(100%);
  display: flex; flex-direction: column; overflow: hidden;
}
.slideover.open { animation: slideIn .42s var(--ease) forwards; }
.slideover.closing { animation: slideOut .30s var(--ease) forwards; }
@keyframes slideIn { to { transform: none; } }
@keyframes slideOut { to { transform: translateX(100%); } }

.so-head { padding: 22px 24px 18px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.so-close {
  position: absolute; top: 18px; right: 18px; width: 30px; height: 30px; border-radius: 8px;
  display: grid; place-items: center; color: var(--muted); transition: background .14s, color .14s;
}
.so-close:hover { background: var(--hover); color: var(--ink); }
.so-id { display: flex; align-items: center; gap: 14px; }
.so-avatar { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-size: 16px; font-weight: 600; color: #fff; flex-shrink: 0; }
.so-name { font-size: 18px; font-weight: 600; letter-spacing: -0.015em; }
.so-contact { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.so-actions { display: flex; gap: 8px; margin-top: 18px; }
.so-actions .btn { flex: 1; justify-content: center; }

.so-body { flex: 1; overflow-y: auto; padding: 4px 24px 28px; }
.so-flags { display: flex; flex-wrap: wrap; gap: 7px; margin: 18px 0 4px; }
.followup-banner {
  display: flex; align-items: center; gap: 10px; margin: 16px 0; padding: 11px 14px;
  background: var(--amber-soft); border: 1px solid #f2e3c2; border-radius: var(--r-sm);
  font-size: 12.5px; color: var(--amber); font-weight: 500;
}
.followup-banner svg { width: 16px; height: 16px; flex-shrink: 0; }

.so-section { margin-top: 24px; }
.so-section-t { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; }
.so-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.so-field { min-width: 0; }
.so-field .lbl { font-size: 11.5px; color: var(--muted); margin-bottom: 2px; }
.so-field .val { font-size: 13px; color: var(--ink); font-weight: 450; }
.so-field .val.empty-val { color: var(--faint); font-weight: 400; }

.so-notes {
  font-size: 13px; line-height: 1.6; color: var(--ink-2);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r);
  padding: 14px 16px; font-family: var(--serif); font-size: 14.5px;
}
.so-prefs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.so-pref { background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px; padding: 10px 12px; }
.so-pref .pk { font-size: 11px; color: var(--muted); }
.so-pref .pv { font-size: 13px; font-weight: 500; margin-top: 1px; }

.timeline { display: flex; flex-direction: column; gap: 0; }
.tl-item { display: flex; gap: 13px; padding-bottom: 16px; position: relative; }
.tl-item:not(:last-child)::before { content: ''; position: absolute; left: 4.5px; top: 14px; bottom: 0; width: 1.5px; background: var(--line-2); }
.tl-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 3px; flex-shrink: 0; background: var(--surface); border: 2px solid var(--accent); z-index: 1; }
.tl-text { font-size: 12.5px; color: var(--ink-2); line-height: 1.45; }

.note-add { display: flex; gap: 8px; margin-top: 12px; }
.note-add input { flex: 1; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: var(--r-sm); font-size: 13px; outline: none; transition: border-color .16s, box-shadow .16s; }
.note-add input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }

/* =========================================================================
   COMPOSE / BUILDER
   ========================================================================= */
.composer { display: grid; grid-template-columns: 1fr 392px; gap: 28px; align-items: start; }

.steps-rail { display: flex; align-items: center; gap: 0; margin-bottom: 26px; }
.step-node { display: flex; align-items: center; gap: 9px; }
.step-bubble {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  font-size: 12px; font-weight: 600; flex-shrink: 0;
  background: var(--surface); border: 1.5px solid var(--line-strong); color: var(--muted);
  transition: all .22s var(--ease);
}
.step-node.active .step-bubble { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: 0 0 0 4px var(--accent-ring); }
.step-node.done .step-bubble { background: var(--green); border-color: var(--green); color: #fff; }
.step-label { font-size: 12.5px; font-weight: 500; color: var(--muted); }
.step-node.active .step-label { color: var(--ink); }
.step-node.done .step-label { color: var(--ink-2); }
.step-line { flex: 1; height: 1.5px; background: var(--line-2); margin: 0 16px; min-width: 30px; transition: background .3s; }
.step-line.filled { background: var(--green); }

.field-group { margin-bottom: 18px; }
.field-label { display: block; font-size: 12px; font-weight: 600; color: var(--ink-2); margin-bottom: 7px; letter-spacing: -0.005em; }
.field-input, .field-textarea {
  width: 100%; padding: 11px 14px; border: 1px solid var(--line-2); border-radius: var(--r-sm);
  font-size: 14px; color: var(--ink); outline: none; background: var(--surface);
  transition: border-color .16s, box-shadow .16s; resize: none;
}
.field-input:focus, .field-textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
.field-textarea { min-height: 280px; line-height: 1.7; font-family: var(--serif); font-size: 15.5px; color: var(--ink-2); }
.field-hint { font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.field-from { display: flex; align-items: center; gap: 9px; padding: 10px 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); font-size: 13.5px; color: var(--ink-2); }
.field-from .avatar { width: 24px; height: 24px; font-size: 10px; }

.composer-toolbar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.tool-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px;
  border: 1px solid var(--line-2); border-radius: 8px; background: var(--surface);
  font-size: 12px; font-weight: 500; color: var(--ink-2); box-shadow: var(--sh-1);
  transition: border-color .14s, box-shadow .14s, background .14s, color .14s;
}
.tool-btn:hover { border-color: var(--line-strong); box-shadow: var(--sh-2); }
.tool-btn svg { width: 14px; height: 14px; color: var(--muted); }
.tool-btn-ai { background: var(--accent-soft); border-color: var(--accent-soft-2); color: var(--accent-ink); }
.tool-btn-ai:hover { background: var(--accent-soft-2); border-color: var(--accent-soft-2); }
.tool-btn-ai svg { color: var(--accent); }
.tool-btn.is-busy { pointer-events: none; opacity: .85; }

.merge-menu, .tmpl-menu {
  position: absolute; z-index: 50; margin-top: 6px; min-width: 220px;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r);
  box-shadow: var(--sh-pop); padding: 6px; animation: popIn .16s var(--ease);
}
.menu-head { font-size: 10.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); padding: 6px 10px 4px; }
.menu-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 10px; border-radius: 7px; font-size: 13px; color: var(--ink-2); width: 100%; text-align: left; transition: background .12s; }
.menu-item:hover { background: var(--hover); }
.menu-item .mono { font-family: ui-monospace, 'SF Mono', monospace; font-size: 12px; color: var(--accent-ink); }
.menu-item .meta { font-size: 11px; color: var(--faint); }

/* Email preview (phone frame) */
.preview-col { position: sticky; top: 0; }
.preview-label { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.phone {
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 22px;
  box-shadow: var(--sh-3); overflow: hidden; max-width: 360px; margin: 0 auto;
}
.phone-bar { height: 30px; background: var(--surface-2); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: center; gap: 5px; }
.phone-bar i { width: 5px; height: 5px; border-radius: 50%; background: var(--line-strong); }
.phone-mail { padding: 18px 18px 22px; }
.pm-from { display: flex; align-items: center; gap: 9px; padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.pm-from .avatar { width: 32px; height: 32px; font-size: 12px; }
.pm-from-name { font-size: 13px; font-weight: 600; }
.pm-from-email { font-size: 11px; color: var(--muted); }
.pm-subject { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; margin: 14px 0 10px; line-height: 1.35; }
.pm-body { font-size: 13px; line-height: 1.65; color: var(--ink-2); white-space: pre-wrap; font-family: var(--serif); font-size: 14px; }
.pm-footer { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 10.5px; color: var(--faint); line-height: 1.5; }
.pm-footer a { color: var(--muted); text-decoration: underline; }

.composer-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }

/* =========================================================================
   REVIEW & SEND
   ========================================================================= */
.review-grid { display: grid; grid-template-columns: 1fr; gap: 18px; max-width: 760px; }
.review-card { padding: 20px 22px; }
.rc-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.rc-ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); color: var(--ink-2); flex-shrink: 0; }
.rc-ico svg { width: 16px; height: 16px; }
.rc-title { font-size: 14px; font-weight: 600; }
.rc-sub { font-size: 12px; color: var(--muted); }

.recipient-summary { display: flex; align-items: center; gap: 16px; }
.recip-big { font-size: 30px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.recip-bd { flex: 1; }
.recip-bars { display: flex; flex-direction: column; gap: 7px; }
.rbar-row { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.rbar-row .rl { width: 130px; color: var(--ink-2); }
.rbar-track { flex: 1; height: 6px; border-radius: 4px; background: var(--surface-3); overflow: hidden; }
.rbar-track i { display: block; height: 100%; border-radius: 4px; }
.rbar-row .rn { width: 46px; text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); }

/* Pre-flight checks */
.preflight { display: flex; flex-direction: column; gap: 2px; }
.pf-item { display: flex; align-items: center; gap: 11px; padding: 9px 4px; border-bottom: 1px solid var(--line); }
.pf-item:last-child { border-bottom: none; }
.pf-check { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; background: var(--green-soft); color: var(--green); }
.pf-check svg { width: 12px; height: 12px; }
.pf-text { font-size: 13px; color: var(--ink-2); }

/* CASL footer preview */
.casl-preview {
  font-size: 11.5px; line-height: 1.6; color: var(--muted);
  background: var(--surface-2); border: 1px dashed var(--line-strong); border-radius: var(--r-sm);
  padding: 13px 15px;
}
.casl-preview strong { color: var(--ink-2); font-weight: 600; }

/* A/B toggle */
.toggle-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.tch-text { flex: 1; }
.toggle {
  position: relative; width: 42px; height: 24px; border-radius: 20px; flex-shrink: 0;
  background: var(--line-strong); transition: background .24s var(--ease); cursor: pointer;
}
.toggle::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: var(--sh-2); transition: transform .26s var(--spring);
}
.toggle.on { background: var(--accent); }
.toggle.on::after { transform: translateX(18px); }

.ab-body { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.ab-variants { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ab-var { border: 1px solid var(--line-2); border-radius: var(--r); padding: 13px 15px; position: relative; }
.ab-var.win { border-color: var(--green); background: var(--green-soft); }
.ab-tag { position: absolute; top: -9px; left: 13px; font-size: 10px; font-weight: 700; letter-spacing: 0.05em; padding: 1px 7px; border-radius: 5px; background: var(--ink); color: #fff; }
.ab-var.win .ab-tag { background: var(--green); }
.ab-subject { font-size: 13px; font-weight: 500; line-height: 1.4; margin-top: 4px; }
.ab-rate { font-size: 11.5px; color: var(--muted); margin-top: 8px; display: flex; align-items: center; gap: 6px; }
.ab-rate b { color: var(--ink); font-variant-numeric: tabular-nums; }
.ab-meta { display: flex; align-items: center; gap: 20px; margin-top: 16px; font-size: 12px; color: var(--ink-2); }
.ab-meta .am-num { font-weight: 600; color: var(--ink); }

/* =========================================================================
   ⭐ BATCH SEND
   ========================================================================= */
.batch-card { padding: 20px 22px; transition: background .3s var(--ease); }
.batch-card.on { background: linear-gradient(160deg, #fdfdff, #f7f7ff); border-color: var(--accent-soft-2); }
.batch-body { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }

.batch-control { margin-bottom: 22px; }
.bc-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.bc-label { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }
.bc-value { font-size: 13px; font-weight: 600; color: var(--accent-ink); font-variant-numeric: tabular-nums; }

/* segmented control */
.segmented { display: grid; gap: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 11px; padding: 4px; }
.seg-sizes { grid-template-columns: repeat(6, 1fr); }
.seg-times { grid-template-columns: repeat(6, 1fr); }
.seg-opt {
  padding: 8px 4px; border-radius: 8px; font-size: 12.5px; font-weight: 500; color: var(--muted);
  text-align: center; transition: all .16s var(--ease); white-space: nowrap; font-variant-numeric: tabular-nums;
}
.seg-opt:hover { color: var(--ink); }
.seg-opt.sel { background: var(--surface); color: var(--accent-ink); box-shadow: var(--sh-2); font-weight: 600; }

/* live estimate */
.batch-estimate {
  display: flex; align-items: center; gap: 16px; margin-top: 4px; padding: 16px 18px;
  background: var(--surface); border: 1px solid var(--accent-soft-2); border-radius: var(--r);
  box-shadow: var(--sh-1);
}
.be-ico { width: 40px; height: 40px; border-radius: 11px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex-shrink: 0; }
.be-ico svg { width: 20px; height: 20px; }
.be-main { flex: 1; }
.be-line { font-size: 13px; color: var(--ink-2); }
.be-line b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.be-finish { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; margin-top: 2px; }
.be-finish .accent { color: var(--accent-ink); }

.warm-note {
  display: flex; align-items: flex-start; gap: 9px; margin-top: 14px; font-size: 12px; color: var(--muted); line-height: 1.5;
}
.warm-note svg { width: 15px; height: 15px; color: var(--amber); flex-shrink: 0; margin-top: 1px; }

/* Help tooltip "?" */
.help-q {
  display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 50%;
  background: var(--surface-2); border: 1px solid var(--line-2); color: var(--muted);
  font-size: 11px; font-weight: 600; cursor: help; position: relative; vertical-align: middle;
  transition: background .14s, color .14s, border-color .14s;
}
.help-q:hover { background: var(--accent-soft); color: var(--accent-ink); border-color: var(--accent-soft-2); }
.help-tip {
  position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%) translateY(4px);
  width: 290px; z-index: 60; background: var(--ink); color: #f2f2f0;
  font-size: 12px; line-height: 1.55; font-weight: 400; padding: 13px 15px; border-radius: 11px;
  box-shadow: var(--sh-pop); opacity: 0; pointer-events: none; transition: opacity .2s var(--ease), transform .2s var(--ease);
  text-align: left; letter-spacing: 0;
}
.help-tip::after { content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); border: 6px solid transparent; border-top-color: var(--ink); }
.help-q:hover .help-tip, .help-q:focus .help-tip { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }

/* Send bar */
.send-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px; max-width: 760px;
  margin-top: 6px; padding: 18px 22px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--sh-2); position: sticky; bottom: 0;
}
.send-summary { font-size: 13px; color: var(--ink-2); }
.send-summary b { color: var(--ink); }

/* =========================================================================
   SEQUENCES
   ========================================================================= */
.seq-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
.seq-card {
  padding: 22px 24px; transition: box-shadow .2s var(--ease), border-color .2s, transform .2s var(--ease);
  position: relative; overflow: hidden;
}
.seq-card.on { border-color: var(--accent-soft-2); }
.seq-card.on::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); }
.seq-hd { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.seq-id { display: flex; align-items: center; gap: 12px; }
.seq-ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0; background: var(--surface-2); color: var(--ink-2); transition: all .2s; }
.seq-card.on .seq-ico { background: var(--accent-soft); color: var(--accent); }
.seq-ico svg { width: 19px; height: 19px; }
.seq-name { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; }
.seq-status-line { font-size: 12px; margin-top: 1px; display: flex; align-items: center; gap: 7px; }
.seq-desc { font-size: 13px; color: var(--ink-2); line-height: 1.55; margin-bottom: 18px; }
.seq-steps { display: flex; flex-direction: column; gap: 0; margin-bottom: 6px; }
.seq-step { display: flex; gap: 12px; padding: 9px 0; position: relative; }
.seq-step:not(:last-child)::before { content: ''; position: absolute; left: 21px; top: 26px; bottom: -2px; width: 1.5px; background: var(--line-2); }
.seq-day { width: 44px; flex-shrink: 0; font-size: 10.5px; font-weight: 600; color: var(--muted); text-align: center; padding-top: 4px; }
.seq-day b { display: block; font-size: 14px; color: var(--ink); }
.seq-step-body { flex: 1; min-width: 0; }
.seq-step-subj { font-size: 12.5px; font-weight: 500; color: var(--ink); line-height: 1.4; }
.seq-step-note { font-size: 11.5px; color: var(--muted); margin-top: 2px; line-height: 1.4; }
.seq-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.seq-enrolled { font-size: 12.5px; color: var(--ink-2); }
.seq-enrolled b { font-weight: 600; color: var(--ink); }

/* =========================================================================
   ANALYTICS
   ========================================================================= */
.an-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 24px; }
.an-stat { padding: 18px 20px; }
.an-stat .as-num { font-size: 25px; font-weight: 600; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.an-stat .as-label { font-size: 12px; color: var(--muted); margin-top: 2px; }
.an-stat .as-label.dim { color: var(--faint); }

.an-bars { display: flex; align-items: flex-end; gap: 14px; height: 200px; padding: 0 4px; }
.an-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; min-width: 0; }
.an-bar { width: 100%; max-width: 44px; border-radius: 7px 7px 3px 3px; background: var(--accent); transition: height .5s var(--ease), background .14s; position: relative; cursor: pointer; }
.an-bar:hover { background: var(--accent-ink); }
.an-bar-val { position: absolute; top: -20px; left: 50%; transform: translateX(-50%); font-size: 11px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.an-bar-label { font-size: 10.5px; color: var(--muted); text-align: center; line-height: 1.3; max-width: 100%; }

.camp-table { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--sh-1); }
.cmp-head, .cmp-row { display: grid; grid-template-columns: 2.6fr 0.9fr 0.8fr 0.9fr 0.7fr 0.7fr; align-items: center; gap: 14px; padding: 0 22px; }
.cmp-head { height: 42px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.cmp-h { font-size: 11px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.cmp-h.r, .cmp-cell.r { text-align: right; justify-self: end; }
.cmp-row { min-height: 62px; padding-top: 11px; padding-bottom: 11px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background .12s; }
.cmp-row:last-child { border-bottom: none; }
.cmp-row:hover { background: var(--hover); }
.cmp-name { font-size: 13.5px; font-weight: 500; line-height: 1.3; }
.cmp-subj { font-size: 11.5px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 320px; }
.cmp-cell { font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.cmp-cell.big { font-size: 14.5px; font-weight: 600; color: var(--ink); }
.cmp-cell.dim { color: var(--faint); }
.cmp-status { font-size: 11.5px; }

/* =========================================================================
   DELIVERABILITY / SETTINGS
   ========================================================================= */
.deliv-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; align-items: start; }
.auth-list { display: flex; flex-direction: column; gap: 2px; }
.auth-item { display: flex; align-items: center; gap: 14px; padding: 14px 4px; border-bottom: 1px solid var(--line); }
.auth-item:last-child { border-bottom: none; }
.auth-badge { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; background: var(--green-soft); color: var(--green); }
.auth-badge.amber { background: var(--amber-soft); color: var(--amber); }
.auth-badge svg { width: 17px; height: 17px; }
.auth-name { font-size: 13.5px; font-weight: 600; }
.auth-desc { font-size: 12px; color: var(--muted); margin-top: 1px; }
.auth-state { margin-left: auto; }

.supp-table { display: flex; flex-direction: column; }
.supp-row { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.supp-row:last-child { border-bottom: none; }
.supp-email { font-size: 13px; font-weight: 450; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.supp-reason { font-size: 11.5px; }
.supp-date { font-size: 11.5px; color: var(--muted); width: 64px; text-align: right; flex-shrink: 0; }

.auto-supp {
  display: flex; gap: 13px; padding: 16px 18px; background: var(--accent-soft);
  border: 1px solid var(--accent-soft-2); border-radius: var(--r); margin-top: 16px;
}
.auto-supp .as-ico { width: 32px; height: 32px; border-radius: 9px; background: #fff; color: var(--accent); display: grid; place-items: center; flex-shrink: 0; box-shadow: var(--sh-1); }
.auto-supp .as-ico svg { width: 17px; height: 17px; }
.auto-supp-t { font-size: 13px; font-weight: 600; color: var(--accent-ink); }
.auto-supp-d { font-size: 12px; color: var(--accent-ink); opacity: .82; margin-top: 2px; line-height: 1.5; }

/* Preference centre preview */
.pref-frame {
  border: 1px solid var(--line-2); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--sh-2); background: var(--surface);
}
.pref-top { padding: 20px 22px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, #fff, #fafafa); }
.pref-brand { display: flex; align-items: center; gap: 10px; }
.pref-brand .brand-mark { width: 26px; height: 26px; }
.pref-h { font-size: 14px; font-weight: 600; margin-top: 14px; }
.pref-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.pref-body { padding: 18px 22px; }
.pref-opt { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.pref-opt:last-of-type { border-bottom: none; }
.pref-check { width: 18px; height: 18px; border-radius: 6px; border: 1.5px solid var(--line-strong); flex-shrink: 0; display: grid; place-items: center; transition: all .16s; }
.pref-check.on { background: var(--accent); border-color: var(--accent); }
.pref-check svg { width: 11px; height: 11px; color: #fff; opacity: 0; transition: opacity .16s; }
.pref-check.on svg { opacity: 1; }
.pref-opt-text { font-size: 13px; }
.pref-opt-sub { font-size: 11.5px; color: var(--muted); }
.pref-foot { padding: 16px 22px; border-top: 1px solid var(--line); background: var(--surface-2); }
.pref-unsub { font-size: 12px; color: var(--muted); text-align: center; }
.pref-unsub a { color: var(--accent-ink); text-decoration: underline; }

/* =========================================================================
   COMMAND PALETTE
   ========================================================================= */
.cmdk { position: fixed; inset: 0; z-index: 200; display: flex; align-items: flex-start; justify-content: center; padding-top: 14vh; }
.cmdk[hidden] { display: none; }
.cmdk-backdrop { position: absolute; inset: 0; background: rgba(26,26,24,0.32); backdrop-filter: blur(3px); animation: fadeIn .2s var(--ease); }
.cmdk-panel {
  position: relative; width: 580px; max-width: 92vw; background: var(--surface);
  border: 1px solid var(--line-2); border-radius: var(--r-lg); box-shadow: var(--sh-pop);
  overflow: hidden; animation: cmdkIn .26s var(--spring);
}
@keyframes cmdkIn { from { opacity: 0; transform: scale(.97) translateY(-8px); } to { opacity: 1; transform: none; } }
.cmdk-input-row { display: flex; align-items: center; gap: 11px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.cmdk-input-row svg { color: var(--faint); flex-shrink: 0; }
.cmdk-input-row input { flex: 1; border: none; outline: none; font-size: 15.5px; background: none; color: var(--ink); letter-spacing: -0.01em; }
.cmdk-input-row input::placeholder { color: var(--faint); }
.cmdk-results { max-height: 380px; overflow-y: auto; padding: 8px; }
.cmdk-group-label { font-size: 10.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--faint); padding: 8px 10px 4px; }
.cmdk-item {
  display: flex; align-items: center; gap: 12px; padding: 9px 11px; border-radius: 9px;
  font-size: 13.5px; color: var(--ink-2); cursor: pointer; transition: background .1s;
}
.cmdk-item.sel { background: var(--accent-soft); color: var(--accent-ink); }
.cmdk-item .ci-ico { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); flex-shrink: 0; color: var(--muted); }
.cmdk-item.sel .ci-ico { background: #fff; color: var(--accent); }
.cmdk-item .ci-ico svg { width: 15px; height: 15px; }
.cmdk-item .ci-avatar { width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; font-size: 10px; font-weight: 600; color: #fff; }
.cmdk-item-main { flex: 1; min-width: 0; }
.cmdk-item-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmdk-item-sub { font-size: 11.5px; color: var(--faint); }
.cmdk-item .ci-kind { font-size: 11px; color: var(--faint); }
.cmdk-empty { text-align: center; padding: 36px 20px; color: var(--muted); font-size: 13px; }
.cmdk-foot { display: flex; align-items: center; gap: 18px; padding: 10px 16px; border-top: 1px solid var(--line); background: var(--surface-2); font-size: 11px; color: var(--muted); }

/* =========================================================================
   TOASTS
   ========================================================================= */
.toast-stack { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  display: flex; align-items: center; gap: 11px; padding: 11px 16px 11px 13px;
  background: var(--ink); color: #f4f4f2; border-radius: 11px; box-shadow: var(--sh-pop);
  font-size: 13px; font-weight: 450; animation: toastIn .34s var(--spring);
}
.toast.out { animation: toastOut .26s var(--ease) forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px) scale(.98); } }
.toast .t-ico { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; background: rgba(255,255,255,.12); }
.toast .t-ico svg { width: 13px; height: 13px; color: #8ee0a8; }

/* =========================================================================
   AI drafting shimmer
   ========================================================================= */
.shimmer-lines { display: flex; flex-direction: column; gap: 11px; padding: 4px 0; }
.shimmer-line { height: 13px; border-radius: 6px; background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.spin { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* utility */
.flex { display: flex; }
.items-center { align-items: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.mt-0 { margin-top: 0; }
.text-muted { color: var(--muted); }
.section-gap { margin-top: 30px; }
.section-label { font-size: 12px; font-weight: 600; letter-spacing: 0.02em; color: var(--ink-2); margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.section-label .count { font-size: 11.5px; color: var(--muted); font-weight: 450; }

/* =========================================================================
   RESPONSIVE — graceful under 1280
   ========================================================================= */
@media (max-width: 1280px) {
  :root { --nav-w: 220px; }
  .view-scroll { padding: 0 28px 48px; }
  .topbar { padding: 22px 28px 18px; }
  .composer { grid-template-columns: 1fr 340px; gap: 22px; }
  .metric-row { grid-template-columns: 1fr 1fr; }
  .metric-hero { grid-column: 1 / -1; }
  .an-summary { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 1080px) {
  .composer { grid-template-columns: 1fr; }
  .preview-col { position: static; max-width: 360px; }
  .dash-2up { grid-template-columns: 1fr; }
  .seq-grid { grid-template-columns: 1fr; }
  .deliv-cols { grid-template-columns: 1fr; }
  .ct-head, .ct-row { grid-template-columns: 2.4fr 1.2fr 1fr 0.6fr; }
  .ct-h.tags-h, .ct-tags { display: none; }
}
