/* Sparkfuse CRM — interactive prototype component layer.
   Sits on top of the live app's shell.css and uses ONLY its tokens:
   --bg --card --border --text --muted --muted-2 --accent --accent-2 --accent-3 --danger
   --grad --surface-1/2/hover --cta-bg --cta-text. Extra semantic tokens are defined here
   for both themes. Patterns follow the live pages (Leads table, Dashboard tiles, Team
   Management tabs, automation drawer). */

:root {
  --ok: #16A34A; --ok-soft: rgba(22,163,74,.10);
  --warn: #B45309; --warn-soft: rgba(245,158,11,.14);
  --bad: #DC2626; --bad-soft: rgba(220,38,38,.10);
  --info: #2563EB; --info-soft: rgba(37,99,235,.10);
  --ai: #0D9488; --ai-soft: rgba(13,148,136,.10);
  --violet: #7C3AED; --violet-soft: rgba(124,58,237,.10);
  --accent-soft: rgba(79,70,229,.10);
  --orange-soft: rgba(234,88,12,.10);
  --shadow: 0 1px 2px rgba(20,20,30,.04);
  --shadow-lg: 0 18px 48px rgba(0,0,0,.18);
  --overlay: rgba(10,12,20,.45);
}
:root[data-theme="dark"] {
  --ok: #4ADE80; --ok-soft: rgba(74,222,128,.12);
  --warn: #FBBF24; --warn-soft: rgba(251,191,36,.12);
  --bad: #F87171; --bad-soft: rgba(248,113,113,.12);
  --info: #60A5FA; --info-soft: rgba(96,165,250,.12);
  --ai: #2DD4BF; --ai-soft: rgba(45,212,191,.12);
  --violet: #A78BFA; --violet-soft: rgba(167,139,250,.14);
  --accent-soft: rgba(99,102,241,.16);
  --orange-soft: rgba(251,146,60,.14);
  --shadow: 0 1px 2px rgba(0,0,0,.3);
  --shadow-lg: 0 18px 48px rgba(0,0,0,.55);
  --overlay: rgba(0,0,0,.6);
}

body { font-size: 14px; line-height: 1.5; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
.num, .mono { font-variant-numeric: tabular-nums; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .92em; }
.muted { color: var(--muted); } .muted2 { color: var(--muted-2); }
.small { font-size: 12.5px; } .tiny { font-size: 11.5px; }
.strong { font-weight: 700; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.hide { display: none !important; }
.link { color: var(--accent); font-weight: 600; cursor: pointer; }
.link:hover { text-decoration: underline; }
.right { margin-left: auto; }
.tr { text-align: right; }
.row { display: flex; align-items: center; gap: 8px; min-width: 0; }
.row.wrap { flex-wrap: wrap; }
.row.top { align-items: flex-start; }
.row.between { justify-content: space-between; }
.stack { display: grid; gap: 12px; align-content: start; min-width: 0; }
.stack.tight { gap: 6px; } .stack.loose { gap: 20px; }
.spacer { flex: 1; }
.divider { height: 1px; background: var(--border); margin: 6px 0; }

/* ---------- Shell additions (prototype shows the top bar on every page) ---------- */
body .topbar { display: flex !important; justify-content: flex-start; padding: 12px 28px; border-bottom: 1px solid var(--border); background: var(--card); gap: 12px; }
.topbar .page-crumbs { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 13px; color: var(--muted); }
.topbar .page-crumbs a { color: var(--muted); }
.topbar .page-crumbs a:hover { color: var(--text); }
.topbar .page-crumbs .cur { color: var(--text); font-weight: 700; }
.topbar .page-crumbs svg { width: 14px; height: 14px; opacity: .6; }
.gsearch { position: relative; margin-left: auto; width: min(360px, 34vw); }
.gsearch input { width: 100%; height: 36px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-1); padding: 0 12px 0 34px; font-size: 13px; }
.gsearch input:focus { outline: none; border-color: var(--accent); background: var(--card); }
.gsearch > svg { position: absolute; left: 11px; top: 10px; width: 16px; height: 16px; color: var(--muted-2); }
.gsearch kbd { position: absolute; right: 8px; top: 8px; }
kbd { font-family: ui-monospace, Consolas, monospace; font-size: 10.5px; padding: 1px 6px; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px; color: var(--muted); background: var(--card); }
.gs-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--card); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); z-index: 90; max-height: 420px; overflow-y: auto; padding: 6px; display: none; }
.gsearch.open .gs-results { display: block; }
.gs-sec { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted-2); padding: 8px 10px 4px; }
.gs-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; font-size: 13px; }
.gs-item:hover, .gs-item.sel { background: var(--surface-hover); }
.gs-item .sub { margin-left: auto; font-size: 11.5px; color: var(--muted-2); }
.role-switch { height: 36px; border-radius: 10px; border: 1px dashed var(--accent-2); background: var(--orange-soft); color: var(--text); font-size: 12.5px; font-weight: 700; padding: 0 8px; }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--border); background: var(--card); color: var(--muted); display: inline-flex; align-items: center; justify-content: center; position: relative; flex-shrink: 0; }
.icon-btn:hover { background: var(--surface-hover); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn.sm { width: 30px; height: 30px; border-radius: 8px; } .icon-btn.sm svg { width: 15px; height: 15px; } .icon-btn.xs { width: 18px; height: 18px; border-radius: 99px; } .icon-btn.xs svg { width: 11px; height: 11px; }
.topbar .notif-dropdown { width: 380px; }
.nav-link .count { margin-left: auto; font-size: 11px; font-weight: 700; color: var(--muted-2); }
.nav-link .count.hot { color: var(--accent-2); }
.nav-link .newp { margin-left: auto; font-size: 9px; font-weight: 800; letter-spacing: .05em; padding: 1px 6px; border-radius: 99px; background: var(--accent-2); color: #fff; }
.content { padding: 26px 28px 110px; }
@media (max-width: 768px) {
  body .topbar { padding: 10px 12px 10px 62px; flex-wrap: wrap; gap: 8px; }
  .gsearch { order: 5; width: 100%; margin-left: 0; }
  .topbar .page-crumbs { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; }
  .topbar .page-crumbs > *:not(:last-child) { display: none; }
  .topbar .page-crumbs .cur { overflow: hidden; text-overflow: ellipsis; }
  .topbar .role-switch, .topbar #themeBtn { display: none; }
  #createBtn { width: 36px; padding: 0; }
  .mobile-menu-btn { top: 10px; left: 12px; }
  .content { padding: 18px 16px 110px; }
  .page-head h1 { font-size: 21px; }
}

@media (max-width: 1100px) { .hide-sm { display: none; } }
@media (max-width: 1280px) { .role-switch { max-width: 150px; } }
/* Bare pages (login) hide the app chrome */
body.bare .sidebar, body.bare .topbar, body.bare .mobile-menu-btn, body.bare .asst-fab, body.bare .asst-panel { display: none !important; }
body.bare .content { padding: 0; }
/* New-vs-live markers (prototype menu → Show new-vs-live markers) */
body:not(.sf-highlight) .nav-link .sf-flag { display: none; }
.sf-highlight .sf-new { outline: 2px dashed var(--accent-2); outline-offset: 3px; border-radius: 10px; position: relative; }
.sf-highlight .sf-new::after { content: attr(data-sf-label); position: absolute; top: -9px; right: 10px; z-index: 5; padding: 1px 6px; border-radius: 99px; font-size: 9px; font-weight: 800; letter-spacing: .06em; background: var(--accent-2); color: #fff; pointer-events: none; }
.sf-highlight .sf-new:not([data-sf-label])::after { content: "NEW"; }
.sf-highlight .sf-changed { outline: 2px dashed var(--accent); outline-offset: 3px; border-radius: 10px; position: relative; }
.sf-highlight .sf-changed::after { content: "IMPROVED"; position: absolute; top: -9px; right: 10px; z-index: 5; padding: 1px 6px; border-radius: 99px; font-size: 9px; font-weight: 800; letter-spacing: .06em; background: var(--accent); color: #fff; pointer-events: none; }

/* ---------- Page header ---------- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { font-size: 24px; font-weight: 800; letter-spacing: -.01em; }
.page-head .sub { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.back:hover { color: var(--text); }
.back svg { width: 15px; height: 15px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 36px; padding: 0 14px; border-radius: 9px; border: 1px solid var(--border); background: var(--card); color: var(--text); font-size: 13px; font-weight: 700; white-space: nowrap; transition: background .15s, transform .1s; }
.btn:hover { background: var(--surface-hover); }
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.btn.primary { background: var(--cta-bg); color: var(--cta-text); border-color: transparent; }
.btn.primary:hover { opacity: .9; }
.btn.accent { background: var(--accent); color: #fff; border-color: transparent; }
.btn.orange { background: var(--accent-2); color: #fff; border-color: transparent; }
.btn.ai { background: var(--ai); color: #fff; border-color: transparent; }
.btn.ok { background: var(--ok); color: #fff; border-color: transparent; }
.btn.danger { background: var(--bad); color: #fff; border-color: transparent; }
.btn.danger-ghost { color: var(--bad); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-hover); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12px; border-radius: 8px; }
.btn.xs { height: 24px; padding: 0 8px; font-size: 11.5px; border-radius: 7px; }
.btn.lg { height: 44px; padding: 0 20px; font-size: 14px; border-radius: 11px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; } .btn-group .btn:first-child { border-radius: 9px 0 0 9px; } .btn-group .btn:last-child { border-radius: 0 9px 9px 0; }
.btn-group .btn + .btn { border-left: 0; }

/* ---------- Cards ---------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow); min-width: 0; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card-head h3 { font-size: 14.5px; font-weight: 800; }
.card-head .sub { font-size: 12px; color: var(--muted); }
.card-head .right { display: flex; gap: 8px; align-items: center; }
.card-body { padding: 16px 18px; }
.card-body.flush { padding: 0; }
.card-foot { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; } /* wrap: /connectors MCP foot overflowed at 375 px (integrator, arm 0) */
.card.soft { background: var(--surface-1); box-shadow: none; }
.card.ai-card { border-color: rgba(13,148,136,.35); background: linear-gradient(180deg, var(--ai-soft), var(--card) 70%); }
.card.warn-card { border-color: rgba(245,158,11,.4); background: var(--warn-soft); }
.card.link-card { cursor: pointer; transition: border-color .15s, transform .15s; }
.card.link-card:hover { border-color: var(--accent); transform: translateY(-1px); }

/* ---------- Grids ---------- */
.grid { display: grid; gap: 16px; min-width: 0; }
.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)); }
.g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.g-auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.g-main-side { grid-template-columns: minmax(0, 1fr) 340px; }
.g-side-main { grid-template-columns: 300px minmax(0, 1fr); }
.g-3col { grid-template-columns: 300px minmax(0, 1fr) 320px; }
@media (max-width: 1280px) { .g-3col { grid-template-columns: 280px minmax(0, 1fr); } .g-3col > :nth-child(3) { grid-column: 1 / -1; } }
@media (max-width: 1100px) { .g4, .g5 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-main-side, .g-side-main { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 860px) { .g-3col { grid-template-columns: 1fr; } }
@media (max-width: 640px) { .g2, .g3, .g4, .g5 { grid-template-columns: minmax(0, 1fr); } }

/* ---------- KPI tiles (live Dashboard look) ---------- */
.kpi { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; display: grid; gap: 4px; min-width: 0; }
.kpi .label { font-size: 12px; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.kpi .value { font-size: 24px; font-weight: 800; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.kpi .delta { font-size: 12px; font-weight: 700; }
.kpi .delta.up { color: var(--ok); } .kpi .delta.down { color: var(--bad); }
.kpi.tile { border: none; color: #fff; box-shadow: 0 8px 20px -8px rgba(0,0,0,.25); }
.kpi.tile .label, .kpi.tile .delta { color: rgba(255,255,255,.88); }
.kpi.tile-blue { background: linear-gradient(135deg,#2563eb,#1d4ed8); }
.kpi.tile-green { background: linear-gradient(135deg,#16a34a,#15803d); }
.kpi.tile-purple { background: linear-gradient(135deg,#7c3aed,#6d28d9); }
.kpi.tile-orange { background: linear-gradient(135deg,#f97316,#ea580c); }
.kpi.tile-teal { background: linear-gradient(135deg,#0d9488,#0f766e); }
.kpi.tile-pink { background: linear-gradient(135deg,#db2777,#be185d); }
.kpi .spark { height: 30px; width: 100%; display: block; margin-top: 4px; }
.kpi.link-card { cursor: pointer; }

/* ---------- Chips / pills / status ---------- */
.chip { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: 99px; font-size: 11.5px; font-weight: 700; background: var(--surface-2); color: var(--muted); white-space: nowrap; border: 1px solid transparent; }
.chip svg { width: 12px; height: 12px; }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.bad { background: var(--bad-soft); color: var(--bad); }
.chip.info { background: var(--info-soft); color: var(--info); }
.chip.ai { background: var(--ai-soft); color: var(--ai); }
.chip.violet { background: var(--violet-soft); color: var(--violet); }
.chip.accent { background: var(--accent-soft); color: var(--accent-soft-text); }
.chip.orange { background: var(--orange-soft); color: var(--accent-2); }
.chip.outline { background: transparent; border-color: var(--border); }
.chip.solid { background: var(--cta-bg); color: var(--cta-text); }
.chip.click { cursor: pointer; }
.chip.click:hover { border-color: var(--accent); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; background: var(--muted-2); }
.dot.ok { background: var(--ok); } .dot.warn { background: var(--warn); } .dot.bad { background: var(--bad); } .dot.ai { background: var(--ai); } .dot.accent { background: var(--accent); }
.dot.live { background: var(--ok); animation: pulse 1.8s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(22,163,74,.5); } 70% { box-shadow: 0 0 0 7px rgba(22,163,74,0); } 100% { box-shadow: 0 0 0 0 rgba(22,163,74,0); } }
.stage-pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 99px; font-size: 12px; font-weight: 700; color: #fff; white-space: nowrap; }
.score { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 24px; padding: 0 7px; border-radius: 8px; font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums; }
.score.hot { background: var(--bad-soft); color: var(--bad); } .score.warm { background: var(--warn-soft); color: var(--warn); } .score.cold { background: var(--info-soft); color: var(--info); }
.newflag { font-size: 9px; font-weight: 800; letter-spacing: .05em; padding: 1px 6px; border-radius: 99px; background: var(--accent-2); color: #fff; }

/* ---------- Avatars ---------- */
.avatar { width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 800; color: #fff; flex-shrink: 0; background: var(--accent); }
.avatar.xs { width: 20px; height: 20px; font-size: 9px; } .avatar.sm { width: 24px; height: 24px; font-size: 10px; }
.avatar.lg { width: 44px; height: 44px; font-size: 15px; } .avatar.xl { width: 60px; height: 60px; font-size: 20px; }
.avatar.ai { background: linear-gradient(135deg, #0d9488, #0f766e); }
.avatar.ai svg { width: 58%; height: 58%; }
.avatars { display: inline-flex; } .avatars .avatar { border: 2px solid var(--card); margin-left: -7px; } .avatars .avatar:first-child { margin-left: 0; }
.person { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.person .nm { font-weight: 600; } .person .rl { font-size: 11.5px; color: var(--muted-2); }

/* ---------- Tabs & segmented ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab { padding: 10px 14px; font-size: 13.5px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab .cnt { font-size: 11px; padding: 0 6px; border-radius: 99px; background: var(--surface-2); color: var(--muted); }
.tab.active .cnt { background: var(--accent-soft); color: var(--accent-soft-text); }
.seg { display: inline-flex; padding: 3px; background: var(--surface-2); border-radius: 10px; gap: 2px; border: 1px solid var(--border); }
.seg button, .seg a { padding: 5px 12px; border-radius: 8px; font-size: 12.5px; font-weight: 700; color: var(--muted); background: none; border: 0; white-space: nowrap; }
.seg .on { background: var(--card); color: var(--text); box-shadow: var(--shadow); }
.filter-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.fchip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--border); background: var(--card); font-size: 12.5px; font-weight: 600; color: var(--muted); }
.fchip:hover { color: var(--text); }
.fchip.on { background: var(--cta-bg); color: var(--cta-text); border-color: transparent; }
.fchip .cnt { font-size: 11px; opacity: .75; }

/* ---------- Toolbar & filters ---------- */
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar .search { position: relative; flex: 1; min-width: 200px; max-width: 360px; }
.toolbar .search input { width: 100%; height: 36px; border: 1px solid var(--border); border-radius: 9px; background: var(--card); padding: 0 12px 0 34px; font-size: 13px; }
.toolbar .search svg { position: absolute; left: 11px; top: 10px; width: 16px; height: 16px; color: var(--muted-2); }

/* ---------- Forms ---------- */
.field { display: grid; gap: 5px; min-width: 0; }
.field > label, .flabel { font-size: 12px; font-weight: 700; color: var(--muted); }
.field .req { color: var(--bad); }
.field .hint { font-size: 11.5px; color: var(--muted-2); }
.input, .select, .textarea { width: 100%; height: 38px; border: 1px solid var(--border); border-radius: 9px; background: var(--card); padding: 0 11px; font-size: 13.5px; color: var(--text); }
.textarea { height: auto; min-height: 84px; padding: 9px 11px; resize: vertical; line-height: 1.45; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input.sm, .select.sm { height: 32px; font-size: 12.5px; }
.input.ai-filled { background: var(--ai-soft); border-color: rgba(13,148,136,.4); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.switch { position: relative; width: 38px; height: 22px; flex-shrink: 0; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--surface-hover); border: 1px solid var(--border); transition: .2s; cursor: pointer; }
.switch span::after { content: ""; position: absolute; width: 16px; height: 16px; left: 2px; top: 2px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.3); transition: .2s; }
.switch input:checked + span { background: var(--accent); border-color: var(--accent); }
.switch input:checked + span::after { transform: translateX(16px); }
.radio-cards { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.radio-card { border: 1px solid var(--border); border-radius: 11px; padding: 11px 12px; cursor: pointer; display: grid; gap: 3px; background: var(--card); }
.radio-card:hover { border-color: var(--accent); }
.radio-card.on { border-color: var(--accent); background: var(--accent-soft); }
.radio-card b { font-size: 13px; } .radio-card span { font-size: 12px; color: var(--muted); }

/* ---------- Data table (live Leads table look) ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; background: var(--card); }
table.dt { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
table.dt th { position: sticky; top: 0; z-index: 1; background: var(--card); text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); padding: 11px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; user-select: none; }
table.dt th.sortable { cursor: pointer; }
table.dt th.sortable:hover { color: var(--text); }
table.dt th .arr { opacity: .6; margin-left: 3px; }
table.dt td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.dt tr:last-child td { border-bottom: 0; }
table.dt tbody tr { transition: background .1s; }
table.dt tbody tr:hover td { background: var(--surface-1); }
table.dt tbody tr.clickable { cursor: pointer; }
table.dt tbody tr.sel td { background: var(--accent-soft); }
table.dt td.num, table.dt th.num { text-align: right; }
table.dt .cbx { width: 34px; }
table.dt input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; }
/* P4-04: column filter button (shown on header hover/focus, lit while that filter is on), resize handle, drag to reorder */
table.dt .th-in { display: inline-flex; align-items: center; gap: 2px; max-width: 100%; vertical-align: middle; }
table.dt .th-lbl { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
table.dt .th-filter { flex-shrink: 0; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 6px; background: transparent; color: var(--muted-2); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; opacity: 0; transition: opacity .12s, background .12s; }
table.dt .th-filter svg { width: 12px; height: 12px; }
table.dt th:hover .th-filter, table.dt .th-filter:focus-visible, table.dt .th-filter.on { opacity: 1; }
table.dt .th-filter:hover { background: var(--surface-hover); color: var(--text); }
table.dt .th-filter.on { color: var(--accent); background: var(--accent-soft); }
table.dt th.th-filtered { color: var(--text); }
/* P4-04 follow-up: `position: sticky` always opens its own stacking context (per spec, regardless of
   z-index), so a .th-resize child's z-index only ever wins inside its OWN th - the overflow into the
   next column was compared th-vs-th instead, a tie (both z-index:1) broken by DOM order, and the
   later (next) th always won that tie. core.js now writes each th's z-index inline, counting DOWN
   left to right (see draw() in core.js), so every th outranks the sibling right after it and its
   handle's overflow wins there without having to special-case hover/drag state. */
table.dt .th-resize { position: absolute; top: 0; right: -6px; width: 12px; height: 100%; cursor: col-resize; z-index: 1; touch-action: none; }
table.dt .th-resize::after { content: ''; position: absolute; top: 28%; bottom: 28%; left: 5px; width: 2px; border-radius: 2px; background: var(--border-strong, var(--border)); opacity: 0; transition: opacity .12s; }
table.dt th:hover .th-resize::after { opacity: 1; }
table.dt .th-resize:hover::after, table.dt .th-resize.on::after { opacity: 1; background: var(--accent); }
table.dt th[draggable="true"] { cursor: grab; }
table.dt th.sortable[draggable="true"] { cursor: pointer; }
table.dt th.th-drag { opacity: .45; }
table.dt th.th-drop { box-shadow: inset 2px 0 0 var(--accent); }
@media (hover: none) { table.dt .th-filter { opacity: 1; } }
.table-foot { display: flex; align-items: center; gap: 10px; padding: 10px 14px; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--border); flex-wrap: wrap; }
.table-foot .pager { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.bulkbar { position: sticky; bottom: 16px; z-index: 30; margin-top: 12px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 12px; border-radius: 12px; background: var(--cta-bg); color: var(--cta-text); box-shadow: var(--shadow-lg); }
.bulkbar .btn { background: transparent; color: var(--cta-text); border-color: rgba(128,128,128,.4); }
.bulkbar .btn:hover { background: rgba(128,128,128,.2); }
.bulkbar b { margin-right: 6px; }

/* ---------- Lists ---------- */
.list { display: grid; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-bottom: 1px solid var(--border); min-width: 0; }
.list-item:last-child { border-bottom: 0; }
.list-item.click { cursor: pointer; }
.list-item.click:hover, .list-item.active { background: var(--surface-hover); }
.list-item .main-t { font-weight: 600; font-size: 13.5px; }
.list-item .sub-t { font-size: 12px; color: var(--muted); }
.kv { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 8px 12px; font-size: 13px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.kv.editable dd { cursor: text; border-radius: 6px; padding: 0 4px; margin-left: -4px; }
.kv.editable dd:hover { background: var(--surface-hover); }

/* ---------- Timeline ---------- */
.timeline { display: grid; }
.tl { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; position: relative; padding-bottom: 16px; }
.tl::before { content: ""; position: absolute; left: 16px; top: 34px; bottom: 0; width: 2px; background: var(--border); }
.tl:last-child::before { display: none; }
.tl-ico { width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: var(--surface-2); color: var(--muted); }
.tl-ico svg { width: 16px; height: 16px; }
.tl-ico.call { background: var(--ok-soft); color: var(--ok); } .tl-ico.wa { background: rgba(34,197,94,.12); color: #16A34A; }
.tl-ico.ai { background: var(--ai-soft); color: var(--ai); } .tl-ico.stage { background: var(--violet-soft); color: var(--violet); }
.tl-ico.doc { background: var(--info-soft); color: var(--info); } .tl-ico.note { background: var(--warn-soft); color: var(--warn); }
.tl-ico.task { background: var(--accent-soft); color: var(--accent); } .tl-ico.money { background: var(--orange-soft); color: var(--accent-2); }
.tl-body { border: 1px solid var(--border); border-radius: 12px; padding: 10px 13px; background: var(--card); display: grid; gap: 6px; min-width: 0; }
.tl-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.tl-head .when { margin-left: auto; font-size: 11.5px; color: var(--muted-2); white-space: nowrap; }

/* Recording player */
.player { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--surface-1); border: 1px solid var(--border); min-width: 0; }
.player .pbtn { width: 30px; height: 30px; border-radius: 50%; border: 0; background: var(--cta-bg); color: var(--cta-text); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.player .pbtn svg { width: 14px; height: 14px; }
.wave { display: flex; align-items: center; gap: 2px; height: 26px; flex: 1; min-width: 0; overflow: hidden; }
.wave i { width: 3px; border-radius: 2px; background: var(--border); flex-shrink: 0; }
.wave i.on { background: var(--accent); }
.transcript { display: grid; gap: 6px; font-size: 13px; }
.transcript .ln { display: grid; grid-template-columns: 44px 70px minmax(0, 1fr); gap: 8px; }
.transcript .t { color: var(--muted-2); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.transcript .who { font-weight: 700; font-size: 12px; }
.transcript .who.agent { color: var(--accent); } .transcript .who.ai { color: var(--ai); }

/* ---------- Progress / bars ---------- */
.progress { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 99px; background: var(--accent); }
.progress.ok > i { background: var(--ok); } .progress.warn > i { background: var(--warn); } .progress.bad > i { background: var(--bad); } .progress.ai > i { background: var(--ai); } .progress.orange > i { background: var(--accent-2); }
.progress.thin { height: 5px; }
.meter { display: grid; gap: 4px; }
.meter .row { font-size: 12px; }

/* ---------- Stage tracker (live snake look, simplified) ---------- */
.tracker { display: flex; gap: 4px; flex-wrap: wrap; }
.tracker .st { flex: 1; min-width: 92px; padding: 8px 10px; border-radius: 9px; background: var(--surface-2); font-size: 11.5px; font-weight: 700; color: var(--muted); text-align: center; position: relative; cursor: pointer; border: 1px solid transparent; }
.tracker .st.done { background: var(--accent-soft); color: var(--accent-soft-text); }
.tracker .st.cur { background: var(--accent); color: #fff; }
.tracker .st.locked { border-style: dashed; border-color: var(--warn); }
.tracker .st.won { background: var(--ok); color: #fff; } .tracker .st.lost { background: var(--bad); color: #fff; }
.tracker .st:hover { border-color: var(--accent); }

/* ---------- Kanban ---------- */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(264px, 1fr); gap: 12px; overflow-x: auto; padding-bottom: 10px; align-items: start; }
.kcol { background: var(--surface-1); border: 1px solid var(--border); border-radius: 14px; padding: 10px; display: grid; gap: 8px; align-content: start; min-height: 200px; }
.kcol.drop { border-color: var(--accent); background: var(--accent-soft); }
.kcol.blocked { border-color: var(--bad); background: var(--bad-soft); }
.kcol-head { display: flex; align-items: center; gap: 8px; padding: 2px 4px 6px; font-size: 13px; font-weight: 800; }
.kcol-head .sum { margin-left: auto; font-size: 11.5px; color: var(--muted); font-weight: 700; }
.kcard { background: var(--card); border: 1px solid var(--border); border-radius: 11px; padding: 10px 11px; display: grid; gap: 6px; box-shadow: var(--shadow); cursor: grab; font-size: 12.5px; }
.kcard:hover { border-color: var(--accent); }
.kcard.dragging { opacity: .5; }
.kcard .t { font-weight: 700; font-size: 13px; }

/* ---------- Modal & drawer ---------- */
.pm-overlay { position: fixed; inset: 0; z-index: 1000; background: var(--overlay); display: flex; align-items: center; justify-content: center; padding: 16px; animation: fin .12s ease; }
.pm-overlay.drawer-ov { justify-content: flex-end; padding: 0; }
@keyframes fin { from { opacity: 0; } to { opacity: 1; } }
.pm-dialog { width: 100%; max-width: 560px; max-height: calc(100vh - 32px); background: var(--card); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; overflow: hidden; }
.pm-dialog.sm { max-width: 420px; } .pm-dialog.lg { max-width: 820px; } .pm-dialog.xl { max-width: 1100px; }
.pm-drawer { width: min(560px, 100vw); height: 100vh; background: var(--card); border-left: 1px solid var(--border); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slin .18s ease; }
.pm-drawer.lg { width: min(760px, 100vw); }
@keyframes slin { from { transform: translateX(30px); opacity: .5; } to { transform: none; opacity: 1; } }
.pm-head { display: flex; align-items: center; gap: 10px; padding: 15px 18px; border-bottom: 1px solid var(--border); }
.pm-head h3 { font-size: 16px; font-weight: 800; }
.pm-head .sub { font-size: 12px; color: var(--muted); }
.pm-body { padding: 16px 18px; overflow-y: auto; flex: 1; display: grid; gap: 14px; align-content: start; }
.pm-foot { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.pm-foot .left { margin-right: auto; }

/* ---------- Dropdown menu ---------- */
.menu { position: fixed; z-index: 1200; min-width: 200px; background: var(--card); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; display: grid; }
.menu button, .menu a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; font-size: 13px; text-align: left; background: none; border: 0; color: var(--text); }
.menu button:hover, .menu a:hover { background: var(--surface-hover); }
.menu svg { width: 15px; height: 15px; color: var(--muted); }
.menu .sep { height: 1px; background: var(--border); margin: 4px 0; }
.menu .danger { color: var(--bad); }
.menu .mhead { font-size: 10.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted-2); padding: 6px 10px 2px; }

/* ---------- Callbar (active call, any page) ---------- */
.callbar { position: fixed; left: calc(240px + 24px); right: 24px; bottom: 18px; z-index: 900; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 12px 10px 16px; border-radius: 16px; background: #16181D; color: #F7F8FA; box-shadow: var(--shadow-lg); }
.callbar .who b { display: block; font-size: 14px; } .callbar .who span { font-size: 12px; opacity: .72; }
.callbar .timer { font-variant-numeric: tabular-nums; font-size: 15px; font-weight: 800; }
.callbar .rec { font-size: 10.5px; font-weight: 800; letter-spacing: .06em; padding: 2px 7px; border-radius: 99px; background: #DC2626; }
.callbar .cb { height: 36px; min-width: 36px; padding: 0 10px; border-radius: 11px; border: 0; background: rgba(255,255,255,.12); color: inherit; display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; }
.callbar .cb svg { width: 16px; height: 16px; }
.callbar .cb.on { background: #F7F8FA; color: #16181D; }
.callbar .cb.end { background: #DC2626; }
@media (max-width: 768px) { .callbar { left: 10px; right: 10px; bottom: 76px; } }

/* ---------- Assistant ---------- */
.asst-fab { position: fixed; right: 22px; bottom: 22px; z-index: 800; display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 18px 0 14px; border-radius: 99px; border: 0; background: var(--accent); color: #fff; font-weight: 800; font-size: 13.5px; box-shadow: 0 12px 30px rgba(79,70,229,.35); }
.asst-fab svg { width: 18px; height: 18px; }
.asst-panel { position: fixed; right: 22px; bottom: 80px; z-index: 850; width: min(420px, calc(100vw - 24px)); height: min(620px, calc(100vh - 120px)); background: var(--card); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-lg); display: none; flex-direction: column; overflow: hidden; }
.asst-panel.open { display: flex; }
.asst-head { background: var(--accent); color: #fff; padding: 13px 16px; display: flex; align-items: center; gap: 10px; }
.asst-head .t { font-weight: 800; font-size: 14px; } .asst-head .s { font-size: 11px; opacity: .8; }
.asst-msgs { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.amsg { max-width: 88%; padding: 9px 12px; border-radius: 14px; font-size: 13px; line-height: 1.45; white-space: pre-wrap; }
.amsg.bot { background: var(--surface-1); border: 1px solid var(--border); align-self: flex-start; border-bottom-left-radius: 4px; }
.amsg.user { background: var(--accent); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; font-weight: 600; }
.amsg.card { background: var(--ai-soft); border: 1px solid rgba(13,148,136,.35); white-space: normal; }
.asst-sugg { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 14px 10px; }
.asst-sugg button { font-size: 11.5px; padding: 5px 10px; border-radius: 99px; border: 1px solid var(--border); background: var(--card); color: var(--muted); }
.asst-sugg button:hover { color: var(--text); border-color: var(--accent); }
.asst-comp { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--border); }
.asst-comp input { flex: 1; height: 38px; border: 1px solid var(--border); border-radius: 99px; padding: 0 14px; background: var(--surface-1); }
@media (max-width: 768px) { .asst-fab { right: 14px; bottom: 14px; padding: 0 14px; } .asst-fab span { display: none; } .asst-panel { right: 12px; bottom: 70px; } }

/* ---------- Misc ---------- */
.banner { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-1); font-size: 13px; }
.banner svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.banner.warn { background: var(--warn-soft); border-color: rgba(245,158,11,.35); } .banner.warn svg { color: var(--warn); }
.banner.info { background: var(--info-soft); border-color: rgba(37,99,235,.3); } .banner.info svg { color: var(--info); }
.banner.ai { background: var(--ai-soft); border-color: rgba(13,148,136,.35); } .banner.ai svg { color: var(--ai); }
.banner.bad { background: var(--bad-soft); border-color: rgba(220,38,38,.3); } .banner.bad svg { color: var(--bad); }
.banner.ok { background: var(--ok-soft); border-color: rgba(22,163,74,.3); } .banner.ok svg { color: var(--ok); }
.ai-label { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ai); }
.ai-label svg { width: 13px; height: 13px; }
.section-title { font-size: 11.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted-2); margin: 6px 0 2px; }
.empty-mini { padding: 28px 16px; text-align: center; color: var(--muted); font-size: 13px; }
.chart { width: 100%; display: block; }
.chart text { fill: var(--muted); font-size: 11px; font-family: inherit; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.split { display: grid; grid-template-columns: 340px minmax(0, 1fr); border: 1px solid var(--border); border-radius: 14px; background: var(--card); overflow: hidden; min-height: 560px; }
.split > .pane-l { border-right: 1px solid var(--border); overflow-y: auto; max-height: calc(100vh - 210px); }
.split > .pane-r { min-width: 0; display: flex; flex-direction: column; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } .split > .pane-l { max-height: 320px; border-right: 0; border-bottom: 1px solid var(--border); } }
.mapbox { position: relative; border-radius: 14px; overflow: hidden; min-height: 360px; background:
  repeating-linear-gradient(0deg, var(--border) 0 1px, transparent 1px 40px), repeating-linear-gradient(90deg, var(--border) 0 1px, transparent 1px 40px), var(--surface-1); }
.mapbox .pin { position: absolute; transform: translate(-50%, -100%); display: grid; justify-items: center; gap: 2px; font-size: 10.5px; font-weight: 700; }
.mapbox .pin i { width: 24px; height: 24px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); display: block; box-shadow: var(--shadow-lg); }
.mapbox .pin span { background: var(--card); border: 1px solid var(--border); border-radius: 6px; padding: 0 5px; white-space: nowrap; }
.phone-frame { width: 320px; height: 660px; border-radius: 44px; background: #0b0f10; padding: 12px; box-shadow: var(--shadow-lg); position: relative; flex-shrink: 0; }
.phone-frame::before { content: ""; position: absolute; top: 22px; left: 50%; width: 90px; height: 22px; border-radius: 12px; background: #000; transform: translateX(-50%); z-index: 3; }
.phone-screen { width: 100%; height: 100%; border-radius: 34px; overflow: hidden; background: var(--bg); display: flex; flex-direction: column; font-size: 12.5px; position: relative; }
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--surface-hover), var(--surface-2)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 6px; }
@keyframes sk { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.help-dot { display: inline-flex; width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--border); font-size: 10px; align-items: center; justify-content: center; color: var(--muted); cursor: help; }
.upload-zone { border: 2px dashed var(--border); border-radius: 14px; padding: 28px; text-align: center; display: grid; gap: 8px; justify-items: center; background: var(--surface-1); cursor: pointer; }
.upload-zone:hover, .upload-zone.drag { border-color: var(--accent); background: var(--accent-soft); }
.upload-zone svg { width: 34px; height: 34px; color: var(--accent); }
.steps { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.steps .s { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 99px; border: 1px solid var(--border); font-size: 12.5px; font-weight: 700; color: var(--muted); background: var(--card); }
.steps .s i { width: 20px; height: 20px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-style: normal; font-size: 11px; background: var(--surface-2); }
.steps .s.done { color: var(--ok); } .steps .s.done i { background: var(--ok); color: #fff; }
.steps .s.cur { color: var(--accent); border-color: var(--accent); } .steps .s.cur i { background: var(--accent); color: #fff; }

/* ---------- Empty workspace: structured, product-grade empty states ---------- */
.ghost { position: relative; border: 1px dashed var(--border); border-radius: 12px; padding: 16px 14px 14px; background: linear-gradient(180deg, var(--surface-1), transparent); color: var(--accent); min-width: 0; }
.ghost-tag { position: absolute; top: -9px; left: 12px; font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); background: var(--card); border: 1px solid var(--border); border-radius: 99px; padding: 1px 8px; }
.ghost-bar { display: block; border-radius: 99px; background: var(--surface-hover); }
.ghost-dot { width: 26px; height: 26px; border-radius: 50%; background: var(--surface-hover); flex-shrink: 0; display: inline-block; }
.ghost-chart { display: flex; align-items: flex-end; gap: 6px; height: 96px; }
.ghost-chart i { flex: 1; border-radius: 6px 6px 2px 2px; background: linear-gradient(180deg, var(--accent-soft), var(--surface-hover)); }
.ghost-svg { width: 100%; height: 90px; opacity: .45; display: block; }
.ghost-kanban { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.ghost-kanban > div { display: grid; gap: 6px; align-content: start; background: var(--surface-1); border-radius: 9px; padding: 8px; }
.ghost-card { display: grid; gap: 5px; background: var(--card); border: 1px solid var(--border); border-radius: 7px; padding: 7px; }
.ghost-bubble { display: grid; gap: 5px; max-width: 70%; padding: 9px 10px; border-radius: 12px; background: var(--surface-2); }
.ghost-bubble.out { margin-left: auto; background: var(--ok-soft); }
.ghost-map { position: relative; height: 120px; border-radius: 9px; background: repeating-linear-gradient(0deg, var(--border) 0 1px, transparent 1px 24px), repeating-linear-gradient(90deg, var(--border) 0 1px, transparent 1px 24px); }
.ghost-map i { position: absolute; width: 12px; height: 12px; border-radius: 50%; background: var(--accent-2); opacity: .55; box-shadow: 0 0 0 6px var(--orange-soft); }
.ghost-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.ghost-kpis span { display: grid; gap: 7px; padding: 10px; border-radius: 9px; background: var(--surface-1); }
.empty-rich { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 28px; padding: 28px; align-items: center; background: radial-gradient(600px circle at 0% 0%, var(--accent-soft), transparent 60%), var(--card); }
.empty-rich-text { display: grid; gap: 10px; min-width: 0; }
.empty-rich-text h3 { font-size: 20px; font-weight: 800; letter-spacing: -.01em; text-wrap: balance; }
.empty-rich-text p { color: var(--muted); font-size: 14px; max-width: 52ch; }
.empty-rich-ico { width: 44px; height: 44px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent); }
.empty-rich-ico svg { width: 22px; height: 22px; }
.empty-rich-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: 13px; }
.empty-rich-list li { display: flex; gap: 8px; align-items: flex-start; }
.empty-rich-list svg { width: 15px; height: 15px; color: var(--ok); flex-shrink: 0; margin-top: 2px; }
.empty-rich-preview { min-width: 0; }
@media (max-width: 860px) { .empty-rich { grid-template-columns: 1fr; padding: 20px; gap: 18px; } }
.empty-card { display: grid; gap: 12px; padding: 4px 0; }
.empty-card .ghost { padding: 14px 12px 12px; }
.empty-card-text { display: grid; gap: 4px; justify-items: start; }
.empty-card-text b { font-size: 13.5px; }
.empty-card-text span { font-size: 12.5px; color: var(--muted); }
.empty-card-text .btn { margin-top: 4px; }
/* Setup checklist */
.onb { padding: 20px 22px; background: radial-gradient(700px circle at 100% 0%, var(--accent-soft), transparent 55%), var(--card); }
.onb-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-bottom: 14px; }
.onb-head h3 { font-size: 19px; font-weight: 800; margin: 2px 0; }
.onb-ring { width: 92px; flex-shrink: 0; }
.onb-steps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 860px) { .onb-steps { grid-template-columns: 1fr; } }
.onb-step { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); transition: border-color .15s, transform .15s; min-width: 0; }
.onb-step:hover { border-color: var(--accent); transform: translateY(-1px); }
.onb-step.next { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.onb-step.done { opacity: .7; }
.onb-step.done b { text-decoration: line-through; text-decoration-color: var(--muted-2); }
.onb-num { width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 800; background: var(--surface-2); color: var(--muted); }
.onb-step.next .onb-num { background: var(--accent); color: #fff; }
.onb-step.done .onb-num { background: var(--ok); color: #fff; }
.onb-num svg { width: 15px; height: 15px; }
/* Workspace switcher in the sidebar logo */
.ws-switch { display: flex; align-items: center; gap: 10px; width: 100%; padding: 6px 8px 18px; background: none; border: 0; text-align: left; border-radius: 10px; }
.ws-switch:hover .logo-text .sub { color: var(--text); }
.ws-switch .chev { margin-left: auto; width: 16px; height: 16px; color: var(--muted-2); }
.trial-chip { font-size: 10.5px; font-weight: 800; color: var(--accent-2); background: var(--orange-soft); border-radius: 99px; padding: 2px 8px; white-space: nowrap; }
.nav-role-note { margin: 2px 4px 8px; padding: 8px 10px; border-radius: 9px; font-size: 11.5px; line-height: 1.4; color: var(--muted); background: var(--orange-soft); border: 1px dashed var(--accent-2); }
.nav-role-note a { color: var(--accent-2); font-weight: 700; }

/* ---------- Theme refinement (29 Sep feedback): no blue text on black, more contrast in dark ---------- */
/* Names and links read as strong text; the accent appears only as an underline on hover. */
.link { color: var(--text); font-weight: 650; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px; transition: text-decoration-color .15s; }
.link:hover { text-decoration: underline; text-decoration-color: var(--accent-2); color: var(--text); }
.gs-item .sub, .muted a.link { color: inherit; }
.tab.active { color: var(--text); border-bottom-color: var(--accent-2); }
.tab.active .cnt { background: var(--orange-soft); color: var(--accent-2); }
:root[data-theme="dark"] {
  --bg: #0A0B0F; --card: #15171E; --border: rgba(255,255,255,0.13); --text: #F4F5F8; --muted: #B7BBC9; --muted-2: #8F94A6;
  --surface-1: rgba(255,255,255,0.04); --surface-2: rgba(255,255,255,0.065); --surface-hover: rgba(255,255,255,0.09);
  --accent: #818CF8; --accent-soft: rgba(129,140,248,0.16); --accent-soft-text: #C7CCFF;
  --shadow: 0 1px 0 rgba(255,255,255,0.03), 0 1px 3px rgba(0,0,0,0.5);
}
:root[data-theme="dark"] .nav-link.active { color: var(--text); background: rgba(251,146,60,0.13); box-shadow: inset 3px 0 0 var(--accent-2); }
:root[data-theme="dark"] .nav-link { color: #C3C7D4; }
:root[data-theme="dark"] .nav-group-label { color: #8F94A6; }
:root[data-theme="dark"] .card, :root[data-theme="dark"] .kpi:not(.tile), :root[data-theme="dark"] .table-wrap { border-color: rgba(255,255,255,0.12); }
:root[data-theme="dark"] table.dt th { color: #A9AEBF; background: #181A22; }
:root[data-theme="dark"] table.dt tbody tr:hover td { background: rgba(255,255,255,0.045); }
:root[data-theme="dark"] .chip { background: rgba(255,255,255,0.08); color: #D5D8E2; }
:root[data-theme="dark"] .chip.ok { background: rgba(74,222,128,0.16); } :root[data-theme="dark"] .chip.warn { background: rgba(251,191,36,0.16); } :root[data-theme="dark"] .chip.bad { background: rgba(248,113,113,0.16); } :root[data-theme="dark"] .chip.info { background: rgba(96,165,250,0.16); color: #BFD8FF; }
:root[data-theme="dark"] .chip.accent { color: var(--accent-soft-text); }
:root[data-theme="dark"] .input, :root[data-theme="dark"] .select, :root[data-theme="dark"] .textarea { background: #0F1116; border-color: rgba(255,255,255,0.16); }
:root[data-theme="dark"] .btn { border-color: rgba(255,255,255,0.16); }
:root[data-theme="dark"] .tracker .st { background: rgba(255,255,255,0.07); color: #C3C7D4; }
:root[data-theme="dark"] .tracker .st.done { background: rgba(129,140,248,0.2); color: #E0E3FF; }
:root[data-theme="dark"] .progress { background: rgba(255,255,255,0.1); }
:root[data-theme="dark"] .chart text { fill: #A9AEBF; }
/* Charts never scale their text up beyond ~1.25× on wide screens */
svg.chart { max-width: 100%; height: auto; }

/* Pulse used by the command bar mic (.cmd.listening) */
@keyframes micpulse { 0% { box-shadow: 0 0 0 0 rgba(220,38,38,.5); } 70% { box-shadow: 0 0 0 9px rgba(220,38,38,0); } 100% { box-shadow: 0 0 0 0 rgba(220,38,38,0); } }
/* Quick add */
.qa-modes { margin-bottom: 4px; }
.qa-extract { display: flex; flex-wrap: wrap; gap: 6px; }
.qa-extract .chip { height: 26px; font-size: 12px; }

/* Inline input + button pairs must shrink inside narrow cards */
.sx-inv { display: flex !important; gap: 6px; min-width: 0; max-width: 100%; }
.sx-inv .input { min-width: 0; flex: 1 1 auto; width: auto; }
.sx-inv .btn { flex-shrink: 0; }
.kv dd { min-width: 0; }

/* ---------- Sparkfuse AI command bar (replaces the floating chat) ---------- */
.cmd { position: fixed; z-index: 820; bottom: 16px; left: calc(240px + (100vw - 240px) / 2); transform: translateX(-50%); width: min(720px, calc(100vw - 240px - 56px)); display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.cmd > * { pointer-events: auto; }
body:has(#callbar) .cmd { bottom: 86px; }
body.bare .cmd { display: none; }
.cmd-bar { display: flex; align-items: center; gap: 6px; height: 52px; padding: 0 8px 0 8px; border-radius: 16px; background: var(--card); border: 1px solid var(--border); box-shadow: 0 10px 30px rgba(15,17,26,.14), 0 2px 6px rgba(15,17,26,.06); transition: box-shadow .2s, border-color .2s; }
.cmd.open .cmd-bar, .cmd-bar:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft), 0 14px 36px rgba(15,17,26,.18); }
.cmd-bar input { flex: 1; min-width: 0; height: 40px; border: 0; background: transparent; outline: none; font-size: 14px; color: var(--text); }
.cmd-bar input::placeholder { color: var(--muted-2); }
.cmd-ico { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--border); background: var(--card); color: var(--muted); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cmd-ico:hover { color: var(--text); background: var(--surface-hover); }
.cmd-ico svg, .cmd-send svg { width: 16px; height: 16px; }
.cmd-plus { border-style: dashed; }
.cmd-minbtn { border-color: transparent; width: 28px; }
.cmd-send { width: 38px; height: 38px; border-radius: 12px; border: 0; background: var(--accent); color: #fff; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: 0 6px 16px rgba(79,70,229,.35); }
.cmd-ctx { display: inline-flex; align-items: center; gap: 5px; max-width: 170px; height: 26px; padding: 0 9px; border-radius: 99px; background: var(--surface-2); color: var(--muted); font-size: 11.5px; font-weight: 700; flex-shrink: 1; min-width: 0; }
.cmd-ctx svg { width: 12px; height: 12px; flex-shrink: 0; }
.cmd-brand { font-size: 11px; font-weight: 700; color: var(--muted-2); white-space: nowrap; }
.cmd-kbd { flex-shrink: 0; }
.cmd-wave { display: none; align-items: center; gap: 3px; height: 22px; }
.cmd-wave i { width: 3px; border-radius: 3px; background: #DC2626; animation: cmdwave 0.9s ease-in-out infinite; }
.cmd-wave i:nth-child(2) { animation-delay: .1s } .cmd-wave i:nth-child(3) { animation-delay: .2s } .cmd-wave i:nth-child(4) { animation-delay: .3s } .cmd-wave i:nth-child(5) { animation-delay: .15s } .cmd-wave i:nth-child(6) { animation-delay: .25s } .cmd-wave i:nth-child(7) { animation-delay: .05s }
@keyframes cmdwave { 0%, 100% { height: 5px } 50% { height: 20px } }
.cmd.listening .cmd-wave { display: inline-flex; }
.cmd.listening .cmd-kbd, .cmd.listening .cmd-brand { display: none; }
.cmd.listening .cmd-mic { background: #DC2626; color: #fff; border-color: #DC2626; animation: micpulse 1.2s infinite; }
.cmd-sheet { display: none; flex-direction: column; max-height: min(60vh, 560px); border-radius: 18px; background: var(--card); border: 1px solid var(--border); box-shadow: 0 24px 60px rgba(15,17,26,.22); overflow: hidden; animation: cmdin .16s ease; }
@keyframes cmdin { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.cmd.open .cmd-sheet { display: flex; }
.cmd-head { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--border); background: linear-gradient(180deg, var(--accent-soft), transparent); }
.cmd-turns { flex: 1; overflow-y: auto; padding: 12px 14px; display: flex; flex-direction: column; gap: 14px; min-height: 90px; }
.cmd-turn { display: grid; gap: 7px; }
.cmd-q { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; color: var(--text); }
.cmd-q svg { width: 14px; height: 14px; color: var(--muted-2); flex-shrink: 0; }
.cmd-q .tiny { margin-left: auto; }
.cmd-a { border: 1px solid var(--border); border-radius: 12px; padding: 11px 13px; font-size: 13px; line-height: 1.5; background: var(--surface-1); display: grid; gap: 6px; min-width: 0; }
.cmd-thinking { display: flex; gap: 5px; width: max-content; }
.cmd-thinking i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); opacity: .4; animation: cmdthink 1s infinite; }
.cmd-thinking i:nth-child(2) { animation-delay: .15s } .cmd-thinking i:nth-child(3) { animation-delay: .3s }
@keyframes cmdthink { 50% { opacity: 1; transform: translateY(-2px); } }
.cmd-empty { display: grid; gap: 4px; padding: 6px 2px; }
.cmd-sugg { display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 14px 12px; border-top: 1px solid var(--border); }
.cmd-sugg button { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 6px 11px; border-radius: 99px; border: 1px solid var(--border); background: var(--card); color: var(--text); }
.cmd-sugg button svg { width: 12px; height: 12px; color: var(--accent-2); }
.cmd-sugg button:hover { border-color: var(--accent-2); }
.cmd-list { display: grid; gap: 2px; margin-top: 4px; }
.cmd-li { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px dashed var(--border); min-width: 0; }
.cmd-li:last-child { border-bottom: 0; }
.cmd-ul { margin: 2px 0 0 16px; padding: 0; display: grid; gap: 2px; }
.cmd-facts { display: flex; gap: 6px; flex-wrap: wrap; }
.cmd-next { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border-radius: 9px; background: var(--orange-soft); }
.cmd-next svg { width: 15px; height: 15px; color: var(--accent-2); flex-shrink: 0; margin-top: 2px; }
.cmd-done { display: flex; gap: 8px; align-items: center; }
.cmd-done svg { width: 16px; height: 16px; color: var(--ok); flex-shrink: 0; }
.cmd-done span { flex: 1; min-width: 0; }
.cmd-draft { padding: 9px 11px; border-radius: 10px; background: var(--ok-soft); border: 1px solid rgba(22,163,74,.25); }
.cmd-stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
.cmd-stats div { display: grid; padding: 8px 10px; border-radius: 10px; background: var(--card); border: 1px solid var(--border); }
.cmd-stats b { font-size: 18px; } .cmd-stats span { font-size: 11px; color: var(--muted); }
.cmd-orb { display: none; position: fixed; right: 22px; bottom: 22px; width: 52px; height: 52px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; box-shadow: 0 12px 30px rgba(79,70,229,.35); align-items: center; justify-content: center; }
.cmd-orb svg { width: 22px; height: 22px; }
.cmd.min .cmd-bar, .cmd.min .cmd-sheet { display: none; }
.cmd.min .cmd-orb { display: inline-flex; }
.bulkbar { bottom: 84px; }
@media (max-width: 1100px) { .cmd-brand, .cmd-kbd { display: none; } }
@media (max-width: 768px) { .cmd { left: 50%; width: calc(100vw - 24px); bottom: 10px; } .cmd-ctx { display: none; } .cmd-minbtn { display: none; } body:has(#callbar) .cmd { bottom: 150px; } }
:root[data-theme="dark"] .cmd-bar { box-shadow: 0 10px 30px rgba(0,0,0,.55); }

/* Minimised command bar sits in the bottom-right corner (the centring transform must not apply) */
.cmd.min { transform: none; left: auto; right: 22px; bottom: 22px; width: auto; }
.cmd.min .cmd-orb { position: static; }
body:has(#callbar) .cmd.min { bottom: 86px; }
@media (max-width: 768px) { .cmd.min { right: 14px; bottom: 14px; } }

/* Admin-only 'customise this screen' option inside the AI bar's suggestion row */
.cmd-cust { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; padding: 6px 11px; border-radius: 99px; border: 1px dashed color-mix(in srgb, var(--accent-2) 55%, var(--border)); background: transparent; color: var(--muted); margin-left: auto; }
.cmd-cust:hover { color: var(--accent-2); border-color: var(--accent-2); background: var(--orange-soft); }
.cmd-cust svg { width: 13px; height: 13px; }

/* "Customise this screen" lives in the AI panel's header strip, in its own colour so it
   never reads as one of the AI suggestions. */
.cmd-cust { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 8px; border: 1px solid color-mix(in srgb, var(--violet) 55%, transparent); background: var(--violet-soft); color: var(--violet); font-size: 11.5px; font-weight: 700; white-space: nowrap; flex-shrink: 0; }
.cmd-cust:hover { background: color-mix(in srgb, var(--violet) 18%, transparent); border-color: var(--violet); }
.cmd-cust svg { width: 13px; height: 13px; }
@media (max-width: 620px) { .cmd-cust span { display: none; } .cmd-cust { padding: 0 8px; } }

/* ==========================================================================
   UI polish, phases 1 and 2 (see docs/blueprint/13-ui-polish-plan.md).
   Tokens first so nothing is hand-timed. Only transform and opacity animate.
   The reduced-motion rule near the top of this file switches all of it off.
   ========================================================================== */
:root {
  --dur-micro: 120ms; --dur-quick: 180ms; --dur-panel: 240ms; --dur-page: 300ms;
  --ease-out: cubic-bezier(.2, .8, .2, 1);
  --ease-spring: cubic-bezier(.34, 1.4, .64, 1);
  /* A lit top edge rather than a gradient you can name. */
  --sheen: linear-gradient(180deg, rgba(255, 255, 255, .6), rgba(255, 255, 255, 0) 42%);
}
:root[data-theme="dark"] { --sheen: linear-gradient(180deg, rgba(255, 255, 255, .055), rgba(255, 255, 255, 0) 42%); }

/* ---- page arrival: one animation on the view root, not per element ---- */
@keyframes sfPageIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
#view.sf-enter { animation: sfPageIn var(--dur-page) var(--ease-out) both; }

/* ---- row stagger: the first 12 rows only, so long lists stay instant ---- */
@keyframes sfRowIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.sf-stagger > * { animation: sfRowIn var(--dur-quick) var(--ease-out) both; }
.sf-stagger > *:nth-child(1) { animation-delay: 0ms; }
.sf-stagger > *:nth-child(2) { animation-delay: 24ms; }
.sf-stagger > *:nth-child(3) { animation-delay: 48ms; }
.sf-stagger > *:nth-child(4) { animation-delay: 72ms; }
.sf-stagger > *:nth-child(5) { animation-delay: 96ms; }
.sf-stagger > *:nth-child(6) { animation-delay: 120ms; }
.sf-stagger > *:nth-child(7) { animation-delay: 144ms; }
.sf-stagger > *:nth-child(8) { animation-delay: 168ms; }
.sf-stagger > *:nth-child(9) { animation-delay: 192ms; }
.sf-stagger > *:nth-child(10) { animation-delay: 216ms; }
.sf-stagger > *:nth-child(11) { animation-delay: 240ms; }
.sf-stagger > *:nth-child(12) { animation-delay: 264ms; }
.sf-stagger > *:nth-child(n+13) { animation: none; }

/* ---- surfaces: a single lit edge, never a visible gradient ---- */
.card, .kpi:not(.tile) { position: relative; }
.card::before, .kpi:not(.tile)::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--sheen); pointer-events: none; z-index: 0; }
.card > *, .kpi > * { position: relative; z-index: 1; }
.card.link-card, .kcard, .onb-step, .radio-card { transition: transform var(--dur-micro) var(--ease-out), border-color var(--dur-micro) var(--ease-out), box-shadow var(--dur-micro) var(--ease-out); }
.card.link-card:hover, .kcard:hover { transform: translateY(-2px); box-shadow: 0 10px 24px -10px rgba(15, 17, 26, .28); }
:root[data-theme="dark"] .card.link-card:hover, :root[data-theme="dark"] .kcard:hover { box-shadow: 0 10px 24px -8px rgba(0, 0, 0, .6); }

/* ---- controls ---- */
.btn { transition: background var(--dur-micro) var(--ease-out), border-color var(--dur-micro) var(--ease-out), color var(--dur-micro) var(--ease-out), transform 90ms var(--ease-out); }
.btn:active { transform: scale(.975); }
.icon-btn, .chip, .fchip, .tab, .nav-link, .seg button { transition: background var(--dur-micro) var(--ease-out), color var(--dur-micro) var(--ease-out), border-color var(--dur-micro) var(--ease-out); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }

/* ---- table rows: a quiet accent edge on hover ---- */
table.dt tbody tr td:first-child { box-shadow: inset 2px 0 0 transparent; transition: box-shadow var(--dur-micro) var(--ease-out); }
table.dt tbody tr:hover td:first-child { box-shadow: inset 2px 0 0 var(--accent); }

/* ---- sidebar: one indicator that travels between items ---- */
.nav-group { position: relative; }
.nav-ind { position: absolute; left: -4px; top: 0; width: 3px; height: 0; border-radius: 0 3px 3px 0; background: var(--accent); opacity: 0; pointer-events: none; transition: transform var(--dur-quick) var(--ease-out), height var(--dur-quick) var(--ease-out), opacity var(--dur-quick) var(--ease-out); }

/* ---- panels ---- */
@keyframes sfDialogIn { from { opacity: 0; transform: scale(.98) translateY(6px); } to { opacity: 1; transform: none; } }
.pm-dialog { animation: sfDialogIn var(--dur-panel) var(--ease-out) both; }
.pm-drawer { animation: slin var(--dur-panel) var(--ease-out) both; }
.menu { animation: sfDialogIn var(--dur-quick) var(--ease-out) both; }

/* ---- phase 3: each page carries a whisper of its own colour ---- */
#view { position: relative; --bleed: 28px; --bleed-top: 26px; }
@media (max-width: 768px) { #view { --bleed: 16px; --bleed-top: 18px; } }
#view::before { content: ""; position: absolute; top: calc(-1 * var(--bleed-top)); left: calc(-1 * var(--bleed)); right: calc(-1 * var(--bleed)); height: 250px; pointer-events: none; z-index: 0;
  background: radial-gradient(900px 250px at 16% 0%, color-mix(in srgb, var(--page-tint, transparent) 9%, transparent), transparent 70%); }
:root[data-theme="dark"] #view::before { background: radial-gradient(900px 250px at 16% 0%, color-mix(in srgb, var(--page-tint, transparent) 16%, transparent), transparent 70%); }
#view > * { position: relative; z-index: 1; }

/* ---- phase 3: dragging a card on the board ---- */
.kcard.dragging { opacity: .92; transform: rotate(.4deg) scale(1.02); box-shadow: 0 16px 34px -12px rgba(15, 17, 26, .4); cursor: grabbing; }
.kcol { transition: background var(--dur-quick) var(--ease-out), border-color var(--dur-quick) var(--ease-out); }
.kcol.drop { box-shadow: inset 0 0 0 2px var(--accent), 0 0 0 4px var(--accent-soft); }
.kcol.blocked { box-shadow: inset 0 0 0 2px var(--bad); }

/* ---- phase 3: empty-state previews breathe, very slowly ---- */
@keyframes sfBreathe { 0%, 100% { opacity: .92; } 50% { opacity: 1; } }
.ghost { animation: sfBreathe 4.5s ease-in-out infinite; }
.ghost-chart i, .ghost-bar { transition: opacity var(--dur-quick) var(--ease-out); }

/* ---- phase 4: charts draw themselves in, once, when a page arrives ----
   Gated on .sf-enter, so a filter change or a data refresh redraws instantly. */
@keyframes sfBarIn { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes sfLineIn { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes sfFadeIn { from { opacity: 0; } to { opacity: inherit; } }
@keyframes sfDonutIn { from { opacity: 0; transform: rotate(-10deg) scale(.95); } to { opacity: 1; transform: none; } }
@keyframes sfGrowX { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.sf-enter .chart rect[data-bar] { transform-origin: center bottom; animation: sfBarIn 420ms var(--ease-out) both; }
.sf-enter .chart polyline[data-line] { animation: sfLineIn 600ms var(--ease-out) both; }
.sf-enter .chart polygon[data-area] { animation: sfFadeIn 600ms var(--ease-out) both; }
.sf-enter .sf-donut { transform-origin: center; animation: sfDonutIn 420ms var(--ease-out) both; }
.sf-enter .sf-grow { transform-origin: left center; animation: sfGrowX 480ms var(--ease-out) both; }

/* ---- arm 4 visual QC (1 Oct 2026) ---- */
/* Bare pages (login, signup, portals) have no .content padding, so the page-tint bleed of
   #view::before stuck out 28px and let the page scroll sideways (VQ-01). */
body.bare #view { --bleed: 0px; --bleed-top: 0px; }
/* Dark theme lightens the semantic fills (--ok, --ai, --bad, --accent-2) for text use; white text
   on those light fills read at 1.7-2.8:1 ("Call", "Send", "Change with AI", NEW flags). Solid
   fills take dark ink in dark mode (VQ-02). */
:root[data-theme="dark"] .btn.ai, :root[data-theme="dark"] .btn.ok, :root[data-theme="dark"] .btn.danger,
:root[data-theme="dark"] .newflag, :root[data-theme="dark"] .rx-pbtn.ok,
:root[data-theme="dark"] [style*="background:var(--ok)"], :root[data-theme="dark"] [style*="background: var(--ok)"],
:root[data-theme="dark"] [style*="background:var(--ai)"], :root[data-theme="dark"] [style*="background: var(--ai)"] { color: #0B0D12; }
:root[data-theme="dark"] .btn.ai svg, :root[data-theme="dark"] .btn.ok svg, :root[data-theme="dark"] .btn.danger svg { color: inherit; stroke: currentColor; }
/* Small upper-case section labels sat at 2.9:1 on the light page; one step darker (VQ-03). */
:root:not([data-theme="dark"]) .section-title { color: #6B7385; }
/* The v2 "Signed in as" chip carries an inline display, which beat the phone rule above and
   squeezed the page title to "Sai A…" at 360-768 px; the prototype hides it there (VQ-04). */
@media (max-width: 768px) { .topbar .role-switch { display: none !important; } }
:root[data-theme="dark"] .nav-link .newp { color: #0B0D12; }
/* Workflow builder: the name field shrank to "Sp" beside On / Test run / Save on phones and
   tablets; give it a floor so the actions wrap below instead (VQ-05, prototype has it too). */
.page-head > div:has(> .ex-wfname) { min-width: min(100%, 260px) !important; }
/* Customer portal footers ("This link is only for you", "Powered by Sparkfuse") were 2.9:1 (VQ-06). */
body .xx-pfoot { color: var(--muted); }

/* ---- polish 1 (1 Oct 2026): WCAG AA text contrast in both themes ----
   A strict sweep (qa/reports/polish-1-defects/contrast-aa.js: 4.5:1 body text, 3:1 large) found
   the light theme's semantic colours used as text on their own soft tints at 2.9-4.3:1 (chip.ok
   "Interested", chip.bad, chip.warn, chip.ai, the orange counts and "Sales Head"), --muted-2 at 3.1:1
   (hints, emails, timestamps, nav counts), and in dark mode white text on the light indigo, green and
   violet fills. Light theme: each token one step darker; text-only uses on tints go one step more.
   Dark theme: solid light fills take dark ink, as VQ-02 did for buttons. */
:root:not([data-theme="dark"]) {
  --muted-2: #646B7D;
  --ok: #147838; --bad: #B91C1C; --info: #1D4ED8; --ai: #0F766E; --warn: #9A4A0B; --accent-2: #B93D0B;
}
:root:not([data-theme="dark"]) .chip.ok, :root:not([data-theme="dark"]) .online-toggle-btn.live { color: #166534; }
:root:not([data-theme="dark"]) .chip.orange, :root:not([data-theme="dark"]) .tab .cnt,
:root:not([data-theme="dark"]) .tab.active .cnt { color: #9A3412; }
:root[data-theme="dark"] .online-toggle-btn.live { color: #4ADE80; }
:root[data-theme="dark"] .btn.accent, :root[data-theme="dark"] .empty-cta, :root[data-theme="dark"] .rx-pbtn.pri,
:root[data-theme="dark"] .steps .s.cur i, :root[data-theme="dark"] .steps .s.done i, :root[data-theme="dark"] .ex-ub,
:root[data-theme="dark"] .tx-a.present, :root[data-theme="dark"] .tx-a.late, :root[data-theme="dark"] .tx-a.half_day,
:root[data-theme="dark"] .tx-a.leave, :root[data-theme="dark"] .tx-a.absent,
:root[data-theme="dark"] [style*="background:var(--accent)"], :root[data-theme="dark"] [style*="background: var(--accent)"] { color: #0B0D12; }
:root[data-theme="dark"] .btn.accent svg, :root[data-theme="dark"] .empty-cta svg, :root[data-theme="dark"] .rx-pbtn.pri svg { stroke: currentColor; }
/* WhatsApp template preview: dark mode lightened --ai to #2DD4BF under white text (1.9:1); use
   WhatsApp's own dark header green in both themes' dark variant (VQ-08). */
:root[data-theme="dark"] .ex-phone .bar { background: #075E54; }
:root[data-theme="dark"] .ex-phone .bar .avatar { color: #075E54 !important; }
/* VQ-03's section labels (#6B7385) read 4.47:1 on the grey page; the darker --muted-2 passes. */
:root:not([data-theme="dark"]) .section-title { color: var(--muted-2); }
:root[data-theme="dark"] .ex-meta > span { color: #B7BBC9; }
/* Not changed on purpose: integration and WhatsApp provider logo tiles (.ex-logo) keep each
   provider's brand colour; logotypes are exempt from WCAG 1.4.3 and the name is always next to them. */
/* Count badges: white on --danger (#EF4444, 3.8:1) and on dark-mode reds (#FF5C7A / #F87171, 2.8-3.0:1). */
.notif-badge, body .rx-ph-tabs .b { background: #DC2626; color: #fff; }
/* Dashboard tiles: white labels on the lighter start of the green, teal and orange gradients read
   3.3, 3.7 and 2.8:1 (gradients are skipped by the automatic sweeps). Each gradient moves one step darker. */
.kpi.tile-green { background: linear-gradient(135deg, #15803d, #166534); }
.kpi.tile-orange { background: linear-gradient(135deg, #c2410c, #9a3412); }
.kpi.tile-teal { background: linear-gradient(135deg, #0f766e, #115e59); }
.kpi.tile .label, .kpi.tile .delta { color: rgba(255, 255, 255, .94); }

/* Polish 1 (sev 2): a WhatsApp conversation on a phone. The header squeezed the name to "Aja…" and
   wrapped the number over three lines (the .who block had an inline min-width:0, so the action
   buttons took the row), the page head, spend meter and tabs left a sliver for the messages, and the
   floating AI bar sat on the template picker and send row. On a phone an open conversation now uses
   the screen: name and number get the first header row, actions wrap below, the page head and tabs
   step aside (Back returns to the list), and the AI bar hides while the composer is on screen. */
@media (max-width: 640px) {
  #exHead.ex-th-head { gap: 8px; padding: 8px 10px; }
  #exHead.ex-th-head .who { flex: 1 1 calc(100% - 96px); min-width: 0 !important; }
  #exHead.ex-th-head .who .tiny { line-height: 1.35; }
  body:has(.ex-wa.has-conv) #view .page-head,
  body:has(.ex-wa.has-conv) #view .page-head + .tabs,
  body:has(.ex-wa.has-conv) #view > .tabs { display: none; }
  .split.ex-wa.has-conv { height: calc(100dvh - 150px); min-height: 420px; }
}
@media (max-width: 900px) {
  body:has(.ex-wa.has-conv) .cmd { display: none; }
}

/* Polish 1 (sev 3): on a phone the page's tab bar scrolled sideways, so "Approvals" (RSM) and
   "Coordinator queue" sat off-screen below the KPI cards. Tabs now wrap onto a second line. */
@media (max-width: 640px) {
  #view .tabs { flex-wrap: wrap; overflow-x: visible; row-gap: 0; }
  #view .tabs .tab { padding-left: 10px; padding-right: 10px; }
}

/* Polish 1 (sev 3): the quote item table at 1440 hid the Discount column inside its scroll box. The
   editor gets a little more of the width than the preview, and the line inputs are narrower. */
@media (min-width: 1101px) { .grid.sx-qgrid { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); } }
#view .sx-lines td { padding: 6px 5px; }
#view .sx-lines .sx-sku { min-width: 156px; }
#view .sx-lines .sx-q { width: 64px; }
#view .sx-lines .sx-p { width: 96px; }
#view .sx-lines .sx-dc { width: 60px; }

/* Polish 2 (sev 2): the floating AI bar (z 820) sat on top of the phone menu drawer (z 70) and covered
   Log out, the last item in it. While the drawer is open the bar steps aside. */
@media (max-width: 768px) {
  body:has(.sidebar.open) .cmd, body:has(.sidebar.open) .cmd-orb { display: none; }
  /* the last item must also clear the browser's bottom bar when the menu is scrolled to the end */
  .sidebar { padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }
}

/* Polish 2 (sev 3): toasts on a phone covered the title, search and bell, and several stacked ones hid
   the top of the page. They now sit at the bottom above the AI bar, newest last, at most two at once. */
@media (max-width: 768px) {
  .toast-stack { top: auto; bottom: 74px; left: 12px; right: 12px; align-items: stretch; }
  body:has(#callbar) .toast-stack { bottom: 150px; }
  .toast-item { max-width: none; transform: translateY(12px); padding: 10px 14px; }
  .toast-item.show { transform: none; }
  .toast-item:nth-last-child(n+3) { display: none; }
}

/* Polish 2 (sev 3): tap targets. On a phone the small buttons, '?' help dots and chips that act were
   24 to 30 px tall; everything tappable gets at least 36 px (the help dot keeps its look and gets a
   larger invisible hit area). */
@media (max-width: 768px) {
  .btn.xs, .btn.sm { min-height: 36px; }
  .icon-btn.sm { width: 36px; height: 36px; }
  button.chip, a.chip, .chip[role="button"], .chip[data-action], .chip[data-go] { min-height: 32px; }
  .help-dot { position: relative; }
  .help-dot::after { content: ""; position: absolute; inset: -12px; }
  .tabs .tab { min-height: 40px; }
}

/* Polish 2 (sev 2/3): WhatsApp conversation composer. At laptop heights the pane ended under the floating
   AI bar (Send template / Send were unreachable); the pane now stops above the bar. On a phone with the
   24 h window closed the template composer took 60 percent of the screen; the preview scrolls inside a
   short box and the banner is tighter so the thread keeps room. */
@media (max-width: 640px) {
  .ex-comp { padding: 8px 10px; gap: 6px; }
  .ex-comp #exTplPrev { max-height: 64px; overflow-y: auto; padding: 8px 10px; }
  .ex-comp .banner { padding: 6px 10px !important; font-size: 12px !important; line-height: 1.35; }
  .ex-comp .ex-ph-x, .ex-comp .row > .tiny.muted { display: none; }
  .split.ex-wa.has-conv { height: calc(100dvh - 136px); }
  .ex-wa .ex-thread { min-height: 150px; }
}

/* Polish 2 (sev 2): the menu backdrop (z 65) is a sibling of .shell, and .shell is its own stacking context
   (z 1), so the whole drawer sat UNDER the backdrop: dimmed, and every tap on Log out or a menu item landed
   on the backdrop and only closed the menu. On a phone the shell takes no stacking context of its own, so the
   drawer (z 70) sits above its backdrop (z 65). */
@media (max-width: 768px) { .shell { z-index: auto; } }

/* Founder's screenshots, generic workspaces 2 Oct 2026.
   (1) Form rows: .field is a grid, and a grid row stretched to its tallest neighbour (Mobile with its
   "New number" hint) spread the extra height over the label and input tracks, so Name's input sat 11 px
   lower than Mobile's. Fields pack to the top so inputs in one row line up.
   (2) Selects: some browsers (iOS Safari, Android WebView) draw a native select taller than the 38 px
   inputs next to it. Single selects drop the native chrome and draw the same chevron themselves, so
   every select is exactly the input height. The dark theme's `background` shorthand would erase the
   chevron, so it is set again there.
   (3) Eyebrow labels (NEXT BEST ACTION, GET SET UP, ON VISIT NOW) are blocks of their own: as
   inline-flex the title after them ran on the same line ("NEXT BEST ACTIONCall now"). */
.field { align-content: start; }
.select:not([multiple]) { -webkit-appearance: none; appearance: none; line-height: normal; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 14px 14px; text-overflow: ellipsis; }
:root[data-theme="dark"] .select:not([multiple]) { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394A3B8' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 14px 14px; }
.select.sm:not([multiple]) { padding-right: 28px; background-position: right 8px center; }
div.ai-label { display: flex; width: fit-content; max-width: 100%; margin-bottom: 3px; }

/* AI-driven setup (generic workspaces, 2 Oct 2026): setup previews in the command bar and the
   first-run "What do you sell, and to whom?" card. Stages read as a row of chips that wraps on phones. */
.sf-stagerow { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 2px; min-width: 0; }
.sf-stagearrow { display: inline-flex; color: var(--muted-2); }
.sf-stagearrow svg { width: 13px; height: 13px; }
.chip.sf-stage { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.chip.sf-stage svg { width: 11px; height: 11px; }
.chip.sf-stage.is-new { background: var(--ai-soft); color: var(--ai); border-color: var(--ai); }
.chip.sf-stage.is-won { background: var(--ok-soft); color: var(--ok); }
.chip.sf-stage.is-lost { background: var(--bad-soft); color: var(--bad); }
.sf-setup-preview { display: grid; gap: 8px; min-width: 0; }
.sf-sp-pipe { display: grid; gap: 5px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--card); min-width: 0; }
.sf-sp-pipe .tiny svg { width: 11px; height: 11px; vertical-align: -1px; }
.sf-setup-preview .banner { padding: 8px 10px; }
.card.sf-firstrun { margin-bottom: 16px; border-color: rgba(13,148,136,.35); background: radial-gradient(600px circle at 100% 0%, var(--ai-soft), transparent 60%), var(--card); }
.sf-fr-form { display: flex; flex-wrap: wrap; gap: 8px; }
.sf-fr-form .input { flex: 1 1 240px; min-width: 0; }
.sf-fr-chip { cursor: pointer; height: 28px; font-size: 12.5px; border-color: var(--border); }
.sf-fr-chip:hover { border-color: var(--ai); color: var(--ai); }
.sf-fr-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.sf-fr-next { display: grid; gap: 8px; }
.sf-fr-steptext { flex: 1 1 200px; min-width: 0; }
.sf-fr-step { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); min-width: 0; }

/* Voice task mic beside the task form's Title (wire-calling.js) and the Tasks table (mod-calling.js) */
.vt-inline { display: flex; gap: 6px; align-items: center; }
.vt-inline .input { flex: 1; min-width: 0; }
.vt-mic-sm.rec { background: #DC2626; border-color: #DC2626; color: #fff; animation: vtPulse 1.1s ease-in-out infinite; }
@keyframes vtPulse { 0% { box-shadow: 0 0 0 0 rgba(220,38,38,.5); } 70% { box-shadow: 0 0 0 10px rgba(220,38,38,0); } 100% { box-shadow: 0 0 0 0 rgba(220,38,38,0); } }
.vt-status { display: block; margin-top: 4px; }
.vt-status[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .vt-mic-sm.rec { animation: none; } }

.tk-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.tk-table th { text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; padding: 8px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface-1, var(--card)); }
.tk-table th[data-tsort] { cursor: pointer; user-select: none; }
.tk-table th[data-tsort]:hover { color: var(--text); }
.tk-table th .tk-arrow { margin-left: 4px; opacity: .8; }
.tk-table td { padding: 9px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.tk-table tr.done td { opacity: .6; }
.tk-table tr.sel td { background: var(--accent-soft, rgba(0,0,0,.04)); }
.tk-table .tk-ttl { font-weight: 600; max-width: 340px; overflow-wrap: anywhere; }
.tk-table .tk-due.bad { color: var(--bad); font-weight: 600; }
.tk-table .tk-who { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.tk-cards { display: grid; gap: 10px; padding: 10px; }
.tk-card { border: 1px solid var(--border); border-radius: 12px; padding: 12px; display: grid; gap: 8px; background: var(--card); }
.tk-card.done { opacity: .65; }
.tk-card.sel { border-color: var(--accent); }
.tk-card-top { display: flex; gap: 10px; align-items: flex-start; }
.tk-card-top .cl-ttl { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.tk-card-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; font-size: 12.5px; }
.tk-card-meta .k { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .04em; display: block; }
.tk-card-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.tk-sortbar { display: flex; gap: 8px; align-items: center; padding: 10px 10px 0; }
.tk-open { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: var(--text); text-align: left; cursor: pointer; overflow-wrap: anywhere; }
.tk-open:hover { text-decoration: underline; }
.tk-sortbtn { background: none; border: 0; padding: 0; font: inherit; text-transform: inherit; letter-spacing: inherit; color: inherit; cursor: pointer; font-weight: inherit; }
.tk-sortbtn:hover, .tk-sortbtn:focus-visible { color: var(--text); }
/* Setup checklist: the hide button (dismissible onboarding) */
.onb { position: relative; }
.onb-x { position: absolute; top: 10px; right: 10px; z-index: 1; }
.onb-x ~ .onb-head { padding-right: 34px; }

/* Voice input on every text box (fix pointer 9, web/js/voice-mic.js): the real browser recogniser,
   a mic and a small EN / हि language toggle in the field's top-right corner. */
.voice-wrap { position: relative; display: block; min-width: 0; }
.voice-wrap > textarea, .voice-wrap > input { padding-right: 70px; }
.voice-tools { position: absolute; right: 6px; top: 6px; display: inline-flex; gap: 4px; align-items: center; z-index: 2; }
.voice-wrap:not(.is-area) .voice-tools { top: 50%; transform: translateY(-50%); }
.mic-btn, .voice-lang { height: 26px; border-radius: 8px; border: 1px solid var(--border); background: var(--card); color: var(--muted); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.mic-btn { width: 26px; }
.voice-lang { min-width: 26px; padding: 0 5px; font-size: 11px; font-weight: 700; }
.mic-btn:hover, .voice-lang:hover { color: var(--accent-2); border-color: var(--accent-2); }
.mic-btn:focus-visible, .voice-lang:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.mic-btn svg { width: 14px; height: 14px; }
.mic-btn.rec { background: #DC2626; color: #fff; border-color: #DC2626; animation: micpulse 1.2s infinite; }
.voice-hint { display: block; margin-top: 4px; font-size: 11.5px; font-weight: 600; color: #DC2626; }
.voice-hint.bad { color: var(--bad); font-weight: 500; }
.voice-hint[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .mic-btn.rec { animation: none; } }

/* Call recording player (ui.player) and call history cards (lead page Calls tab) */
.rp { display: flex; align-items: center; gap: 8px; width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-1); }
.rp audio { display: none; }
.rp-btn { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; border: 0; background: transparent; color: var(--muted); cursor: pointer; flex: none; }
.rp-btn:hover { background: var(--surface-hover); color: var(--text); }
.rp-btn svg, .rp-vol svg { width: 15px; height: 15px; }
.rp-play { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 9px; border: 0; background: var(--accent); color: #fff; cursor: pointer; flex: none; }
.rp-play svg { width: 15px; height: 15px; }
.rp-time { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 34px; text-align: center; flex: none; }
.rp-seek { flex: 1; min-width: 60px; accent-color: var(--accent); }
.rp-speed { font-size: 12px; font-weight: 600; color: var(--text); background: var(--surface-2); border: 0; border-radius: 6px; padding: 3px 7px; cursor: pointer; flex: none; }
.rp-vol { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); flex: none; }
.rp-vol input { width: 70px; accent-color: var(--accent); }
@media (max-width: 640px) { .rp-vol { display: none; } .rp { flex-wrap: wrap; } }
.cc { border: 1px solid var(--border); border-radius: 12px; background: var(--card); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.cc-top { display: flex; align-items: flex-start; gap: 12px; }
.cc-when { font-weight: 600; font-size: 13.5px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cc-when svg { width: 14px; height: 14px; color: var(--muted); }
.cc-meta { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; margin-top: 3px; flex-wrap: wrap; }
.cc-chips { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.cc-sum { background: var(--surface-1); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; font-size: 13.5px; line-height: 1.5; }
.cc-sum .cc-lbl { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; display: flex; align-items: center; gap: 5px; margin-bottom: 4px; }
.cc-sum .cc-lbl svg { width: 12px; height: 12px; }
.cc-links { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; font-size: 13px; }
.cc-links details > summary { cursor: pointer; list-style: none; color: var(--accent); display: inline-flex; align-items: center; gap: 5px; font-weight: 500; }
.cc-links details > summary::-webkit-details-marker { display: none; }
.cc-links details > summary svg { width: 14px; height: 14px; flex: none; transition: transform .15s; }
.cc-links details[open] > summary svg { transform: rotate(90deg); }
.cc-links details[open] { flex-basis: 100%; }
.cc-score { margin-top: 8px; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.cc-score div { display: flex; gap: 10px; padding: 8px 12px; font-size: 13px; border-top: 1px solid var(--border); }
.cc-score div:first-child { border-top: 0; }
.cc-score .q { flex: 1; min-width: 0; } .cc-score .a { color: var(--muted); flex: 1; min-width: 0; } .cc-score .p { font-weight: 600; white-space: nowrap; }
