:root {
  color-scheme: light;
  --fog: #e9edf0;
  --paper: #f8fafb;
  --ink: #17232b;
  --muted: #67747c;
  --line: #c9d1d6;
  --soft-line: #e2e7ea;
  --cobalt: #3552a3;
  --coral: #d65a50;
  --coral-ink: #a43d35;
  --mint: #4a9e86;
  --mint-ink: #2f725f;
  --amber: #c68a30;
  --amber-ink: #8a5d18;
  --radius: 12px;
  --touch: 48px;
  font-family: "Roboto Condensed", "Arial Narrow", Roboto, Arial, sans-serif;
  font-size: 16px;
}

* { box-sizing: border-box; }
html, body, #app { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body { background: var(--fog); color: var(--ink); -webkit-text-size-adjust: 100%; }
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: rgba(53,82,163,.18); }
button:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--coral); outline-offset: 2px; }
h1, h2, h3, p { margin: 0; }

.shell {
  display: grid;
  grid-template-columns: 176px minmax(0, 1fr);
  grid-template-rows: 60px minmax(0, 1fr) 56px;
  grid-template-areas: "brand header" "rail main" "rail nav";
  gap: 1px;
  background: var(--line);
}

.boot { grid-column: 1 / -1; grid-row: 1 / -1; display: grid; place-content: center; text-align: center; background: var(--paper); }
.boot-mark { font-size: 3rem; font-weight: 900; color: var(--cobalt); }
.boot p { color: var(--muted); }

.brand { grid-area: brand; display: flex; align-items: center; gap: 10px; padding: 0 14px; background: var(--ink); color: #fff; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; background: var(--cobalt); border-radius: 50% 50% 50% 6px; font-weight: 900; }
.brand strong { display: block; font-size: .92rem; }
.brand small { display: block; color: #aeb8be; font-size: .66rem; text-transform: uppercase; letter-spacing: .1em; }

.topbar { grid-area: header; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 16px; background: var(--paper); }
.topbar h1 { font-size: 1.3rem; line-height: 1; letter-spacing: -.02em; }
.eyebrow { margin-bottom: 3px; color: var(--cobalt); font-size: .66rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.freshness { display: flex; align-items: center; gap: 6px; }
.fresh-chip { display: inline-flex; align-items: center; gap: 5px; min-height: 30px; padding: 0 8px; border-radius: 999px; background: var(--fog); color: var(--muted); font-size: .66rem; font-weight: 700; white-space: nowrap; }
.fresh-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--mint); flex: none; }
.fresh-chip.stale .dot, .fresh-chip.off .dot { background: var(--coral); }
.fresh-chip.off { color: var(--coral-ink); }
.icon-button { min-width: var(--touch); height: var(--touch); border: 0; border-radius: 9px; background: var(--fog); font-size: 1.2rem; }
.icon-button:active { background: var(--line); }
.banner { position: absolute; left: 177px; right: 0; top: 61px; z-index: 5; padding: 6px 16px; background: var(--amber); color: #fff; font-size: .74rem; font-weight: 700; text-align: center; }
.banner.edge { background: var(--cobalt); }

.rail { grid-area: rail; min-height: 0; padding: 10px 8px; overflow-y: auto; background: #dee4e8; }
.rail-title { margin: 0 8px 8px; color: var(--muted); font-size: .64rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.app-button { position: relative; width: 100%; min-height: var(--touch); display: grid; grid-template-columns: 30px minmax(0, 1fr); align-items: center; gap: 8px; margin: 0 0 4px; padding: 6px 8px; border: 0; border-radius: 9px; background: transparent; text-align: left; }
.app-button:active, .app-button.active { background: var(--paper); }
.app-button.active::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px; border-radius: 2px; background: var(--cobalt); }
.app-glyph { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--ink); color: #fff; font-size: .72rem; font-weight: 900; }
.app-glyph.decision { background: var(--coral); }
.app-glyph.attention { background: var(--amber); }
.app-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .78rem; font-weight: 700; line-height: 1.15; }
.app-sub { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: .63rem; font-weight: 600; }

.workspace { grid-area: main; position: relative; min-width: 0; min-height: 0; padding: 14px 16px 18px; overflow-y: auto; background: var(--fog); }
.view { display: grid; gap: 12px; }
.view-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.view-head h2 { font-size: 1.5rem; letter-spacing: -.03em; line-height: 1; }
.view-head p { max-width: 540px; color: var(--muted); font-size: .76rem; line-height: 1.3; }
.two-col { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 12px; align-items: start; }
.stack { display: grid; gap: 12px; }

.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--line); }
.tile { min-height: 96px; padding: 11px 12px; background: var(--paper); }
.tile-label { color: var(--muted); font-size: .63rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.tile-value { margin: 5px 0 2px; font-size: 1.6rem; font-weight: 900; line-height: 1; letter-spacing: -.04em; }
.tile-value.unknown { color: var(--line); }
.tile-note { display: block; color: var(--muted); font-size: .65rem; line-height: 1.25; }
.tile.hot .tile-value { color: var(--coral-ink); }

.spark { position: relative; margin-top: 6px; }
.spark svg { display: block; width: 100%; height: 100%; }
.spark.empty { color: var(--line); font-size: .64rem; padding: 8px 0; }
.spark-max { display: block; margin-top: 2px; color: var(--muted); font-size: .58rem; letter-spacing: .04em; text-transform: uppercase; }

.panel { padding: 13px 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.panel-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.panel-title h3 { font-size: .92rem; }
.panel-title span { color: var(--muted); font-size: .63rem; text-transform: uppercase; letter-spacing: .08em; text-align: right; }
.panel-empty { padding: 10px 0; color: var(--muted); font-size: .76rem; line-height: 1.35; }
.panel-sub { margin: 12px 0 4px; color: var(--muted); font-size: .62rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }

.item { width: 100%; display: grid; grid-template-columns: 6px minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: var(--touch); padding: 6px 4px; border: 0; border-top: 1px solid var(--soft-line); background: transparent; text-align: left; }
.item:first-of-type { border-top: 0; }
.item:active { background: var(--fog); }
.item-bar { width: 6px; height: 34px; border-radius: 3px; background: var(--line); }
.item.decision .item-bar { background: var(--coral); }
.item.attention .item-bar { background: var(--amber); }
.item.problem .item-bar { background: var(--ink); }
.item.info .item-bar { background: var(--cobalt); }
.item-body { min-width: 0; }
.item-title { display: block; font-size: .8rem; font-weight: 800; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-detail { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: .67rem; font-weight: 500; }
.item-meta { color: var(--muted); font-size: .62rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
.events .item.new .item-title::before { content: "NEW "; color: var(--cobalt); font-size: .58rem; letter-spacing: .08em; }

.badge { display: inline-flex; align-items: center; min-height: 24px; padding: 3px 8px; border-radius: 12px; background: rgba(74,158,134,.14); color: var(--mint-ink); font-size: .61rem; font-weight: 800; line-height: 1.2; text-transform: uppercase; letter-spacing: .04em; }
.badge.decision { background: rgba(214,90,80,.14); color: var(--coral-ink); }
.badge.attention { background: rgba(198,138,48,.16); color: var(--amber-ink); }
.badge.unwired { background: #e8ecef; color: #657078; }
.badge.info { background: rgba(53,82,163,.12); color: var(--cobalt); }

.sources { display: grid; gap: 6px; }
.source { display: grid; grid-template-columns: 9px minmax(0, 1fr) auto; gap: 8px; align-items: start; min-height: 30px; }
.source-dot { width: 8px; height: 8px; margin-top: 4px; border-radius: 50%; background: var(--line); }
.source-dot.live { background: var(--mint); }
.source-dot.stale { background: var(--coral); }
.source strong { display: block; font-size: .71rem; }
.source span { display: block; color: var(--muted); font-size: .61rem; line-height: 1.25; }
.source-age { color: var(--muted); font-size: .61rem; white-space: nowrap; }

.text-button { min-height: var(--touch); padding: 0 12px; border: 1px solid var(--line); border-radius: 9px; background: transparent; font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
.text-button:active { background: var(--fog); }

.table-row { width: 100%; display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(72px, .7fr) minmax(110px, 1.1fr) minmax(80px, .9fr) minmax(80px, .9fr) minmax(72px, .8fr) minmax(76px, .8fr); align-items: center; gap: 8px; min-height: 54px; padding: 4px 2px; border: 0; border-top: 1px solid var(--soft-line); background: transparent; text-align: left; }
.table-row:first-child { border-top: 0; }
.table-row:active { background: var(--fog); }
.table-row.header { min-height: 28px; color: var(--muted); font-size: .59rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.table-row > span { min-width: 0; }
.cell-primary { display: block; font-size: .8rem; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cell-secondary { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: .63rem; font-weight: 500; }
.cell-number { display: block; font-size: .95rem; font-weight: 800; letter-spacing: -.02em; }
.cell-number.unknown { color: var(--line); font-weight: 600; }
.cell-number.bad { color: var(--coral-ink); }
.cell-number small { display: block; color: var(--muted); font-size: .59rem; font-weight: 700; letter-spacing: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.pipeline { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.step { padding: 9px 10px; border-radius: 9px; background: var(--fog); min-width: 0; }
.step-label { display: block; color: var(--muted); font-size: .59rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.step-value { margin-top: 3px; font-size: .88rem; font-weight: 800; line-height: 1.15; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step-note { display: block; color: var(--muted); font-size: .62rem; line-height: 1.2; }
.next-action { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: center; margin-top: 10px; padding: 10px 12px; border-left: 4px solid var(--coral); border-radius: 4px 9px 9px 4px; background: #fbf1ef; font-size: .78rem; }
.next-action.calm { border-color: var(--mint); background: #eef6f3; }
.next-action strong { font-size: .6rem; letter-spacing: .1em; text-transform: uppercase; white-space: nowrap; }

.review { padding: 8px 0; border-top: 1px solid var(--soft-line); }
.review:first-of-type { border-top: 0; }
.review-head { display: flex; justify-content: space-between; gap: 8px; font-size: .74rem; font-weight: 800; }
.review-stars { color: var(--amber-ink); letter-spacing: .06em; }
.review-meta { color: var(--muted); font-weight: 600; }
.review p { margin-top: 2px; color: var(--muted); font-size: .69rem; line-height: 1.3; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

.ai-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.quota { padding: 14px; border-radius: var(--radius); background: var(--paper); border: 1px solid var(--line); }
.quota h3 { margin-bottom: 6px; font-size: 1.1rem; }
.quota-window { display: grid; grid-template-columns: 62px minmax(0, 1fr); align-items: center; gap: 10px; margin-top: 8px; }
.quota-window strong { font-size: 1.5rem; line-height: 1; letter-spacing: -.05em; }
.quota-window strong.hot { color: var(--coral-ink); }
.quota-window span { color: var(--muted); font-size: .65rem; }
.meter { height: 10px; margin: 4px 0 2px; overflow: hidden; border-radius: 999px; background: #dfe5e8; }
.meter-fill { height: 100%; border-radius: inherit; background: var(--cobalt); }
.meter-fill.warm { background: var(--amber); }
.meter-fill.hot { background: var(--coral); }
.today-line { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--soft-line); }
.today-line strong { display: block; font-size: 1.02rem; letter-spacing: -.02em; }
.today-line span { color: var(--muted); font-size: .6rem; text-transform: uppercase; letter-spacing: .06em; }

.models { display: grid; gap: 5px; }
.model-row { display: grid; grid-template-columns: 74px minmax(0, 1fr) 88px; align-items: center; gap: 8px; }
.model-name { font-size: .72rem; font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.model-bar { height: 10px; border-radius: 999px; background: #dfe5e8; overflow: hidden; }
.model-bar i { display: block; height: 100%; background: var(--cobalt); border-radius: inherit; }
.model-count { font-size: .72rem; font-weight: 800; text-align: right; }
.model-count small { display: block; color: var(--muted); font-size: .58rem; font-weight: 600; }

.activity { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); align-items: end; gap: 6px; height: 120px; padding-top: 8px; }
.day { display: grid; grid-template-rows: 1fr auto; gap: 4px; height: 100%; text-align: center; color: var(--muted); font-size: .59rem; }
.day-bars { display: flex; justify-content: center; align-items: flex-end; gap: 3px; height: 100%; }
.bar { width: 10px; min-height: 3px; border-radius: 4px 4px 1px 1px; background: var(--cobalt); }
.bar.claude { background: var(--mint); }

.nav { grid-area: nav; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); background: var(--paper); }
.nav-button { position: relative; min-height: var(--touch); border: 0; border-right: 1px solid var(--line); background: transparent; color: var(--muted); font-size: .78rem; font-weight: 800; }
.nav-button:last-child { border-right: 0; }
.nav-button.active { color: var(--cobalt); }
.nav-button.active::before { content: ""; position: absolute; top: 0; left: 24%; right: 24%; height: 4px; background: var(--cobalt); border-radius: 0 0 5px 5px; }
.nav-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; margin-left: 6px; padding: 0 5px; border-radius: 10px; background: var(--coral); color: #fff; font-size: .61rem; }

@media (max-width: 1000px) {
  :root { font-size: 14px; }
  .shell { grid-template-columns: 152px minmax(0, 1fr); grid-template-rows: 54px minmax(0, 1fr) 52px; }
  .banner { left: 153px; top: 55px; }
  .workspace { padding: 10px 12px 14px; }
  .tile { min-height: 84px; padding: 9px 10px; }
  .tile-value { font-size: 1.4rem; }
  .two-col { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
  .table-row { grid-template-columns: minmax(0, 1.4fr) minmax(60px, .6fr) minmax(92px, 1fr) minmax(66px, .8fr) minmax(66px, .8fr) minmax(60px, .7fr) minmax(64px, .7fr); }
  .pipeline { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .model-row { grid-template-columns: 64px minmax(0, 1fr) 78px; }
  .fresh-chip.secondary { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

.funnel { display: grid; gap: 5px; }
.funnel-step { display: grid; grid-template-columns: 118px minmax(0, 1fr) 62px; align-items: center; gap: 8px; }
.funnel-label { font-size: .7rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.funnel-bar { height: 12px; border-radius: 3px; background: #dfe5e8; overflow: hidden; }
.funnel-bar i { display: block; height: 100%; background: var(--mint); }
.funnel-count { font-size: .78rem; font-weight: 800; text-align: right; }
.funnel-count small { display: block; color: var(--coral-ink); font-size: .58rem; font-weight: 700; }
