/* AI Sales OS — design system
   Ink sidebar + warm paper canvas (light) / deep graphite (dark). Geist for UI, Instrument Serif for display.
   Accent comes from workspace branding (--accent), so white-label workspaces recolour the whole product. */
@font-face { font-family: 'Geist'; src: url('/fonts/geist-latin-wght-normal.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Geist Mono'; src: url('/fonts/geist-mono-latin-wght-normal.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Instrument Serif'; src: url('/fonts/instrument-serif-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Instrument Serif'; src: url('/fonts/instrument-serif-latin-400-italic.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: swap; }

:root {
  color-scheme: light;
  --accent: #6d4aff;
  --accent-ink: #ffffff;
  --accent-soft: color-mix(in oklab, var(--accent) 12%, transparent);
  --accent-line: color-mix(in oklab, var(--accent) 35%, transparent);
  --bg: #f5f3ee; --bg-2: #efece5; --panel: #ffffff; --panel-2: #faf9f6; --sunken: #f1efe9;
  --ink: #1b1a17; --ink-2: #4a4740; --muted: #78746b; --faint: #a7a296;
  --line: #e6e2d9; --line-2: #d9d4c8;
  --side: #121110; --side-2: #1b1a18; --side-ink: #e9e6df; --side-muted: #8d887d; --side-line: #2a2825;
  --good: #1f8a4c; --good-soft: #e4f4ea; --warn: #b26a00; --warn-soft: #fbf0dc; --bad: #c93a32; --bad-soft: #fbe7e5; --info: #2463c9; --info-soft: #e5eefc;
  --s1: #257de0; --s2: #f47230; --s3: #00b894;
  --radius: 14px; --radius-sm: 10px; --radius-xs: 7px;
  --shadow-1: 0 1px 0 rgba(20, 18, 12, 0.04), 0 1px 3px rgba(20, 18, 12, 0.05);
  --shadow-2: 0 2px 4px rgba(20, 18, 12, 0.04), 0 12px 32px -12px rgba(20, 18, 12, 0.18);
  --shadow-3: 0 24px 64px -16px rgba(20, 18, 12, 0.35);
  --font: 'Geist', ui-sans-serif, -apple-system, 'Segoe UI', 'Noto Sans', 'Noto Sans Devanagari', sans-serif;
  --mono: 'Geist Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --serif: 'Instrument Serif', ui-serif, Georgia, serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  font-family: var(--font); color: var(--ink); font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; font-feature-settings: 'ss01', 'cv11';
}
:root[data-theme='dark'] {
  color-scheme: dark;
  --accent-soft: color-mix(in oklab, var(--accent) 20%, transparent);
  --bg: #0f0f0e; --bg-2: #141413; --panel: #181816; --panel-2: #1d1d1b; --sunken: #121211;
  --ink: #efece6; --ink-2: #c9c5bb; --muted: #95907f; --faint: #68645a;
  --line: #2a2926; --line-2: #36342f;
  --side: #0a0a09; --side-2: #141412; --side-line: #22211e;
  --good: #3fbf74; --good-soft: #13291c; --warn: #e3a338; --warn-soft: #2e2412; --bad: #f0675d; --bad-soft: #321613; --info: #6aa3ff; --info-soft: #14213a;
  --s1: #338ced; --s2: #e76624; --s3: #00a888;
  --shadow-1: 0 1px 0 rgba(0, 0, 0, .3); --shadow-2: 0 16px 40px -16px rgba(0, 0, 0, .7); --shadow-3: 0 30px 80px -20px rgba(0, 0, 0, .85);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); }
body { overflow-x: hidden; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--accent-soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
.serif { font-family: var(--serif); font-weight: 400; letter-spacing: -0.01em; }
.mono { font-family: var(--mono); font-size: 12px; }
.muted { color: var(--muted); } .faint { color: var(--faint); } .small { font-size: 12px; } .tiny { font-size: 11px; }
.nowrap { white-space: nowrap; } .right { text-align: right; } .grow { flex: 1; min-width: 0; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.side { background: var(--side); color: var(--side-ink); position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 14px 12px; gap: 6px; z-index: 20; }
.side-brand { display: flex; align-items: center; gap: 10px; padding: 6px 8px 14px; }
.logo { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: var(--accent-ink); background: var(--accent); box-shadow: inset 0 0 0 1px rgba(255,255,255,.15), 0 6px 16px -6px var(--accent); letter-spacing: .02em; }
.side-brand b { display: block; font-size: 14px; } .side-brand small { color: var(--side-muted); font-size: 11.5px; }
.ws-switch { margin: 0 4px 10px; width: calc(100% - 8px); display: flex; align-items: center; gap: 8px; background: var(--side-2); border: 1px solid var(--side-line); color: var(--side-ink); border-radius: 10px; padding: 7px 10px; font: inherit; font-size: 12.5px; cursor: pointer; text-align: left; }
.ws-switch:hover { border-color: #3a3833; }
.ws-switch .dot { width: 8px; height: 8px; border-radius: 99px; background: var(--good); flex: none; }
.nav { display: flex; flex-direction: column; gap: 1px; overflow-y: auto; flex: 1; margin: 0 -4px; padding: 0 4px; }
.nav-label { color: var(--side-muted); font-size: 10.5px; letter-spacing: .09em; text-transform: uppercase; padding: 14px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 9px; color: #c9c5bb; font-size: 13.5px; transition: background .15s, color .15s; }
.nav a svg { width: 17px; height: 17px; opacity: .8; flex: none; }
.nav a:hover { background: var(--side-2); color: #fff; }
.nav a.active { background: linear-gradient(90deg, color-mix(in oklab, var(--accent) 28%, transparent), color-mix(in oklab, var(--accent) 8%, transparent)); color: #fff; box-shadow: inset 2px 0 0 var(--accent); }
.nav a.active svg { opacity: 1; }
.nav .count { margin-left: auto; font-size: 11px; font-family: var(--mono); background: #2a2825; color: #ddd8cc; border-radius: 99px; padding: 0 7px; line-height: 18px; }
.nav .count.hot { background: var(--accent); color: var(--accent-ink); }
.side-foot { border-top: 1px solid var(--side-line); padding: 10px 4px 2px; display: flex; flex-direction: column; gap: 8px; }
.outbound-pill { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--side-muted); padding: 6px 8px; border-radius: 8px; background: var(--side-2); }
.outbound-pill i { width: 8px; height: 8px; border-radius: 99px; background: #6b675e; }
.outbound-pill.on i { background: #3fbf74; box-shadow: 0 0 0 4px rgba(63,191,116,.18); }
.user-chip { display: flex; align-items: center; gap: 9px; padding: 6px 6px; border-radius: 10px; cursor: pointer; border: 0; background: none; color: inherit; font: inherit; text-align: left; width: 100%; }
.user-chip:hover { background: var(--side-2); }
.avatar { width: 30px; height: 30px; border-radius: 99px; background: linear-gradient(135deg, #3b3934, #24231f); display: grid; place-items: center; font-size: 12px; font-weight: 600; color: #f0ede6; flex: none; }
.user-chip b { font-size: 12.5px; display: block; } .user-chip small { font-size: 11px; color: var(--side-muted); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 15; display: flex; align-items: center; gap: 12px; padding: 12px 28px; background: color-mix(in oklab, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.topbar.scrolled { border-bottom-color: var(--line); }
.crumbs { font-size: 13px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.crumbs b { color: var(--ink); font-weight: 600; }
.search { flex: 1; max-width: 420px; margin-left: auto; position: relative; }
.search input { width: 100%; padding-left: 34px; background: var(--panel); }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 15px; color: var(--faint); }
.search kbd { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); }
kbd { font-family: var(--mono); font-size: 10.5px; color: var(--muted); border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 5px; padding: 0 5px; background: var(--panel-2); }
.icon-btn { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--ink-2); cursor: pointer; transition: all .15s; }
.icon-btn:hover { border-color: var(--line-2); color: var(--ink); }
.icon-btn svg { width: 17px; height: 17px; }
.menu-btn { display: none; }
.content { padding: 8px 28px 80px; max-width: 1440px; width: 100%; margin: 0 auto; }
.page { animation: pageIn .45s var(--ease) both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.demo-banner { margin: 10px 28px 0; padding: 8px 14px; border-radius: 10px; background: repeating-linear-gradient(135deg, var(--warn-soft), var(--warn-soft) 10px, color-mix(in oklab, var(--warn-soft) 70%, var(--panel)) 10px, color-mix(in oklab, var(--warn-soft) 70%, var(--panel)) 20px); color: var(--warn); font-size: 12.5px; font-weight: 600; border: 1px solid color-mix(in oklab, var(--warn) 30%, transparent); }

/* ---------- Page header ---------- */
.ph { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin: 18px 0 22px; flex-wrap: wrap; }
.ph h1 { font-size: 30px; line-height: 1.1; letter-spacing: -0.02em; font-weight: 600; }
.ph h1 em { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: 1.12em; letter-spacing: -0.01em; color: var(--accent); }
.ph p { margin: 6px 0 0; color: var(--muted); max-width: 680px; }
.ph .eyebrow { font-size: 11.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.live-dot { width: 7px; height: 7px; border-radius: 99px; background: var(--good); box-shadow: 0 0 0 0 color-mix(in oklab, var(--good) 60%, transparent); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--good) 55%, transparent); } 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* ---------- Controls ---------- */
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.btn { font: inherit; font-size: 13px; font-weight: 500; display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line-2); background: var(--panel); color: var(--ink); padding: 7px 13px; border-radius: 10px; cursor: pointer; transition: transform .12s var(--ease), box-shadow .15s, background .15s, border-color .15s; white-space: nowrap; }
.btn:hover { border-color: color-mix(in oklab, var(--ink) 25%, var(--line-2)); box-shadow: var(--shadow-1); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 15px; height: 15px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 16px -8px var(--accent); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.dark { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn.good { background: var(--good); border-color: var(--good); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--sunken); box-shadow: none; }
.btn.danger { color: var(--bad); }
.btn.sm { padding: 4px 9px; font-size: 12px; border-radius: 8px; }
.btn[disabled], .btn.loading { opacity: .55; pointer-events: none; }
.btn.loading::after { content: ''; width: 12px; height: 12px; border-radius: 99px; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
input, select, textarea { font: inherit; font-size: 13.5px; color: var(--ink); background: var(--panel); border: 1px solid var(--line-2); border-radius: 10px; padding: 8px 11px; transition: border-color .15s, box-shadow .15s; min-width: 0; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { width: 100%; min-height: 120px; resize: vertical; line-height: 1.55; }
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; font-weight: 500; color: var(--ink-2); }
label.field .hint { font-weight: 400; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.seg { display: inline-flex; background: var(--sunken); border: 1px solid var(--line); border-radius: 11px; padding: 3px; gap: 2px; }
.seg button { font: inherit; font-size: 12.5px; border: 0; background: transparent; color: var(--muted); padding: 5px 11px; border-radius: 8px; cursor: pointer; transition: all .15s; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--panel); color: var(--ink); box-shadow: var(--shadow-1); font-weight: 500; }
.switch { position: relative; width: 38px; height: 22px; border-radius: 99px; background: var(--line-2); border: 0; cursor: pointer; transition: background .2s; flex: none; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 99px; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s var(--ease); }
.switch.on { background: var(--good); } .switch.on::after { transform: translateX(16px); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font: inherit; font-size: 12.5px; padding: 5px 11px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--panel); cursor: pointer; color: var(--ink-2); transition: all .15s; }
.chip:hover { border-color: var(--accent-line); }
.chip.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* ---------- Cards ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px 0; }
.card-h h3 { font-size: 14px; } .card-h p { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.card-b { padding: 16px 18px 18px; }
.card.pad { padding: 18px; }
a.card, .card.link { transition: transform .2s var(--ease), box-shadow .2s, border-color .2s; cursor: pointer; }
a.card:hover, .card.link:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); border-color: var(--line-2); }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); }
.mt { margin-top: 14px; } .mt2 { margin-top: 22px; } .mb { margin-bottom: 14px; }

/* KPI tiles */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 12px; }
.kpi { position: relative; padding: 14px 16px 15px; overflow: hidden; }
.kpi .k-label { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.kpi .k-val { font-size: 28px; font-weight: 600; letter-spacing: -0.03em; margin-top: 6px; font-variant-numeric: tabular-nums; line-height: 1.05; }
.kpi .k-val small { font-size: 14px; font-weight: 500; color: var(--muted); letter-spacing: 0; margin-left: 3px; }
.kpi .k-sub { font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.kpi.hero { grid-column: span 2; background: radial-gradient(120% 140% at 100% 0%, var(--accent-soft), transparent 55%), var(--panel); }
.kpi.hero .k-val { font-size: 40px; }
.kpi.hero .k-val .serif { font-style: italic; color: var(--accent); }
.kpi-icon { width: 22px; height: 22px; border-radius: 7px; display: grid; place-items: center; background: var(--sunken); color: var(--ink-2); }
.kpi-icon svg { width: 13px; height: 13px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 26px 0 12px; }
.section-title h2 { font-size: 15px; } .section-title span { font-size: 12px; color: var(--muted); }

/* Tags & badges */
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 500; padding: 2px 8px; border-radius: 99px; background: var(--sunken); color: var(--ink-2); white-space: nowrap; border: 1px solid var(--line); }
.tag.good { background: var(--good-soft); color: var(--good); border-color: transparent; }
.tag.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.tag.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.tag.info { background: var(--info-soft); color: var(--info); border-color: transparent; }
.tag.accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.tag.Hot { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
.tag.Warm { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.tag i { width: 6px; height: 6px; border-radius: 99px; background: currentColor; }
.score-ring { --v: 50; width: 38px; height: 38px; border-radius: 99px; display: grid; place-items: center; background: conic-gradient(var(--accent) calc(var(--v) * 1%), var(--sunken) 0); position: relative; font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums; flex: none; }
.score-ring::before { content: ''; position: absolute; inset: 4px; border-radius: 99px; background: var(--panel); }
.score-ring span { position: relative; }

/* Tables */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
table.t th { text-align: left; font-weight: 500; font-size: 11.5px; letter-spacing: .03em; color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; background: var(--panel); }
table.t td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tbody tr { transition: background .12s; }
table.t tbody tr.click { cursor: pointer; }
table.t tbody tr:hover { background: var(--panel-2); }
table.t .num { text-align: right; font-variant-numeric: tabular-nums; }
.co { display: flex; align-items: center; gap: 10px; min-width: 0; }
.co-logo { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; font-weight: 600; font-size: 12px; color: #fff; flex: none; }
.co b { display: block; font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.co small { color: var(--muted); font-size: 11.5px; }

/* Lists / feeds */
.feed { display: flex; flex-direction: column; }
.feed-item { display: flex; gap: 11px; padding: 10px 0; border-bottom: 1px dashed var(--line); align-items: flex-start; }
.feed-item:last-child { border-bottom: 0; }
.feed-dot { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; flex: none; font-size: 11px; font-weight: 600; color: #fff; }
.feed-item .t1 { font-size: 13px; } .feed-item .t2 { font-size: 11.5px; color: var(--muted); margin-top: 1px; }

/* Empty, skeleton */
.empty { text-align: center; padding: 46px 20px; color: var(--muted); }
.empty .em-art { width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 18px; display: grid; place-items: center; background: var(--sunken); border: 1px solid var(--line); color: var(--faint); }
.empty .em-art svg { width: 28px; height: 28px; }
.empty h4 { color: var(--ink); font-size: 15px; margin-bottom: 4px; }
.empty p { margin: 0 auto 14px; max-width: 380px; font-size: 13px; }
.skel { background: linear-gradient(90deg, var(--sunken) 0%, color-mix(in oklab, var(--sunken) 50%, var(--panel)) 50%, var(--sunken) 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite linear; border-radius: 8px; }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* Toast, modal, drawer */
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 100; }
.toast { background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 12px; box-shadow: var(--shadow-3); font-size: 13px; max-width: 420px; animation: toastIn .3s var(--ease) both; display: flex; gap: 10px; align-items: flex-start; }
.toast.err { background: var(--bad); color: #fff; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.overlay { position: fixed; inset: 0; background: rgba(12, 11, 9, .42); backdrop-filter: blur(3px); z-index: 60; display: grid; place-items: center; padding: 20px; animation: fade .2s both; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow-3); width: min(620px, 100%); max-height: calc(100vh - 40px); overflow: auto; animation: modalIn .28s var(--ease) both; }
.modal.wide { width: min(860px, 100%); }
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.modal-h { padding: 20px 22px 6px; } .modal-h h3 { font-size: 17px; } .modal-h p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.modal-b { padding: 14px 22px; } .modal-f { padding: 14px 22px 20px; display: flex; justify-content: flex-end; gap: 8px; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: var(--panel); border-left: 1px solid var(--line); box-shadow: var(--shadow-3); z-index: 61; display: flex; flex-direction: column; animation: drawerIn .3s var(--ease) both; }
@keyframes drawerIn { from { transform: translateX(30px); opacity: 0; } }
.callout { border-radius: 12px; padding: 11px 14px; font-size: 13px; border: 1px solid var(--line); background: var(--panel-2); display: flex; gap: 10px; align-items: flex-start; }
.callout.warn { background: var(--warn-soft); border-color: transparent; color: color-mix(in oklab, var(--warn) 80%, var(--ink)); }
.callout.bad { background: var(--bad-soft); border-color: transparent; color: color-mix(in oklab, var(--bad) 80%, var(--ink)); }
.callout.good { background: var(--good-soft); border-color: transparent; color: color-mix(in oklab, var(--good) 75%, var(--ink)); }
.callout.info { background: var(--info-soft); border-color: transparent; color: color-mix(in oklab, var(--info) 75%, var(--ink)); }
.callout svg { width: 16px; height: 16px; flex: none; margin-top: 2px; }

/* ---------- Charts ---------- */
.chart { position: relative; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .axis-text { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .series { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { opacity: .1; }
.chart .xhair { stroke: var(--ink-2); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .pt { stroke: var(--panel); stroke-width: 2; }
.tip { position: absolute; pointer-events: none; background: var(--ink); color: var(--bg); border-radius: 10px; padding: 8px 10px; font-size: 12px; box-shadow: var(--shadow-3); white-space: nowrap; transform: translate(-50%, calc(-100% - 12px)); z-index: 5; transition: opacity .1s; }
.tip b { display: block; font-weight: 600; margin-bottom: 3px; }
.tip .sw { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 3px; border-radius: 2px; }
.hbar { display: grid; grid-template-columns: 120px minmax(0, 1fr) 46px; align-items: center; gap: 10px; padding: 5px 0; font-size: 12.5px; cursor: default; }
.hbar .lbl { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .track { height: 12px; position: relative; }
.hbar .fill { height: 100%; border-radius: 0 4px 4px 0; background: var(--accent); min-width: 2px; transform-origin: left; animation: grow .8s var(--ease) both; }
.hbar .val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.hbar:hover .fill { filter: brightness(1.1); }
@keyframes grow { from { transform: scaleX(0); } }
.funnel-row .track { background: var(--sunken); border-radius: 0 4px 4px 0; }
.conv { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.conv div { padding: 10px 12px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); }
.conv b { font-size: 18px; font-variant-numeric: tabular-nums; display: block; letter-spacing: -0.02em; }
.conv span { font-size: 11.5px; color: var(--muted); }

/* ---------- Pipeline board ---------- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(232px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 14px; scroll-snap-type: x proximity; }
.col { background: var(--bg-2); border: 1px solid var(--line); border-radius: 14px; display: flex; flex-direction: column; min-height: 420px; scroll-snap-align: start; transition: background .15s, border-color .15s; }
.col.drop { background: var(--accent-soft); border-color: var(--accent-line); }
.col-h { padding: 12px 12px 8px; display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; }
.col-h .n { font-family: var(--mono); font-size: 11px; color: var(--muted); font-weight: 500; }
.col-h .bar { width: 4px; height: 14px; border-radius: 4px; }
.col-b { padding: 4px 8px 10px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.deal { background: var(--panel); border: 1px solid var(--line); border-radius: 11px; padding: 10px 11px; cursor: grab; box-shadow: var(--shadow-1); transition: transform .15s var(--ease), box-shadow .15s; }
.deal:hover { box-shadow: var(--shadow-2); transform: translateY(-1px); }
.deal.dragging { opacity: .5; transform: rotate(1.5deg); }
.deal b { font-size: 13px; display: block; } .deal .m { font-size: 11.5px; color: var(--muted); margin-top: 3px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* ---------- Inbox ---------- */
.inbox { display: grid; grid-template-columns: 330px minmax(0, 1fr) 300px; height: calc(100vh - 150px); min-height: 560px; overflow: hidden; }
.inbox > * { min-height: 0; overflow-y: auto; }
.ib-list { border-right: 1px solid var(--line); }
.ib-item { display: block; padding: 12px 14px; border-bottom: 1px solid var(--line); cursor: pointer; transition: background .12s; position: relative; }
.ib-item:hover { background: var(--panel-2); }
.ib-item.on { background: var(--accent-soft); }
.ib-item.unread::before { content: ''; position: absolute; left: 5px; top: 18px; width: 6px; height: 6px; border-radius: 99px; background: var(--accent); }
.ib-item .t { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 600; }
.ib-item .s { font-size: 12px; color: var(--muted); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.thread { padding: 18px 22px; display: flex; flex-direction: column; gap: 14px; background: var(--panel-2); }
.bubble { max-width: 86%; border-radius: 14px; padding: 12px 14px; border: 1px solid var(--line); background: var(--panel); box-shadow: var(--shadow-1); }
.bubble.out { align-self: flex-end; background: color-mix(in oklab, var(--accent) 7%, var(--panel)); border-color: var(--accent-line); }
.bubble .bh { font-size: 11.5px; color: var(--muted); margin-bottom: 6px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.bubble pre, .msg pre { white-space: pre-wrap; font-family: var(--font); margin: 0; font-size: 13px; line-height: 1.6; }
.suggest { border: 1px dashed var(--accent-line); background: var(--panel); border-radius: 14px; padding: 14px; }
.ib-side { border-left: 1px solid var(--line); padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.kv { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 7px 10px; font-size: 12.5px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; word-break: break-word; }
.timeline { display: flex; flex-direction: column; gap: 8px; }
.timeline div { display: flex; gap: 8px; font-size: 12px; align-items: center; }
.timeline i { width: 8px; height: 8px; border-radius: 99px; background: var(--line-2); flex: none; }
.timeline i.on { background: var(--good); }

/* Messages / approvals */
.msg { border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; background: var(--panel); margin-bottom: 12px; box-shadow: var(--shadow-1); }
.msg-h { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.msg .subj { font-weight: 600; margin-bottom: 6px; }
.blockers { margin: 10px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.blockers li { font-size: 12px; color: var(--warn); display: flex; gap: 6px; }
.blockers li::before { content: '•'; }

/* Tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin: 6px 0 18px; overflow-x: auto; }
.tabs button { font: inherit; font-size: 13px; border: 0; background: none; color: var(--muted); padding: 9px 12px; border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; }
.tabs button:hover { color: var(--ink); }
.tabs button.on { color: var(--ink); border-color: var(--accent); font-weight: 600; }

/* Agents */
.agent-card { padding: 18px; position: relative; overflow: hidden; }
.agent-card .glow { position: absolute; inset: -40% -20% auto auto; width: 220px; height: 220px; border-radius: 99px; filter: blur(40px); opacity: .18; pointer-events: none; }
.agent-av { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; color: #fff; box-shadow: 0 10px 24px -12px currentColor; }
.agent-av svg { width: 22px; height: 22px; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; }
.status i { width: 7px; height: 7px; border-radius: 99px; background: var(--good); }
.status.running i { background: var(--info); animation: pulse 1.2s infinite; }
.status.paused i { background: var(--faint); }

/* Wizard */
.steps { display: flex; gap: 6px; margin-bottom: 18px; }
.steps div { flex: 1; height: 4px; border-radius: 4px; background: var(--line); transition: background .3s; }
.steps div.on { background: var(--accent); }
.opt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.opt { border: 1px solid var(--line-2); border-radius: 12px; padding: 11px 12px; cursor: pointer; background: var(--panel); font: inherit; text-align: left; color: var(--ink); transition: all .15s; }
.opt:hover { border-color: var(--accent-line); }
.opt.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent) inset; }
.opt b { font-size: 13px; display: block; } .opt small { color: var(--muted); font-size: 11.5px; }

/* ---------- Assistant ---------- */
.orb-btn { position: fixed; right: 24px; bottom: 24px; width: 58px; height: 58px; border-radius: 99px; border: 0; cursor: pointer; z-index: 40; background: radial-gradient(circle at 30% 25%, #fff6 0, transparent 35%), conic-gradient(from 210deg, var(--accent), #ff7ab6, #ffb86b, #45d6b5, var(--accent)); box-shadow: 0 18px 40px -12px var(--accent), inset 0 0 0 1px rgba(255,255,255,.25); animation: orbSpin 8s linear infinite; display: grid; place-items: center; }
.orb-btn svg { width: 24px; height: 24px; color: #fff; filter: drop-shadow(0 1px 2px rgba(0,0,0,.3)); animation: orbSpin 8s linear infinite reverse; }
.orb-btn:hover { transform: scale(1.05); }
@keyframes orbSpin { to { transform: rotate(360deg); } }
.assistant { position: fixed; right: 24px; bottom: 96px; width: min(440px, calc(100vw - 32px)); height: min(640px, calc(100vh - 130px)); background: var(--panel); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-3); z-index: 41; display: flex; flex-direction: column; overflow: hidden; animation: modalIn .3s var(--ease) both; }
.assistant.full { position: static; width: 100%; height: calc(100vh - 170px); min-height: 560px; animation: none; box-shadow: var(--shadow-1); }
.as-h { padding: 14px 16px; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid var(--line); background: radial-gradient(140% 160% at 0% 0%, var(--accent-soft), transparent 60%); }
.as-orb { width: 34px; height: 34px; border-radius: 99px; flex: none; position: relative; background: conic-gradient(from 0deg, var(--accent), #ff7ab6, #ffb86b, #45d6b5, var(--accent)); animation: orbSpin 6s linear infinite; }
.as-orb::after { content: ''; position: absolute; inset: 3px; border-radius: 99px; background: var(--panel); opacity: .85; }
.as-orb.listening { animation-duration: 1.2s; box-shadow: 0 0 0 6px var(--accent-soft), 0 0 28px var(--accent); }
.as-orb.speaking { animation-duration: 2s; box-shadow: 0 0 0 5px color-mix(in oklab, #45d6b5 25%, transparent); }
.as-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.as-msg { max-width: 92%; font-size: 13.5px; line-height: 1.55; animation: toastIn .25s var(--ease) both; }
.as-msg.me { align-self: flex-end; background: var(--ink); color: var(--bg); padding: 9px 13px; border-radius: 16px 16px 4px 16px; }
.as-msg.ai { align-self: flex-start; background: var(--panel-2); border: 1px solid var(--line); padding: 11px 13px; border-radius: 16px 16px 16px 4px; }
.as-msg .as-list { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.as-msg .as-li { display: block; padding: 7px 10px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); font-size: 12.5px; cursor: pointer; }
.as-msg .as-li:hover { border-color: var(--accent-line); }
.as-msg .as-li small { display: block; color: var(--muted); font-size: 11.5px; }
.as-msg .req { margin-top: 8px; font-size: 11.5px; color: var(--info); display: flex; gap: 6px; }
.as-foot { border-top: 1px solid var(--line); padding: 10px; display: flex; gap: 8px; align-items: flex-end; }
.as-foot textarea { min-height: 42px; height: 42px; max-height: 120px; border-radius: 14px; resize: none; }
.mic { width: 42px; height: 42px; border-radius: 99px; border: 1px solid var(--line-2); background: var(--panel); cursor: pointer; display: grid; place-items: center; color: var(--ink-2); flex: none; transition: all .2s; }
.mic svg { width: 18px; height: 18px; }
.mic.on { background: var(--bad); border-color: var(--bad); color: #fff; box-shadow: 0 0 0 6px color-mix(in oklab, var(--bad) 18%, transparent); animation: pulse 1.2s infinite; }
.wave { display: flex; gap: 3px; align-items: center; height: 18px; }
.wave i { width: 3px; border-radius: 3px; background: var(--accent); animation: wave 1s ease-in-out infinite; }
.wave i:nth-child(2) { animation-delay: .1s; } .wave i:nth-child(3) { animation-delay: .2s; } .wave i:nth-child(4) { animation-delay: .3s; } .wave i:nth-child(5) { animation-delay: .4s; }
@keyframes wave { 0%, 100% { height: 4px; } 50% { height: 18px; } }
.suggestions { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 16px 10px; }

/* ---------- Auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.auth-art { background: var(--side); color: #f2efe8; padding: 44px 52px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-art::before { content: ''; position: absolute; width: 620px; height: 620px; right: -220px; top: -160px; border-radius: 99px; background: radial-gradient(circle, color-mix(in oklab, var(--accent) 60%, transparent), transparent 62%); filter: blur(10px); opacity: .55; }
.auth-art::after { content: ''; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px); background-size: 44px 44px; mask-image: radial-gradient(ellipse at 70% 20%, #000 20%, transparent 70%); }
.auth-art > * { position: relative; z-index: 1; }
.auth-art h1 { font-size: 54px; line-height: 1.02; letter-spacing: -0.035em; font-weight: 600; max-width: 560px; }
.auth-art h1 em { font-family: var(--serif); font-weight: 400; font-style: italic; color: color-mix(in oklab, var(--accent) 55%, #fff); }
.auth-art p { color: #a9a497; max-width: 460px; font-size: 15px; }
.auth-feats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; max-width: 520px; }
.auth-feats div { border: 1px solid #2c2a26; background: rgba(255,255,255,.03); border-radius: 12px; padding: 11px 12px; font-size: 12.5px; color: #cfcabe; }
.auth-feats b { display: block; color: #fff; font-size: 13px; margin-bottom: 2px; }
.auth-form { display: grid; place-items: center; padding: 40px 24px; }
.auth-card { width: min(400px, 100%); }
.auth-card h2 { font-size: 26px; letter-spacing: -0.02em; }
.auth-card .sub { color: var(--muted); margin: 6px 0 24px; }
.auth-card form { display: flex; flex-direction: column; gap: 14px; }
.auth-card input { padding: 11px 13px; font-size: 14px; }
.auth-card .btn.primary { justify-content: center; padding: 11px; font-size: 14px; }
.pw-meter { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.pw-meter i { display: block; height: 100%; width: 0; transition: width .3s, background .3s; }

/* Settings */
.settings-nav { display: flex; flex-direction: column; gap: 2px; position: sticky; top: 80px; }
.settings-nav button { font: inherit; text-align: left; border: 0; background: none; padding: 8px 12px; border-radius: 9px; color: var(--ink-2); cursor: pointer; font-size: 13px; }
.settings-nav button:hover { background: var(--sunken); }
.settings-nav button.on { background: var(--panel); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-1); border: 1px solid var(--line); }
.meter { height: 6px; border-radius: 6px; background: var(--sunken); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--accent); border-radius: 6px; }
.meter.hi i { background: var(--warn); }
.copybox { display: flex; gap: 8px; align-items: center; background: var(--sunken); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-family: var(--mono); font-size: 12px; word-break: break-all; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main { grid-template-columns: minmax(0, 1fr); }
  .inbox { grid-template-columns: 280px minmax(0, 1fr); }
  .ib-side { display: none; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 264px; transform: translateX(-100%); transition: transform .25s var(--ease); box-shadow: var(--shadow-3); }
  .side.open { transform: none; }
  .menu-btn { display: grid; }
  .topbar { padding: 10px 16px; } .content { padding: 4px 16px 90px; }
  .g2, .g3, .form-grid { grid-template-columns: minmax(0, 1fr); }
  .kpi.hero { grid-column: span 1; }
  .auth { grid-template-columns: minmax(0, 1fr); } .auth-art { display: none; }
  .inbox { grid-template-columns: minmax(0, 1fr); height: auto; }
  .inbox .ib-list { max-height: 300px; border-right: 0; border-bottom: 1px solid var(--line); }
  .search kbd { display: none; }
  .ph h1 { font-size: 24px; }
  .conv { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .demo-banner { margin: 8px 16px 0; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; } }
@media print { .side, .topbar, .orb-btn, .assistant { display: none !important; } .shell { display: block; } }

/* Utilities added in the SaaS UI pass */
[hidden] { display: none !important; }
.ib-list .seg { flex-wrap: wrap; }
@media (max-width: 900px) {
  .side:not(.open) { box-shadow: none; }
  .topbar .crumbs { display: none; }
  .topbar .search { flex: 1; }
  #askBtn span { display: none; }
  .grid[style*="220px"] { grid-template-columns: minmax(0, 1fr) !important; }
  .settings-nav { position: static; flex-direction: row; overflow-x: auto; }
}
