:root {
  --bg: #1b1c19;          /* warm graphite, like a rack panel */
  --bg2: #22231f;
  --rule: #34362f;
  --rule2: #2a2b26;
  --ink: #e6e4da;
  --ink2: #a9a79b;
  --ink3: #75746a;
  --trace: #8fd27a;       /* waveform-monitor phosphor: the one accent */
  --trace-dim: #8fd27a33;
  --tally: #e5484d;       /* reserved for violations */
  --amber: #d9a441;       /* "major" — a lamp colour, used sparingly */
  --grid: #8fd27a0d;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --cond: "Barlow Condensed", "Arial Narrow", sans-serif;
  --sans: "IBM Plex Sans", system-ui, sans-serif;
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #f1efe6; --bg2: #e9e6da; --rule: #cfcbbd; --rule2: #dedacd;
  --ink: #1d1e1a; --ink2: #55554b; --ink3: #85847a;
  --trace: #2f7d32; --trace-dim: #2f7d3226; --tally: #c4262c; --amber: #9a6a00; --grid: #2f7d320a;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 24px 24px;
  color: var(--ink); font: 14px/1.45 var(--sans); min-height: 100dvh; display: flex; flex-direction: column;
}
a { color: inherit; }
button, select, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--trace); outline-offset: 2px; }

.top { display: flex; align-items: center; gap: 18px; padding: 10px 20px; border-bottom: 1px solid var(--rule); background: var(--bg); position: sticky; top: 0; z-index: 5; }
.mark { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 700 20px/1 var(--cond); letter-spacing: .08em; }
.mark svg { width: 28px; height: 28px; color: var(--ink2); }
.mark b { color: var(--trace); font-weight: 700; padding: 0 2px; }
.clock { font: 500 18px/1 var(--mono); letter-spacing: .04em; color: var(--trace); margin-left: auto; font-variant-numeric: tabular-nums; }
.lamp { display: flex; align-items: center; gap: 8px; font: 600 13px var(--cond); text-transform: uppercase; letter-spacing: .1em; color: var(--ink2); }
.lamp i { width: 10px; height: 10px; background: var(--ink3); display: inline-block; }
.lamp.on i { background: var(--trace); box-shadow: 0 0 8px var(--trace); }
.lamp.err i { background: var(--tally); box-shadow: 0 0 8px var(--tally); }
.viewas { font: 600 12px var(--cond); text-transform: uppercase; letter-spacing: .1em; color: var(--ink3); display: flex; gap: 8px; align-items: center; }
select, input[type=text], input[type=search] { background: var(--bg2); border: 1px solid var(--rule); padding: 6px 8px; border-radius: 2px; }
button { background: transparent; border: 1px solid var(--rule); padding: 6px 12px; border-radius: 2px; cursor: pointer; font: 600 13px var(--cond); letter-spacing: .08em; text-transform: uppercase; }
button:hover { border-color: var(--ink3); }
button:active { transform: translateY(1px); }
button.primary { border-color: var(--trace); color: var(--trace); }
button[disabled] { opacity: .45; cursor: not-allowed; }
button.ghost { border: 0; font-size: 18px; padding: 4px 8px; }

.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--rule); padding: 0 20px; overflow-x: auto; scrollbar-width: none; }
.tabs a { padding: 10px 14px; text-decoration: none; font: 600 15px var(--cond); letter-spacing: .06em; text-transform: uppercase; color: var(--ink3); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--trace); }

main { flex: 1; padding: 22px 20px 40px; max-width: 1480px; width: 100%; margin: 0 auto; }
.foot { display: flex; justify-content: space-between; gap: 20px; padding: 12px 20px; border-top: 1px solid var(--rule); color: var(--ink3); font-size: 12px; flex-wrap: wrap; }

h1 { font: 700 34px/1 var(--cond); letter-spacing: .02em; margin: 0 0 4px; text-transform: uppercase; }
h2 { font: 600 18px/1.1 var(--cond); letter-spacing: .08em; text-transform: uppercase; color: var(--ink2); margin: 26px 0 10px; }
.lede { color: var(--ink2); max-width: 75ch; margin: 0 0 18px; }
.head { display: flex; align-items: end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.controls { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.seg { display: inline-flex; border: 1px solid var(--rule); }
.seg button { border: 0; border-right: 1px solid var(--rule); }
.seg button:last-child { border-right: 0; }
.seg button[aria-pressed="true"] { color: var(--trace); background: var(--trace-dim); }

/* meters row */
.meters { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); margin-bottom: 20px; }
.meter { padding: 12px 14px; border-right: 1px solid var(--rule2); }
.meter:last-child { border-right: 0; }
.meter .k { font: 600 12px var(--cond); text-transform: uppercase; letter-spacing: .12em; color: var(--ink3); }
.meter .v { font: 500 28px/1.1 var(--mono); font-variant-numeric: tabular-nums; margin-top: 4px; }
.meter .s { color: var(--ink3); font-size: 12px; }
.meter.bad .v { color: var(--tally); }
.meter.good .v { color: var(--trace); }

/* channel strips */
.strip { display: grid; grid-template-columns: 220px 1fr 160px; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--rule2); }
.strip .name { font: 600 17px var(--cond); letter-spacing: .04em; }
.strip .sub { font: 12px var(--mono); color: var(--ink3); }
.lane { position: relative; height: 34px; background: var(--bg2); border: 1px solid var(--rule2); overflow: hidden; }
.lane .tick { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--rule2); }
.lane .tick span { position: absolute; top: 1px; left: 3px; font: 10px var(--mono); color: var(--ink3); }
.lane .blk { position: absolute; top: 8px; bottom: 4px; background: var(--c, var(--trace)); opacity: .85; border-left: 2px solid var(--bg); cursor: pointer; }
.lane .blk:hover { opacity: 1; outline: 1px solid var(--ink); }
.lane .now { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--trace); box-shadow: 0 0 6px var(--trace); }
.vu { display: flex; align-items: center; gap: 8px; font: 12px var(--mono); color: var(--ink2); }
.vu .bar { flex: 1; height: 8px; background: var(--bg2); border: 1px solid var(--rule2); position: relative; overflow: hidden; }
.vu .bar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--trace); transform-origin: left; transition: transform .4s; width: 100%; }

.ticker { border-top: 1px solid var(--rule); }
.tick-row { display: grid; grid-template-columns: 120px 150px 1fr 110px 90px; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--rule2); align-items: center; animation: in .5s ease-out; }
@keyframes in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .tick-row { animation: none; } .vu .bar i { transition: none; } }

/* tables */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font: 600 12px var(--cond); text-transform: uppercase; letter-spacing: .1em; color: var(--ink3); padding: 8px 10px 8px 0; border-bottom: 1px solid var(--rule); white-space: nowrap; }
.tbl td { padding: 8px 10px 8px 0; border-bottom: 1px solid var(--rule2); vertical-align: top; }
.tbl tr:hover td { background: var(--trace-dim); }
.tc, .num { font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.dim { color: var(--ink3); }
.sha { font: 11px var(--mono); color: var(--ink3); }
.swatch { display: inline-block; width: 9px; height: 9px; margin-right: 7px; background: var(--c); vertical-align: 0; }
.wrap { overflow-x: auto; }

.pill { display: inline-block; font: 600 12px var(--cond); letter-spacing: .08em; text-transform: uppercase; padding: 1px 7px; border: 1px solid var(--rule); white-space: nowrap; }
.pill.ok { color: var(--trace); border-color: var(--trace); }
.pill.critical { color: var(--tally); border-color: var(--tally); }
.pill.major { color: var(--amber); border-color: var(--amber); }
.pill.minor, .pill.info { color: var(--ink2); }

.codes { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); border: 1px solid var(--rule); margin-bottom: 18px; }
.code { padding: 10px 12px; border-right: 1px solid var(--rule2); border-bottom: 1px solid var(--rule2); cursor: pointer; background: transparent; text-align: left; border-radius: 0; text-transform: none; letter-spacing: 0; font: inherit; }
.code b { font: 500 24px var(--mono); display: block; }
.code span { font: 600 12px var(--cond); letter-spacing: .1em; text-transform: uppercase; color: var(--ink3); }
.code.sel { background: var(--trace-dim); }
.code.critical b { color: var(--tally); }
.code.major b { color: var(--amber); }
.code.okc b { color: var(--trace); }

/* bars */
.bars { border-top: 1px solid var(--rule); }
.barrow { display: grid; grid-template-columns: 200px 1fr 120px; gap: 14px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--rule2); }
.barrow .track { height: 18px; background: var(--bg2); position: relative; }
.barrow .track i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--c, var(--trace)); }

.cand { display: grid; grid-template-columns: 110px 1fr 260px; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--rule2); align-items: start; }
.cand .occ { font: 12px var(--mono); color: var(--ink2); }
audio { height: 28px; width: 220px; vertical-align: middle; }
mark { background: var(--trace-dim); color: var(--ink); padding: 0 2px; }

.empty { border: 1px dashed var(--rule); padding: 26px; color: var(--ink2); }
.empty b { display: block; font: 600 16px var(--cond); letter-spacing: .08em; text-transform: uppercase; color: var(--ink); margin-bottom: 6px; }
.err { border: 1px solid var(--tally); color: var(--tally); padding: 12px 14px; }
.skel { height: 14px; background: linear-gradient(90deg, var(--bg2), var(--rule2), var(--bg2)); background-size: 200% 100%; animation: sk 1.2s infinite linear; margin: 10px 0; }
@keyframes sk { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skel { animation: none; } }

pre.code-block { background: var(--bg2); border: 1px solid var(--rule); padding: 14px; overflow-x: auto; font: 12.5px/1.6 var(--mono); }
.kv { display: grid; grid-template-columns: 260px 1fr; border-top: 1px solid var(--rule); }
.kv > div { padding: 8px 0; border-bottom: 1px solid var(--rule2); }
.kv > div:nth-child(odd) { color: var(--ink2); }
.note { color: var(--ink3); font-size: 12.5px; max-width: 90ch; }

@media (max-width: 860px) {
  .top { flex-wrap: wrap; gap: 10px; padding: 10px 16px; }
  .clock { margin-left: 0; font-size: 15px; }
  main { padding: 16px; }
  .strip { grid-template-columns: 1fr; gap: 6px; }
  .tick-row { grid-template-columns: 90px 1fr 80px; }
  .tick-row > :nth-child(4), .tick-row > :nth-child(5) { display: none; }
  .barrow { grid-template-columns: 110px 1fr 70px; }
  .cand { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; }
  h1 { font-size: 28px; }
}

/* try it: a patch-sheet form (label column, field column), hairlines like the rest of the log */
.tabs a.try { color: var(--trace); margin-left: auto; }
.sheet { display: grid; grid-template-columns: 200px minmax(0, 560px); gap: 0 18px; border-top: 1px solid var(--rule); margin-bottom: 18px; }
.sheet > label, .sheet > span, .sheet > div { padding: 10px 0; border-bottom: 1px solid var(--rule2); }
.sheet > label { font: 600 13px var(--cond); text-transform: uppercase; letter-spacing: .1em; color: var(--ink2); padding-top: 16px; }
.sheet input[type=text], .sheet input[type=email] { width: 100%; background: var(--bg2); border: 1px solid var(--rule); padding: 8px 10px; border-radius: 2px; }
.sheet input[type=file] { width: 100%; padding: 8px; border: 1px dashed var(--rule); background: var(--bg2); }
.sheet input[type=file]::file-selector-button { font: 600 12px var(--cond); text-transform: uppercase; letter-spacing: .08em; background: transparent; color: var(--trace); border: 1px solid var(--trace); padding: 4px 10px; margin-right: 10px; cursor: pointer; }
.sheet small { display: block; color: var(--ink3); font-size: 12px; margin-top: 5px; }
.sheet > label.check { font: 13px/1.45 var(--sans); text-transform: none; letter-spacing: 0; }
.sheet .check { display: flex; gap: 10px; align-items: start; color: var(--ink2); font-size: 13px; padding: 12px 0; border-bottom: 1px solid var(--rule2); max-width: 70ch; }
.sheet .check input { accent-color: var(--trace); margin-top: 3px; }
.sheet .fielderr { color: var(--tally); }
.sheet .err { grid-column: 2; margin-top: 10px; }
.prog { height: 6px; background: var(--bg2); border: 1px solid var(--rule); max-width: 560px; }
.prog i { display: block; height: 100%; background: var(--trace); transition: width .4s ease-out; }
@media (prefers-reduced-motion: reduce) { .prog i { transition: none; } }
.mono { font-family: var(--mono); font-size: 12px; }
@media (max-width: 860px) {
  .sheet { grid-template-columns: 1fr; }
  .sheet > label { padding-bottom: 0; border-bottom: 0; }
  .sheet > span { display: none; }
  .sheet .err { grid-column: 1; }
  .tabs a.try { margin-left: 0; order: -1; }
}
