/* Command Center layout, shared by all 5 dashboards. Colours, fonts and radii come only from each dashboard's tokens.css.
   Shell: 56px top bar, 232px side rail, fluid canvas with 32px gutters, one 16px gap everywhere.
   Bridge (command view): side panels 320px (360px from 1600px) and the orb column takes the rest:
   at 1440, 1440 - 232 - 64 - 2 x 320 - 2 x 16 = 472px for the orb. */
*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, h3, p, ol, ul, dl, dd { margin: 0; padding: 0; }
ol, ul { list-style: none; }
body { min-height: 100svh; background: var(--bg); color: var(--text); font: 15px/1.6 var(--font); -webkit-font-smoothing: antialiased; }
button, input { font: inherit; color: inherit; }
::selection { background: var(--accent); color: var(--on-accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
i.ph { font-size: 16px; }

/* top bar */
.bar { position: sticky; top: 0; z-index: 10; background: var(--bg); border-bottom: 1px solid var(--border); }
.bar-in { display: flex; align-items: center; gap: 16px; min-height: 56px; padding: 0 32px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; color: var(--text); text-decoration: none; white-space: nowrap; }
.mark { width: 20px; height: 20px; fill: var(--accent); }
.scope { color: var(--muted); font-size: 14px; }
.bar-end { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.seg { display: inline-flex; padding: 3px; border-radius: var(--r-ctl); background: var(--surface); border: 1px solid var(--border); }
.seg button { height: 30px; padding: 0 12px; border: 0; border-radius: calc(var(--r-ctl) - 3px); background: none; color: var(--muted); font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--raised); color: var(--text); }

/* shell: rail + canvas */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); }
.rail { position: sticky; top: 56px; height: calc(100svh - 56px); padding: 24px 12px; border-right: 1px solid var(--border); background: var(--bg); }
#nav { display: grid; gap: 2px; }
.nav-i { display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 12px; border-radius: var(--r-ctl); color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 500; transition: background-color .15s, color .15s; }
.nav-i:hover { color: var(--text); background: var(--surface); }
.nav-i[aria-current="page"] { color: var(--text); background: var(--raised); }
.nav-i[aria-current="page"] i.ph { color: var(--accent); }
.nav-i i.ph { font-size: 18px; }
.count { margin-left: auto; min-width: 22px; height: 20px; padding: 0 6px; border-radius: var(--r-pill); background: var(--accent); color: var(--on-accent); font-size: 12px; font-weight: 600; line-height: 20px; text-align: center; }
main { min-width: 0; padding: 32px 32px 56px; }

/* title */
.title-row { margin-bottom: 24px; }
h1 { font-size: 28px; line-height: 1.2; font-weight: 600; }
.sub { margin-top: 6px; font-size: 16px; color: var(--muted); }
.sub b { color: var(--text); font-weight: 600; }

/* cards and rows */
.row { display: grid; gap: var(--gap); }
.r-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.r-75 { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); align-items: start; }
.stack { display: grid; gap: var(--gap); }
.card { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); padding: var(--pad); min-width: 0; }
.head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 32px; margin-bottom: 16px; }
h2 { font-size: 16px; line-height: 1.3; font-weight: 600; }
h3 { font-size: 14px; font-weight: 600; }
.meta { font-size: 13px; color: var(--muted); white-space: nowrap; }
.s { display: block; font-size: 13px; color: var(--muted); }
.gap { margin-top: 12px; margin-bottom: 16px; }
.gap-t { margin-top: 16px; }
.status { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); white-space: nowrap; }
.dot { display: inline-block; width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--positive); }
.tag { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: var(--r-pill); font-size: 12px; font-weight: 500; white-space: nowrap; flex: none; background: var(--raised); color: var(--text); }
.tag.ac { background: var(--tint); color: var(--accent); }
.link { display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none; color: var(--accent); font-size: 14px; font-weight: 500; cursor: pointer; text-decoration: none; }
.link:hover { text-decoration: underline; text-underline-offset: 3px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: var(--r-ctl); border: 1px solid var(--control); background: transparent; color: var(--text); font-size: 14px; font-weight: 500; cursor: pointer; text-decoration: none; white-space: nowrap; transition: transform .15s var(--ease), background-color .15s, border-color .15s; }
.btn:hover { background: var(--raised); transform: translateY(-1px); }
.btn:active { transform: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; }
.field { width: 100%; height: 44px; padding: 0 14px; border-radius: var(--r-ctl); border: 1px solid var(--control); background: var(--bg); }
.field::placeholder { color: var(--faint); }
.field:focus { outline: none; border-color: var(--accent); }
.track { height: 6px; border-radius: var(--r-pill); background: var(--raised); overflow: hidden; }
.track i { display: block; height: 100%; min-width: 2px; background: var(--accent); border-radius: var(--r-pill); transition: width .6s var(--ease); }
.gl { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 8px; font-size: 14px; }
.gl .num { color: var(--muted); }
.gl .num b { color: var(--text); font-weight: 600; }

/* lists and tables */
.list > li { display: flex; align-items: center; gap: 14px; padding: 12px 0; }
.list > li + li { border-top: 1px solid var(--rule); }
.li-body { flex: 1; min-width: 0; }
.li-body b { display: block; font-weight: 500; line-height: 1.4; }
.empty { padding: 24px 0; color: var(--muted); }
.foot-link { margin-top: 12px; }
table { width: 100%; border-collapse: collapse; }
th { height: 36px; padding: 0 0 0 12px; text-align: left; font-size: 12px; font-weight: 500; color: var(--muted); border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 12px 0 12px 12px; border-bottom: 1px solid var(--rule); vertical-align: middle; }
th:first-child, td:first-child { padding-left: 0; }
tbody tr:last-child td { border-bottom: 0; }
td b { display: block; font-weight: 500; }
.n { text-align: right; }

/* command view: status strip */
.hud { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin-bottom: var(--gap); border: 1px solid var(--border); border-radius: var(--r-card); background: var(--surface); }
.hud-c { display: grid; gap: 2px; padding: 16px 20px; color: var(--text); text-decoration: none; transition: background-color .15s; }
.hud-c + .hud-c { border-left: 1px solid var(--rule); }
.hud-c:first-child { border-radius: var(--r-card) 0 0 var(--r-card); }
.hud-c:last-child { border-radius: 0 var(--r-card) var(--r-card) 0; }
.hud-c:hover { background: var(--raised); }
.hud-l { font-size: 12px; color: var(--muted); }
.hud-v { font-size: 22px; font-weight: 600; line-height: 1.3; white-space: nowrap; }
.hud-v .of { font-size: 14px; font-weight: 500; color: var(--muted); }
.hud-s { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* command view: the bridge, orb in the middle */
.bridge { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr) minmax(0, 320px); gap: var(--gap); align-items: stretch; }
.stage { display: flex; flex-direction: column; justify-content: space-between; min-height: clamp(600px, calc(100svh - 300px), 820px); overflow: hidden; text-align: center; }
.orb { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.stage-top, .stage-bottom { position: relative; }
.stage-top .meta { display: inline-flex; align-items: center; gap: 4px; }
.stage h2 { margin-top: 4px; font-size: 28px; letter-spacing: -.01em; }
.now { margin: 4px auto 0; max-width: 52ch; color: var(--muted); }
.orb-state { margin-bottom: 12px; color: var(--muted); }
[data-voice="listening"] .orb-state, [data-voice="thinking"] .orb-state { color: var(--accent); }
[data-voice="speaking"] .orb-state { color: var(--accent-2); }
.cmd { display: flex; gap: 8px; max-width: 640px; margin: 0 auto; }
.mic { width: 44px; height: 44px; padding: 0; flex: none; }
.mic[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.cmd .btn.primary { height: 44px; }
.needs, .feed-card { display: flex; flex-direction: column; }
.need { flex-direction: column; align-items: stretch !important; gap: 10px !important; }
.need .by { display: block; margin-top: 4px; font-size: 12px; color: var(--faint); }
.need-acts { display: flex; gap: 8px; }
.feed > li { align-items: baseline; }
.feed > li:nth-child(n+8) { display: none; } /* 7 rows; a dashboard whose feed fills a fixed height shows up to 10 */
.feed .t { width: 68px; flex: none; font-size: 12px; color: var(--faint); }
.feed .who { font-weight: 600; }
.feed .you .who { color: var(--accent); }
.feed .fresh { animation: arrive .5s var(--ease); }
@keyframes arrive { from { opacity: 0; transform: translateY(-6px); } }
.pulse { animation: blink 2s ease-in-out infinite; }
@keyframes blink { 50% { opacity: .35; } }

/* agents */
.agent .now { margin: 0 0 16px; max-width: none; }
.kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 16px; }
.kpis > div + div { padding-left: 16px; border-left: 1px solid var(--rule); }
.kpis dt { font-size: 13px; color: var(--muted); }
.kpis dd { font-size: 24px; font-weight: 600; }
.mem { padding: 16px; border-radius: var(--r-ctl); background: var(--raised); }
.mem ul { margin: 8px 0 12px; display: grid; gap: 6px; }
.mem li { padding-left: 14px; position: relative; font-size: 14px; }
.mem li::before { content: ""; position: absolute; left: 0; top: .65em; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }

/* apps */
.apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.apps li { padding: 12px 14px; border-radius: var(--r-ctl); background: var(--raised); }
.apps b { display: block; font-weight: 500; }

/* launch and academy */
.step-d { width: 56px; flex: none; font-size: 13px; color: var(--faint); }
.step.past .step-d { color: var(--accent); }
.step.today { margin: 0 -12px; padding: 12px; border-radius: var(--r-ctl); background: var(--tint); border-top-color: transparent !important; }
.step.today + li { border-top-color: transparent; }
.step.next b { color: var(--muted); }
.train .t { width: 92px; flex: none; font-size: 13px; color: var(--faint); }
.past-row b { color: var(--muted); font-weight: 400; }
.bonus .list > li { gap: 12px; }

@media (min-width: 1600px) { .bridge { grid-template-columns: minmax(0, 360px) minmax(0, 1fr) minmax(0, 360px); } }
/* tablet: the rail becomes a tab row under the bar; the orb goes first, full width */
@media (max-width: 1100px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail { position: sticky; top: 56px; z-index: 9; height: auto; padding: 8px 32px; border-right: 0; border-bottom: 1px solid var(--border); overflow-x: auto; }
  #nav { display: flex; gap: 4px; }
  .nav-i { flex: none; }
  .bridge { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stage { grid-column: 1 / -1; order: -1; min-height: 560px; }
  .hud { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hud-c { border-radius: 0 !important; }
  .hud-c:nth-child(4) { border-left: 0; }
  .hud-c:nth-child(n+4) { border-top: 1px solid var(--rule); }
  .hud-c:nth-child(5) { grid-column: span 2; }
  .r-2, .r-75 { grid-template-columns: minmax(0, 1fr); }
  .scope { display: none; }
}
@media (max-width: 760px) {
  .bar-in { flex-wrap: wrap; padding: 8px 16px; row-gap: 8px; }
  .bar-end { margin-left: 0; width: 100%; justify-content: space-between; }
  .seg button { height: 38px; }
  .rail { position: relative; top: 0; padding: 8px 16px; }
  main { padding: 24px 16px 48px; }
  .card { padding: 20px 16px; }
  .head { flex-wrap: wrap; }
  .hud { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hud-c:nth-child(n) { border-left: 0; border-top: 1px solid var(--rule); grid-column: auto; }
  .hud-c:nth-child(-n+2) { border-top: 0; }
  .hud-c:nth-child(even) { border-left: 1px solid var(--rule); }
  .hud-c:nth-child(5) { grid-column: 1 / -1; }
  .bridge { grid-template-columns: minmax(0, 1fr); }
  .stage { min-height: 520px; }
  .send-l { display: none; }
  .cmd .btn.primary { width: 44px; padding: 0; }
  .need-acts .btn { min-height: 44px; flex: 1; }
  th:nth-child(2), td:nth-child(2) { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }
/* the side column of a 7/5 view is a short summary: it stays in view while the long list scrolls */
@media (min-width: 1101px) { .r-75 > :last-child { position: sticky; top: 80px; } }
