:root {
  --bg: #eef2f5; --panel: #ffffff; --ink: #14212d; --muted: #5a6876; --faint: #8b97a3; --line: #d8dfe6;
  --accent: #2a78d6; --accent-ink: #ffffff;
  --go: #16834a; --go-bg: #ddf1e5; --stop: #c2362f; --stop-bg: #f9dedb; --warn: #9a6200; --warn-bg: #fbebcb;
  --s-backlog: #c4ccd4; --s-ready: #2a78d6; --s-progress: #eb6834; --s-review: #1baf7a; --s-testing: #eda100;
  --s-done: #14212d; --s-blocked: #e34948;
  --radius: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #11181f; --panel: #19222b; --ink: #e8edf2; --muted: #a3afba; --faint: #73808c; --line: #2c3743;
    --accent: #3987e5; --go: #4cc283; --go-bg: #173a28; --stop: #f07a72; --stop-bg: #44201e; --warn: #f0b84a; --warn-bg: #3f3016;
    --s-backlog: #4a5664; --s-ready: #3987e5; --s-progress: #d95926; --s-review: #199e70; --s-testing: #c98500;
    --s-done: #e8edf2; --s-blocked: #e66767;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #11181f; --panel: #19222b; --ink: #e8edf2; --muted: #a3afba; --faint: #73808c; --line: #2c3743;
  --accent: #3987e5; --go: #4cc283; --go-bg: #173a28; --stop: #f07a72; --stop-bg: #44201e; --warn: #f0b84a; --warn-bg: #3f3016;
  --s-backlog: #4a5664; --s-ready: #3987e5; --s-progress: #d95926; --s-review: #199e70; --s-testing: #c98500;
  --s-done: #e8edf2; --s-blocked: #e66767;
  color-scheme: dark;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 "Instrument Sans", system-ui, sans-serif; }
h1, h2, h3, .display { font-family: "Bricolage Grotesque", "Instrument Sans", sans-serif; letter-spacing: -0.01em; }
h1 { font-size: 2.6rem; line-height: 1.05; margin: 0; font-weight: 700; }
h2 { font-size: 1.35rem; margin: 0 0 .25rem; font-weight: 650; }
h3 { font-size: 1.02rem; margin: 0 0 .5rem; font-weight: 650; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.num { font-variant-numeric: tabular-nums; }

/* top bar */
.top { background: var(--panel); border-bottom: 1px solid var(--line); }
.top-in { max-width: 1280px; margin: 0 auto; padding: 12px 24px; display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.brand { font-family: "Bricolage Grotesque", sans-serif; font-weight: 700; font-size: 1.1rem; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.brand-mark { width: 18px; height: 18px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; }
.brand-mark i { background: var(--s-done); border-radius: 1px; }
.brand-mark i:nth-child(3n) { background: var(--go); }
.pickers { display: flex; gap: 8px; align-items: center; }
select, input, textarea, button { font: inherit; color: inherit; }
select, input[type=text], input[type=number], input[type=url], input[type=date], textarea {
  background: var(--panel); border: 1px solid var(--line); border-radius: 7px; padding: 6px 9px; }
textarea { width: 100%; }
.spacer { flex: 1; }
.syncinfo { font-size: .82rem; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: var(--panel);
  padding: 6px 12px; border-radius: 7px; cursor: pointer; color: var(--ink); font-weight: 550; white-space: nowrap; }
.btn:hover { border-color: var(--faint); text-decoration: none; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.small { padding: 3px 9px; font-size: .85rem; }
.btn.ghost { border-color: transparent; background: none; }
.linkbtn { background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; }
.tabs { max-width: 1280px; margin: 0 auto; padding: 0 24px; display: flex; gap: 4px; overflow-x: auto; }
.tabs a { padding: 10px 14px; color: var(--muted); border-bottom: 3px solid transparent; font-weight: 550; white-space: nowrap; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.on { color: var(--ink); border-bottom-color: var(--ink); }

main { max-width: 1280px; margin: 0 auto; padding: 28px 24px 80px; }
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 18px; background: var(--go-bg); color: var(--go); font-weight: 550; }
.flash.err { background: var(--stop-bg); color: var(--stop); }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.grid2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; margin-top: 20px; }
.stack > * + * { margin-top: 20px; }
@media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; } h1 { font-size: 2rem; } }

/* hero: one square per item */
.hero { display: grid; grid-template-columns: minmax(260px, 1fr) 2fr; gap: 32px; align-items: end; }
@media (max-width: 900px) { .hero { grid-template-columns: 1fr; } }
.hero .sub { color: var(--muted); margin-top: 8px; }
.hero .big { font-size: 4rem; font-weight: 800; line-height: .9; font-family: "Bricolage Grotesque", sans-serif; }
.hero .big span { color: var(--faint); font-weight: 500; }
.wafer { display: flex; flex-wrap: wrap; gap: 4px; }
.cell { width: 22px; height: 22px; border-radius: 4px; background: var(--s-backlog); display: block; position: relative; }
.cell.released::after { content: ""; position: absolute; inset: 6px; border-radius: 50%; background: var(--go); box-shadow: 0 0 0 2px var(--panel); }
.cell:hover { transform: scale(1.25); z-index: 1; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; font-size: .85rem; color: var(--muted); }
.legend i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.st-Backlog, .st-No.status { background: var(--s-backlog); }
[data-s="Backlog"], [data-s="No status"] { --c: var(--s-backlog); }
[data-s="Ready"] { --c: var(--s-ready); }
[data-s="In progress"], [data-s="In Dev"] { --c: var(--s-progress); }
[data-s="In review"] { --c: var(--s-review); }
[data-s="Testing"] { --c: var(--s-testing); }
[data-s="Done"] { --c: var(--s-done); }
[data-s="Blocked"] { --c: var(--s-blocked); }
.cell[data-s], .legend i[data-s], .bar-seg[data-s], .dot[data-s] { background: var(--c, var(--s-backlog)); }

.kpis { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 18px; }
.kpi b { display: block; font-size: 1.5rem; font-family: "Bricolage Grotesque", sans-serif; line-height: 1.1; }
.kpi span { color: var(--muted); font-size: .85rem; }

/* status bars */
.statusrow { display: grid; grid-template-columns: 110px 1fr 36px; gap: 10px; align-items: center; margin: 7px 0; font-size: .9rem; }
.track { height: 10px; background: var(--bg); border-radius: 5px; overflow: hidden; }
.track > div { height: 100%; background: var(--c, var(--accent)); border-radius: 0 4px 4px 0; }
.stackbar { display: flex; height: 12px; gap: 2px; border-radius: 4px; overflow: hidden; background: var(--bg); min-width: 120px; }
.bar-seg { height: 100%; }

/* attention */
.attn h3 { display: flex; gap: 8px; align-items: center; }
.attn ul { list-style: none; padding: 0; margin: 0 0 16px; columns: 2 380px; column-gap: 32px; }
.attn li { break-inside: avoid; }
.attn li { padding: 6px 0; border-top: 1px solid var(--line); font-size: .9rem; display: flex; gap: 8px; }
.attn li:first-child { border-top: 0; }
.count { background: var(--bg); color: var(--muted); border-radius: 20px; padding: 0 9px; font-size: .8rem; font-weight: 600; }
.count.warn { background: var(--warn-bg); color: var(--warn); }
.count.bad { background: var(--stop-bg); color: var(--stop); }
.count.good { background: var(--go-bg); color: var(--go); }

/* tables */
.tablewrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { text-align: left; font-weight: 600; color: var(--muted); font-size: .8rem; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td.r, th.r { text-align: right; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 20px; font-size: .78rem; font-weight: 600; background: var(--bg); color: var(--muted); white-space: nowrap; }
.tag.good { background: var(--go-bg); color: var(--go); }
.tag.bad { background: var(--stop-bg); color: var(--stop); }
.tag.warn { background: var(--warn-bg); color: var(--warn); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.chip { border: 1px solid var(--line); background: var(--panel); border-radius: 20px; padding: 3px 11px; cursor: pointer; font-size: .85rem; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--panel); border-color: var(--ink); }
.sectionhead { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }

/* charts */
.chart text { fill: var(--muted); font-size: 11px; font-family: "Instrument Sans", sans-serif; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .ideal { stroke: var(--faint); stroke-width: 2; stroke-dasharray: 2 5; fill: none; stroke-linecap: round; }
.chart .actual { stroke: var(--accent); stroke-width: 2.5; fill: none; stroke-linejoin: round; }
.chart .pt { fill: var(--accent); stroke: var(--panel); stroke-width: 2; }
.chart .hit { fill: transparent; }
.chart .hit:hover + .pt, .chart g.h:hover .pt { r: 6; }
.chart .today { stroke: var(--ink); stroke-width: 1; stroke-dasharray: 3 3; }

/* release verdict */
.verdict { border-radius: var(--radius); padding: 24px; display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: center; border: 1px solid var(--line); background: var(--panel); }
@media (max-width: 900px) { .verdict { grid-template-columns: 1fr; } }
.verdict .word { font-family: "Bricolage Grotesque", sans-serif; font-weight: 800; font-size: 3rem; line-height: .95; }
.verdict.no .word { color: var(--stop); }
.verdict.yes .word { color: var(--go); }
.lamps { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px 18px; }
.lamp { display: grid; grid-template-columns: 16px 1fr; gap: 10px; align-items: start; }
.lamp .bulb { width: 14px; height: 14px; border-radius: 50%; margin-top: 4px; background: var(--stop); box-shadow: 0 0 0 3px var(--stop-bg); }
.lamp.ok .bulb { background: var(--go); box-shadow: 0 0 0 3px var(--go-bg); }
.lamp b { display: block; font-weight: 600; font-size: .92rem; }
.lamp span { color: var(--muted); font-size: .82rem; }
.jump { display: flex; gap: 6px; flex-wrap: wrap; margin: 20px 0; position: sticky; top: 0; background: var(--bg); padding: 8px 0; z-index: 2; }
.owner { font-size: .85rem; color: var(--muted); }
.owner .tag { margin-left: 4px; }
.inline { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; }
.inline label { display: flex; flex-direction: column; gap: 3px; font-size: .8rem; color: var(--muted); }
details > summary { cursor: pointer; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details[open] > summary .chev { transform: rotate(90deg); }
.chev { display: inline-block; transition: transform .15s; color: var(--faint); }
.empty { padding: 28px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: var(--radius); }
td form { margin: 0; }
td select, td input[type=text] { padding: 3px 6px; font-size: .85rem; }

/* login */
.login { max-width: 440px; margin: 12vh auto; text-align: left; }
.login .wafer { margin-bottom: 28px; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } .cell:hover { transform: none; } }

.people th, .people td { padding: 8px 7px; }
.people tr.groups th { border-bottom: 0; padding-bottom: 0; color: var(--faint); font-weight: 550; }
.people tr.groups th + th { border-left: 1px solid var(--line); }
