/* ==========================================================================
   Project Jarvis - TEEMA Direct command centre
   Design system: dark-luxury mission-control. Navy spine, orange brand CTA,
   teal Jarvis/AI accent. Fonts: Spectral (display) / Poppins (UI) / JetBrains Mono (HUD).
   ========================================================================== */

:root {
  --navy-900: #0F1626;
  --navy-850: #15203B;
  --navy-800: #1E2A4A;
  --navy-700: #29375C;
  --navy-600: #3A4A75;
  --blue-400: #576DB4;
  --orange:   #FF6900;
  --orange-br:#FF6600;
  --orange2:  #FF6600;
  --teal:     #1FA9A0;
  --teal-br:  #3FD0C6;
  --green:    #1FA97A;
  --gold:     #F5B335;
  --coral:    #FF6B5E;
  --danger:   #E5484D;
  --paper:    #F7F7F9;
  --mist:     #C4CEE6;
  --muted:    #9AA6C7;
  --line:     #2A3556;

  --font-display: 'Spectral', Georgia, 'Times New Roman', serif;
  --font-ui: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --rail-w: 250px;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-card: 0 18px 40px -24px rgba(0,0,0,.7), 0 2px 0 0 rgba(255,255,255,.02) inset;
  --shadow-teal: 0 0 0 1px rgba(31,169,160,.25), 0 14px 40px -16px rgba(31,169,160,.35);
  --maxw: 1180px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-ui);
  color: var(--paper);
  background:
    radial-gradient(1200px 700px at 78% -10%, rgba(31,169,160,.14), transparent 60%),
    radial-gradient(900px 600px at 10% 110%, rgba(58,74,117,.4), transparent 55%),
    radial-gradient(700px 500px at 95% 100%, rgba(255,105,0,.06), transparent 60%),
    linear-gradient(180deg, var(--navy-850), var(--navy-900));
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.6;
}
/* subtle grain */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

h1,h2,h3,h4 { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em; margin: 0; line-height: 1.12; }
p { margin: 0 0 .7em; }
a { color: var(--teal-br); text-decoration: none; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.eyebrow { font-family: var(--font-mono); font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--teal-br); }
.muted { color: var(--muted); }
.mist { color: var(--mist); }
.center { text-align: center; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--navy-700); border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------------------------------------------------------- App shell */
.app { position: relative; z-index: 1; display: grid; grid-template-columns: var(--rail-w) 1fr; min-height: 100vh; }

.rail {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  background: linear-gradient(180deg, rgba(15,22,38,.7), rgba(15,22,38,.92));
  border-right: 1px solid var(--line); backdrop-filter: blur(8px); padding: 22px 16px;
}
.rail-brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 18px; }
.rail-nav { display: flex; flex-direction: column; gap: 3px; margin-top: 6px; overflow-y: auto; }
.nav-group-label { font-family: var(--font-mono); font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); padding: 14px 12px 6px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm);
  color: var(--mist); cursor: pointer; border: 1px solid transparent; transition: background .18s ease, color .18s ease, border-color .18s ease;
  font-size: 14px; font-weight: 500; width: 100%; text-align: left; background: none; font-family: var(--font-ui);
}
.nav-item:hover { background: rgba(87,109,180,.12); color: var(--paper); }
.nav-item:focus-visible { outline: 2px solid var(--teal-br); outline-offset: 2px; }
.nav-item.active { background: linear-gradient(90deg, rgba(31,169,160,.18), rgba(31,169,160,.04)); color: #fff; border-color: rgba(31,169,160,.4); }
.nav-item.active .nav-ic { color: var(--teal-br); }
.nav-ic { width: 18px; height: 18px; flex: 0 0 18px; color: var(--muted); }
.nav-item .vtag { margin-left: auto; font-family: var(--font-mono); font-size: 9px; letter-spacing: .1em; padding: 2px 6px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.rail-foot { margin-top: auto; padding: 12px 8px 2px; border-top: 1px solid var(--line); }
.rail-foot .who { display: flex; align-items: center; gap: 10px; }
.avatar-chip { width: 34px; height: 34px; border-radius: 10px; background: linear-gradient(135deg, var(--teal), var(--navy-600)); display: grid; place-items: center; font-family: var(--font-mono); font-weight: 600; font-size: 13px; color: #fff; }

/* logo burst */
.burst { position: relative; width: 30px; height: 30px; flex: 0 0 30px; }
.burst .blade { position: absolute; left: 50%; top: 50%; width: 3.2px; height: 13px; border-radius: 3px; background: var(--blue-400); transform-origin: 50% 100%; }
.wordmark { display: flex; flex-direction: column; line-height: 1; }
.wordmark .tm { font-family: var(--font-ui); font-weight: 700; letter-spacing: .06em; font-size: 16px; color: var(--paper); }
.wordmark .sub { font-family: var(--font-ui); font-weight: 600; letter-spacing: .26em; font-size: 8.5px; color: var(--orange); margin-top: 3px; }
.jarvis-word { font-family: var(--font-display); }

/* ---------------------------------------------------------------- Main */
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px;
  padding: 16px 28px; border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(21,32,59,.86), rgba(21,32,59,.6)); backdrop-filter: blur(10px);
}
.topbar .crumb { display: flex; flex-direction: column; }
.topbar .crumb .t { font-family: var(--font-display); font-size: 19px; font-weight: 700; }
.topbar .crumb .s { font-size: 12px; color: var(--muted); }
.topbar .spacer { flex: 1; }
.view { padding: 28px; max-width: var(--maxw); width: 100%; margin: 0 auto; }
.view-wide { max-width: 1320px; }

/* ---------------------------------------------------------------- Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 10px; cursor: pointer;
  font-family: var(--font-ui); font-weight: 600; font-size: 13.5px; border: 1px solid transparent; transition: transform .12s ease, background .18s ease, box-shadow .18s ease, border-color .18s ease; color: #fff;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--teal-br); outline-offset: 2px; }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: linear-gradient(135deg, var(--orange), var(--orange-br)); box-shadow: 0 10px 26px -12px rgba(255,105,0,.7); }
.btn-primary:hover { box-shadow: 0 14px 30px -10px rgba(255,105,0,.85); }
.btn-teal { background: linear-gradient(135deg, var(--teal), #16857d); box-shadow: 0 10px 26px -14px rgba(31,169,160,.8); }
.btn-teal:hover { box-shadow: var(--shadow-teal); }
.btn-ghost { background: rgba(87,109,180,.1); border-color: var(--line); color: var(--mist); }
.btn-ghost:hover { background: rgba(87,109,180,.2); color: #fff; }
.btn-sm { padding: 7px 12px; font-size: 12.5px; }
.btn-icon { padding: 9px; border-radius: 10px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 999px; cursor: pointer;
  background: rgba(87,109,180,.12); border: 1px solid var(--line); color: var(--mist); font-size: 12.5px; font-weight: 500;
  transition: background .16s ease, border-color .16s ease, color .16s ease; font-family: var(--font-ui);
}
.chip:hover { background: rgba(31,169,160,.16); border-color: rgba(31,169,160,.45); color: #fff; }
.chip:focus-visible { outline: 2px solid var(--teal-br); outline-offset: 2px; }

/* ---------------------------------------------------------------- Cards / panels */
.panel {
  position: relative; background: linear-gradient(180deg, rgba(41,55,92,.5), rgba(30,42,74,.55));
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-card);
}
.panel.pad { padding: 22px; }
.panel-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.panel-head h3 { font-size: 16px; }
.panel-head .eyebrow { margin-bottom: 2px; }
.corner-tick::before, .corner-tick::after { content: ""; position: absolute; width: 12px; height: 12px; border-color: var(--teal); opacity: .5; }
.corner-tick::before { top: 10px; left: 10px; border-left: 2px solid; border-top: 2px solid; }
.corner-tick::after { bottom: 10px; right: 10px; border-right: 2px solid; border-bottom: 2px solid; }

.tag {
  display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-mono); font-size: 10px; letter-spacing: .12em;
  text-transform: uppercase; padding: 3px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted);
}
.tag-ai { color: var(--teal-br); border-color: rgba(31,169,160,.4); background: rgba(31,169,160,.08); }
.tag-live { color: var(--orange); border-color: rgba(255,105,0,.4); background: rgba(255,105,0,.08); }
.tag-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.status-pill { display: inline-flex; align-items: center; gap: 6px; font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; letter-spacing: .08em; padding: 4px 10px; border-radius: 999px; }
.st-exceeding { color: #04241a; background: var(--green); }
.st-on-track  { color: #04231f; background: var(--teal); }
.st-at-risk   { color: #3a2700; background: var(--gold); }
.st-critical  { color: #fff; background: var(--danger); }

/* ---------------------------------------------------------------- Jarvis orb */
.orb-wrap { position: relative; display: grid; place-items: center; }
.orb { position: relative; width: 168px; height: 168px; display: grid; place-items: center; margin: 0 auto; }
.btn.speak-on { background: linear-gradient(135deg, var(--coral), #cf4338); color: #fff; border-color: transparent; }
.orb .ring { position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid rgba(31,169,160,.35); }
.orb .ring.r2 { inset: 16px; border-color: rgba(63,208,198,.3); }
.orb .ring.r3 { inset: 34px; border-color: rgba(31,169,160,.5); }
.orb .core {
  width: 96px; height: 96px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--teal-br), var(--teal) 45%, #11605a 100%);
  display: grid; place-items: center; box-shadow: 0 0 40px -4px rgba(31,169,160,.6), inset 0 0 30px rgba(0,0,0,.25);
}
.orb .core .j { font-family: var(--font-display); font-weight: 700; font-size: 46px; color: #eafffb; text-shadow: 0 2px 12px rgba(0,0,0,.35); }
.orb .halo { position: absolute; inset: -16px; border-radius: 50%; background: radial-gradient(circle, rgba(31,169,160,.22), transparent 65%); }

@media (prefers-reduced-motion: no-preference) {
  .orb .ring { animation: breathe 4.2s ease-in-out infinite; }
  .orb .ring.r2 { animation-delay: .5s; }
  .orb .ring.r3 { animation-delay: 1s; }
  .orb .core { animation: corepulse 4.2s ease-in-out infinite; }
  .orb.is-speaking .ring { animation-duration: 1.15s; border-color: rgba(63,208,198,.7); }
  .orb.is-speaking .core { animation-duration: 1.15s; box-shadow: 0 0 60px 2px rgba(63,208,198,.85), inset 0 0 30px rgba(0,0,0,.25); }
  .orb.is-listening .ring { animation-duration: 1.4s; border-color: rgba(255,107,94,.7); }
  .orb.is-listening .core { background: radial-gradient(circle at 35% 30%, #ff9d92, var(--coral) 45%, #8f2f27 100%); }
}
@keyframes breathe { 0%,100% { transform: scale(1); opacity: .8; } 50% { transform: scale(1.06); opacity: 1; } }
@keyframes corepulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.04); } }

.eq { display: inline-flex; align-items: flex-end; gap: 3px; height: 16px; }
.eq i { width: 3px; height: 4px; background: var(--teal-br); border-radius: 2px; display: inline-block; }
@media (prefers-reduced-motion: no-preference) {
  .eq.on i { animation: eq 0.9s ease-in-out infinite; }
  .eq.on i:nth-child(2){ animation-delay:.15s } .eq.on i:nth-child(3){ animation-delay:.3s } .eq.on i:nth-child(4){ animation-delay:.45s } .eq.on i:nth-child(5){ animation-delay:.1s }
}
@keyframes eq { 0%,100% { height: 4px; } 50% { height: 16px; } }

/* ---------------------------------------------------------------- Command centre */
.cc-grid { display: grid; grid-template-columns: 340px 1fr; gap: 22px; align-items: start; }
.cc-hero { text-align: center; padding: 26px 22px; }
.cc-hero .eyebrow { display: block; margin-bottom: 8px; }
.cc-hero .orb { margin: 26px auto 8px; }
.cc-hero .greet { font-family: var(--font-display); font-size: 22px; margin: 18px 0 6px; }
.cc-hero .sub { color: var(--muted); font-size: 13px; }
.cc-voicebar { display: flex; gap: 8px; justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.momentum { margin-top: 18px; }
.momentum .ring-num { font-family: var(--font-mono); font-size: 30px; font-weight: 600; }
.brief-block { margin-bottom: 18px; }
.brief-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.brief-list li { display: flex; gap: 12px; padding: 13px 15px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: rgba(15,22,38,.4); }
.brief-list li .bdot { width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; flex: 0 0 8px; background: var(--teal); }
.reveal { opacity: 0; transform: translateY(8px); }
@media (prefers-reduced-motion: no-preference) { .reveal.in { animation: reveal .5s ease forwards; } }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; } }
@keyframes reveal { to { opacity: 1; transform: none; } }

.metric-row { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 11px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: rgba(15,22,38,.35); margin-bottom: 8px; }
.metric-row .ml { font-weight: 500; }
.metric-row .mv { font-family: var(--font-mono); font-size: 15px; }
.metric-row .mt { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.bar { height: 6px; border-radius: 4px; background: rgba(87,109,180,.2); overflow: hidden; grid-column: 1 / -1; }
.bar > i { display: block; height: 100%; border-radius: 4px; }

/* ---------------------------------------------------------------- Chat */
.chat { display: grid; grid-template-rows: 1fr auto; height: calc(100vh - 142px); max-width: 900px; margin: 0 auto; }
.chat-scroll { overflow-y: auto; padding: 8px 4px 20px; display: flex; flex-direction: column; gap: 16px; }
.msg { display: flex; gap: 12px; max-width: 88%; }
.msg .ava { width: 34px; height: 34px; border-radius: 10px; flex: 0 0 34px; display: grid; place-items: center; }
.msg.jarvis .ava { background: radial-gradient(circle at 35% 30%, var(--teal-br), var(--teal) 60%, #11605a); font-family: var(--font-display); font-weight: 700; color: #eafffb; }
.msg.user { align-self: flex-end; flex-direction: row-reverse; }
.msg.user .ava { background: linear-gradient(135deg, var(--navy-600), var(--blue-400)); font-family: var(--font-mono); font-size: 12px; color: #fff; }
.bubble { padding: 13px 16px; border-radius: 14px; border: 1px solid var(--line); white-space: pre-wrap; }
.msg.jarvis .bubble { background: linear-gradient(180deg, rgba(41,55,92,.6), rgba(30,42,74,.6)); border-top-left-radius: 4px; }
.msg.user .bubble { background: linear-gradient(135deg, rgba(255,105,0,.16), rgba(255,105,0,.06)); border-color: rgba(255,105,0,.3); border-top-right-radius: 4px; }
.bubble .meta { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.speak-btn { background: none; border: 1px solid var(--line); color: var(--muted); border-radius: 8px; padding: 4px 8px; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-family: var(--font-mono); }
.speak-btn:hover { color: var(--teal-br); border-color: rgba(31,169,160,.4); }
.typing { display: inline-flex; gap: 4px; padding: 4px 0; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--teal); opacity: .5; }
@media (prefers-reduced-motion: no-preference) { .typing i { animation: blink 1.2s infinite; } .typing i:nth-child(2){animation-delay:.2s} .typing i:nth-child(3){animation-delay:.4s} }
@keyframes blink { 0%,100%{opacity:.3;transform:translateY(0)} 50%{opacity:1;transform:translateY(-3px)} }

.composer { border-top: 1px solid var(--line); padding-top: 14px; }
.composer .chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.composer .inbox { display: flex; gap: 10px; align-items: flex-end; }
.composer textarea {
  flex: 1; resize: none; background: rgba(15,22,38,.6); border: 1px solid var(--line); border-radius: 12px; color: var(--paper);
  padding: 12px 14px; font-family: var(--font-ui); font-size: 14px; line-height: 1.5; max-height: 120px; min-height: 46px;
}
.composer textarea:focus { outline: none; border-color: rgba(31,169,160,.5); box-shadow: 0 0 0 3px rgba(31,169,160,.12); }
.mic-btn { position: relative; }
.mic-btn.live { background: linear-gradient(135deg, var(--coral), #cf4338); box-shadow: 0 0 0 0 rgba(255,107,94,.5); }
@media (prefers-reduced-motion: no-preference) { .mic-btn.live { animation: micpulse 1.3s infinite; } }
@keyframes micpulse { 0%{box-shadow:0 0 0 0 rgba(255,107,94,.5)} 70%{box-shadow:0 0 0 12px rgba(255,107,94,0)} 100%{box-shadow:0 0 0 0 rgba(255,107,94,0)} }

/* ---------------------------------------------------------------- Toolbox */
.tool-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.tool-tab { padding: 9px 15px; border-radius: 999px; border: 1px solid var(--line); background: rgba(87,109,180,.08); color: var(--mist); cursor: pointer; font-size: 13px; font-weight: 500; font-family: var(--font-ui); display: inline-flex; gap: 8px; align-items: center; transition: background .16s ease, color .16s ease, border-color .16s ease; }
.tool-tab:hover { color: #fff; border-color: rgba(31,169,160,.4); }
.tool-tab:focus-visible, .seg button:focus-visible, .speak-btn:focus-visible, .followup:focus-visible { outline: 2px solid var(--teal-br); outline-offset: 2px; }
.tool-tab.active { background: linear-gradient(135deg, rgba(31,169,160,.2), rgba(31,169,160,.05)); border-color: rgba(31,169,160,.5); color: #fff; }
.tool-tab svg { width: 16px; height: 16px; }
.io-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
.io-pane h4 { font-size: 13px; font-family: var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.io-input { width: 100%; min-height: 220px; background: rgba(15,22,38,.6); border: 1px solid var(--line); border-radius: 12px; color: var(--mist); padding: 14px; font-family: var(--font-mono); font-size: 12.5px; line-height: 1.55; white-space: pre-wrap; }
.io-input.editable:focus { outline: none; border-color: rgba(31,169,160,.4); }
.io-output { background: linear-gradient(180deg, rgba(41,55,92,.5), rgba(30,42,74,.55)); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; min-height: 220px; position: relative; }
.io-output.empty { display: grid; place-items: center; color: var(--muted); text-align: center; }
.tool-select { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.select {
  background: rgba(15,22,38,.6); border: 1px solid var(--line); color: var(--paper); border-radius: 10px; padding: 9px 12px; font-family: var(--font-ui); font-size: 13px; cursor: pointer;
}
.gen-row { display: flex; gap: 10px; align-items: center; margin: 14px 0; flex-wrap: wrap; }

/* rich rendered markdown */
.md h1,.md h2 { font-size: 18px; margin: 4px 0 10px; }
.md h2 { font-size: 16px; margin-top: 16px; }
.md h3 { font-size: 14px; color: var(--teal-br); margin: 14px 0 6px; font-family: var(--font-ui); font-weight: 600; }
.md p { font-size: 13.5px; }
.md ul,.md ol { margin: 6px 0 12px; padding-left: 20px; }
.md li { font-size: 13.5px; margin-bottom: 5px; }
.md strong { color: #fff; }
.md hr { border: none; border-top: 1px solid var(--line); margin: 14px 0; }
.md table { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 12.5px; }
.md th, .md td { border: 1px solid var(--line); padding: 7px 10px; text-align: left; }
.md th { background: rgba(87,109,180,.12); font-family: var(--font-mono); font-size: 11px; letter-spacing: .04em; }
.md code { font-family: var(--font-mono); background: rgba(15,22,38,.6); padding: 1px 5px; border-radius: 5px; font-size: 12px; }

/* gaps list */
.gaps { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.gap { display: flex; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: rgba(15,22,38,.4); font-size: 12.5px; }
.gap .sev { font-family: var(--font-mono); font-size: 9px; letter-spacing: .1em; padding: 2px 6px; border-radius: 999px; height: fit-content; }
.sev-high { background: var(--danger); color: #fff; } .sev-med { background: var(--gold); color: #3a2700; } .sev-low { background: var(--navy-700); color: var(--mist); }

/* ---------------------------------------------------------------- Dashboard */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 24px; }
.kpi { padding: 16px; border-radius: var(--radius); border: 1px solid var(--line); background: linear-gradient(180deg, rgba(41,55,92,.45), rgba(30,42,74,.5)); position: relative; overflow: hidden; }
.kpi .k-name { font-size: 11px; color: var(--muted); font-family: var(--font-mono); letter-spacing: .08em; text-transform: uppercase; }
.kpi .k-val { font-family: var(--font-mono); font-size: 24px; font-weight: 600; margin: 8px 0 2px; }
.kpi .k-tgt { font-size: 11px; color: var(--muted); }
.kpi .k-bar { height: 4px; border-radius: 3px; background: rgba(87,109,180,.2); margin-top: 10px; overflow: hidden; }
.kpi .k-bar > i { display: block; height: 100%; }
.stat-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 22px; }
.stat { padding: 16px 18px; border-radius: var(--radius); border: 1px solid var(--line); background: linear-gradient(180deg, rgba(41,55,92,.4), rgba(30,42,74,.5)); }
.stat .s-num { font-family: var(--font-mono); font-size: 26px; font-weight: 600; }
.stat .s-lab { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.stat .s-sub { font-size: 11px; margin-top: 2px; }

.tbl { width: 100%; border-collapse: collapse; }
.tbl th { text-align: left; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 13px 12px; border-bottom: 1px solid rgba(42,53,86,.5); font-size: 13.5px; }
.tbl tr:hover td { background: rgba(87,109,180,.06); }
.tbl .num { font-family: var(--font-mono); }
.tbl .rname { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.tbl .rname small { display: block; font-weight: 400; color: var(--muted); font-size: 11px; }
.flag-cell { text-align: right; }
.trend { font-family: var(--font-mono); font-size: 12px; }
.trend.up { color: var(--green); } .trend.down { color: var(--danger); } .trend.flat { color: var(--muted); }

.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.chart-box { padding: 18px 20px; height: 320px; }
.chart-box canvas { max-height: 240px; }
.chart-box.tall { height: 360px; }
.chart-box.tall canvas { max-height: 280px; }

.coach-alert { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--radius-sm); border: 1px solid; margin-bottom: 10px; align-items: flex-start; }
.coach-alert.crit { border-color: rgba(229,72,77,.45); background: rgba(229,72,77,.08); }
.coach-alert.warn { border-color: rgba(245,179,53,.4); background: rgba(245,179,53,.07); }
.coach-alert .ca-ic { width: 18px; height: 18px; margin-top: 2px; flex: 0 0 18px; }
.coach-alert .ca-name { font-weight: 600; }
.coach-alert .ca-txt { font-size: 12.5px; color: var(--mist); }

/* ---------------------------------------------------------------- Roadmap */
.road { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.road-col { border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden; background: linear-gradient(180deg, rgba(41,55,92,.4), rgba(30,42,74,.5)); }
.road-col .rc-head { padding: 16px 18px; color: #07221f; }
.rc-v1 .rc-head { background: linear-gradient(135deg, var(--teal), var(--teal-br)); }
.rc-v2 .rc-head { background: linear-gradient(135deg, var(--gold), #f7c668); color: #3a2700; }
.rc-v3 .rc-head { background: linear-gradient(135deg, var(--coral), #ff9183); color: #4a1410; }
.rc-head .rv { font-family: var(--font-mono); font-weight: 600; letter-spacing: .14em; font-size: 12px; }
.rc-head .rt { font-family: var(--font-display); font-size: 19px; font-weight: 700; margin-top: 4px; }
.rc-head .rd { font-size: 11.5px; opacity: .85; margin-top: 2px; }
.rc-body { padding: 16px 18px; }
.rc-body .rlab { font-family: var(--font-display); font-size: 15px; margin-bottom: 12px; }
.rc-body ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 9px; }
.rc-body li { display: flex; gap: 10px; font-size: 13px; color: var(--mist); }
.rc-body li .rdot { width: 7px; height: 7px; border-radius: 50%; margin-top: 6px; flex: 0 0 7px; }
.rc-v1 li .rdot { background: var(--teal); } .rc-v2 li .rdot { background: var(--gold); } .rc-v3 li .rdot { background: var(--coral); }

/* ---------------------------------------------------------------- Modal */
.modal-back { position: fixed; inset: 0; z-index: 100; background: rgba(8,12,22,.7); backdrop-filter: blur(4px); display: none; place-items: center; padding: 20px; }
.modal-back.open { display: grid; }
.modal { width: 100%; max-width: 540px; max-height: 88vh; overflow-y: auto; background: linear-gradient(180deg, var(--navy-800), var(--navy-850)); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 40px 80px -30px #000; }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 22px; }
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 7px; }
.field .hint { font-size: 11.5px; color: var(--muted); margin-bottom: 8px; }
.field input[type=text], .field input[type=password], .field select { width: 100%; background: rgba(15,22,38,.6); border: 1px solid var(--line); border-radius: 10px; color: var(--paper); padding: 11px 13px; font-family: var(--font-ui); font-size: 13.5px; }
.field input:focus, .field select:focus { outline: none; border-color: rgba(31,169,160,.5); }
.toggle-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid rgba(42,53,86,.4); }
.note-box { font-size: 11.5px; color: var(--muted); background: rgba(15,22,38,.5); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; line-height: 1.55; }
.note-box strong { color: var(--teal-br); }

/* segmented control */
.seg { display: inline-flex; background: rgba(15,22,38,.6); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 3px; }
.seg button { background: none; border: none; color: var(--muted); padding: 7px 13px; border-radius: 8px; cursor: pointer; font-family: var(--font-ui); font-size: 12.5px; font-weight: 500; }
.seg button.on { background: rgba(31,169,160,.18); color: #fff; }

/* ---------------------------------------------------------------- Misc */
.section-title { display: flex; align-items: baseline; gap: 14px; margin: 4px 0 18px; flex-wrap: wrap; }
.section-title h2 { font-size: 22px; }
.section-title .desc { color: var(--muted); font-size: 13px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.flex { display: flex; } .between { justify-content: space-between; } .items-center { align-items: center; } .items-start { align-items: flex-start; } .gap8 { gap: 8px; } .gap12 { gap: 12px; } .wrap { flex-wrap: wrap; }
.mt8{margin-top:8px}.mt16{margin-top:16px}.mt24{margin-top:24px}.mb8{margin-bottom:8px}.mb16{margin-bottom:16px}
.hide { display: none !important; }
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--teal-br); }
@media (prefers-reduced-motion: no-preference) { .pulse-dot { animation: pdot 1.6s infinite; } }
@keyframes pdot { 0%,100%{opacity:1;box-shadow:0 0 0 0 rgba(63,208,198,.5)} 50%{opacity:.6;box-shadow:0 0 0 6px rgba(63,208,198,0)} }

/* ---------------------------------------------------------------- Jarvis dock */
.jdock { position: fixed; right: 24px; bottom: 24px; z-index: 80; }
.jdock-fab { display: inline-flex; align-items: center; gap: 11px; padding: 11px 18px 11px 11px; border: none; border-radius: 999px; cursor: pointer; color: #eafffb; font-family: var(--font-ui); font-weight: 600; font-size: 13.5px; background: linear-gradient(135deg, var(--teal), #14857c); box-shadow: 0 16px 38px -14px rgba(31,169,160,.75), inset 0 0 0 1px rgba(63,208,198,.3); transition: transform .14s ease, box-shadow .18s ease; }
.jdock-fab:hover { transform: translateY(-2px); box-shadow: 0 22px 46px -14px rgba(31,169,160,.9); }
.jdock-fab:focus-visible { outline: 2px solid var(--teal-br); outline-offset: 3px; }
.jdock-fab-j { font-family: var(--font-display); font-weight: 700; font-size: 19px; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 35% 30%, var(--teal-br), var(--teal) 60%, #11605a); box-shadow: 0 0 16px -2px rgba(63,208,198,.7); }
@media (prefers-reduced-motion: no-preference) { .jdock-fab-j { animation: corepulse 4.2s ease-in-out infinite; } }
.jdock-panel { width: 384px; max-width: calc(100vw - 36px); height: 564px; max-height: calc(100vh - 130px); display: flex; flex-direction: column; background: linear-gradient(180deg, var(--navy-800), var(--navy-850)); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 44px 90px -30px #000, var(--shadow-teal); overflow: hidden; }
.jdock-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, rgba(31,169,160,.14), transparent); }
.jdock-orb { width: 38px; height: 38px; border-radius: 50%; flex: 0 0 38px; display: grid; place-items: center; background: radial-gradient(circle at 35% 30%, var(--teal-br), var(--teal) 60%, #11605a); box-shadow: 0 0 18px -3px rgba(63,208,198,.6); }
.jdock-orb .eq i { background: #eafffb; }
.jdock-title { flex: 1; min-width: 0; }
.jdock-title .t { font-family: var(--font-display); font-weight: 700; font-size: 16px; line-height: 1; }
.jdock-title .s { font-size: 11px; margin-top: 4px; }
.jdock-scroll { flex: 1; overflow-y: auto; padding: 16px 14px; display: flex; flex-direction: column; gap: 14px; }
.jdock-scroll .msg { max-width: 100%; }
.jdock-scroll .bubble { font-size: 13px; padding: 11px 13px; }
.jdock-scroll .ava { width: 30px; height: 30px; flex-basis: 30px; }
.jdock-panel .composer textarea { min-height: 42px; }
.jdock-panel .chip { font-size: 12px; padding: 6px 11px; }

/* range slider */
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 4px; background: var(--navy-700); outline: none; cursor: pointer; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--teal); cursor: pointer; box-shadow: 0 0 0 4px rgba(31,169,160,.2); }
input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border: none; border-radius: 50%; background: var(--teal); cursor: pointer; }
input[type=range]:focus-visible { outline: 2px solid var(--teal-br); outline-offset: 4px; }

/* ==========================================================================
   ELEVATION + NEW SURFACES (V1 KPIs / Tool Stack, V2 Amplify, V3 Autonomy)
   ========================================================================== */

/* nav group version chips */
.ng-v { font-family: var(--font-mono); font-size: 8.5px; font-weight: 600; letter-spacing: .06em; padding: 1px 5px; border-radius: 999px; margin-left: 7px; }
.ng-v1 { color: var(--teal-br); background: rgba(31,169,160,.16); }
.ng-v2 { color: var(--gold); background: rgba(245,179,53,.16); }
.ng-v3 { color: var(--coral); background: rgba(255,107,94,.16); }

/* section-title TEEMA underline tick */
.section-title h2 { position: relative; padding-bottom: 9px; }
.section-title h2::after { content: ""; position: absolute; left: 0; bottom: 0; width: 44px; height: 3px; border-radius: 2px; background: linear-gradient(90deg, var(--teal), var(--teal-br)); }

/* TEEMA signature: overlapping-circles watermark (orange disc + blue disc, screen-blended) */
.teema-circles { position: absolute; pointer-events: none; opacity: .1; z-index: 0; width: 220px; height: 150px; }
.teema-circles > span { position: absolute; border-radius: 50%; }
.teema-circles .tc-o { width: 122px; height: 122px; right: 64px; top: 6px; background: var(--orange2); }
.teema-circles .tc-n { width: 96px; height: 96px; right: 12px; top: 34px; background: var(--blue-400); mix-blend-mode: screen; }
.panel { overflow: hidden; }

/* delta chips */
.delta { display: inline-flex; align-items: center; gap: 3px; font-family: var(--font-mono); font-size: 10.5px; font-weight: 600; padding: 2px 7px; border-radius: 999px; letter-spacing: .02em; vertical-align: middle; }
.delta.up { color: var(--green); background: rgba(31,169,122,.14); }
.delta.down { color: var(--coral); background: rgba(255,107,94,.14); }
.delta.flat { color: var(--muted); background: rgba(154,166,199,.12); }

/* hero ring counter (TEEMA "Trend Setters" circle stat) */
.ring-stat { position: relative; width: 138px; height: 138px; flex: 0 0 138px; }
.ring-stat svg { width: 138px; height: 138px; transform: rotate(-90deg); }
.ring-stat .rs-track { fill: none; stroke: var(--line); stroke-width: 7; }
.ring-stat .rs-arc { fill: none; stroke-width: 7; stroke-linecap: round; transition: stroke-dashoffset 1.1s cubic-bezier(.22,.61,.36,1); }
@media (prefers-reduced-motion: reduce) { .ring-stat .rs-arc { transition: none; } }
.ring-stat .rs-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-stat .rs-num { font-family: var(--font-mono); font-size: 30px; font-weight: 600; line-height: 1; }
.ring-stat .rs-lab { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-top: 5px; }
.hero-ring-row { display: flex; gap: 24px; align-items: center; }
.hero-ring-row .hrr-body { flex: 1; min-width: 0; }
.hero-ring-row .hrr-quote { font-family: var(--font-display); font-size: 17px; line-height: 1.4; color: var(--paper); margin-top: 6px; }

/* inline sparkline */
.spark { height: 40px; margin-top: 10px; position: relative; }
.spark canvas { height: 40px !important; width: 100% !important; }

/* card hover lift */
.lift { transition: transform .16s ease, box-shadow .2s ease, border-color .2s ease; }
@media (prefers-reduced-motion: no-preference) {
  .lift:hover { transform: translateY(-3px); box-shadow: 0 26px 52px -28px rgba(0,0,0,.85), 0 0 0 1px rgba(31,169,160,.25); border-color: rgba(31,169,160,.35); }
}

/* avatar performance status rings */
.avatar-chip.ring-ex { box-shadow: 0 0 0 2px var(--green); }
.avatar-chip.ring-on { box-shadow: 0 0 0 2px var(--teal); }
.avatar-chip.ring-risk { box-shadow: 0 0 0 2px var(--gold); }
.avatar-chip.ring-crit { box-shadow: 0 0 0 2px var(--danger); }

/* extra tag + alert variants */
.tag-gold { color: var(--gold); border-color: rgba(245,179,53,.4); background: rgba(245,179,53,.1); }
.tag-coral { color: var(--coral); border-color: rgba(255,107,94,.4); background: rgba(255,107,94,.1); }
.coach-alert.info { border-color: rgba(31,169,160,.4); background: rgba(31,169,160,.07); }
.coach-alert.win { border-color: rgba(31,169,122,.4); background: rgba(31,169,122,.08); }

/* generic status badge */
.badge { display: inline-flex; align-items: center; gap: 5px; font-family: var(--font-mono); font-size: 10px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; }
.badge .bdotc { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.live { color: var(--green); background: rgba(31,169,122,.15); }
.badge.ip { color: var(--gold); background: rgba(245,179,53,.15); }
.badge.running { color: var(--teal-br); background: rgba(31,169,160,.15); }
.badge.queued { color: var(--muted); background: rgba(154,166,199,.12); }
.badge.done { color: var(--green); background: rgba(31,169,122,.15); }
@media (prefers-reduced-motion: no-preference) { .badge.live .bdotc, .badge.running .bdotc { animation: pdot 1.6s infinite; } }

/* ---- My KPIs (V1) ---- */
.kpi-grid.k12 { grid-template-columns: repeat(3, 1fr); }
.kpi { display: flex; flex-direction: column; }
.kpi .k-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.kpi .k-freq { font-family: var(--font-mono); font-size: 9px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 2px 7px; white-space: nowrap; }
.kpi .k-valrow { display: flex; align-items: baseline; gap: 8px; margin: 8px 0 2px; }
.kpi .k-tgt { font-size: 11px; color: var(--muted); }
.kpi .k-note { font-size: 11.5px; color: var(--mist); line-height: 1.5; margin-top: 10px; border-top: 1px solid var(--line); padding-top: 9px; }
.kpi .k-spk { margin-top: 8px; }

/* ---- Tool Stack (V1) ---- */
.ts-legend { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 18px; font-size: 12px; color: var(--muted); align-items: center; }
.ts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.ts-tile { position: relative; padding: 18px; border-radius: var(--radius); border: 1px solid var(--line); background: linear-gradient(180deg, rgba(41,55,92,.45), rgba(30,42,74,.5)); display: flex; flex-direction: column; gap: 10px; }
.ts-top { display: flex; align-items: center; gap: 12px; }
.ts-mono { width: 46px; height: 46px; border-radius: 12px; flex: 0 0 46px; display: grid; place-items: center; font-family: var(--font-mono); font-weight: 700; font-size: 15px; color: #fff; letter-spacing: -.02em; box-shadow: 0 6px 16px -8px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.18); }
.ts-mono svg { width: 26px; height: 26px; color: #fff; }
.ts-logo { width: 46px; height: 46px; border-radius: 12px; flex: 0 0 46px; background: #fff; display: grid; place-items: center; padding: 7px; box-shadow: 0 6px 16px -8px rgba(0,0,0,.6), inset 0 0 0 1px rgba(0,0,0,.07); }
.ts-logo img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.ts-mono.teal { background: linear-gradient(135deg, var(--teal-br), #11605a); }
.ts-mono.blue { background: linear-gradient(135deg, var(--blue-400), var(--navy-600)); }
.ts-mono.orange { background: linear-gradient(135deg, var(--orange), var(--orange-br)); }
.ts-mono.green { background: linear-gradient(135deg, var(--green), #14704f); }
.ts-mono.gold { background: linear-gradient(135deg, #c98f1e, #7d5510); }
.ts-name { font-family: var(--font-ui); font-weight: 600; font-size: 15px; line-height: 1.2; }
.ts-cat { font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-top: 3px; }
.ts-desc { font-size: 12.5px; color: var(--mist); line-height: 1.55; }
.ts-foot { margin-top: auto; padding-top: 4px; }

/* ---- Amplify (V2) ---- */
.amp-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 18px; align-items: start; }
.worker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.worker-card { position: relative; padding: 16px 18px; border-radius: var(--radius); border: 1px solid var(--line); background: linear-gradient(180deg, rgba(41,55,92,.45), rgba(30,42,74,.5)); }
.wc-head { display: flex; align-items: center; gap: 10px; }
.wc-orb { width: 34px; height: 34px; border-radius: 10px; flex: 0 0 34px; display: grid; place-items: center; background: radial-gradient(circle at 35% 30%, var(--teal-br), var(--teal) 60%, #11605a); font-family: var(--font-display); font-weight: 700; color: #eafffb; font-size: 14px; box-shadow: 0 0 14px -3px rgba(63,208,198,.55); }
.wc-orb svg { width: 18px; height: 18px; color: #eafffb; }
.wc-h-txt { flex: 1; min-width: 0; }
.wc-name { font-weight: 600; font-size: 14px; }
.wc-tag { font-size: 11px; color: var(--muted); }
.wc-metric { font-family: var(--font-mono); font-size: 22px; font-weight: 600; color: var(--teal-br); margin: 10px 0 1px; }
.wc-metric-lab { font-size: 10px; color: var(--muted); font-family: var(--font-mono); letter-spacing: .06em; text-transform: uppercase; }
.wc-last { font-size: 12px; color: var(--mist); line-height: 1.5; margin-top: 10px; border-top: 1px solid var(--line); padding-top: 10px; }

.wf-trigger { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm); background: rgba(255,105,0,.08); border: 1px solid rgba(255,105,0,.3); margin-bottom: 16px; font-size: 12.5px; }
.wf-trigger svg { width: 16px; height: 16px; color: var(--orange); flex: 0 0 16px; }
.wf-steps { display: flex; flex-direction: column; }
.wf-step { display: flex; gap: 14px; padding-bottom: 16px; position: relative; }
.wf-step::before { content: ""; position: absolute; left: 13px; top: 28px; bottom: -2px; width: 2px; background: var(--line); }
.wf-step:last-child::before { display: none; }
.wf-step:last-child { padding-bottom: 0; }
.wf-dot { width: 28px; height: 28px; border-radius: 50%; flex: 0 0 28px; display: grid; place-items: center; border: 2px solid var(--line); background: var(--navy-800); z-index: 1; color: var(--muted); }
.wf-dot svg { width: 14px; height: 14px; }
.wf-step.done .wf-dot { border-color: var(--green); color: var(--green); }
.wf-step.running .wf-dot { border-color: var(--teal-br); color: var(--teal-br); }
.wf-body { flex: 1; padding-top: 3px; }
.wf-label { font-weight: 600; font-size: 13.5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wf-detail { font-size: 12px; color: var(--muted); margin-top: 2px; }

.amp-chat { display: flex; flex-direction: column; gap: 14px; }
.amp-q { align-self: flex-end; max-width: 84%; background: linear-gradient(135deg, rgba(255,105,0,.16), rgba(255,105,0,.06)); border: 1px solid rgba(255,105,0,.3); border-radius: 14px 14px 4px 14px; padding: 11px 15px; font-size: 13px; }
.amp-a { align-self: flex-start; max-width: 90%; background: linear-gradient(180deg, rgba(41,55,92,.6), rgba(30,42,74,.6)); border: 1px solid var(--line); border-radius: 14px 14px 14px 4px; padding: 13px 16px; font-size: 13px; line-height: 1.55; }
.amp-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

/* ---- Jarvis V3 (Autonomy) ---- */
.v3-stage { text-align: center; max-width: 800px; margin: 0 auto; position: relative; }
.v3-stage .orb { width: 216px; height: 216px; }
.v3-stage .orb .ring.r3 { inset: 44px; }
.v3-stage .orb .core { width: 124px; height: 124px; }
.v3-stage .orb .core .j { font-size: 56px; }
.v3-greet { font-family: var(--font-display); font-size: 24px; margin: 18px 0 4px; }
.v3-substage { color: var(--muted); font-size: 12.5px; font-family: var(--font-mono); letter-spacing: .04em; }
.v3-controls { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin: 20px 0; }

.coach-transcript { display: flex; flex-direction: column; gap: 14px; max-height: 440px; overflow-y: auto; padding: 4px 2px; text-align: left; }
.ct-turn { display: flex; gap: 12px; max-width: 90%; }
.ct-turn .ava { width: 32px; height: 32px; border-radius: 9px; flex: 0 0 32px; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 13px; }
.ct-jarvis .ava { background: radial-gradient(circle at 35% 30%, var(--teal-br), var(--teal) 60%, #11605a); color: #eafffb; }
.ct-sarah { flex-direction: row-reverse; align-self: flex-end; }
.ct-sarah .ava { background: linear-gradient(135deg, var(--navy-600), var(--blue-400)); font-family: var(--font-mono); font-size: 12px; color: #fff; }
.ct-bubble { padding: 12px 15px; border-radius: 13px; border: 1px solid var(--line); font-size: 13.5px; line-height: 1.55; }
.ct-jarvis .ct-bubble { background: linear-gradient(180deg, rgba(41,55,92,.6), rgba(30,42,74,.6)); border-top-left-radius: 4px; }
.ct-sarah .ct-bubble { background: linear-gradient(135deg, rgba(255,105,0,.13), rgba(255,105,0,.05)); border-color: rgba(255,105,0,.28); border-top-right-radius: 4px; }

.v3-tabsub { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.cand-row { cursor: pointer; }
.cand-row:focus-visible { outline: 2px solid var(--teal-br); outline-offset: -2px; }
.match-bar { display: inline-flex; align-items: center; gap: 8px; }
.match-bar .bar { width: 64px; grid-column: auto; }
.cand-detail { margin-top: 14px; }
.score-glyph { font-family: var(--font-mono); font-weight: 600; }
.draft-box { margin-top: 10px; border: 1px dashed var(--line); border-radius: 10px; padding: 12px 14px; background: rgba(15,22,38,.45); font-size: 12.5px; line-height: 1.55; }
.guard-line { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--gold); font-family: var(--font-mono); margin-top: 4px; }
.guard-line svg { width: 13px; height: 13px; }
.alert-feed { display: flex; flex-direction: column; gap: 12px; }
.ca-time { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }
.ca-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- Responsive */
.rail-toggle { display: none; }
@media (max-width: 1080px) {
  .cc-grid { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-row { grid-template-columns: repeat(3, 1fr); }
  .chart-grid, .io-grid, .grid-2, .road { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .rail { position: fixed; left: 0; top: 0; z-index: 60; transform: translateX(-100%); transition: transform .25s ease; width: 270px; }
  .rail.open { transform: translateX(0); }
  .rail-toggle { display: inline-flex; }
  .view { padding: 18px; }
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .chat { height: calc(100vh - 130px); }
}
@media (max-width: 520px) {
  .kpi-grid, .stat-row { grid-template-columns: 1fr; }
  .topbar { padding: 14px 16px; }
  .jdock { right: 12px; bottom: 12px; left: 12px; text-align: right; }
  .jdock-panel { width: 100%; height: 72vh; }
}
