/* ───────────────────────── FONTS ───────────────────────── */
@font-face { font-family: "Neue Montreal"; src: url("/fonts/NeueMontreal-Light.otf") format("opentype"); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: "Neue Montreal"; src: url("/fonts/NeueMontreal-Regular.otf") format("opentype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Neue Montreal"; src: url("/fonts/NeueMontreal-Medium.otf") format("opentype"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Neue Montreal"; src: url("/fonts/NeueMontreal-Bold.otf") format("opentype"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Missive Serif"; src: url("/fonts/MissiveSerif-Light.otf") format("opentype"); font-weight: 300; font-style: normal; font-display: swap; }

/* ───────────────────────── DESIGN TOKENS ───────────────────────── */
:root {
  /* brand */
  --teal-950:#151E1D; --teal-900:#2B3634; --teal-800:#303F3C; --teal-700:#384D49;
  --teal-600:#47645E; --teal-500:#55776F; --teal-400:#709189; --teal-300:#96B2AA;
  --teal-200:#BED1CB; --teal-100:#DFE8E5; --teal-50:#F5F8F7;
  --moss-950:#162112; --moss-900:#2F3F28; --moss-800:#384C2F; --moss-700:#435F36;
  --moss-600:#537742; --moss-500:#699255; --moss-400:#8BB078; --moss-300:#B4CEA7;
  --moss-200:#CFE0C6; --moss-100:#EAF2E6; --moss-50:#F6F9F4;
  --ink-950:#0B0B0B; --ink-900:#1B1B1B; --ink-800:#272727; --ink-700:#404040;
  --ink-600:#535353; --ink-500:#727272; --ink-400:#A3A3A3; --ink-300:#D3D3D3;
  --ink-200:#E6E6E6; --ink-100:#F5F5F5; --ink-50:#FAFAFA;

  /* tertiary accents */
  --rust-red:#9B392A; --dusty-rose:#D58C8B; --sienna:#CC774C;
  --warm-ochre:#D5A03F; --slate-blue:#829CB9; --olive-green:#696F45;

  /* semantic — light mode */
  --bg:         var(--ink-50);
  --bg-sunken:  var(--ink-100);
  --surface:    #FFFFFF;
  --surface-2:  #FAFAFA;
  --border:     var(--ink-200);
  --border-strong: var(--ink-300);
  --text:       var(--ink-900);
  --text-muted: var(--ink-600);
  --text-faint: var(--ink-500);
  --accent:     var(--teal-600);
  --accent-bg:  var(--teal-50);
  --positive:   var(--moss-700);
  --positive-bg:var(--moss-100);
  --negative:   var(--rust-red);
  --negative-bg:#F5E8E4;
  --warning:    #8A6B2A;
  --warning-bg: #F6EFDD;
  --highlight:  var(--moss-200);

  /* type */
  --font-sans: "Neue Montreal", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "Kode Mono", ui-monospace, monospace;
  --font-serif:"Missive Serif", Georgia, serif;

  /* spacing & layout */
  --sidebar-w: 224px;
  --topbar-h: 52px;
  --r-sm: 4px;
  --r-md: 6px;
  --r-lg: 10px;
}

[data-theme="dark"] {
  --bg:         #0E1413;
  --bg-sunken:  #0A0F0E;
  --surface:    #151E1D;
  --surface-2:  #1B2624;
  --border:     #263330;
  --border-strong: #324241;
  --text:       #ECF1EF;
  --text-muted: #96B2AA;
  --text-faint: #5E7873;
  --accent:     var(--teal-300);
  --accent-bg:  #1F2D2A;
  --positive:   var(--moss-400);
  --positive-bg:#1F2C1B;
  --negative:   var(--dusty-rose);
  --negative-bg:#2C1E1A;
  --warning:    #D6B774;
  --warning-bg: #2B2418;
  --highlight:  #2D3F26;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--bg); color: var(--text); font-family: var(--font-sans); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body { min-height: 100vh; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, select { font: inherit; color: inherit; }

/* ───────────────────────── TYPOGRAPHY UTILITIES ───────────────────────── */
.mono { font-family: var(--font-mono); font-feature-settings: "tnum"; letter-spacing: -0.01em; }
.serif { font-family: var(--font-serif); }
.eyebrow { font-size: 10.5px; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-faint); }
.label-sm { font-size: 11px; font-weight: 500; color: var(--text-muted); }
.num-display { font-family: var(--font-mono); font-weight: 500; letter-spacing: -0.02em; font-feature-settings: "tnum"; }

/* ───────────────────────── LAYOUT ───────────────────────── */
:root { --chat-w: 320px; }
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr var(--chat-w); grid-template-rows: var(--topbar-h) 1fr; min-height: 100vh; }
.topbar { grid-column: 1 / -1; display: flex; align-items: center; gap: 16px; padding: 0 16px 0 16px; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.sidebar { background: var(--surface); border-right: 1px solid var(--border); padding: 12px 8px; display: flex; flex-direction: column; gap: 2px; min-height: calc(100vh - var(--topbar-h)); position: sticky; top: var(--topbar-h); align-self: start; max-height: calc(100vh - var(--topbar-h)); overflow-y: auto; }
.main { padding: 16px 24px 40px; min-width: 0; }

/* Chat panel — right side, sticky */
.chat-panel { background: var(--surface); border-left: 1px solid var(--border); display: flex; flex-direction: column; position: sticky; top: var(--topbar-h); align-self: start; height: calc(100vh - var(--topbar-h)); }
.chat-header { padding: 14px 16px; border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 10px; }
.chat-header-icon { width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(135deg, var(--teal-700), var(--teal-500)); display: grid; place-items: center; color: white; font-weight: 600; font-size: 12px; flex-shrink: 0; }
.chat-header-title { font-size: 13.5px; font-weight: 600; }
.chat-header-sub { font-size: 11px; color: var(--text-faint); }
.chat-body { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.chat-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; padding: 24px 8px; }
.chat-empty-icon { width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(135deg, var(--teal-700), var(--teal-500)); color: white; display: grid; place-items: center; }
[data-theme="dark"] .chat-empty-icon { background: linear-gradient(135deg, var(--teal-700), var(--teal-500)); color: white; }
.chat-empty-title { font-size: 15px; font-weight: 600; color: var(--text); }
.chat-empty-sub { font-size: 12px; color: var(--text-muted); max-width: 280px; line-height: 1.5; }
.chat-suggestions { display: flex; flex-direction: column; gap: 6px; width: 100%; margin-top: 4px; }
.chat-suggestion { padding: 10px 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px; font-size: 12.5px; color: var(--text); cursor: pointer; text-align: left; transition: background 100ms, border-color 100ms; }
.chat-suggestion:hover { background: var(--teal-50); border-color: var(--teal-300); }
[data-theme="dark"] .chat-suggestion:hover { background: rgba(71,100,94,0.18); border-color: var(--teal-500); }
.chat-msg { display: flex; gap: 10px; font-size: 13px; line-height: 1.55; }
.chat-msg.user { flex-direction: row-reverse; }
.chat-msg-avatar { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-size: 11px; font-weight: 600; flex-shrink: 0; }
.chat-msg.ai .chat-msg-avatar { background: linear-gradient(135deg, var(--teal-700), var(--teal-500)); color: white; }
.chat-msg.user .chat-msg-avatar { background: var(--teal-600); color: white; }
.chat-msg-bubble { padding: 8px 12px; border-radius: 12px; max-width: 80%; }
.chat-msg.ai .chat-msg-bubble { background: var(--surface-2); }
.chat-msg.user .chat-msg-bubble { background: var(--moss-100); color: var(--moss-950); }
[data-theme="dark"] .chat-msg.user .chat-msg-bubble { background: rgba(75,100,94,0.22); color: var(--text); }
.chat-input-wrap { padding: 12px 14px 14px; border-top: 1px solid var(--border); }
.chat-input-box { display: flex; gap: 6px; align-items: flex-end; padding: 8px 8px 8px 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; transition: border-color 100ms; }
.chat-input-box:focus-within { border-color: var(--teal-500); box-shadow: 0 0 0 3px rgba(71,100,94,0.12); }
.chat-input { flex: 1; border: none; background: transparent; resize: none; font-family: inherit; font-size: 13px; color: var(--text); outline: none; padding: 4px 0; min-height: 22px; max-height: 120px; line-height: 1.5; }
.chat-input::placeholder { color: var(--text-faint); }
.chat-send-btn { flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%; border: none; background: var(--teal-600); color: white; cursor: pointer; display: grid; place-items: center; transition: filter 120ms; }
.chat-send-btn:hover { filter: brightness(1.08); }
.chat-send-btn:disabled { background: var(--ink-300); cursor: not-allowed; filter: none; }
.chat-input-hint { font-size: 10.5px; color: var(--text-faint); margin-top: 6px; padding-left: 4px; }

@media (max-width: 1280px) {
  .app { grid-template-columns: var(--sidebar-w) 1fr; }
  .chat-panel { display: none; }
}

/* Chat collapsed state — main expands, FAB appears */
.app.chat-hidden { grid-template-columns: var(--sidebar-w) 1fr; }
.app.chat-hidden .chat-panel { display: none; }
.app.chat-hidden #chatOpenFab { display: inline-flex !important; }

.chat-open-fab {
  position: fixed;
  bottom: 22px;
  right: 22px;
  height: 44px;
  padding: 0 16px 0 14px;
  border-radius: 22px;
  border: none;
  background: var(--teal-700);
  color: white;
  cursor: pointer;
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-sans);
  box-shadow: 0 8px 24px rgba(71,100,94,0.28), 0 2px 4px rgba(0,0,0,0.08);
  transition: background 120ms, transform 100ms, box-shadow 120ms;
}
.chat-open-fab:hover { background: var(--teal-600); transform: translateY(-1px); box-shadow: 0 10px 28px rgba(71,100,94,0.34), 0 2px 4px rgba(0,0,0,0.1); }
.chat-open-fab:active { transform: translateY(0); }

/* ───────────────────────── TOPBAR ───────────────────────── */
.brand { display: flex; align-items: center; gap: 10px; padding-right: 14px; border-right: 1px solid var(--border); height: 100%; padding-left: 0; }
.brand-icon { width: 22px; height: 25px; flex-shrink: 0; }
.brand-icon path { fill: var(--text); }
.brand-name { font-weight: 500; letter-spacing: 0.04em; font-size: 13px; }
.workspace-switcher { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: var(--r-md); cursor: pointer; transition: background 80ms ease; }
.workspace-switcher:hover { background: var(--surface-2); }
.workspace-avatar { width: 22px; height: 22px; border-radius: 4px; background: linear-gradient(135deg, var(--teal-600), var(--teal-700)); color: white; display: grid; place-items: center; font-size: 11px; font-weight: 600; }
.workspace-name { font-weight: 500; font-size: 13px; }
.workspace-chev { color: var(--text-faint); }

.topbar-spacer { flex: 1; }
.topbar-search { display: flex; align-items: center; gap: 8px; padding: 5px 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); width: 240px; color: var(--text-faint); font-size: 12.5px; }
.range-picker { display: flex; align-items: center; gap: 8px; }
.range-picker .range-eyebrow { font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-faint); font-family: var(--font-mono); }
.range-segmented button { padding: 4px 10px; font-family: var(--font-mono); letter-spacing: 0.02em; }
.chart-range-picker { flex-shrink: 0; }
.chart-range-picker button { font-size: 11.5px; padding: 3px 9px; }
.topbar-search kbd { font-family: var(--font-mono); font-size: 10px; padding: 1px 5px; background: var(--surface); border: 1px solid var(--border); border-radius: 3px; color: var(--text-muted); margin-left: auto; }
.topbar-icon-btn { width: 30px; height: 30px; display: grid; place-items: center; border-radius: var(--r-md); color: var(--text-muted); transition: all 80ms ease; }
.topbar-icon-btn:hover { background: var(--surface-2); color: var(--text); }
.user-chip { width: 28px; height: 28px; border-radius: 50%; background: var(--teal-700); color: white; display: grid; place-items: center; font-size: 11px; font-weight: 600; }
/* Notifications bell + dropdown */
.notif-wrap { position: relative; }
.notif-badge { position: absolute; top: 2px; right: 2px; min-width: 15px; height: 15px; padding: 0 4px; border-radius: 8px; background: var(--negative); color: #fff; font-size: 9.5px; font-weight: 700; font-family: var(--font-mono); display: flex; align-items: center; justify-content: center; line-height: 1; box-shadow: 0 0 0 2px var(--surface); }
.notif-badge[hidden] { display: none; }
.notif-panel { position: absolute; right: 0; top: 38px; width: 360px; max-height: 460px; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 18px 50px rgba(0,0,0,0.22); z-index: 1300; overflow: hidden; animation: notifPop 140ms ease-out; }
.notif-panel[hidden] { display: none; }
@keyframes notifPop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.notif-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 13px; font-weight: 600; color: var(--text); }
.notif-clear { font-size: 11.5px; color: var(--accent); font-weight: 500; cursor: pointer; background: none; border: none; }
.notif-clear:hover { text-decoration: underline; }
.notif-list { overflow-y: auto; }
.notif-item { display: flex; gap: 11px; padding: 12px 14px; border-bottom: 1px solid var(--border); position: relative; }
.notif-item:last-child { border-bottom: none; }
.notif-item.unread { background: var(--moss-50); }
[data-theme="dark"] .notif-item.unread { background: rgba(110,140,85,0.10); }
.notif-ic { width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0; display: grid; place-items: center; }
.notif-ic .ico { width: 15px; height: 15px; }
.notif-body { flex: 1; min-width: 0; }
.notif-title { font-size: 12.5px; font-weight: 600; color: var(--text); line-height: 1.3; }
.notif-text { font-size: 11.5px; color: var(--text-muted); line-height: 1.45; margin-top: 2px; }
.notif-time { font-size: 10px; color: var(--text-faint); font-family: var(--font-mono); margin-top: 4px; }
.notif-empty { padding: 30px 14px; text-align: center; font-size: 12px; color: var(--text-faint); }

/* ───────────────────────── SIDEBAR ───────────────────────── */
.nav-section-label { padding: 14px 10px 6px; font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-faint); font-weight: 500; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--r-md); font-size: 13px; color: var(--text-muted); cursor: pointer; transition: all 80ms ease; position: relative; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.active { background: var(--accent-bg); color: var(--accent); font-weight: 500; }
[data-theme="dark"] .nav-item.active { color: var(--teal-100); }
.nav-item .nav-icon { width: 16px; height: 16px; flex-shrink: 0; opacity: 0.85; }
.nav-item .nav-badge { margin-left: auto; font-family: var(--font-mono); font-size: 10.5px; padding: 1px 6px; border-radius: 8px; background: var(--surface-2); color: var(--text-faint); }
.nav-item.active .nav-badge { background: var(--surface); color: var(--accent); }
.nav-item .nav-dot { margin-left: auto; width: 6px; height: 6px; border-radius: 50%; background: var(--warning); }
.nav-pillar-num { font-family: var(--font-mono); font-size: 9.5px; color: var(--text-faint); width: 14px; text-align: center; font-weight: 500; }
.nav-item.active .nav-pillar-num { color: var(--accent); }

.sidebar-footer { margin-top: auto; padding: 12px 8px 10px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 2px; }
.sidebar-footer .nav-section-label { padding-bottom: 4px; }
.nav-item-sm { padding: 6px 10px; font-size: 12.5px; }
.nav-item-sm .nav-icon { width: 14px; height: 14px; opacity: 0.7; }
.nav-item-sm .nav-badge { font-size: 10px; padding: 1px 5px; }
.theme-toggle { display: flex; align-items: center; justify-content: space-between; padding: 6px 8px; margin-top: 8px; border-radius: var(--r-md); font-size: 12px; color: var(--text-faint); cursor: pointer; border-top: 1px solid var(--border); padding-top: 12px; }
.theme-toggle:hover { background: var(--surface-2); }
.theme-toggle .icon { width: 14px; height: 14px; }
.theme-toggle .icon path { fill: currentColor; }
.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: inline-block; }
[data-theme="dark"] .theme-toggle .icon-sun  { display: none; }

/* ───────────────────────── PAGE HEADER ───────────────────────── */
.page-header { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 10px; gap: 24px; }
.page-header .titlegroup .breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-faint); margin-bottom: 4px; }
.page-header .titlegroup .breadcrumb .pillar-marker { font-family: var(--font-mono); font-size: 10px; padding: 1px 6px; background: var(--surface); border: 1px solid var(--border); border-radius: 3px; color: var(--text-muted); letter-spacing: 0.04em; }
.page-header h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; }
.page-header h1 .pulse { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--moss-600); margin-left: 8px; vertical-align: middle; animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }
.page-header .sub { font-size: 13px; color: var(--text-muted); margin-top: 4px; max-width: 640px; }
.page-actions { display: flex; align-items: center; gap: 8px; }

/* ───────────────────────── BUTTONS ───────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--r-md); font-size: 12.5px; font-weight: 500; transition: all 100ms ease; border: 1px solid transparent; line-height: 1.4; }
.btn-primary { background: var(--ink-900); color: white; }
.btn-primary:hover { background: var(--ink-800); }
[data-theme="dark"] .btn-primary { background: var(--teal-50); color: var(--ink-900); }
[data-theme="dark"] .btn-primary:hover { background: var(--teal-100); }
.btn-accent { background: var(--accent); color: white; }
[data-theme="dark"] .btn-accent { background: var(--moss-400); color: var(--ink-950); }
.btn-secondary { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-secondary:hover { background: var(--surface-2); }
.btn-ghost { color: var(--text-muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn .icon { width: 13px; height: 13px; }

/* ───────────────────────── CARDS & SURFACES ───────────────────────── */
.card { background: var(--surface); border: 2px solid var(--border); border-radius: var(--r-lg); overflow: hidden; }
.card-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 2px solid var(--border); }
.card-header-stack { flex-direction: column; align-items: flex-start; gap: 0; }
.card-header-stack > .row-flex { width: 100%; }

/* Multi-select trigger button (for By tool / By team dropdowns on AI traffic chart) */
.multi-select-trigger { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md, 6px); cursor: pointer; font-size: 12.5px; color: var(--text); transition: background 100ms; }
.multi-select-trigger:hover { background: var(--ink-100); }
.multi-select-trigger .ms-label { color: var(--text-muted); font-size: 11.5px; }
.multi-select-trigger .ms-count { font-family: var(--font-mono); color: var(--text); }
.multi-select-trigger svg { color: var(--text-faint); }
[data-theme="dark"] .multi-select-trigger:hover { background: var(--ink-700); }

/* Full-width trend container */
.trend-container-full { padding: 4px 0 4px 0; }

/* IdP setup card on Setup page */
.idp-setup-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 22px 24px; margin-bottom: 22px; }
.idp-setup-card .idp-setup-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.idp-setup-card .idp-logo { width: 44px; height: 44px; border-radius: 8px; background: var(--moss-100); color: var(--moss-700); display: grid; place-items: center; flex-shrink: 0; }
.idp-setup-card .idp-logo svg { width: 22px; height: 22px; }
.idp-setup-card .idp-setup-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0; padding: 18px 0; border-bottom: 1px solid var(--border); }
.idp-setup-card .idp-fact { display: flex; flex-direction: column; gap: 4px; padding: 0 16px; border-right: 1px solid var(--border); }
.idp-setup-card .idp-fact:last-child { border-right: none; }
.idp-setup-card .idp-fact:first-child { padding-left: 0; }
.idp-setup-card .idp-fact-label { font-size: 11px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.04em; }
.idp-setup-card .idp-fact-value { font-size: 15px; font-weight: 600; color: var(--text); }
.idp-setup-card .idp-fact-value.mono { font-family: var(--font-mono); font-weight: 500; }
.idp-setup-card .idp-setup-supported { display: flex; align-items: center; gap: 6px; padding-top: 16px; flex-wrap: wrap; }
.idp-setup-card .idp-supported-pill { font-size: 11.5px; padding: 3px 9px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; color: var(--text-muted); }

/* Control page: policy icons + prompt inspector */
.policy-icon { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 6px; font-size: 14px; line-height: 1; }
.inspector-list { display: flex; flex-direction: column; }
.vis-cluster[hidden] { display: none; }
.ctrl-pane[hidden] { display: none; }
.adopt-view[hidden] { display: none; }

/* Optimize page */
.opt-filter-row { display: flex; gap: 6px; flex-wrap: wrap; margin: 14px 0 18px; }
.opt-pill { padding: 6px 12px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; font-size: 12.5px; color: var(--text-muted); cursor: pointer; transition: all 100ms; display: inline-flex; align-items: center; gap: 7px; font-family: inherit; }
.opt-pill:hover { color: var(--text); border-color: var(--border-strong); }
.opt-pill.active { background: var(--ink-900); color: white; border-color: var(--ink-900); }
[data-theme="dark"] .opt-pill.active { background: var(--moss-300); color: var(--ink-900); border-color: var(--moss-300); }
.opt-pill-count { font-family: var(--font-mono); font-size: 10.5px; opacity: 0.65; }
.opt-feed { display: flex; flex-direction: column; gap: 10px; }
.opt-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px 18px; display: grid; grid-template-columns: 1fr 180px 150px; gap: 18px; align-items: center; transition: border-color 100ms, box-shadow 100ms; }
.opt-card:hover { border-color: var(--border-strong); box-shadow: 0 2px 6px rgba(0,0,0,0.04); }
.opt-card { min-height: 188px; }
.opt-card .opt-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.opt-cat-pill { font-size: 9.5px; font-family: var(--font-mono); padding: 2px 7px; border-radius: 8px; letter-spacing: 0.06em; text-transform: uppercase; background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border); }
.opt-status { font-size: 9.5px; font-family: var(--font-mono); padding: 2px 7px; border-radius: 8px; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 500; }
.opt-status.proposed { background: var(--accent-bg); color: var(--accent); }
.opt-status.applied  { background: var(--warning-bg); color: var(--warning); }
.opt-status.verified { background: var(--positive-bg); color: var(--positive); }
.opt-status.invoiced { background: var(--moss-100); color: var(--moss-700); }
.opt-suggestion-pill { font-size: 9.5px; font-family: var(--font-mono); padding: 2px 7px; border-radius: 8px; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 500; background: var(--warning-bg); color: var(--warm-ochre); border: 1px solid var(--warning); }
[data-theme="dark"] .opt-suggestion-pill { background: rgba(213,160,63,0.18); color: var(--warm-ochre); border-color: var(--warm-ochre); }
[data-theme="dark"] .opt-status.invoiced { background: var(--moss-900); color: var(--moss-200); }
.opt-title { font-size: 14px; font-weight: 500; color: var(--text); line-height: 1.4; }
.opt-evidence { font-size: 12.5px; color: var(--text-muted); margin-top: 6px; line-height: 1.55; max-width: 640px; }
.opt-verify { font-size: 11.5px; color: var(--text-faint); margin-top: 8px; line-height: 1.5; font-style: italic; }
.opt-savings { text-align: right; display: flex; flex-direction: column; gap: 4px; }
.opt-savings .num { font-family: var(--font-mono); font-weight: 500; font-size: 24px; color: var(--positive); letter-spacing: -0.02em; line-height: 1.1; }
.opt-savings .sub { font-size: 10.5px; color: var(--text-faint); letter-spacing: 0.06em; text-transform: uppercase; font-family: var(--font-mono); }
.opt-savings .ours { font-size: 11.5px; color: var(--text-muted); margin-top: 6px; padding-top: 8px; border-top: 1px dashed var(--border); font-family: var(--font-mono); }
.opt-actions { display: flex; flex-direction: column; gap: 6px; }
.opt-actions .btn { justify-content: center; }
.opt-feed-empty { padding: 32px 16px; text-align: center; color: var(--text-faint); font-size: 13px; }

/* ───────── Semantic eval sandbox · Optimize page ───────── */
.eval-sandbox { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); margin: 4px 0 18px; overflow: hidden; }
.eval-sandbox-head { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: flex-start; padding: 18px 20px; border-bottom: 1px solid var(--border); background: linear-gradient(180deg, var(--surface) 0%, var(--surface-2) 100%); }
.eval-sandbox-eyebrow { font-size: 10.5px; font-family: var(--font-mono); color: var(--moss-700); letter-spacing: 0.06em; text-transform: uppercase; font-weight: 500; margin-bottom: 4px; }
[data-theme="dark"] .eval-sandbox-eyebrow { color: var(--moss-300); }
.eval-sandbox-title { font-size: 16px; font-weight: 500; color: var(--text); letter-spacing: -0.01em; line-height: 1.3; margin-bottom: 6px; }
.eval-sandbox-sub { font-size: 12.5px; color: var(--text-muted); line-height: 1.55; max-width: 680px; }
.eval-sandbox-actions { display: flex; gap: 6px; flex-shrink: 0; }
.eval-sandbox-body { padding: 16px 20px 18px; display: flex; flex-direction: column; gap: 14px; }
.eval-meta-row { display: flex; flex-wrap: wrap; gap: 6px; }
.eval-meta-pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 16px; font-size: 11.5px; }
.eval-meta-pill .eval-meta-label { color: var(--text-faint); font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.04em; text-transform: uppercase; }
.eval-meta-pill .eval-meta-val { color: var(--text); font-weight: 500; }
.eval-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 1100px) { .eval-grid { grid-template-columns: repeat(2, 1fr); } }
.eval-metric { background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.eval-metric-label { font-size: 10.5px; color: var(--text-faint); font-family: var(--font-mono); letter-spacing: 0.04em; text-transform: uppercase; font-weight: 500; }
.eval-metric-row { height: 6px; background: var(--surface); border-radius: 3px; overflow: hidden; }
.eval-metric-bar { display: block; height: 100%; border-radius: 3px; }
.eval-metric-foot { font-size: 11.5px; color: var(--text-muted); line-height: 1.4; }
.eval-metric-foot strong { color: var(--text); font-weight: 600; font-family: var(--font-mono); }
.eval-sandbox-foot { display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--text-muted); padding: 10px 12px; background: var(--moss-50); border: 1px solid var(--moss-200); border-radius: 6px; line-height: 1.5; }
[data-theme="dark"] .eval-sandbox-foot { background: var(--moss-900); border-color: var(--moss-700); color: var(--moss-200); }
@media (max-width: 900px) { .eval-sandbox-head { grid-template-columns: 1fr; } }

/* A/B test button — second option for proposed routing changes */
.opt-actions .btn.btn-abtest { background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); }
.opt-actions .btn.btn-abtest:hover { background: var(--surface-2); border-color: var(--text-muted); }
.ctrl-tabs { display: flex; gap: 2px; margin: 18px 0 14px; padding: 3px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; width: fit-content; }
.ctrl-tab { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; background: transparent; border: none; border-radius: 6px; font-size: 12.5px; font-weight: 500; color: var(--text-muted); cursor: pointer; transition: all 120ms; font-family: inherit; }
.ctrl-tab:hover { color: var(--text); background: var(--surface); }
.ctrl-tab.active { background: var(--surface); color: var(--moss-700); box-shadow: 0 1px 3px rgba(0,0,0,0.06); font-weight: 600; }
[data-theme="dark"] .ctrl-tab.active { color: var(--moss-300); }
.inspector-row { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; transition: background 100ms; }
.inspector-row:last-child { border-bottom: none; }
.inspector-row:hover { background: var(--surface-2); }
.inspector-prompt { display: inline-block; flex: 1; min-width: 200px; padding: 6px 10px; background: var(--surface-2); border-radius: 4px; font-family: var(--font-mono); font-size: 12px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.redact-pill { display: inline-block; padding: 1px 6px; background: var(--warning); color: white; border-radius: 3px; font-size: 10.5px; font-weight: 600; margin: 0 2px; }
[data-theme="dark"] .inspector-prompt { background: var(--ink-800); }

/* MoM coloring on the by-tool table */
.mom-up   { color: var(--negative); font-weight: 600; }
.mom-down { color: var(--moss-600); font-weight: 600; }
.mom-flat { color: var(--text-faint); }
.mom-new  { color: var(--moss-700); font-weight: 600; }

/* Multi-select floating panel */
.ms-panel { position: absolute; z-index: 100; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md, 6px); box-shadow: 0 8px 24px rgba(0,0,0,0.12), 0 2px 6px rgba(0,0,0,0.06); padding: 6px; min-width: 240px; max-width: 360px; max-height: min(640px, calc(100vh - 120px)); display: flex; flex-direction: column; }
.ms-panel-actions { display: flex; gap: 4px; padding: 4px 4px 6px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.ms-panel-actions button { flex: 1; padding: 5px 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px; cursor: pointer; font-size: 11.5px; color: var(--text-muted); transition: background 100ms; }
.ms-panel-actions button:hover { background: var(--moss-100); color: var(--moss-700); }
.ms-panel-list { overflow-y: auto; flex: 1; padding: 2px; }
.ms-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 4px; cursor: pointer; font-size: 12.5px; user-select: none; transition: background 100ms; }
.ms-item:hover { background: var(--surface-2); }
.ms-item input[type=checkbox] { margin: 0; cursor: pointer; accent-color: var(--moss-700); }
[data-theme="dark"] .ms-panel-actions button:hover { background: rgba(75, 100, 94, 0.18); color: var(--moss-300); }

/* Vendor concentration bars */
.vendor-bar-row { display: grid; grid-template-columns: 240px 1fr 200px; align-items: center; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.vendor-bar-row:last-child { border-bottom: none; }
.vendor-bar-name { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 13.5px; }
.vendor-swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.vendor-bar-track { height: 14px; background: var(--ink-200); border-radius: 7px; overflow: hidden; }
.vendor-bar-fill { display: block; height: 100%; border-radius: 7px; transition: width 300ms; }
.vendor-bar-value { display: flex; align-items: baseline; gap: 8px; font-size: 13px; }
[data-theme="dark"] .vendor-bar-track { background: var(--ink-700); }
.card-header h3 { font-size: 13px; font-weight: 700; letter-spacing: 0.01em; }
.card-header .meta { font-size: 11.5px; color: var(--text-faint); font-family: var(--font-mono); }
.card-body { padding: 12px; }
.card-body.flush { padding: 0; }

/* ───────────────────────── KPI HERO ───────────────────────── */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; border: 2px solid var(--border); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.kpi-grid.kpi-grid-5 { grid-template-columns: repeat(5, 1fr); }
.kpi-grid.kpi-grid-3 { grid-template-columns: repeat(3, 1fr); }
.kpi-grid.kpi-grid-6 { grid-template-columns: repeat(6, 1fr); }
.kpi-grid.kpi-grid-4 { grid-template-columns: repeat(4, 1fr); margin-bottom: 10px; }
.kpi-section-label { display: flex; align-items: baseline; gap: 12px; margin: 22px 0 10px 0; padding-bottom: 6px; }
.kpi-section-label .kpi-section-title { font-size: 13px; font-weight: 600; color: var(--text); text-transform: uppercase; letter-spacing: 0.06em; }
.kpi-section-label .kpi-section-sub { font-size: 12.5px; color: var(--text-muted); font-style: italic; }
.kpi-section-label .kpi-section-pill { font-size: 10.5px; padding: 2px 7px; background: var(--moss-100); color: var(--moss-700); border-radius: 10px; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; margin-left: auto; }
[data-theme="dark"] .kpi-section-label .kpi-section-pill { background: rgba(75, 100, 94, 0.25); color: var(--moss-300); }
.kpi { padding: 12px 16px 14px; border-right: 1px solid var(--border); position: relative; }
.kpi:last-child { border-right: none; }
.kpi .eyebrow { display: block; margin-bottom: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: 0.07em; }
.kpi .value { font-family: var(--font-mono); font-size: 30px; font-weight: 500; letter-spacing: -0.025em; color: var(--text); line-height: 1.1; }
.kpi.primary .value { font-size: 36px; }
.kpi .change { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 8px; font-size: 12px; min-width: 0; }
.kpi .change .mono { white-space: nowrap; }
.kpi .change.up { color: var(--negative); }
.kpi .change.down { color: var(--positive); }
.kpi .change.neutral { color: var(--text-muted); }
.kpi .change.up.good { color: var(--positive); }
.kpi .change .delta { font-family: var(--font-mono); font-weight: 500; }
.kpi { position: relative; }
.kpi .sub-meta { display: none; }
.kpi-tip {
  position: absolute;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.5;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12), 0 2px 6px rgba(0,0,0,0.05);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease-out, transform 140ms ease-out;
  transform: translateY(-4px);
  max-width: 360px;
}
.kpi-tip.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.kpi-tip::before {
  content: '';
  position: absolute;
  top: -5px;
  right: 16px;
  width: 8px;
  height: 8px;
  background: var(--surface);
  border-left: 1px solid var(--border);
  border-top: 1px solid var(--border);
  transform: rotate(45deg);
}
.kpi-info-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 18px;
  height: 18px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--text-faint);
  opacity: 0.45;
  transition: opacity 100ms ease-out, color 100ms, background 100ms, box-shadow 100ms;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}
.kpi:hover .kpi-info-btn { opacity: 0.7; }
.kpi-info-btn:hover, .kpi.show-info .kpi-info-btn { opacity: 1; color: var(--moss-700); background: var(--moss-100); box-shadow: 0 0 0 4px rgba(67, 95, 54, 0.14); }
[data-theme="dark"] .kpi-info-btn:hover, [data-theme="dark"] .kpi.show-info .kpi-info-btn { background: rgba(75,100,94,0.18); color: var(--moss-300); box-shadow: 0 0 0 4px rgba(180, 206, 167, 0.10); }
.kpi-tip.show:hover { box-shadow: 0 8px 24px rgba(0,0,0,0.12), 0 2px 6px rgba(0,0,0,0.05), 0 0 0 3px rgba(67, 95, 54, 0.18); border-color: var(--moss-400); }
[data-theme="dark"] .kpi-tip.show:hover { box-shadow: 0 8px 24px rgba(0,0,0,0.4), 0 0 0 3px rgba(180, 206, 167, 0.16); border-color: var(--moss-500); }
.kpi .sparkline { position: absolute; right: 16px; bottom: 16px; opacity: 0.7; }

/* ───────────────────────── DASHBOARD GRID ───────────────────────── */
.dash-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 18px; margin-top: 18px; }
.dash-grid-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 18px; margin-top: 18px; }
.dash-grid-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; }

/* ───────────────────────── TREND CHART ───────────────────────── */
.trend-container { padding: 14px 18px 0; }
.trend-container svg { display: block; width: 100%; height: 240px; }
.trend-legend { display: flex; gap: 14px; padding: 6px calc(8px + 5.71%) 8px calc(8px + 5.71%); border-top: 1px solid var(--border); margin-top: 4px; flex-wrap: wrap; }
.legend-item { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-muted); position: relative; }
.legend-others { cursor: help; padding: 2px 8px; border-radius: 12px; transition: background 100ms; }
.legend-others:hover, .legend-others:focus { background: var(--surface-2); outline: none; }
.legend-others .others-count { color: var(--text-faint); font-family: var(--font-mono); font-size: 10.5px; margin-left: 2px; }
.legend-others .others-popover {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 0;
  min-width: 240px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12), 0 2px 6px rgba(0,0,0,0.05);
  opacity: 0;
  pointer-events: none;
  transition: opacity 140ms ease-out, transform 140ms ease-out;
  z-index: 100;
}
.legend-others:hover .others-popover, .legend-others:focus .others-popover {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.legend-others .others-popover::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 8px;
  height: 8px;
  background: var(--surface);
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.legend-others .others-popover-title { display: block; padding: 0 14px 8px; font-size: 11px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.04em; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.legend-others .others-row { display: flex; align-items: center; gap: 8px; padding: 4px 14px; font-size: 12px; color: var(--text); }
.legend-others .others-swatch { width: 10px; height: 10px; border-radius: 2px; flex-shrink: 0; }
.legend-others .others-name { flex: 1; }
.legend-others .others-val { color: var(--text-muted); font-size: 11px; }
.legend-swatch { width: 10px; height: 2px; border-radius: 1px; }
.trend-axis-label { font-size: 10px; fill: var(--text-faint); font-family: var(--font-mono); }
.trend-grid-line { stroke: var(--border); stroke-width: 1; stroke-dasharray: 2 4; }
.trend-line { stroke: var(--accent); stroke-width: 1.75; fill: none; }
.trend-area { fill: var(--accent); opacity: 0.07; }
.trend-line-2 { stroke: var(--moss-600); stroke-width: 1.5; fill: none; stroke-dasharray: 3 3; }
[data-theme="dark"] .trend-line-2 { stroke: var(--moss-400); }
.trend-point { fill: var(--surface); stroke: var(--accent); stroke-width: 1.75; }

/* ───────────────────────── ACTIVITY FEED ───────────────────────── */
.feed { display: flex; flex-direction: column; }
.feed-item { display: grid; grid-template-columns: 28px 1fr auto; gap: 12px; align-items: flex-start; padding: 12px 18px; border-bottom: 1px solid var(--border); }
.feed-item:last-child { border-bottom: none; }
.feed-icon { width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; flex-shrink: 0; margin-top: 2px; }
.feed-icon.warn { background: var(--warning-bg); color: var(--warning); }
.feed-icon.opportunity { background: var(--positive-bg); color: var(--positive); }
.feed-icon.event { background: var(--accent-bg); color: var(--accent); }
.feed-icon.info { background: var(--surface-2); color: var(--text-muted); }
.feed-icon svg { width: 13px; height: 13px; }
.feed-body { min-width: 0; }
.feed-title { font-size: 13px; color: var(--text); line-height: 1.45; }
.feed-title strong { font-weight: 500; }
.feed-title .tag { font-family: var(--font-mono); font-size: 11px; padding: 0px 5px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 3px; color: var(--text-muted); margin-left: 4px; }
.feed-meta { font-size: 11.5px; color: var(--text-faint); margin-top: 3px; display: flex; align-items: center; gap: 8px; }
.feed-meta .dot { width: 2px; height: 2px; border-radius: 50%; background: var(--text-faint); }
.feed-time { font-family: var(--font-mono); font-size: 11px; color: var(--text-faint); white-space: nowrap; }

/* ───────────────────────── TABLES ───────────────────────── */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { text-align: left; font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 500; color: var(--text-faint); padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--bg-sunken); white-space: nowrap; }
.data-table th.num { text-align: right; }
.data-table td { padding: 11px 14px; border-bottom: 1px solid var(--border); font-size: 13px; vertical-align: middle; }
.data-table th:not(:last-child),
.data-table td:not(:last-child) { border-right: 1px solid var(--border); }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg-sunken); }
.data-table td.num { text-align: right; font-family: var(--font-mono); letter-spacing: -0.01em; }
.data-table td.muted { color: var(--text-muted); }
.data-table .col-name { font-weight: 500; }
.data-table .col-name .pre { font-family: var(--font-mono); color: var(--text); }
.data-table .col-name .desc { font-size: 11.5px; color: var(--text-faint); margin-top: 2px; }

/* Team × tool nested table */
.team-tool-table { border-collapse: collapse; table-layout: fixed; width: 100%; }

/* Team adoption table */
.team-adoption-table { border-collapse: collapse; table-layout: fixed; width: 100%; }
.team-adoption-table tbody tr { cursor: pointer; transition: background 100ms; }
.team-adoption-table tbody tr:hover { background: var(--surface-2); }
.team-adoption-table td { padding: 14px 12px; vertical-align: middle; }
.team-adoption-table .team-cell { font-weight: 600; }
.team-adoption-table .team-sub { font-size: 11px; color: var(--text-faint); font-weight: 400; margin-top: 2px; }
.adoption-bar { display: flex; align-items: center; gap: 10px; }
.adoption-bar .bar { display: block; flex: 1; height: 10px; background: var(--ink-200); border-radius: 5px; overflow: hidden; min-width: 80px; position: relative; }
.adoption-bar .bar.positive { background: #CFE0C6; }
.adoption-bar .bar.good     { background: #DDE9D5; }
.adoption-bar .bar.warning  { background: #F0DBA6; }
.adoption-bar .bar.negative { background: #EBC2B7; }
.adoption-bar .fill { display: block; height: 100%; border-radius: 5px; transition: width 300ms; opacity: 1; }
.adoption-bar .fill.positive { background: var(--moss-700); }
.adoption-bar .fill.good     { background: var(--moss-500); }
.adoption-bar .fill.warning  { background: var(--warning); }
.adoption-bar .fill.negative { background: var(--negative); }
[data-theme="dark"] .adoption-bar .bar.positive { background: #2F3F28; }
[data-theme="dark"] .adoption-bar .bar.good     { background: #2F3F28; }
[data-theme="dark"] .adoption-bar .bar.warning  { background: #4A3D1F; }
[data-theme="dark"] .adoption-bar .bar.negative { background: #4A2C24; }
[data-theme="dark"] .adoption-bar .fill.positive { background: var(--moss-300); }
[data-theme="dark"] .adoption-bar .fill.good     { background: var(--moss-400); }
.adoption-bar .pct { font-family: var(--font-mono); font-size: 12.5px; font-weight: 600; width: 52px; text-align: right; opacity: 1; }
.adoption-bar .pct.positive { color: var(--moss-700); }
.adoption-bar .pct.good     { color: var(--moss-600); }
.adoption-bar .pct.warning  { color: var(--warning); }
.adoption-bar .pct.negative { color: var(--negative); }
[data-theme="dark"] .adoption-bar .pct.positive { color: var(--moss-300); }
[data-theme="dark"] .adoption-bar .pct.good     { color: var(--moss-400); }
.tools-chip-row { display: flex; flex-wrap: wrap; gap: 4px; font-size: 11px; color: var(--text-muted); }
.tools-chip-row .tool-chip { padding: 1px 7px; background: var(--surface-2); border-radius: 3px; white-space: nowrap; }

/* Tool adoption heat-map */
.heatmap-wrap { overflow-x: auto; }
.heatmap-grid { display: grid; gap: 3px; font-size: 11.5px; }
.heatmap-grid .hm-corner { background: transparent; }
.heatmap-grid .hm-col-label { padding: 8px 4px 10px; text-align: center; font-size: 10px; color: var(--text-muted); font-weight: 500; border-bottom: 1px solid var(--border); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.heatmap-grid .hm-col-label.shadow { color: var(--negative); }
.heatmap-grid .hm-row-label { padding: 10px 10px 10px 4px; font-size: 12px; font-weight: 500; color: var(--text); text-align: right; border-right: 1px solid var(--border); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.heatmap-grid .hm-cell { padding: 10px 4px; border-radius: 4px; text-align: center; font-family: var(--font-mono); font-size: 11px; font-weight: 500; cursor: pointer; transition: transform 100ms; min-width: 0; }width: 56px; min-height: 32px; display: flex; align-items: center; justify-content: center; }
.heatmap-grid .hm-cell:hover { transform: scale(1.08); }
.heatmap-grid .hm-cell.zero { color: var(--text-faint); background: var(--surface-2); }
.heatmap-grid .hm-cell.na { color: var(--text-faint); opacity: 0.5; cursor: default; background: repeating-linear-gradient(45deg, transparent, transparent 4px, var(--border) 4px, var(--border) 5px); }
.heatmap-grid .hm-cell.na:hover { transform: none; }
.heatmap-grid .hm-cell.has-value { color: var(--ink-900); }
.heatmap-grid .hm-cell.value-mid { color: var(--ink-900); }
.heatmap-grid .hm-cell.value-high { color: var(--ink-900); }
.heatmap-legend { margin-top: 16px; display: flex; align-items: center; gap: 12px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 11.5px; color: var(--text-muted); }
.heatmap-legend .legend-scale { display: flex; gap: 2px; }
.heatmap-legend .legend-cell { width: 24px; height: 12px; border-radius: 2px; }
.heatmap-legend .legend-label { font-family: var(--font-mono); font-size: 11px; }

/* Team chip filter row */
.team-chip-row { display: flex; gap: 6px; flex-wrap: wrap; }
.team-chip { padding: 5px 12px; border: 1px solid var(--border); background: var(--surface); border-radius: 14px; font-size: 12px; cursor: pointer; color: var(--text-muted); transition: all 120ms; font-family: var(--font-sans); }
.team-chip:hover { border-color: var(--text-muted); color: var(--text); }
.team-chip.active { background: var(--ink-900); color: white; border-color: var(--ink-900); }

/* Adoption view toggle */
.adoption-view-row { display: flex; align-items: center; gap: 12px; padding: 14px 0 18px; }
.adoption-view-row .segmented { margin-left: 4px; }
.adoption-view-row .meta { font-size: 12px; color: var(--text-muted); }
.adoption-view-row .meta.dim { color: var(--text-faint); margin-left: 8px; }

/* View show/hide based on data-view attribute */
.adoption-view { display: none; }
#page-adoption[data-view="team"] .adoption-view.show-in-team,
#page-adoption[data-view="tool"] .adoption-view.show-in-tool,
#page-adoption[data-view="user"] .adoption-view.show-in-user { display: block; }

/* Tool adoption table */
.tool-adoption-table { border-collapse: collapse; table-layout: fixed; width: 100%; }
.tool-adoption-table tbody tr { transition: background 100ms; }
.tool-adoption-table tbody tr:hover { background: var(--surface-2); }
.tool-adoption-table td { padding: 14px 12px; vertical-align: middle; }
.tool-adoption-table .tool-cell { font-weight: 600; }
.tool-adoption-table .tool-cell .tc-flex { display: flex; align-items: center; gap: 10px; }
.tool-adoption-table .tool-cell .tc-flex > div { min-width: 0; }
.tool-adoption-table .tool-cell .tc-logo { width: 22px; height: 22px; border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.tool-adoption-table .tool-cell .tc-logo svg { width: 14px; height: 14px; }
.tool-adoption-table .tool-name-text { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tool-adoption-table .tool-sub { font-size: 11px; color: var(--text-faint); font-weight: 400; margin-top: 3px; line-height: 1.35; }
.tool-adoption-table .tools-chip-row { white-space: normal; }
.tool-adoption-table .tools-chip-row .tool-chip { white-space: nowrap; }
.tool-adoption-table td.shadow-cell { color: var(--text-faint); }
.tool-adoption-table .notes-cell { font-size: 12.5px; color: var(--text-muted); line-height: 1.4; }

/* Sparkline cell */
.tool-trend-cell { padding: 8px 10px !important; }
.tool-trend-wrap { display: flex; flex-direction: column; gap: 3px; }
.tool-trend-wrap .trend-svg { display: block; height: 30px; width: 100%; }
.tool-trend-wrap .trend-meta { font-size: 10.5px; color: var(--text-faint); display: flex; justify-content: space-between; font-family: var(--font-mono); }
.tool-trend-wrap .trend-delta-up { color: var(--moss-600); font-weight: 600; }
.tool-trend-wrap .trend-delta-down { color: var(--negative); font-weight: 600; }
.tool-trend-wrap .trend-delta-flat { color: var(--text-faint); }

/* Active filter bar */
.active-filter-bar { display: flex; align-items: center; gap: 10px; padding: 12px 16px; margin: 10px 0 14px; background: var(--accent-bg, var(--moss-50)); border: 1px solid var(--moss-200); border-radius: var(--r-md, 8px); }
.active-filter-label { font-size: 12px; color: var(--text-muted); }
.active-filter-chip { display: inline-flex; align-items: center; gap: 8px; padding: 4px 4px 4px 12px; background: var(--moss-700); color: white; border-radius: 14px; font-size: 12.5px; font-weight: 500; }
.active-filter-chip .filter-chip-prefix { font-size: 10.5px; font-family: var(--font-mono); opacity: 0.7; text-transform: uppercase; letter-spacing: 0.04em; margin-right: -2px; }
.active-filter-x { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: rgba(255,255,255,0.18); border: none; color: white; cursor: pointer; padding: 0; transition: background 100ms; }
.active-filter-x:hover { background: rgba(255,255,255,0.32); }
.active-filter-count { font-size: 12px; color: var(--text-muted); margin-left: auto; font-family: var(--font-mono); }
[data-theme="dark"] .active-filter-bar { background: rgba(75, 100, 94, 0.18); border-color: var(--moss-700); }
[data-theme="dark"] .active-filter-chip { background: var(--moss-500); color: var(--ink-950); }

/* Section tabs · each cluster shows separately */
.vis-tabs { display: flex; gap: 2px; margin: 8px 0 10px; padding: 3px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; width: fit-content; }
.vis-tab { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; background: transparent; border: none; border-radius: 6px; font-size: 12.5px; font-weight: 500; color: var(--text-muted); cursor: pointer; transition: all 120ms; font-family: inherit; }
.vis-tab:hover { color: var(--text); background: var(--surface); }
.vis-tab.active { background: var(--surface); color: var(--moss-700); box-shadow: 0 1px 3px rgba(0,0,0,0.06); }
[data-theme="dark"] .vis-tab.active { color: var(--moss-300); }
.vis-tab svg { opacity: 0.85; }
.vis-cluster[hidden] { display: none; }

/* Filter chip row — multiple chips */
.filter-chip-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.filter-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 3px 3px 10px; background: var(--moss-100); color: var(--moss-800); border: 1px solid var(--moss-200); border-radius: 14px; font-size: 11.5px; font-weight: 500; }
.filter-chip .chip-kind { font-size: 9.5px; font-family: var(--font-mono); opacity: 0.6; text-transform: uppercase; letter-spacing: 0.04em; margin-right: 4px; }
.filter-chip .chip-x { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50%; background: transparent; border: none; color: var(--moss-700); cursor: pointer; padding: 0; transition: background 100ms; }
.filter-chip .chip-x:hover { background: var(--moss-300); }
[data-theme="dark"] .filter-chip { background: rgba(75, 100, 94, 0.22); color: var(--moss-300); border-color: var(--moss-700); }
[data-theme="dark"] .filter-chip .chip-x { color: var(--moss-300); }
[data-theme="dark"] .filter-chip .chip-x:hover { background: rgba(180, 206, 167, 0.16); }

.filter-clear-all { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; background: transparent; border: 1px solid var(--border); border-radius: 12px; font-size: 11px; color: var(--text-muted); cursor: pointer; transition: all 100ms; }
.filter-clear-all:hover { background: var(--surface-2); color: var(--negative); border-color: var(--negative); }

/* Okta suggestion dropdown — shows matches as you type */
.okta-suggest { position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; max-height: 240px; overflow-y: auto; box-shadow: 0 8px 24px rgba(0,0,0,0.10); z-index: 60; }
.okta-suggest-item { display: flex; align-items: center; gap: 8px; padding: 8px 12px; cursor: pointer; font-size: 12.5px; color: var(--text); transition: background 80ms; border-bottom: 1px solid var(--border); }
.okta-suggest-item:last-child { border-bottom: none; }
.okta-suggest-item:hover, .okta-suggest-item.active { background: var(--moss-100); }
[data-theme="dark"] .okta-suggest-item:hover, [data-theme="dark"] .okta-suggest-item.active { background: rgba(75, 100, 94, 0.18); }
.okta-suggest-kind { font-size: 9.5px; font-family: var(--font-mono); color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.04em; padding: 2px 6px; background: var(--surface-2); border-radius: 8px; flex-shrink: 0; }
.okta-suggest-name { flex: 1; }
.okta-suggest-meta { font-size: 11px; color: var(--text-faint); }
.okta-suggest-empty { padding: 14px; text-align: center; color: var(--text-faint); font-size: 12px; }

/* User search input */
.user-search-wrap { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); width: 100%; max-width: 480px; }
.user-search-wrap:focus-within { border-color: var(--accent); }
.user-search-wrap .ic-sm { color: var(--text-faint); width: 14px; height: 14px; flex-shrink: 0; }
.user-search-input { border: none; outline: none; background: transparent; font-size: 12.5px; font-family: var(--font-sans); color: var(--text); width: 100%; }
.user-search-input::placeholder { color: var(--text-faint); }
.team-tool-table th, .team-tool-table td { border-right: 1px solid var(--border); }
.team-tool-table th:last-child, .team-tool-table td:last-child { border-right: none; }
.team-tool-table tbody tr.tool-row td { padding-top: 9px; padding-bottom: 9px; vertical-align: middle; }
.team-tool-table tbody tr.tool-row td.tool-cell { padding-left: 14px; font-family: var(--font-mono); font-size: 12.5px; color: var(--text); }
.team-tool-table tbody tr.tool-row td.tool-cell.tool-cell-clickable { cursor: pointer; position: relative; transition: background 100ms, color 100ms; }
.team-tool-table tbody tr.tool-row td.tool-cell.tool-cell-clickable:hover { background: var(--moss-100); color: var(--moss-700); }
.team-tool-table tbody tr.tool-row td.tool-cell .drill-arrow-sm { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--text-faint); font-size: 12px; font-family: var(--font-mono); opacity: 0; transition: opacity 120ms, transform 120ms; }
.team-tool-table tbody tr.tool-row td.tool-cell.tool-cell-clickable:hover .drill-arrow-sm { opacity: 1; color: var(--moss-700); transform: translateY(-50%) translateX(2px); }
[data-theme="dark"] .team-tool-table tbody tr.tool-row td.tool-cell.tool-cell-clickable:hover { background: rgba(75, 100, 94, 0.18); color: var(--moss-300); }
.team-tool-table tbody tr.tool-row.shadow td.tool-cell { color: var(--negative); }
.team-tool-table tbody tr.tool-row.shadow td.tool-cell::after { content: " · shadow"; color: var(--negative); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; margin-left: 6px; opacity: 0.85; }
.team-tool-table tbody td.col-name { font-weight: 600; vertical-align: middle; user-select: none; background: var(--bg-sunken); position: relative; transition: background 100ms; }
.team-tool-table tbody td.col-name.col-name-clickable { cursor: pointer; }
.team-tool-table tbody td.col-name.col-name-clickable:hover { background: var(--moss-100); color: var(--moss-700); }
.team-tool-table tbody td.col-name .team-summary { font-size: 11.5px; font-weight: 400; color: var(--text-faint); font-family: var(--font-mono); margin-top: 4px; display: block; }
.team-tool-table tbody td.col-name .drill-arrow { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--text-faint); font-size: 13px; font-family: var(--font-mono); opacity: 0; transition: opacity 120ms, transform 120ms; }
.team-tool-table tbody td.col-name.col-name-clickable:hover .drill-arrow { opacity: 1; color: var(--moss-700); transform: translateY(-50%) translateX(2px); }
.team-tool-table tbody td.col-people { vertical-align: middle; font-family: var(--font-mono); color: var(--text-muted); background: var(--bg-sunken); }
.team-tool-table tbody tr.team-first td { border-top: 2px solid var(--border-strong); }
[data-theme="dark"] .team-tool-table tbody td.col-name.col-name-clickable:hover { background: rgba(75, 100, 94, 0.18); color: var(--moss-300); }
.team-tool-table tbody tr.tool-row .usage-bar { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 12px; justify-content: flex-end; }
.team-tool-table tbody tr.tool-row .usage-bar .bar { display: inline-block; width: 80px; height: 8px; border-radius: 4px; overflow: hidden; }
.team-tool-table tbody tr.tool-row .usage-bar .bar.high { background: #CFE0C6; }
.team-tool-table tbody tr.tool-row .usage-bar .bar.mid  { background: #F0DBA6; }
.team-tool-table tbody tr.tool-row .usage-bar .bar.low  { background: #EBC2B7; }
[data-theme="dark"] .team-tool-table tbody tr.tool-row .usage-bar .bar.high { background: #2F3F28; }
[data-theme="dark"] .team-tool-table tbody tr.tool-row .usage-bar .bar.mid  { background: #4A3D1F; }
[data-theme="dark"] .team-tool-table tbody tr.tool-row .usage-bar .bar.low  { background: #4A2C24; }
.team-tool-table tbody tr.tool-row .usage-bar .bar .fill { display: block; height: 100%; border-radius: 4px; opacity: 1; }
.team-tool-table tbody tr.tool-row .usage-bar .fill.high { background: var(--moss-700); }
.team-tool-table tbody tr.tool-row .usage-bar .fill.mid  { background: var(--warning); }
.team-tool-table tbody tr.tool-row .usage-bar .fill.low  { background: var(--negative); }
[data-theme="dark"] .team-tool-table tbody tr.tool-row .usage-bar .fill.high { background: var(--moss-400); }
.team-tool-table tbody tr.tool-row .usage-bar .pct.high { color: var(--moss-700); font-weight: 600; opacity: 1; }
.team-tool-table tbody tr.tool-row .usage-bar .pct.mid  { color: var(--warning); font-weight: 600; opacity: 1; }
.team-tool-table tbody tr.tool-row .usage-bar .pct.low  { color: var(--negative); font-weight: 600; opacity: 1; }
[data-theme="dark"] .team-tool-table tbody tr.tool-row .usage-bar .pct.high { color: var(--moss-300); }
.team-tool-table tbody tr.tool-row.shadow .usage-bar { color: var(--negative); font-style: italic; }

/* Activity modal */
.gk-modal-overlay { display: none; position: fixed; inset: 0; background: rgba(11,11,11,0.42); z-index: 1000; align-items: center; justify-content: center; }
.gk-modal-overlay.open { display: flex; }
.gk-modal { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); width: 680px; max-width: 92vw; max-height: 80vh; display: flex; flex-direction: column; overflow: hidden; }

/* Drawer variant — opens as a right-side panel */
.gk-modal-overlay#activityModal { display: flex; align-items: stretch; justify-content: flex-end; background: rgba(11,11,11,0.28); opacity: 0; pointer-events: none; transition: opacity 200ms ease-out; }
.gk-modal-overlay#activityModal.open { opacity: 1; pointer-events: auto; }
.gk-modal-overlay#activityModal .gk-modal { width: 460px; max-width: 92vw; height: 100vh; max-height: 100vh; border-radius: 0; border-top: 0; border-right: 0; border-bottom: 0; border-left: 1px solid var(--border); transform: translateX(20px); transition: transform 260ms cubic-bezier(0.2, 0.7, 0.2, 1); box-shadow: -12px 0 32px rgba(0,0,0,0.08); }
.gk-modal-overlay#activityModal.open .gk-modal { transform: translateX(0); }
.gk-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 22px; border-bottom: 1px solid var(--border); }
.gk-modal-header h3 { font-size: 15px; font-weight: 500; letter-spacing: -0.005em; }
.gk-modal-header .meta { font-size: 11.5px; color: var(--text-faint); font-family: var(--font-mono); }
.gk-modal-body { padding: 8px 22px 18px; overflow-y: auto; flex: 1; }
.gk-modal-body .feed { padding: 6px 0; }
.gk-modal-footer { padding: 12px 22px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; font-size: 11.5px; color: var(--text-muted); }

/* Trend chart axes */
.trend-axis-tick { font-family: var(--font-mono); font-size: 10px; fill: var(--text-faint); }
.trend-axis-line { stroke: var(--border-strong); stroke-width: 1; }
.vis-trend-area { transition: opacity 200ms; }
.vis-trend-area:hover { opacity: 1; }

/* Range picker active feedback */
.range-segmented button[aria-pressed="true"] { color: var(--accent); }
@keyframes kpiFlash { 0% { background: var(--accent-bg); } 100% { background: transparent; } }
[data-metric].flash { animation: kpiFlash 600ms ease-out; }

/* ───────── Headline-to-evidence: jump links, flash, provenance ───────── */
.kpi[data-jump] { cursor: pointer; }
.kpi[data-jump]::after { content: ''; position: absolute; right: 12px; bottom: 11px; width: 11px; height: 11px;
  background: var(--text-faint); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='15 10 20 15 15 20'/%3E%3Cpath d='M4 4v7a4 4 0 0 0 4 4h12'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='15 10 20 15 15 20'/%3E%3Cpath d='M4 4v7a4 4 0 0 0 4 4h12'/%3E%3C/svg%3E") center/contain no-repeat;
  opacity: 0; transition: opacity 120ms; }
.kpi[data-jump]:hover::after, .kpi[data-jump]:focus-visible::after { opacity: 0.5; }
.kpi[data-jump]:hover { background: var(--surface-2); }
.kpi[data-jump]:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
[data-jump-token] { cursor: pointer; border-bottom: 1px dashed transparent; transition: border-color 120ms; }
[data-jump-token]:hover { border-bottom-color: currentColor; }
@keyframes evidenceFlash { 0% { box-shadow: 0 0 0 2px var(--accent) inset, 0 0 0 6px var(--accent-bg); background: var(--accent-bg); } 100% { box-shadow: 0 0 0 0 transparent; background: var(--surface); } }
.evidence-flash { animation: evidenceFlash 1100ms ease-out; }
@media (prefers-reduced-motion: reduce) { .evidence-flash { animation: none; } }
.evidence-eyebrow { display: block; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.06em; color: var(--text-faint); margin-bottom: 3px; text-transform: none; }
.evidence-eyebrow .ee-arrow { color: var(--accent); }
.evidence-eyebrow strong { color: var(--text-muted); font-weight: 500; }
.section-divider { position: relative; }
.prov-tag { font-family: var(--font-mono); font-size: 9.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; padding: 2px 8px; border-radius: 10px; white-space: nowrap; }
.prov-measured  { background: var(--moss-100);  color: var(--moss-700); }
.prov-modeled   { background: var(--warning-bg); color: var(--warm-ochre); }
.prov-benchmark { background: #E8EDF3;          color: #4E6488; }
[data-theme="dark"] .prov-measured { background: rgba(110,140,85,0.20); color: var(--moss-300); }
[data-theme="dark"] .prov-benchmark { background: #243140; color: #9DB4D0; }
.section-tags { display: inline-flex; gap: 5px; align-items: center; margin-left: auto; }
.plot-foot { font-size: 11px; color: var(--text-faint); line-height: 1.5; font-style: italic; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }
.summary-back-fab { position: fixed; bottom: 22px; right: 22px; z-index: 1400; display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 16px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-family: inherit; font-size: 12.5px; font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,0.16); cursor: pointer; opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity 180ms, transform 180ms, background 120ms; }
.summary-back-fab.show { opacity: 1; transform: none; pointer-events: auto; }
.summary-back-fab:hover { background: var(--surface-2); }
.summary-back-fab .ico { width: 14px; height: 14px; }
/* Distribution histogram primitive */
.dist-plot { width: 100%; }
.dist-plot svg { width: 100%; height: auto; display: block; }
.dist-bar { transition: opacity 120ms; }
.dist-plot:hover .dist-bar:not(:hover) { opacity: 0.62; }
.dist-axis-line { stroke: var(--border); stroke-width: 1; }
.dist-mean-line { stroke: var(--ink-900); stroke-width: 1.5; stroke-dasharray: 4,3; }
[data-theme="dark"] .dist-mean-line { stroke: var(--ink-300); }
.dist-bench-line { stroke: var(--slate-blue); stroke-width: 1.5; stroke-dasharray: 2,3; }
.dist-tick { font-family: var(--font-mono); font-size: 10px; fill: var(--text-faint); }
.dist-lbl { font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; }
.dist-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 12px; font-size: 11.5px; color: var(--text-muted); }
.dist-legend .dk { display: inline-flex; align-items: center; gap: 6px; }
.dist-legend .dk i { width: 16px; height: 9px; border-radius: 2px; display: inline-block; }
.dist-legend .dk .ln { width: 16px; height: 0; border-top-width: 2px; border-top-style: dashed; }

.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 500; font-family: var(--font-mono); letter-spacing: 0; }
.pill .pdot { width: 5px; height: 5px; border-radius: 50%; }
.pill-positive { background: var(--positive-bg); color: var(--positive); }
.pill-positive .pdot { background: var(--positive); }
.pill-negative { background: var(--negative-bg); color: var(--negative); }
.pill-negative .pdot { background: var(--negative); }
.pill-warning { background: var(--warning-bg); color: var(--warning); }
.pill-warning .pdot { background: var(--warning); }
.pill-neutral { background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border); }
.pill-neutral .pdot { background: var(--text-faint); }
.pill-accent { background: var(--accent-bg); color: var(--accent); }
.pill-accent .pdot { background: var(--accent); }

.delta-cell { display: inline-flex; align-items: center; gap: 3px; font-family: var(--font-mono); font-size: 12px; }
.delta-up { color: var(--negative); }
.delta-down { color: var(--positive); }
.delta-up.good { color: var(--positive); }
.delta-down.bad { color: var(--negative); }

/* sparkbar */
.bar-stack { display: inline-block; vertical-align: middle; height: 4px; background: var(--ink-200); border-radius: 2px; width: 80px; position: relative; overflow: hidden; }
[data-theme="dark"] .bar-stack { background: var(--border); }
.bar-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); border-radius: 2px; }
.bar-fill.moss { background: var(--moss-600); }
[data-theme="dark"] .bar-fill.moss { background: var(--moss-400); }

/* ───────────────────────── TOOL ROSTER (visibility hero) ───────────────────────── */
.tool-roster { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.tool-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 14px; display: flex; flex-direction: column; gap: 9px; position: relative; transition: border-color 100ms; }
.tool-card:hover { border-color: var(--border-strong); }
.tool-card.shadow { border-style: dashed; border-color: var(--warning); background: var(--warning-bg); }
[data-theme="dark"] .tool-card.shadow { background: var(--warning-bg); }
.tool-card .tc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.tool-card .tc-logo { width: 28px; height: 28px; border-radius: 6px; display: grid; place-items: center; font-family: var(--font-mono); font-size: 12px; font-weight: 600; color: white; flex-shrink: 0; }
.tool-card .tc-logo svg { width: 16px; height: 16px; display: block; }
.tool-card .tc-logo img { width: 16px; height: 16px; display: block; }
.tool-card .tc-logo-letter { color: white; font-family: var(--font-mono); font-size: 12px; font-weight: 600; line-height: 1; }
.tool-card .tc-name { font-size: 13px; font-weight: 500; line-height: 1.3; }
.tool-card .tc-cat { font-size: 10.5px; color: var(--text-faint); margin-top: 1px; letter-spacing: 0.04em; text-transform: uppercase; font-family: var(--font-mono); }
.tool-card .tc-num { display: flex; align-items: baseline; gap: 6px; font-family: var(--font-mono); }
.tool-card .tc-num .big { font-size: 18px; font-weight: 500; color: var(--text); letter-spacing: -0.02em; }
.tool-card .tc-num .small { font-size: 11px; color: var(--text-faint); }
.tool-card .tc-meta { font-size: 11px; color: var(--text-muted); display: flex; justify-content: space-between; align-items: center; padding-top: 8px; border-top: 1px solid var(--border); }
.tool-card .tc-meta .delta { font-family: var(--font-mono); }
.tool-card .tc-meta .delta.up { color: var(--negative); }
.tool-card .tc-meta .delta.down { color: var(--positive); }
.tool-card .tc-meta .tc-pct-active { font-family: var(--font-mono); font-weight: 600; opacity: 1; }
.tool-card .tc-meta .tc-pct-active.high { color: var(--positive); }
.tool-card .tc-meta .tc-pct-active.mid  { color: var(--warning); }
.tool-card .tc-meta .tc-pct-active.low  { color: var(--negative); }
.tool-card.shadow .tc-meta .tc-pct-active { color: var(--negative); }
.tool-card.shadow .tc-meta { border-top-color: rgba(138, 107, 42, 0.2); }

/* ───────────────────────── TREEMAP ───────────────────────── */
.treemap-cell { position: absolute; padding: 10px; color: white; overflow: hidden; transition: opacity 100ms ease; border: 1px solid rgba(255,255,255,0.7); }
[data-theme="dark"] .treemap-cell { border-color: rgba(0,0,0,0.4); }
.treemap-cell:hover { opacity: 0.9; }
.treemap-cell .name { font-size: 12.5px; font-weight: 500; line-height: 1.3; }
.treemap-cell .pct { font-family: var(--font-mono); font-size: 11px; opacity: 0.8; margin-top: 2px; }
.treemap-cell .amount { font-family: var(--font-mono); font-size: 14px; margin-top: 4px; }
.treemap-cell.small .amount { font-size: 11px; margin-top: 1px; }
.treemap-cell.small .pct { display: none; }

/* ───────────────────────── OPPORTUNITY LIST ───────────────────────── */
.opp-list { display: flex; flex-direction: column; }
.opp-item { display: grid; grid-template-columns: 70px 1fr auto; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--border); align-items: center; }
.opp-item:last-child { border-bottom: none; }
.opp-savings { text-align: center; }
.opp-savings .num { font-family: var(--font-mono); font-weight: 600; font-size: 15px; color: var(--positive); display: block; letter-spacing: -0.02em; }
.opp-savings .label { font-size: 9.5px; color: var(--text-faint); letter-spacing: 0.08em; text-transform: uppercase; margin-top: 1px; }
.opp-title { font-size: 13px; line-height: 1.4; font-weight: 500; }
.opp-desc { font-size: 12px; color: var(--text-muted); margin-top: 3px; line-height: 1.45; }
.opp-meta { display: flex; gap: 10px; margin-top: 5px; font-size: 11px; color: var(--text-faint); font-family: var(--font-mono); flex-wrap: wrap; }
.opp-meta span { display: flex; align-items: center; gap: 4px; }
.opp-cta { display: flex; flex-direction: column; gap: 4px; align-items: stretch; }

/* ───────────────────────── BANNER ───────────────────────── */
.alert-banner { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--accent-bg); border: 1px solid var(--teal-200); border-radius: var(--r-md); margin-bottom: 18px; font-size: 13px; color: var(--teal-800); }
[data-theme="dark"] .alert-banner { background: var(--teal-950); border-color: var(--teal-800); color: var(--teal-100); }
.alert-banner .icon { width: 16px; height: 16px; flex-shrink: 0; }
.alert-banner .body { flex: 1; }
.alert-banner strong { font-weight: 500; }
.alert-banner button { font-size: 12px; font-weight: 500; padding: 4px 10px; background: var(--surface); border: 1px solid var(--border); border-radius: 4px; color: var(--text); }

/* ───────────────────────── SEGMENTED CONTROL ───────────────────────── */
.segmented { display: inline-flex; padding: 3px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); }
.segmented button { padding: 4px 12px; border-radius: 4px; font-size: 12px; font-weight: 500; color: var(--text-muted); transition: all 100ms; }
.segmented button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,0.06); }
[data-theme="dark"] .segmented button[aria-pressed="true"] { box-shadow: 0 1px 2px rgba(0,0,0,0.4); }

/* ───────────────────────── TABS NAV (within page) ───────────────────────── */
.subtabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: 18px; }
.subtab { padding: 9px 14px; font-size: 13px; color: var(--text-muted); border-bottom: 2px solid transparent; cursor: pointer; margin-bottom: -1px; }
.subtab.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 500; }
.subtab:hover:not(.active) { color: var(--text); }

/* ───────────────────────── INTEGRATIONS GRID ───────────────────────── */
.integ-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.integ-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 18px; display: flex; flex-direction: column; gap: 12px; transition: all 100ms ease; }
.integ-card:hover { border-color: var(--border-strong); }
.integ-card.connected { background: var(--surface); }
.integ-card.disconnected { background: var(--bg-sunken); }
.integ-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.integ-logo { width: 32px; height: 32px; border-radius: 6px; background: var(--surface-2); display: grid; place-items: center; font-family: var(--font-mono); font-size: 13px; font-weight: 600; border: 1px solid var(--border); color: var(--text); flex-shrink: 0; }
.integ-logo svg { width: 18px; height: 18px; display: block; }
.integ-name { font-size: 13.5px; font-weight: 500; }
.integ-cat { font-size: 11.5px; color: var(--text-faint); margin-top: 1px; }
.integ-body { font-size: 12px; color: var(--text-muted); line-height: 1.5; }
/* Live indicator — pulsing green dot */
.live-badge { display: inline-flex; align-items: center; gap: 5px; margin-left: 7px; font-size: 9.5px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--positive); font-family: var(--font-mono); }
.live-badge .live-dot { width: 7px; height: 7px; border-radius: 50%; background: #2FBF6B; position: relative; }
.live-badge .live-dot::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: #2FBF6B; animation: livePulse 1.6s ease-out infinite; }
@keyframes livePulse { 0% { transform: scale(1); opacity: 0.7; } 70% { transform: scale(2.6); opacity: 0; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .live-badge .live-dot::after { animation: none; } }
.integ-desc { font-size: 12px; color: var(--text-muted); line-height: 1.5; margin-top: 3px; }
.src-status { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 500; font-family: var(--font-mono); }
.src-status .src-dot { width: 7px; height: 7px; border-radius: 50%; }
.src-status.ok { color: var(--positive); }
.src-status.ok .src-dot { background: var(--positive); box-shadow: 0 0 0 3px var(--positive-bg); }
.src-status.warn { color: var(--warning); }
.src-status.warn .src-dot { background: var(--warning); box-shadow: 0 0 0 3px var(--warning-bg); }
.btn-sm { padding: 4px 10px; font-size: 11.5px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); }
.btn-sm:hover { background: var(--surface-2); }
.integ-foot { display: flex; align-items: center; justify-content: space-between; padding-top: 12px; border-top: 1px solid var(--border); margin-top: 4px; }
.integ-foot .meta { font-family: var(--font-mono); font-size: 11px; color: var(--text-faint); }

/* ───────────────────────── SETTINGS ───────────────────────── */
.settings-row { display: grid; grid-template-columns: 1fr 2fr; gap: 32px; padding: 22px 0; border-bottom: 1px solid var(--border); }
.settings-row:last-child { border-bottom: none; }
.settings-row .label h4 { font-size: 13.5px; font-weight: 500; margin-bottom: 4px; }
.settings-row .label p { font-size: 12.5px; color: var(--text-muted); line-height: 1.5; }
.settings-row .control input[type="text"], .settings-row .control select { width: 100%; padding: 7px 10px; border: 1px solid var(--border-strong); background: var(--surface); border-radius: var(--r-md); font-size: 13px; color: var(--text); }
.toggle-switch { width: 34px; height: 20px; background: var(--ink-300); border-radius: 10px; position: relative; cursor: pointer; transition: background 150ms; }
.toggle-switch.on { background: var(--accent); }
.toggle-switch::after { content: ""; position: absolute; width: 16px; height: 16px; background: white; border-radius: 50%; top: 2px; left: 2px; transition: transform 150ms; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
.toggle-switch.on::after { transform: translateX(14px); }

/* ───────────────────────── PAGE VISIBILITY ───────────────────────── */
.page { display: none; }
.page.active { display: block; }

/* ───────────────────────── MISC ───────────────────────── */
.section-divider { display: flex; align-items: center; gap: 12px; margin: 14px 0 8px; flex-wrap: wrap; }
.section-divider .evidence-eyebrow { flex-basis: 100%; margin-bottom: 1px; }
.section-divider h2 { font-size: 14px; font-weight: 500; letter-spacing: -0.005em; white-space: nowrap; flex-shrink: 0; }
.section-divider h2 .pillar-marker { font-family: var(--font-mono); font-size: 9.5px; color: var(--text-faint); padding: 1px 5px; background: var(--surface); border: 1px solid var(--border); border-radius: 3px; margin-right: 6px; letter-spacing: 0.04em; vertical-align: 1px; }
.section-divider .line { flex: 1; height: 1px; background: var(--border); }
.section-divider .count { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-faint); }
.dim { color: var(--text-faint); }
.row-flex { display: flex; align-items: center; gap: 10px; }
.row-flex-tight { display: flex; align-items: center; gap: 6px; }
.muted-link { color: var(--text-muted); font-size: 12px; }
.muted-link:hover { color: var(--text); }
button.muted-link { background: none; border: none; padding: 0; cursor: pointer; font-family: inherit; text-decoration: underline; text-decoration-style: dashed; text-decoration-color: var(--border-strong); text-underline-offset: 3px; }
button.muted-link:hover { text-decoration-color: var(--text-muted); }
.serif-accent { font-family: var(--font-serif); font-style: italic; color: var(--text-muted); font-weight: 300; font-size: 14px; }

/* ───────────────────────── ICON STYLES (inline SVG) ───────────────────────── */
.ic { width: 14px; height: 14px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* Mask-based icon set — files in icons/, color inherits from text */
.ico { display: inline-block; width: 16px; height: 16px; vertical-align: -3px; background-color: currentColor; -webkit-mask-position: center; mask-position: center; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-size: contain; mask-size: contain; flex-shrink: 0; }
.ico-sm { width: 12px; height: 12px; vertical-align: -2px; }
.ico-md { width: 14px; height: 14px; }
.ico-lg { width: 18px; height: 18px; }
.ico-eye      { -webkit-mask-image: url('/icons/eye.svg');      mask-image: url('/icons/eye.svg'); }
.ico-users    { -webkit-mask-image: url('/icons/users.svg');    mask-image: url('/icons/users.svg'); }
.ico-coins    { -webkit-mask-image: url('/icons/coins.svg');    mask-image: url('/icons/coins.svg'); }
.ico-money    { -webkit-mask-image: url('/icons/money.svg');    mask-image: url('/icons/money.svg'); }
.ico-shield   { -webkit-mask-image: url('/icons/shield.svg');   mask-image: url('/icons/shield.svg'); }
.ico-zap      { -webkit-mask-image: url('/icons/zap.svg');      mask-image: url('/icons/zap.svg'); }
.ico-cpu      { -webkit-mask-image: url('/icons/cpu.svg');      mask-image: url('/icons/cpu.svg'); }
.ico-database { -webkit-mask-image: url('/icons/database.svg'); mask-image: url('/icons/database.svg'); }
.ico-server   { -webkit-mask-image: url('/icons/server.svg');   mask-image: url('/icons/server.svg'); }
.ico-cloud    { -webkit-mask-image: url('/icons/cloud.svg');    mask-image: url('/icons/cloud.svg'); }
.ico-file-text{ -webkit-mask-image: url('/icons/file-text.svg');mask-image: url('/icons/file-text.svg'); }
.ico-folder   { -webkit-mask-image: url('/icons/folder.svg');   mask-image: url('/icons/folder.svg'); }
.ico-settings { -webkit-mask-image: url('/icons/settings-cog.svg'); mask-image: url('/icons/settings-cog.svg'); }
.ico-download { -webkit-mask-image: url('/icons/download.svg'); mask-image: url('/icons/download.svg'); }
.ico-plus     { -webkit-mask-image: url('/icons/plus.svg');     mask-image: url('/icons/plus.svg'); }
.ico-check    { -webkit-mask-image: url('/icons/check.svg');    mask-image: url('/icons/check.svg'); }
.ico-search   { -webkit-mask-image: url('/icons/search.svg');   mask-image: url('/icons/search.svg'); }
.ico-chart-bar{ -webkit-mask-image: url('/icons/chart-bar.svg');mask-image: url('/icons/chart-bar.svg'); }
.ico-chart    { -webkit-mask-image: url('/icons/chart.svg');    mask-image: url('/icons/chart.svg'); }
.ico-bell     { -webkit-mask-image: url('/icons/bell.svg');     mask-image: url('/icons/bell.svg'); }
.ico-target   { -webkit-mask-image: url('/icons/target.svg');   mask-image: url('/icons/target.svg'); }
.ico-sparkles { -webkit-mask-image: url('/icons/sparkles.svg'); mask-image: url('/icons/sparkles.svg'); }
.ico-grid     { -webkit-mask-image: url('/icons/grid.svg');     mask-image: url('/icons/grid.svg'); }
.ico-chevron-down  { -webkit-mask-image: url('/icons/chevron-down.svg');  mask-image: url('/icons/chevron-down.svg'); }
.ico-chevron-right { -webkit-mask-image: url('/icons/chevron-right.svg'); mask-image: url('/icons/chevron-right.svg'); }
.ico-arrow-right   { -webkit-mask-image: url('/icons/arrow-right.svg');   mask-image: url('/icons/arrow-right.svg'); }
.ico-arrow-left    { -webkit-mask-image: url('/icons/arrow-left.svg');    mask-image: url('/icons/arrow-left.svg'); }
.ico-info     { -webkit-mask-image: url('/icons/info.svg');     mask-image: url('/icons/info.svg'); }
.ico-lock     { -webkit-mask-image: url('/icons/lock.svg');     mask-image: url('/icons/lock.svg'); }
.ico-flag     { -webkit-mask-image: url('/icons/flag.svg');     mask-image: url('/icons/flag.svg'); }
.ico-alert    { -webkit-mask-image: url('/icons/alert.svg');    mask-image: url('/icons/alert.svg'); }
.ico-wallet   { -webkit-mask-image: url('/icons/wallet.svg');   mask-image: url('/icons/wallet.svg'); }
.ico-user     { -webkit-mask-image: url('/icons/user.svg');     mask-image: url('/icons/user.svg'); }
.ico-home     { -webkit-mask-image: url('/icons/home.svg');     mask-image: url('/icons/home.svg'); }
.ico-menu     { -webkit-mask-image: url('/icons/menu.svg');     mask-image: url('/icons/menu.svg'); }
.ico-moon     { -webkit-mask-image: url('/icons/moon.svg');     mask-image: url('/icons/moon.svg'); }
.ico-arrow-up { -webkit-mask-image: url('/icons/arrow-up.svg'); mask-image: url('/icons/arrow-up.svg'); }
.ico-scissors { -webkit-mask-image: url('/icons/scissors.svg'); mask-image: url('/icons/scissors.svg'); }
.nav-item .ico { width: 16px; height: 16px; opacity: 0.85; vertical-align: middle; }
.nav-item-sm .ico { width: 14px; height: 14px; opacity: 0.7; vertical-align: middle; }
.btn .ico { width: 14px; height: 14px; vertical-align: -2px; }

.ic-sm { width: 12px; height: 12px; stroke-width: 1.6; stroke: currentColor; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.ic-lg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ───────────────────── PREDICTIVE ALERTS ───────────────────── */
.signals-stack { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.signal-card { background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--warning); border-radius: var(--r-md); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.signal-card.critical { border-left-color: var(--negative); }
.signal-card.positive { border-left-color: var(--positive); }
.signal-card .sig-head { display: flex; align-items: center; gap: 8px; }
.signal-card .sig-head .sig-eyebrow { font-size: 10.5px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-faint); font-family: var(--font-mono); }
.signal-card .sig-head .sig-time { margin-left: auto; font-size: 11px; color: var(--text-faint); font-family: var(--font-mono); }
.signal-card .sig-title { font-size: 13.5px; font-weight: 500; color: var(--text); line-height: 1.4; }
.signal-card .sig-title .num { font-family: var(--font-mono); color: var(--negative); }
.signal-card.positive .sig-title .num { color: var(--positive); }
.signal-card .sig-drivers { display: flex; flex-wrap: wrap; gap: 6px; font-size: 11.5px; color: var(--text-muted); }
.signal-card .sig-drivers .chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; background: var(--bg-sunken); border-radius: 10px; font-family: var(--font-mono); font-size: 11px; color: var(--text); }
.signal-card .sig-drivers .chip .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--negative); }
.signal-card.positive .sig-drivers .chip .dot { background: var(--positive); }
.signal-card .sig-action { display: flex; gap: 8px; align-items: center; padding-top: 6px; border-top: 1px solid var(--border); }
.signal-card .sig-action .rec { flex: 1; font-size: 11.5px; color: var(--text-muted); font-style: italic; }
.signal-card .sig-action button { font-size: 11.5px; padding: 4px 10px; border-radius: 4px; border: 1px solid var(--border); background: var(--surface); color: var(--text); }
.signal-card .sig-action button.primary { background: var(--ink-900); color: white; border-color: var(--ink-900); }
[data-theme="dark"] .signal-card .sig-action button.primary { background: var(--moss-300); color: var(--ink-900); border-color: var(--moss-300); }

/* ───────────────────── COST-VS-OUTPUT SCATTER ───────────────────── */
.scatter-wrap { display: grid; grid-template-columns: 1fr 220px; gap: 18px; align-items: stretch; }
.scatter-svg { width: 100%; height: 280px; background: var(--bg-sunken); border-radius: var(--r-md); position: relative; overflow: hidden; }
.scatter-svg .quadrant-label { position: absolute; font-size: 10px; font-family: var(--font-mono); color: var(--text-faint); letter-spacing: 0.04em; text-transform: uppercase; padding: 6px 8px; }
.scatter-svg .quadrant-label.tl { top: 0; left: 0; }
.scatter-svg .quadrant-label.tr { top: 0; right: 0; text-align: right; }
.scatter-svg .quadrant-label.bl { bottom: 0; left: 0; }
.scatter-svg .quadrant-label.br { bottom: 0; right: 0; text-align: right; }
.scatter-legend { display: flex; flex-direction: column; gap: 12px; font-size: 11.5px; }
.scatter-legend .key { display: flex; align-items: flex-start; gap: 8px; }
.scatter-legend .key .swatch { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; margin-top: 4px; }
.scatter-legend .key .text { color: var(--text); line-height: 1.4; }
.scatter-legend .key .text strong { font-weight: 500; }
.scatter-legend .key .text .sub { display: block; color: var(--text-faint); font-size: 10.5px; margin-top: 2px; }

/* ───────────────────── COMMITMENTS CARD ───────────────────── */
.commit-list { display: flex; flex-direction: column; gap: 14px; }
.commit-row { padding: 10px 0; border-bottom: 1px solid var(--border); cursor: pointer; border-radius: 4px; transition: background 100ms; margin: 0 -8px; padding-left: 8px; padding-right: 8px; }
.commit-row:hover { background: var(--bg-sunken); }
.commit-row:last-child { border-bottom: none; padding-bottom: 0; }
.commit-row:first-child { padding-top: 0; }
.commit-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.commit-head .name { font-size: 12.5px; font-weight: 500; color: var(--text); display: flex; align-items: center; gap: 7px; }
.commit-head .name .new-pill { font-size: 9.5px; font-family: var(--font-mono); padding: 2px 6px; border-radius: 9px; background: var(--moss-100); color: var(--moss-700); letter-spacing: 0.04em; }
[data-theme="dark"] .commit-head .name .new-pill { background: var(--moss-900); color: var(--moss-200); }
.commit-head .nums { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-muted); letter-spacing: -0.01em; }
.commit-head .nums strong { color: var(--text); font-weight: 500; }
.commit-bar { height: 7px; background: var(--bg-sunken); border-radius: 4px; position: relative; overflow: hidden; }
.commit-bar .fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); border-radius: 4px; }
.commit-bar .fill.warn { background: var(--warning); }
.commit-bar .fill.over { background: var(--negative); }
.commit-bar .expected { position: absolute; top: -2px; bottom: -2px; width: 1px; background: var(--text-faint); }
.commit-bar .projected { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink-900); border-radius: 1px; }
[data-theme="dark"] .commit-bar .projected { background: var(--ink-100); }
.commit-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 7px; font-size: 11px; color: var(--text-muted); }
.commit-meta .proj { font-family: var(--font-mono); }
.commit-meta .proj.over { color: var(--negative); }
.commit-meta .proj.under { color: var(--positive); }

/* ───────────────────── SANKEY / ROUTING FLOW ───────────────────── */
.sankey-wrap { padding: 18px; }
.sankey-svg { width: 100%; height: 360px; display: block; }
.sankey-node-label { font-family: var(--font-mono); font-size: 11px; fill: var(--text); font-weight: 500; }
.sankey-node-sub { font-family: var(--font-mono); font-size: 10px; fill: var(--text-faint); }
.sankey-flow { transition: opacity 150ms; }
.sankey-flow:hover { opacity: 0.85; }
.sankey-key { display: flex; align-items: center; gap: 18px; margin-top: 6px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 11.5px; color: var(--text-muted); }
.sankey-key-item { display: flex; align-items: center; gap: 6px; }
.sankey-dot { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.sankey-key-hint { margin-left: auto; font-style: italic; color: var(--text-faint); }
.sankey-focus-chip { display: inline-flex; align-items: center; gap: 2px; padding: 4px 10px; font-size: 11.5px; font-weight: 500; color: var(--accent); background: var(--accent-bg); border: 1px solid var(--accent); border-radius: 14px; cursor: pointer; white-space: nowrap; transition: opacity 120ms; }
.sankey-focus-chip:hover { opacity: 0.8; }
.sankey-chip-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: flex-end; max-width: 60%; }
/* ───────── Agents page ───────── */
#agentSankey svg { width: 100%; height: auto; display: block; }
.agent-snode { transition: opacity 150ms; }
.agent-sflow { transition: opacity 150ms; cursor: pointer; }
.agent-sankey-dim { opacity: 0.08 !important; }
.agent-snode-label { font-family: var(--font-mono); font-size: 11.5px; fill: var(--text); font-weight: 500; }
.agent-snode-sub { font-family: var(--font-mono); font-size: 10px; fill: var(--text-faint); }
.agent-snode-hit { cursor: pointer; }
/* provider mix mini-bar (table) */
.prov-mix { display: inline-flex; width: 124px; height: 9px; border-radius: 3px; overflow: hidden; background: var(--bg-sunken); vertical-align: middle; }
.prov-mix span { height: 100%; }
.prov-mix .anthropic { background: #C18055; } .prov-mix .bedrock { background: #5B7B9A; } .prov-mix .vertex { background: #9A8CB0; }
.prov-legend { display: inline-flex; gap: 12px; align-items: center; font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); }
.prov-legend .pk { display: inline-flex; align-items: center; gap: 5px; }
.prov-legend .pk i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
/* trigger mix mini-bar (table) */
.trig-mix { display: inline-flex; align-items: center; gap: 8px; }
.trig-mix .bar { width: 64px; height: 9px; border-radius: 3px; overflow: hidden; background: var(--moss-600); display: inline-flex; }
.trig-mix .bar .auto { height: 100%; background: var(--warm-ochre); }
.trig-mix .lbl { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); }
/* provider rollup strip — 3-segment variant of cost-split-strip */
.cost-split-strip.providers .seg.anthropic { background: #C18055; color: #fff; }
.cost-split-strip.providers .seg.bedrock { background: #5B7B9A; color: #fff; }
.cost-split-strip.providers .seg.vertex { background: #9A8CB0; color: #fff; }
.agent-name-cell { display: inline-flex; align-items: center; gap: 4px; font-weight: 500; color: var(--text); }
.agent-kind-tag { font-family: var(--font-mono); font-size: 10px; color: var(--text-faint); margin-left: 6px; padding: 1px 6px; border: 1px solid var(--border); border-radius: 10px; }
/* ───── Tools / API Keys / Agents global views ───── */
.app[data-mode="tools"]  .mode-keys,  .app[data-mode="tools"]  .mode-agents { display: none; }
.app[data-mode="keys"]   .mode-tools, .app[data-mode="keys"]   .mode-agents { display: none; }
.app[data-mode="agents"] .mode-tools, .app[data-mode="agents"] .mode-keys   { display: none; }
.mode-crumb { margin-bottom: 12px; }
.mode-toggle { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); }
.mode-toggle button { display: inline-flex; align-items: center; gap: 6px; padding: 5px 14px; font-weight: 500; font-size: 12.5px; font-family: inherit; color: var(--text-muted); background: transparent; border: none; border-radius: calc(var(--r-md) - 3px); cursor: pointer; transition: background 120ms, color 120ms; }
.mode-toggle button .ico { width: 14px; height: 14px; }
.mode-toggle button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,.06); }
.app[data-mode="agents"] .mode-toggle button[aria-pressed="true"] { color: var(--warm-ochre); }
.app[data-mode="keys"] .mode-toggle button[aria-pressed="true"] { color: var(--slate-blue); }
.mode-agents-stub { padding: 42px 40px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 13px; }
.mode-agents-stub.keys .ico { color: var(--slate-blue); }
/* ───── API Keys view ───── */
.vendor-card-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(186px,1fr)); gap: 12px; }
.vendor-card { border: 1px solid var(--border); border-radius: var(--r-md); padding: 15px 16px; background: var(--surface); cursor: pointer; transition: border-color 120ms, box-shadow 120ms, background 120ms; position: relative; }
.vendor-card:hover { border-color: var(--border-strong); box-shadow: 0 2px 6px rgba(0,0,0,0.04); }
.vendor-card.is-active { border-color: var(--slate-blue); box-shadow: 0 0 0 1px var(--slate-blue) inset; }
.vendor-card.is-empty { opacity: 0.66; cursor: default; border-style: dashed; }
.vendor-card.is-empty:hover { border-color: var(--border); box-shadow: none; }
.vendor-card .vc-name { font-weight: 600; font-size: 13.5px; color: var(--text); display: flex; align-items: center; gap: 7px; }
.vendor-card .vc-spend { font-family: var(--font-mono); font-size: 22px; color: var(--text); margin: 8px 0 2px; }
.vendor-card .vc-meta { font-family: var(--font-mono); font-size: 11px; color: var(--text-faint); }
.vendor-card .vc-mix { display: flex; height: 7px; border-radius: 3px; overflow: hidden; margin-top: 11px; background: var(--bg-sunken); }
.vendor-card .vc-mix span { height: 100%; }
.vendor-card .vc-connect { font-family: var(--font-mono); font-size: 10.5px; color: var(--slate-blue); margin-top: 9px; display: inline-flex; align-items: center; gap: 5px; }
.vendor-card .vc-badge { position: absolute; top: 13px; right: 14px; font-family: var(--font-mono); font-size: 9px; letter-spacing: 0.05em; text-transform: uppercase; padding: 2px 7px; border-radius: 9px; }
.vendor-card .vc-badge.live { background: var(--moss-100); color: var(--moss-700); }
.vendor-card .vc-badge.pending { background: var(--bg-sunken); color: var(--text-faint); }
[data-theme="dark"] .vendor-card .vc-badge.live { background: rgba(110,140,85,0.20); color: var(--moss-300); }
.key-fp { font-family: var(--font-mono); font-size: 12px; color: var(--text); }
.key-rotbadge { font-family: var(--font-mono); font-size: 10px; padding: 1px 7px; border-radius: 9px; white-space: nowrap; }
.key-rotbadge.ok { background: var(--moss-100); color: var(--moss-700); }
.key-rotbadge.due { background: var(--warning-bg); color: var(--warm-ochre); }
.key-rotbadge.dormant { background: var(--bg-sunken); color: var(--text-faint); }
[data-theme="dark"] .key-rotbadge.ok { background: rgba(110,140,85,0.20); color: var(--moss-300); }
.keys-empty-state { padding: 40px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.keys-empty-state .ico { width: 26px; height: 26px; color: var(--text-faint); }
.keys-empty-state .kes-title { font-size: 14.5px; font-weight: 500; color: var(--text); }
.keys-empty-state .kes-sub { font-size: 12.5px; color: var(--text-muted); max-width: 420px; line-height: 1.55; }
.kmix-seg { display: inline-flex; width: 120px; height: 9px; border-radius: 3px; overflow: hidden; background: var(--bg-sunken); vertical-align: middle; }
.kmix-seg span { height: 100%; }
.pareto-row { display: grid; grid-template-columns: 150px 1fr 96px; gap: 12px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--border); }
.pareto-row:last-child { border-bottom: none; }
.pareto-track { height: 15px; background: var(--bg-sunken); border-radius: 3px; overflow: hidden; }
.pareto-fill { height: 100%; background: var(--slate-blue); border-radius: 3px; }
.pareto-row .p-val { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-muted); text-align: right; }
.mode-agents-stub .ico { width: 30px; height: 30px; color: var(--warm-ochre); }
.mode-agents-stub .mas-title { font-size: 16px; font-weight: 500; color: var(--text); }
.mode-agents-stub .mas-sub { font-size: 13px; color: var(--text-muted); max-width: 460px; line-height: 1.55; }
.mode-agents-stub .mas-sub strong { color: var(--text); }
/* Agents ▸ Visibility */
.agent-status { font-family: var(--font-mono); font-size: 10.5px; padding: 2px 8px; border-radius: 10px; white-space: nowrap; }
.agent-status.ok { background: var(--moss-100); color: var(--moss-700); }
.agent-status.warn { background: rgba(213,160,63,0.16); color: var(--warm-ochre); }
[data-theme="dark"] .agent-status.ok { background: rgba(110,140,85,0.20); color: var(--moss-300); }
.shadow-agent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(244px,1fr)); gap: 12px; }
.shadow-agent-card { border: 1px dashed var(--negative); border-radius: var(--r-md); padding: 14px; background: var(--surface); display: flex; flex-direction: column; gap: 8px; }
.shadow-agent-card .sac-head { display: flex; align-items: center; gap: 8px; }
.shadow-agent-card .sac-head .ico { width: 15px; height: 15px; color: var(--negative); }
.shadow-agent-card .sac-name { font-family: var(--font-mono); font-size: 12.5px; font-weight: 500; color: var(--text); }
.shadow-agent-card .sac-kind { font-size: 11.5px; color: var(--text-muted); }
.shadow-agent-card .sac-stats { display: flex; flex-wrap: wrap; gap: 10px; font-size: 11px; color: var(--text-muted); }
.shadow-agent-card .sac-stats strong { color: var(--text); font-family: var(--font-mono); }
.shadow-agent-card .sac-cost { color: var(--negative); font-family: var(--font-mono); }
.shadow-agent-card .sac-btn { align-self: flex-start; font-size: 11.5px; padding: 4px 12px; }
.agent-discovery-svg { width: 100%; height: auto; display: block; }
/* Agents ▸ Control */
.agent-status.off { background: var(--bg-sunken); color: var(--text-faint); }
.evt-bars { display: flex; align-items: flex-end; gap: 14px; height: 180px; padding-top: 8px; }
.evt-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.evt-stack { width: 60%; max-width: 32px; display: flex; flex-direction: column; justify-content: flex-end; }
.evt-stack .blk { background: var(--negative); border-radius: 3px 3px 0 0; }
.evt-stack .thr { background: var(--warm-ochre); }
.evt-col .wk { font-family: var(--font-mono); font-size: 10px; color: var(--text-faint); }
.audit-feed { display: flex; flex-direction: column; }
.audit-row { display: grid; grid-template-columns: 52px 156px 1fr auto; gap: 12px; align-items: center; padding: 10px 4px; border-bottom: 1px solid var(--border); font-size: 12.5px; }
.audit-row:last-child { border-bottom: none; }
.audit-row .a-time { font-family: var(--font-mono); font-size: 11px; color: var(--text-faint); }
.audit-row .a-agent { font-weight: 500; color: var(--text); }
.audit-row .a-act { color: var(--text-muted); }
.audit-row .a-hash { font-family: var(--font-mono); font-size: 10.5px; color: var(--moss-700); display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.audit-row .a-hash::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--moss-600); }
[data-theme="dark"] .audit-row .a-hash { color: var(--moss-300); }
/* Agents ▸ ROI / Adoption / Optimization */
.cpo-row { display: grid; grid-template-columns: 150px 1fr 168px; gap: 12px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--border); }
.cpo-row:last-child { border-bottom: none; }
.cpo-row .cpo-nm { font-size: 12.5px; font-weight: 500; color: var(--text); }
.cpo-track { position: relative; height: 16px; background: var(--bg-sunken); border-radius: 3px; overflow: hidden; }
.cpo-track .cpo-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--moss-600); border-radius: 3px; min-width: 3px; }
.cpo-row .cpo-val { text-align: right; }
.cpo-row .cpo-val strong { font-family: var(--font-mono); font-size: 12.5px; color: var(--moss-700); }
.cpo-row .cpo-val .cpo-sub { display: block; font-family: var(--font-mono); font-size: 10px; color: var(--text-faint); }
[data-theme="dark"] .cpo-row .cpo-val strong { color: var(--moss-300); }
.inv-row { display: grid; grid-template-columns: 168px 1fr 64px; gap: 12px; align-items: center; padding: 8px 0; }
.inv-bar-track { height: 14px; background: var(--bg-sunken); border-radius: 3px; overflow: hidden; }
.inv-bar { height: 100%; background: var(--teal-500); border-radius: 3px; min-width: 2px; }
.inv-bar.dormant { background: var(--negative); }
.inv-row .inv-val { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-muted); text-align: right; }
.inv-row .inv-nm { font-size: 12.5px; color: var(--text); font-weight: 500; display: flex; align-items: center; gap: 7px; }
.inv-row .inv-nm .dtag { font-family: var(--font-mono); font-size: 9.5px; padding: 1px 6px; border-radius: 8px; background: rgba(155,57,42,0.14); color: var(--negative); }
.oppa-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.oppa-card { border: 1px solid var(--border); border-radius: var(--r-md); padding: 14px 16px; background: var(--surface); display: flex; flex-direction: column; gap: 8px; }
.oppa-card .oppa-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.oppa-card .oppa-cat { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-faint); }
.oppa-card .oppa-save { font-family: var(--font-mono); font-weight: 600; color: var(--moss-700); }
[data-theme="dark"] .oppa-card .oppa-save { color: var(--moss-300); }
.oppa-card .oppa-title { font-size: 13px; color: var(--text); line-height: 1.4; }
.oppa-card .oppa-foot { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--text-muted); }
.oppa-card .oppa-status { font-family: var(--font-mono); font-size: 10px; padding: 2px 8px; border-radius: 10px; background: var(--bg-sunken); color: var(--text-muted); }
.oppa-card .oppa-status.applied { background: var(--moss-100); color: var(--moss-700); }
[data-theme="dark"] .oppa-card .oppa-status.applied { background: rgba(110,140,85,0.20); color: var(--moss-300); }

/* ───────────────────── TOAST ───────────────────── */
.gk-toast { position: fixed; bottom: 24px; right: 24px; background: var(--ink-900); color: white; padding: 10px 16px; border-radius: 6px; font-size: 12.5px; font-family: var(--font-sans); box-shadow: 0 4px 24px rgba(0,0,0,0.18); z-index: 9999; transform: translateY(8px); opacity: 0; transition: opacity 200ms, transform 200ms; max-width: 360px; letter-spacing: -0.005em; }
[data-theme="dark"] .gk-toast { background: var(--moss-200); color: var(--ink-900); }
.gk-toast.show { opacity: 1; transform: translateY(0); }
.gk-toast-success { background: var(--positive); color: white; }
[data-theme="dark"] .gk-toast-success { background: var(--moss-400); color: var(--ink-900); }

/* ───────────────────── ADOPTION (commits / tickets) ───────────────────── */
.adoption-strip { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 18px; }
.commit-mix { padding: 18px; }
.commit-mix .legend { display: flex; gap: 14px; margin-bottom: 12px; font-size: 11.5px; color: var(--text-muted); }
.commit-mix .legend .key { display: flex; align-items: center; gap: 6px; }
.commit-mix .legend .swatch { width: 10px; height: 10px; border-radius: 2px; }
.commit-mix .commit-bars { display: flex; flex-direction: column; gap: 11px; }
.commit-mix .crow { display: grid; grid-template-columns: 110px 1fr 70px; gap: 12px; align-items: center; font-size: 12px; }
.commit-mix .crow .nm { font-weight: 500; color: var(--text); }
.commit-mix .crow .stacked { height: 14px; background: var(--bg-sunken); border-radius: 3px; overflow: hidden; display: flex; }
.commit-mix .crow .stacked .ai { background: var(--moss-600); height: 100%; }
.commit-mix .crow .stacked .manual { background: var(--ink-400); height: 100%; }
.commit-mix .crow .pct { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-muted); text-align: right; }
/* Tool catalogue · grid of all tools */
.catalogue-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.catalogue-card { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 12px; display: flex; flex-direction: column; gap: 10px; transition: border-color 100ms, transform 100ms; cursor: pointer; }
.catalogue-card:hover { border-color: var(--moss-400); transform: translateY(-1px); }
.catalogue-card.shadow { border-left: 3px solid var(--negative); }
.cat-logo { position: relative; overflow: hidden; }
.cat-logo .bi-logo { position: absolute; left: 50%; top: 50%; width: 60%; height: 60%; object-fit: contain; transform: translate(-50%,-50%); opacity: 0; transition: opacity 120ms; }
.cat-logo .bi-mono { line-height: 1; }
.catalogue-card.embedded { border-left: 3px solid var(--teal-400); }
.catalogue-card.embedded.is-available { opacity: 0.62; border-left-style: dashed; }
.catalogue-card .cat-flag { color: var(--warning); margin-left: 5px; font-size: 11px; }
/* Collapsible catalogue wrapper · closed by default to keep page tidy at scale */
.catalogue-collapse { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.catalogue-collapse > summary { display: flex; align-items: center; gap: 16px; padding: 12px 16px; cursor: pointer; list-style: none; user-select: none; }
.catalogue-collapse > summary::-webkit-details-marker { display: none; }
.catalogue-collapse > summary:hover { background: var(--surface-2); }
.catalogue-collapse[open] > summary { border-bottom: 1px solid var(--border); }
.cat-sum-title  { font-size: 13.5px; font-weight: 500; color: var(--text); white-space: nowrap; }
.cat-sum-meta   { font-size: 11.5px; color: var(--text-muted); font-family: var(--font-mono); white-space: nowrap; }
.cat-sum-cta    { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); flex-shrink: 0; padding: 4px 10px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); margin-left: auto; }order: 1px solid var(--border); }
.cat-sum-cta .ico { transition: transform 150ms; }
.catalogue-collapse[open] .cat-sum-cta .ico { transform: rotate(180deg); }
.catalogue-collapse[open] .cat-sum-cta-open  { display: none; }
.catalogue-collapse .cat-sum-cta-close { display: none; }
.catalogue-collapse[open] .cat-sum-cta-close { display: inline; }
.catalogue-collapse .catalogue-grid { padding: 12px; }
.cat-group-header { display: flex; align-items: baseline; gap: 10px; padding: 14px 16px 6px; border-top: 1px solid var(--border); }
.cat-group-header:first-of-type { border-top: none; }
.cat-group-title { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
.cat-group-count { font-family: var(--font-mono); font-size: 11px; color: var(--text-faint); }
/* SSO / account-exposure badge on each catalogue card */
.cat-head { position: relative; }
.cat-sso { margin-left: auto; flex: 0 0 auto; align-self: flex-start; display: inline-flex; align-items: center; gap: 3px; font-family: var(--font-mono); font-size: 9.5px; font-weight: 500; letter-spacing: .01em; padding: 2px 6px; border-radius: 10px; white-space: nowrap; line-height: 1.4; }
.cat-sso.is-sso { background: color-mix(in srgb, var(--moss-600) 14%, transparent); color: var(--moss-700); }
.cat-sso.is-corp { background: color-mix(in srgb, #D9A441 20%, transparent); color: #8A6410; }
.cat-sso.is-personal { background: color-mix(in srgb, var(--negative) 14%, transparent); color: var(--negative); cursor: pointer; }
.cat-sso.is-personal:hover { background: color-mix(in srgb, var(--negative) 24%, transparent); }
[data-theme="dark"] .cat-sso.is-sso { color: var(--moss-300); }
[data-theme="dark"] .cat-sso.is-corp { color: #E6BE63; }
/* Surface tag (secondary axis) — sits top-right of the card head, where the SSO badge was */
.cat-surface { margin-left: auto; align-self: flex-start; flex: 0 0 auto; font-family: var(--font-mono); font-size: 9px; font-weight: 500; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 2px 7px; line-height: 1.4; white-space: nowrap; }
/* Account-exposure widget */
.exposure-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 10px; }
.exposure-key { display: flex; gap: 16px; flex-wrap: wrap; }
.exposure-key-item { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-muted); }
.exposure-dot { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.exposure-hint { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-faint); }
.kpi-clickable { cursor: pointer; transition: background 120ms, border-color 120ms; }
.kpi-clickable:hover { background: var(--surface-2); }
/* Spend visibility split — where AI spend enters the company */
.spend-bar { display: flex; gap: 2px; height: 48px; border-radius: 8px; overflow: hidden; }
.spend-seg { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; color: #fff; padding: 0 12px; min-width: 0; white-space: nowrap; line-height: 1.15; transition: box-shadow 160ms, filter 160ms; }
.spend-seg .ss-amt { font-family: var(--font-mono); font-size: 13px; font-weight: 600; }
.spend-seg .ss-pct { font-size: 10px; opacity: 0.85; }
.spend-seg.is-highlight { box-shadow: inset 0 0 0 2px #fff, 0 0 0 2px var(--negative); filter: saturate(1.2); }
.spend-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.spend-card { border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; background: var(--surface); display: flex; flex-direction: column; gap: 4px; border-top-width: 3px; }
.spend-card .sc-name { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); display: flex; align-items: center; gap: 6px; }
.spend-card .sc-amt { font-family: var(--font-mono); font-size: 21px; font-weight: 600; color: var(--text); }
.spend-card .sc-amt small { font-size: 12px; color: var(--text-faint); font-weight: 400; }
.spend-card .sc-mom { font-family: var(--font-mono); font-size: 11px; }
.spend-card .sc-mom.bad { color: var(--negative); }
.spend-card .sc-mom.good { color: var(--moss-700); }
.spend-card .sc-vendors { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.spend-card .sc-flag { display: inline-flex; align-items: center; gap: 3px; font-size: 9.5px; font-weight: 600; color: #8A6410; background: color-mix(in srgb, #D9A441 22%, transparent); padding: 1px 5px; border-radius: 8px; letter-spacing: .02em; }
[data-theme="dark"] .spend-card .sc-flag { color: #E6BE63; }
/* Category filter pills (tool catalogue) */
.cat-filter-row { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 14px; }
.catalogue-card.cat-hide { display: none; }
.cat-group-header.cat-hide, .catalogue-grid.cat-hide { display: none; }
.cat-group-count .cat-group-of { color: var(--moss-700); }
[data-theme="dark"] .cat-group-count .cat-group-of { color: var(--moss-300); }
@media (max-width: 720px) {
  .cat-filter-row { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; scrollbar-width: thin; }
  .cat-filter-row .opt-pill { flex: 0 0 auto; }
}
.catalogue-collapse .cat-group-header + .catalogue-grid { padding-top: 6px; padding-bottom: 14px; }
.cat-head { display: flex; align-items: center; gap: 10px; }
.cat-head > div { flex: 1; min-width: 0; }
.cat-logo { width: 32px; height: 32px; border-radius: 6px; display: grid; place-items: center; font-size: 12px; font-weight: 600; flex-shrink: 0; }
.cat-name { font-size: 13px; font-weight: 500; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-vendor { font-size: 11px; color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-stats { display: flex; justify-content: space-between; padding: 8px 0; border-top: 1px solid var(--border); font-size: 11.5px; color: var(--text-muted); }
.cat-stats strong { color: var(--text); font-weight: 600; }
.cat-foot { font-size: 10.5px; color: var(--text-faint); }
.status-pill { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 10.5px; font-weight: 600; }
.status-pill.status-pos { background: var(--moss-100); color: var(--moss-700); }

/* ───────── ROI pane ───────── */
.roi-pane { overflow: hidden; }
.roi-pane .card-body { padding: 0; }
.roi-head { display: grid; grid-template-columns: minmax(220px, 280px) 1fr; gap: 36px; padding: 22px 24px; align-items: center; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.roi-headline { display: flex; flex-direction: column; gap: 6px; }
.roi-headline .eyebrow { color: var(--text-faint); }
.roi-multiple { font-family: var(--font-mono); font-size: 56px; font-weight: 500; letter-spacing: -0.03em; line-height: 1; color: var(--teal-700); display: flex; align-items: baseline; gap: 2px; }
[data-theme="dark"] .roi-multiple { color: var(--teal-200); }
.roi-multiple .roi-x { font-size: 36px; font-weight: 400; color: var(--moss-600); }
[data-theme="dark"] .roi-multiple .roi-x { color: var(--moss-300); }
.roi-net { font-size: 13px; color: var(--text-muted); display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.roi-net .roi-net-num { font-family: var(--font-mono); font-weight: 600; color: var(--moss-700); font-size: 14px; }
[data-theme="dark"] .roi-net .roi-net-num { color: var(--moss-300); }
.roi-meter { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.roi-bar { display: flex; height: 28px; border-radius: 6px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--border); }
.roi-segment { height: 100%; display: flex; align-items: center; padding: 0 10px; font-family: var(--font-mono); font-size: 11.5px; white-space: nowrap; overflow: hidden; }
.roi-segment.roi-invest  { background: var(--teal-700);   color: white; }
.roi-segment.roi-savings { background: var(--moss-600);   color: white; }
.roi-segment.roi-prod    { background: var(--warm-ochre); color: var(--ink-900); }
.roi-meter-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-faint); font-family: var(--font-mono); }
.roi-meter-axis .roi-axis-mark { display: flex; align-items: center; gap: 6px; }
.roi-meter-axis .roi-axis-dot { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.roi-breakdown { display: grid; grid-template-columns: 1fr 1fr 1fr; }
.roi-col { padding: 20px 24px; border-right: 1px solid var(--border); display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.roi-col:last-child { border-right: none; }
.roi-col-label { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 500; color: var(--text-muted); letter-spacing: 0.06em; text-transform: uppercase; }
.roi-col-label .legend-swatch { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
.roi-col-value { font-family: var(--font-mono); font-weight: 500; font-size: 28px; letter-spacing: -0.02em; color: var(--text); display: flex; align-items: baseline; gap: 4px; }
.roi-col-value .dim { font-size: 14px; color: var(--text-faint); font-weight: 400; }
.roi-col-rows { display: flex; flex-direction: column; gap: 0; font-size: 12.5px; color: var(--text-muted); }
.roi-col-rows > div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--border); }
.roi-col-rows > div:last-child { border-bottom: none; }
.roi-col-rows .mono { font-family: var(--font-mono); color: var(--text); font-feature-settings: "tnum"; }
.roi-foot { padding: 12px 24px; font-size: 11.5px; color: var(--text-faint); font-style: italic; border-top: 1px solid var(--border); background: var(--bg-sunken); line-height: 1.55; }
.roi-foot strong { color: var(--text-muted); font-weight: 500; font-style: normal; }

/* ───────── Intent bento (size = % of traffic) ───────── */
.intent-bento { display: grid; grid-template-columns: repeat(12, 1fr); grid-template-rows: repeat(10, 1fr); flex: 1; min-height: 480px; gap: 10px; }
.intent-cell { border-radius: 12px; padding: 16px 18px; display: flex; flex-direction: column; justify-content: space-between; gap: 6px; position: relative; overflow: hidden; color: var(--ink-900); min-width: 0; min-height: 0; }
.intent-cell .intent-name  { font-size: 13px; font-weight: 500; opacity: 0.95; line-height: 1.25; }
.intent-cell .intent-pct   { font-family: var(--font-mono); font-weight: 500; font-size: 22px; letter-spacing: -0.02em; line-height: 1; }
.intent-cell .intent-tools { font-size: 11px; opacity: 0.78; line-height: 1.45; }
/* Size modifiers — tuned to each tile's aspect ratio */
.intent-cell.intent-xl  { padding: 24px 26px; }
.intent-cell.intent-xl .intent-pct   { font-size: 72px; letter-spacing: -0.03em; }
.intent-cell.intent-xl .intent-name  { font-size: 22px; }
.intent-cell.intent-xl .intent-tools { font-size: 12.5px; max-width: 360px; opacity: 0.82; }
.intent-cell.intent-lg .intent-pct   { font-size: 36px; }
.intent-cell.intent-lg .intent-name  { font-size: 14px; }
.intent-cell.intent-md .intent-pct   { font-size: 28px; }
.intent-cell.intent-sm { padding: 9px 12px; gap: 2px; }
.intent-cell.intent-sm .intent-pct { font-size: 17px; }
.intent-cell.intent-sm .intent-name { font-size: 11.5px; }
.intent-cell.intent-sm .intent-tools { font-size: 10.5px; }
.intent-cell.intent-mini { padding: 10px; align-items: center; justify-content: center; text-align: center; gap: 4px; }
.intent-cell.intent-mini .intent-pct  { font-size: 22px; }
.intent-cell.intent-mini .intent-name { font-size: 10px; letter-spacing: 0.04em; text-transform: uppercase; opacity: 0.9; }
.intent-foot { font-size: 11.5px; color: var(--text-faint); font-style: italic; margin-top: 14px; line-height: 1.55; }

/* Intent → tool heatmap card · stretches to match the bento card height */
.intent-tool-card { display: flex; flex-direction: column; }
.intent-tool-body { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.intent-tool-card .heatmap-wrap { flex: 1; display: flex; }
.intent-tool-card .heatmap-grid { gap: 3px; flex: 0 0 auto; align-content: stretch; }
.intent-tool-card .hm-col-label { writing-mode: vertical-rl; transform: rotate(180deg); padding: 6px 2px 4px; font-size: 9.5px; letter-spacing: 0.02em; align-self: end; justify-self: center; border-bottom: none; border-top: 1px solid var(--border); }
.intent-tool-card .hm-row-label { padding: 0 8px 0 2px; font-size: 11px; display: flex; align-items: center; justify-content: flex-end; }
.intent-tool-card .hm-cell { padding: 0; font-size: 10.5px; display: flex; align-items: center; justify-content: center; }
.intent-tool-card .heatmap-legend { margin-top: 12px; padding-top: 10px; }
/* Expandable parent row */
.row-expandable td:first-child { cursor: pointer; }
.row-expandable:hover { background: var(--surface-2); }
.row-chevron { display: inline-block; margin-left: 6px; color: var(--text-faint); font-size: 10px; transition: transform 150ms; }
.row-expandable.is-open .row-chevron { transform: rotate(90deg); color: var(--text-muted); }
.row-child td { background: var(--bg-sunken); font-size: 12px; }
.row-child td:first-child { padding-left: 28px; color: var(--text-muted); position: relative; }
.row-child td:first-child::before { content: "↳"; position: absolute; left: 14px; color: var(--text-faint); }

/* ───────── ROI page · imported from index (7).html ───────── */
/* Inline method tooltip · ⓘ next to page subtitles */
.method-info { display: inline-flex; align-items: center; gap: 3px; margin-left: 10px; font-size: 11.5px; color: var(--text-muted); cursor: help; border-bottom: 1px dashed var(--text-faint); padding-bottom: 1px; transition: color 120ms, border-color 120ms; }
.method-info:hover, .method-info:focus { color: var(--text); border-bottom-color: var(--text-muted); outline: none; }
.method-info { position: relative; cursor: pointer; }
/* Icon-only variant — mirrors .kpi-info-btn styling so chart-title tooltips match KPI tooltips */
.method-info.is-icon { width: 18px; height: 18px; padding: 0; margin-left: 6px; border: none; border-bottom: none; background: transparent; color: var(--text-faint); opacity: 0.6; transition: opacity 100ms, color 100ms, background 100ms, box-shadow 100ms; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; vertical-align: -3px; }
.method-info.is-icon:hover, .method-info.is-icon.is-open { opacity: 1; color: var(--moss-700); background: var(--moss-100); box-shadow: 0 0 0 3px rgba(67, 95, 54, 0.14); border-bottom: none; }
[data-theme="dark"] .method-info.is-icon:hover, [data-theme="dark"] .method-info.is-icon.is-open { background: rgba(75,100,94,0.18); color: var(--moss-300); box-shadow: 0 0 0 3px rgba(180, 206, 167, 0.10); }
.method-pop { display: none; position: absolute; top: 100%; left: 0; margin-top: 10px; padding: 14px 16px 16px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 8px; box-shadow: 0 12px 32px rgba(0,0,0,0.12), 0 2px 6px rgba(0,0,0,0.05); width: 480px; max-width: 92vw; font-size: 12px; color: var(--text-muted); line-height: 1.6; letter-spacing: 0; text-align: left; white-space: normal; z-index: 60; }
.method-pop > strong { color: var(--text); font-size: 11.5px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; display: block; margin-bottom: 8px; }
.method-info.is-open .method-pop { display: block; }
.method-info.is-open { color: var(--text); border-bottom-color: var(--text); }
/* Hover-driven popup for the icon variant — matches KPI tooltip behavior */
.method-info.is-icon:hover .method-pop, .method-info.is-icon:focus .method-pop { display: block; }
.method-info.is-icon .method-pop { width: auto; min-width: 240px; max-width: 340px; padding: 10px 14px; font-size: 11.5px; line-height: 1.5; color: var(--text-muted); background: var(--surface); border: 1px solid var(--border); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.12), 0 2px 6px rgba(0,0,0,0.05); margin-top: 10px; left: 0; transform: none; text-align: left; white-space: normal; z-index: 9999; }
.method-info.is-icon .method-pop > strong { display: block; color: var(--text); font-size: 11.5px; font-weight: 600; letter-spacing: 0; text-transform: none; margin-bottom: 4px; }
.method-info.is-icon .method-pop::before { content: ''; position: absolute; top: -5px; left: 16px; transform: rotate(45deg); width: 8px; height: 8px; background: var(--surface); border-left: 1px solid var(--border); border-top: 1px solid var(--border); }

/* Proficiency ROI rows · ROI page */
.prof-roi-row { display: grid; grid-template-columns: 90px 1fr 140px; align-items: center; gap: 10px; font-size: 12.5px; }
.prof-roi-label { color: var(--text); font-weight: 500; }
.prof-roi-track { background: var(--surface-2); height: 22px; border-radius: 4px; overflow: hidden; position: relative; }
.prof-roi-fill { display: flex; align-items: center; justify-content: flex-end; height: 100%; padding-right: 8px; color: white; font-size: 11.5px; font-weight: 600; font-family: var(--font-mono); transition: width 240ms; min-width: 36px; }
.prof-roi-count { color: var(--text-muted); font-size: 11px; text-align: right; }

/* ───────── Proficiency wedge widget · Adoption page ───────── */
.prof-wedge { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: 18px 20px; display: block; }
.prof-wedge-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.prof-filter-label { font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.prof-wedge-scopemeta { font-family: var(--font-mono); font-size: 11px; color: var(--text-faint); margin-left: 4px; }
.prof-wedge-select { padding: 5px 10px; border: 1px solid var(--border); border-radius: 5px; background: var(--surface); color: var(--text); font-family: var(--font-sans); font-size: 12.5px; cursor: pointer; }
.prof-wedge-select:focus { outline: 2px solid var(--moss-300); outline-offset: -1px; border-color: var(--moss-500); }
.prof-wedge-stack { display: flex; flex-direction: column; gap: 6px; }
.prof-wedge-cap { display: flex; align-items: baseline; justify-content: space-between; font-size: 10.5px; color: var(--text-faint); font-family: var(--font-mono); letter-spacing: 0.04em; text-transform: uppercase; }
.prof-wedge-cap .cap-axis { color: var(--text); font-weight: 500; letter-spacing: 0.04em; }
.prof-wedge-cap .cap-total { color: var(--text-muted); font-family: var(--font-mono); text-transform: none; letter-spacing: 0; }
.prof-wedge-bar { display: flex; height: 38px; border-radius: 4px; overflow: hidden; border: 1px solid var(--border); background: var(--surface-2); }
.prof-wedge-seg { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; padding: 0 10px; color: white; font-size: 11.5px; line-height: 1.15; min-width: 0; overflow: hidden; white-space: nowrap; }
.prof-wedge-seg .pw-name { font-weight: 500; letter-spacing: 0.01em; opacity: 0.96; text-overflow: ellipsis; overflow: hidden; max-width: 100%; }
.prof-wedge-seg .pw-val { font-family: var(--font-mono); font-size: 12.5px; font-weight: 600; letter-spacing: -0.01em; margin-top: 2px; }
.prof-wedge-seg.tier-dormant     { background: var(--ink-200); color: var(--ink-700); }
.prof-wedge-seg.tier-beginner    { background: var(--ink-400); color: white; }
.prof-wedge-seg.tier-intermediate { background: var(--moss-300); color: var(--ink-900); }
.prof-wedge-seg.tier-advanced    { background: var(--moss-500); }
.prof-wedge-seg.tier-power       { background: var(--moss-700); }
.prof-wedge-bar.roi { background: var(--surface); }
.prof-wedge-bar.roi .prof-wedge-seg { color: var(--text); padding-left: 12px; align-items: flex-start; background: transparent; border-right: 1px solid var(--border); }
.prof-wedge-bar.roi .prof-wedge-seg:last-child { border-right: none; }
.prof-wedge-bar.roi .prof-wedge-seg .pw-name { font-size: 10.5px; color: var(--text-faint); font-family: var(--font-mono); letter-spacing: 0.04em; text-transform: uppercase; font-weight: 500; }
.prof-wedge-bar.roi .prof-wedge-seg .pw-val { font-size: 18px; color: var(--text); letter-spacing: -0.02em; margin-top: 3px; }
.prof-wedge-bar.roi .prof-wedge-seg .pw-val .x { font-size: 12px; color: var(--text-muted); margin-left: 1px; }
.prof-wedge-gap { padding: 8px 12px; border-radius: 4px; background: linear-gradient(135deg, var(--moss-50) 0%, transparent 100%); border: 1px dashed var(--moss-300); color: var(--text-muted); font-size: 12px; line-height: 1.55; margin-top: 4px; }
[data-theme="dark"] .prof-wedge-gap { background: linear-gradient(135deg, var(--moss-900) 0%, transparent 100%); border-color: var(--moss-700); }
.prof-wedge-gap strong { color: var(--text); font-weight: 600; }
.prof-wedge-cta { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; }
.prof-wedge-cta .pw-cta-label { font-size: 10.5px; color: var(--text-faint); font-family: var(--font-mono); letter-spacing: 0.04em; text-transform: uppercase; }
.prof-wedge-cta .pw-cta-num { font-family: var(--font-mono); font-size: 28px; font-weight: 500; color: var(--moss-700); letter-spacing: -0.02em; line-height: 1; }
[data-theme="dark"] .prof-wedge-cta .pw-cta-num { color: var(--moss-300); }
.prof-wedge-cta .pw-cta-sub { font-size: 11.5px; color: var(--text-muted); line-height: 1.5; }
.prof-wedge-cta .pw-cta-actions { display: flex; gap: 6px; margin-top: 4px; }
.prof-wedge-cta .pw-cta-actions .btn { flex: 1; justify-content: center; font-size: 11.5px; padding: 6px 10px; }
@media (max-width: 1100px) { .prof-wedge { grid-template-columns: 1fr; } }

/* Workflow intent unit-economics grid · ROI page */
#page-roi .intent-grid { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; }
#page-roi .intent-grid-3 { grid-template-columns: 1fr 1fr 1fr; }
#page-roi .intent-grid-3 #page-roi .intent-cell { border-bottom: 1px solid var(--border); }
#page-roi .intent-grid-3 #page-roi .intent-cell:nth-last-child(-n+3) { border-bottom: none; }
#page-roi .intent-grid-3 #page-roi .intent-cell:nth-child(3n) { border-right: none; }
#page-roi .intent-cell { padding: 18px 20px; border-right: 1px solid var(--border); }
#page-roi .intent-cell:last-child { border-right: none; }
#page-roi .intent-name { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 500; margin-bottom: 10px; }
#page-roi .intent-rate { display: flex; align-items: baseline; gap: 5px; margin-bottom: 8px; }
#page-roi .rate-value { font-family: var(--font-mono); font-size: 26px; font-weight: 600; color: var(--text); line-height: 1; }
#page-roi .rate-unit { font-size: 13px; color: var(--text-muted); }
#page-roi .intent-output { font-size: 12.5px; color: var(--text); margin-bottom: 4px; }
#page-roi .intent-spend { font-size: 11px; color: var(--text-faint); line-height: 1.45; }
#page-roi .intent-lift { margin-top: 9px; padding-top: 8px; border-top: 1px dashed var(--border); font-family: var(--font-mono); font-size: 11px; color: var(--moss-700); line-height: 1.4; }
#page-roi .intent-lift b { font-weight: 600; }
#page-roi .intent-lift .lift-sub { display: block; color: var(--text-faint); font-family: var(--font-body); font-size: 10.5px; margin-top: 2px; }
[data-theme="dark"] #page-roi .intent-lift { color: var(--moss-300); }

/* Team selector tabs · above counterfactual chart */
.team-tab { background: transparent; border: none; padding: 10px 14px; font-size: 12.5px; color: var(--text-muted); cursor: pointer; border-bottom: 2px solid transparent; transition: color 120ms, border-color 120ms; font-family: inherit; margin-bottom: -1px; }
.team-tab:hover { color: var(--text); }
.team-tab.active { color: var(--moss-700); border-bottom-color: var(--moss-700); font-weight: 500; }

/* Substitutability pills · Renewal performance table */
.sub-type { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 500; letter-spacing: 0.02em; }
.sub-type.sub-comp { background: rgba(71, 100, 94, 0.12); color: var(--moss-700); }
.sub-type.sub-sub { background: rgba(196, 103, 67, 0.12); color: #a04c2a; }
.sub-type.sub-stand { background: var(--surface-2); color: var(--text-muted); }
.sub-detail { font-size: 11px; color: var(--text-faint); margin-top: 3px; line-height: 1.3; }
.status-pill.status-warn { background: var(--warning-bg); color: var(--warning); }

/* ───────── Adoption page · view toggle (Per org / Per tool / Per user) ───────── */
.adoption-view-row { display: flex; align-items: center; gap: 12px; padding: 0 0 12px; }
.adoption-view-row .meta { font-size: 12px; color: var(--text-muted); }
.adoption-view-row .meta.dim { color: var(--text-faint); margin-left: 8px; }
.adoption-view { display: none; }
#page-adoption[data-view="team"] .adoption-view.show-in-team,
#page-adoption[data-view="tool"] .adoption-view.show-in-tool,
#page-adoption[data-view="user"] .adoption-view.show-in-user { display: block; }


/* ───────── Cost page · spend breakdown slicer ───────── */
.spend-view { display: none; }
#page-cost[data-spend-view="team"]   .spend-view.show-in-team,
#page-cost[data-spend-view="tool"]   .spend-view.show-in-tool,
#page-cost[data-spend-view="intent"] .spend-view.show-in-intent,
#page-cost[data-spend-view="user"]   .spend-view.show-in-user { display: block; }
.spend-bento .intent-cell .spend-amt { font-family: var(--font-mono); font-weight: 500; letter-spacing: -0.02em; line-height: 1; font-size: 22px; }
.spend-bento .intent-cell.intent-xl .spend-amt { font-size: 56px; letter-spacing: -0.03em; }
.spend-bento .intent-cell.intent-lg .spend-amt { font-size: 32px; }
.spend-bento .intent-cell.intent-md .spend-amt { font-size: 26px; }
.spend-bento .intent-cell.intent-sm .spend-amt { font-size: 18px; }
.spend-bento .intent-cell .spend-pct { font-size: 11px; opacity: 0.78; font-family: var(--font-mono); }
/* Side-by-side: current spend bento + budget-vs-spend bento. */
.spend-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: stretch; }
.spend-pair > .card { display: flex; flex-direction: column; }
.spend-pair > .card > .card-body { flex: 1; }
/* Drill: filter the By-tool treemap + By-user table to a team, with a chip (sankey-style) */
.spend-toolbar-row { display: flex; align-items: center; gap: 12px; }
.spend-toolbar-row .sankey-chip-row { margin-left: auto; }
/* Drillable team cells in the Current-spend bento */
.spend-bento .intent-cell { cursor: pointer; transition: filter 120ms, box-shadow 120ms, transform 120ms; position: relative; }
.spend-bento .intent-cell:hover { filter: brightness(1.06); box-shadow: 0 0 0 2px var(--moss-500) inset; }
.spend-bento .intent-cell::after { content: '⤢ drill'; position: absolute; top: 8px; right: 10px; font-size: 9px; font-family: var(--font-mono); letter-spacing: 0.04em; color: rgba(255,255,255,0.66); opacity: 0; transition: opacity 120ms; }
.spend-bento .intent-cell.intent-sm::after { color: var(--text-faint); }
.spend-bento .intent-cell:hover::after { opacity: 1; }
/* Treemap tiles become clickable when a team filter is active */
#page-cost.spend-team-filtered .spend-view.show-in-tool .tm-tile { cursor: pointer; }
#page-cost.spend-team-filtered .spend-view.show-in-tool #spendTreemapByTool .tm-tile:hover { outline: 2px solid rgba(255,255,255,0.55); outline-offset: -2px; }
@media (max-width: 1100px) { .spend-pair { grid-template-columns: 1fr; } }


/* Squarified treemap tiles (native, no charts lib). */
#spendTreemapByTool, #budgetTreemapByTool { position: relative; overflow: hidden; }
.tm-tile {
  position: absolute;
  border-radius: 6px;
  color: #fff;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 2px;
  overflow: hidden;
  cursor: default;
  transition: filter 120ms;
  font-family: var(--font-sans);
}
.tm-tile.is-tiny { padding: 4px 6px; justify-content: center; align-items: center; gap: 0; }
.tm-tile.is-tiny .tm-val-sm { font-size: 10px; opacity: 0.95; }
.tm-tile:hover { filter: brightness(1.08); }
/* Floating custom tooltip for treemap tiles */
.tm-tooltip {
  position: fixed;
  z-index: 1000;
  pointer-events: none;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 8px 11px;
  font-size: 12px;
  line-height: 1.5;
  box-shadow: 0 6px 20px rgba(0,0,0,0.18);
  max-width: 280px;
  white-space: normal;
  opacity: 0;
  transition: opacity 100ms;
  font-family: var(--font-sans);
}
.tm-tooltip.show { opacity: 1; }
.tm-tooltip strong { color: var(--text); font-weight: 500; }
.tm-tooltip .tm-tip-meta { color: var(--text-muted); font-size: 11px; margin-top: 4px; }
.tm-tooltip .tm-tip-shadow-tag { color: #B5564A; font-size: 10px; font-family: var(--font-mono); letter-spacing: 0.02em; margin-left: 4px; }
.tm-tile .tm-name { font-size: 13px; font-weight: 500; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tm-tile .tm-val  { font-family: var(--font-mono); font-size: 12px; font-weight: 500; letter-spacing: -0.02em; opacity: 0.86; }
.tm-tile .tm-name-sm { font-size: 11px; font-weight: 500; line-height: 1.1; }
.tm-tile .tm-val-sm  { font-size: 10.5px; }

/* Fixed vs variable split strip above the By Tool treemaps */
.cost-split-strip { display: flex; align-items: stretch; gap: 0; height: 38px; border-radius: 6px; overflow: hidden; margin-bottom: 14px; border: 1px solid var(--border); background: var(--surface); font-size: 12px; }
.cost-split-strip .seg { display: flex; align-items: center; padding: 0 14px; gap: 8px; white-space: nowrap; color: white; }
.cost-split-strip .seg.fx  { background: var(--moss-600); }
.cost-split-strip .seg.var { background: var(--warm-ochre); color: var(--ink-900); }
.cost-split-strip .seg .label { font-weight: 500; letter-spacing: 0.02em; }
.cost-split-strip .seg .amt   { font-family: var(--font-mono); font-weight: 600; letter-spacing: -0.01em; }
.cost-split-strip .seg .pct   { font-family: var(--font-mono); font-size: 11px; opacity: 0.78; }

/* Budget bento — size = budget share, color = (spend − budget) / budget.
   Five-tier diverging scale: moss-deep (under) → moss-mid → neutral → warm-ochre → rust-red (over). */
.budget-bento .intent-cell                  { color: #fff; }
.budget-bento .intent-cell.budget-under-2   { background: var(--moss-700); }   /* >10% under */
.budget-bento .intent-cell.budget-under-1   { background: var(--moss-500); }   /* 3–10% under */
.budget-bento .intent-cell.budget-on-track  { background: #9CA886; color: #1B1B1B; }   /* ±3% */
.budget-bento .intent-cell.budget-over-1    { background: var(--warm-ochre); color: #1B1B1B; }   /* 3–10% over */
.budget-bento .intent-cell.budget-over-2    { background: var(--rust-red); }   /* >10% over */
.budget-bento .intent-cell .budget-dev      { font-family: var(--font-mono); font-weight: 500; letter-spacing: -0.02em; line-height: 1; font-size: 22px; }
.budget-bento .intent-cell.intent-xl .budget-dev { font-size: 56px; letter-spacing: -0.03em; }
.budget-bento .intent-cell.intent-lg .budget-dev { font-size: 32px; }
.budget-bento .intent-cell.intent-md .budget-dev { font-size: 26px; }
.budget-bento .intent-cell.intent-sm .budget-dev { font-size: 18px; }
.budget-bento .intent-cell .budget-meta { font-size: 11px; opacity: 0.78; font-family: var(--font-mono); }

/* ───────── License utilization funnel ───────── */
.util-funnel { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.util-funnel-header { display: grid; grid-template-columns: 220px repeat(5, 1fr); background: var(--surface-2); border-bottom: 1px solid var(--border); }
.util-funnel-header > div { padding: 10px 14px; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); font-family: var(--font-mono); font-weight: 500; border-right: 1px solid var(--border); }
.util-funnel-header > div:last-child { border-right: none; }
.util-funnel-header .stage-hint { font-size: 9.5px; color: var(--text-faint); display: block; margin-top: 2px; text-transform: none; letter-spacing: 0; font-family: var(--font-body); font-weight: 400; }
.util-funnel-row { display: grid; grid-template-columns: 220px repeat(5, 1fr); border-bottom: 1px solid var(--border); transition: background 100ms; }
.util-funnel-row:last-child { border-bottom: none; }
.util-funnel-row:hover { background: var(--surface-2); }
.util-funnel-row.bad { background: linear-gradient(to right, rgba(196, 103, 67, 0.04), transparent 60%); }
.util-funnel-row > div { padding: 14px; border-right: 1px solid var(--border); position: relative; }
.util-funnel-row > div:last-child { border-right: none; }
.util-funnel-label { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 500; color: var(--text); }
.util-funnel-label .cat-logo { width: 22px; height: 22px; border-radius: 4px; display: flex; align-items: center; justify-content: center; font-size: 9px; color: white; font-weight: 600; flex-shrink: 0; }
.util-funnel-label .util-sub { font-size: 10.5px; color: var(--text-faint); font-family: var(--font-mono); margin-top: 2px; display: block; font-weight: 400; }
.util-funnel-stage { display: flex; flex-direction: column; gap: 4px; position: relative; }
/* In-column proficiency mini bar chart (replaces the Power User column) */
.util-prof-mini { display: flex; align-items: flex-end; gap: 3px; height: 38px; padding: 2px 2px 0; }
.util-prof-mini .upm-bar { flex: 1; min-width: 4px; min-height: 2px; border-radius: 2px 2px 0 0; }
.util-prof-foot { font-family: var(--font-mono); font-size: 9.5px; color: var(--text-faint); margin-top: 2px; }
.util-prof-foot b { color: var(--moss-700); font-weight: 600; }
[data-theme="dark"] .util-prof-foot b { color: var(--moss-300); }
.util-funnel-bar { position: absolute; left: 0; top: 0; bottom: 0; background: var(--moss-100); opacity: 0.45; pointer-events: none; transition: width 240ms ease; }
.util-funnel-row.bad .util-funnel-bar { background: rgba(196, 103, 67, 0.2); }
.util-funnel-row > div > * { position: relative; z-index: 1; }
.util-funnel-num { font-family: var(--font-mono); font-size: 15px; font-weight: 500; color: var(--text); letter-spacing: -0.01em; }
.util-funnel-pct { font-size: 11px; color: var(--text-muted); margin-left: 5px; font-family: var(--font-mono); }
.util-funnel-drop { font-size: 10.5px; color: var(--text-faint); font-family: var(--font-mono); }
.util-funnel-drop.bad { color: var(--negative); }
.util-funnel-drop.good { color: var(--moss-700); }
.util-funnel-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.util-funnel-toolbar .seg { display: flex; gap: 0; }
.util-funnel-scopewrap { display: flex; align-items: center; gap: 8px; }
.util-funnel-toolbar .seg-btn { padding: 5px 12px; background: transparent; border: 1px solid var(--border); border-right: none; font-size: 11.5px; cursor: pointer; color: var(--text-muted); font-family: inherit; }
.util-funnel-toolbar .seg-btn:first-child { border-radius: 4px 0 0 4px; }
.util-funnel-toolbar .seg-btn:last-child { border-right: 1px solid var(--border); border-radius: 0 4px 4px 0; }
.util-funnel-toolbar .seg-btn.active { background: var(--ink-900); color: white; border-color: var(--ink-900); }
[data-theme="dark"] .util-funnel-toolbar .seg-btn.active { background: var(--moss-300); color: var(--ink-900); border-color: var(--moss-300); }
.util-funnel-toolbar .legend { display: flex; align-items: center; gap: 12px; font-size: 11px; color: var(--text-muted); }
.util-funnel-totals { display: grid; grid-template-columns: 220px repeat(5, 1fr); background: var(--surface-2); border-top: 1px solid var(--border); font-family: var(--font-mono); font-weight: 600; }
.util-funnel-totals > div { padding: 10px 14px; font-size: 12px; color: var(--text); border-right: 1px solid var(--border); }
.util-funnel-totals > div:last-child { border-right: none; }
.util-funnel-totals .label { font-weight: 500; text-transform: uppercase; letter-spacing: 0.06em; font-size: 10.5px; color: var(--text-muted); }

.ctrl-tabs { display: flex; gap: 2px; margin: 18px 0 14px; padding: 3px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 9px; width: fit-content; }
.ctrl-tab { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; background: transparent; border: none; border-radius: 6px; font-size: 12.5px; font-weight: 500; color: var(--text-muted); cursor: pointer; transition: all 120ms; font-family: inherit; }
.ctrl-tab:hover { color: var(--text); background: var(--surface); }
.ctrl-tab.active { background: var(--surface); color: var(--moss-700); box-shadow: 0 1px 3px rgba(0,0,0,0.06); font-weight: 600; }
[data-theme="dark"] .ctrl-tab.active { color: var(--moss-300); }
.inspector-row { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap; transition: background 100ms; }
.inspector-row:last-child { border-bottom: none; }
.inspector-row:hover { background: var(--surface-2); }
.inspector-prompt { display: inline-block; flex: 1; min-width: 200px; padding: 6px 10px; background: var(--surface-2); border-radius: 4px; font-family: var(--font-mono); font-size: 12px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.redact-pill { display: inline-block; padding: 1px 6px; background: var(--warning); color: white; border-radius: 3px; font-size: 10.5px; font-weight: 600; margin: 0 2px; }
[data-theme="dark"] .inspector-prompt { background: var(--ink-800); }

/* MoM coloring on the by-tool table */
.mom-up   { color: var(--negative); font-weight: 600; }
.mom-down { color: var(--moss-600); font-weight: 600; }
.mom-flat { color: var(--text-faint); }
.mom-new  { color: var(--moss-700); font-weight: 600; }

/* Multi-select floating panel */
.ms-panel { position: absolute; z-index: 100; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md, 6px); box-shadow: 0 8px 24px rgba(0,0,0,0.12), 0 2px 6px rgba(0,0,0,0.06); padding: 6px; min-width: 240px; max-width: 360px; max-height: min(640px, calc(100vh - 120px)); display: flex; flex-direction: column; }
.ms-panel-actions { display: flex; gap: 4px; padding: 4px 4px 6px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.ms-panel-actions button { flex: 1; padding: 5px 10px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px; cursor: pointer; font-size: 11.5px; color: var(--text-muted); transition: background 100ms; }
.ms-panel-actions button:hover { background: var(--moss-100); color: var(--moss-700); }
.ms-panel-list { overflow-y: auto; flex: 1; padding: 2px; }
.ms-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 4px; cursor: pointer; font-size: 12.5px; user-select: none; transition: background 100ms; }
.ms-item:hover { background: var(--surface-2); }
.ms-item input[type=checkbox] { margin: 0; cursor: pointer; accent-color: var(--moss-700); }
[data-theme="dark"] .ms-panel-actions button:hover { background: rgba(75, 100, 94, 0.18); color: var(--moss-300); }

/* Vendor concentration bars */
.vendor-bar-row { display: grid; grid-template-columns: 240px 1fr 200px; align-items: center; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.vendor-bar-row:last-child { border-bottom: none; }
.vendor-bar-name { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 13.5px; }
.vendor-swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.vendor-bar-track { height: 14px; background: var(--ink-200); border-radius: 7px; overflow: hidden; }
.vendor-bar-fill { display: block; height: 100%; border-radius: 7px; transition: width 300ms; }
.vendor-bar-value { display: flex; align-items: baseline; gap: 8px; font-size: 13px; }
[data-theme="dark"] .vendor-bar-track { background: var(--ink-700); }
.card-header h3 { font-size: 13px; font-weight: 700; letter-spacing: 0.01em; }
.card-header .meta { font-size: 11.5px; color: var(--text-faint); font-family: var(--font-mono); }
.card-body { padding: 12px; }
.card-body.flush { padding: 0; }

#assumptionsModal .gk-modal-body table.data-table th { font-size: 10.5px; font-family: var(--font-mono); letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-faint); font-weight: 500; padding: 8px 12px; border-bottom: 1px solid var(--border); text-align: left; background: var(--surface-2); }
#assumptionsModal .gk-modal-body table.data-table th.num { text-align: right; }
#assumptionsModal .gk-modal-body table.data-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); font-size: 13px; }
#assumptionsModal .gk-modal-body table.data-table td.num { text-align: right; }
#assumptionsModal .gk-modal-body table.data-table tbody tr:last-child td { border-bottom: none; }
#assumptionsModal .assume-input { width: 90px; padding: 5px 8px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); color: var(--text); font-family: var(--font-mono); font-size: 12.5px; text-align: right; }
#assumptionsModal .assume-input:focus { outline: 2px solid var(--moss-300); outline-offset: -1px; border-color: var(--moss-500); }
#ctrlPoliciesBody tr { cursor: pointer; }
#ctrlPoliciesBody tr:hover { background: var(--surface-2) !important; }
.pv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; margin-bottom: 16px; }
.pv-cell { display: flex; flex-direction: column; gap: 3px; }
.pv-k { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); font-family: var(--font-mono); }
.pv-v { font-size: 14px; color: var(--text); font-weight: 500; }
.pv-section { padding-top: 12px; border-top: 1px solid var(--border); margin-top: 4px; }
.pol-field { margin-bottom: 16px; }
.pol-row { display: flex; gap: 16px; align-items: flex-start; }
.pol-row .pol-field { flex: 1; }
.pol-label { display: block; font-size: 10.5px; font-family: var(--font-mono); letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-faint); font-weight: 500; margin-bottom: 7px; }
.pol-input { width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); font-family: var(--font-sans); font-size: 13.5px; }
.pol-input:focus { outline: 2px solid var(--moss-300); outline-offset: -1px; border-color: var(--moss-500); }
select.pol-input { cursor: pointer; }
.pol-action-seg { width: 100%; }
.pol-action-seg button { flex: 1; }
.pol-scope { display: flex; flex-wrap: wrap; gap: 6px; }
.pol-chip { padding: 6px 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 16px; font-size: 12px; color: var(--text-muted); cursor: pointer; transition: all 100ms; }
.pol-chip:hover { border-color: var(--text-muted); color: var(--text); }
.pol-chip.active { background: var(--moss-700); color: white; border-color: var(--moss-700); }
[data-theme="dark"] .pol-chip.active { background: var(--moss-300); color: var(--ink-900); border-color: var(--moss-300); }
.pol-toggle { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.pol-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.pol-toggle-track { width: 38px; height: 22px; background: var(--border-strong); border-radius: 11px; position: relative; transition: background 140ms; flex-shrink: 0; }
.pol-toggle-thumb { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; background: white; border-radius: 50%; transition: transform 140ms; box-shadow: 0 1px 3px rgba(0,0,0,0.2); }
.pol-toggle input:checked + .pol-toggle-track { background: var(--moss-600); }
.pol-toggle input:checked + .pol-toggle-track .pol-toggle-thumb { transform: translateX(16px); }
.pol-toggle-text { font-size: 13px; color: var(--text); }
