/* Olympus Pit Wall — front board styles.
 *
 * Lifted VERBATIM from the mockup's <style> block in
 * wesolv-infra/docs/olympus/olympus-pit-wall.html (the deliverable, epic
 * wesolv-infra#77). The mockup's look is a HARD REQUIREMENT — do not restyle or
 * "tidy" these rules; re-prove any visual change against the mockup first.
 *
 * The only ADDITIONS below the verbatim block are the pitwall-ui-specific bits
 * the live board needs and the static mockup did not: `.placeholder` (the
 * coming-soon tiles for panels with no proven query yet — Team Radio,
 * Constructors' Standings, Strategy/Iris), `.board-banner` (the non-blocking
 * "upstream unavailable" strip shown on a 502 so the board is never blank),
 * `.tt-empty` (the quiet-platform empty state for the timing tower), and
 * `.auth-gate` (the sign-in / access-denied / config-error fullscreen states for
 * the Keycloak SSO gate, issue #5). They are grouped at the end under "pitwall-ui
 * additions" and use the same design tokens.
 */

:root {
  --bg: #070A12;
  --bg-2: #0B1020;
  --panel: #0D1424;
  --panel-2: #101a30;
  --line: rgba(255,255,255,0.08);
  --line-strong: rgba(255,255,255,0.16);
  --ink: #F2F5FA;
  --dim: #7A8699;
  --dimmer: #4C566B;

  --green: #2BE08A;   /* personal best / healthy */
  --purple: #B14BFF;  /* session best / fastest */
  --yellow: #FFC21E;  /* managing */
  --red: #FF3B47;     /* DNF / incident */

  --zeus: #FFD84D;
  --pegasus: #4DA8FF;
  --themis: #14C7A8;
  --hephaestus: #FF5A1F;
  --gaia: #7FB840;

  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --cond: 'Saira Condensed', system-ui, sans-serif;
  --body: 'Saira', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background:
    radial-gradient(1200px 600px at 78% -10%, rgba(77,168,255,0.06), transparent 60%),
    radial-gradient(900px 500px at 0% 110%, rgba(255,90,31,0.05), transparent 55%),
    var(--bg);
  color: var(--ink);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  letter-spacing: 0.01em;
}
/* faint broadcast scanline atmosphere */
body::after {
  content: "";
  position: fixed; inset: 0; pointer-events: none; z-index: 999;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,0.014) 0 1px, transparent 1px 3px);
  mix-blend-mode: overlay;
}

.tnum { font-variant-numeric: tabular-nums; font-family: var(--mono); }
.eyebrow {
  font-family: var(--cond); font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.18em; font-size: 11px; color: var(--dim);
}

.wrap { max-width: 1500px; margin: 0 auto; padding: 14px 16px 34px; }

/* ---------- Session bar ---------- */
.session {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1.2fr;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border-radius: 4px;
  padding: 12px 16px;
  position: relative;
  overflow: hidden;
}
.session::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: linear-gradient(180deg, var(--zeus), var(--hephaestus));
}
.gp-name {
  font-family: var(--cond); font-weight: 800; font-size: 26px;
  text-transform: uppercase; letter-spacing: 0.02em; line-height: 1;
}
.gp-sub { color: var(--dim); font-size: 12px; margin-top: 3px; }
.gp-sub b { color: var(--pegasus); font-weight: 600; }

.centre { text-align: center; }
.laps {
  font-family: var(--cond); font-weight: 800; font-size: 30px; line-height: 1;
  letter-spacing: 0.02em;
}
.laps small { color: var(--dim); font-size: 15px; font-weight: 600; }
.live {
  display: inline-flex; align-items: center; gap: 7px; margin-top: 5px;
  font-family: var(--cond); font-weight: 700; letter-spacing: 0.16em; font-size: 11px;
  color: var(--red); text-transform: uppercase;
}
.live .dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--red);
  box-shadow: 0 0 8px var(--red); animation: blink 1.4s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0.25; } }

.right-head { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.clock { font-family: var(--mono); font-weight: 500; font-size: 15px; color: var(--ink); }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--line-strong); border-radius: 3px;
  padding: 6px 10px; font-size: 11px; font-family: var(--cond);
  font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim);
  background: var(--bg-2);
}
.statuslight { display: inline-flex; align-items: center; gap: 8px; }
.bulb {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--green); box-shadow: 0 0 12px var(--green), inset 0 0 3px rgba(0,0,0,0.4);
  animation: breathe 3.2s ease-in-out infinite;
}
@keyframes breathe { 50% { opacity: 0.55; transform: scale(0.9); } }

/* ---------- Grid ---------- */
.board {
  display: grid;
  grid-template-columns: 1.55fr 1.1fr 0.95fr;
  gap: 12px;
  margin-top: 12px;
}
.col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

.panel {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,0.015), transparent), var(--panel);
  border-radius: 4px;
  overflow: hidden;
}
.panel-h {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 12px; border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,0.03), transparent);
}
.panel-h h2 {
  margin: 0; font-family: var(--cond); font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.14em; font-size: 13px; color: var(--ink);
}
.panel-h .tag { font-family: var(--mono); font-size: 10px; color: var(--dimmer); }

/* ---------- Timing tower ---------- */
.tt-row {
  display: grid;
  grid-template-columns: 30px 4px minmax(0,1fr) 74px 78px 58px 52px 44px;
  align-items: center;
  gap: 8px;
  padding: 9px 12px 9px 0;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.tt-row:last-child { border-bottom: 0; }
.tt-head {
  padding: 6px 12px 6px 0; border-bottom: 1px solid var(--line-strong);
}
.tt-head span {
  font-family: var(--cond); font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; font-size: 10px; color: var(--dimmer);
}
.bar { width: 4px; height: 34px; border-radius: 0 2px 2px 0; }
.pos {
  font-family: var(--cond); font-weight: 800; font-size: 20px; text-align: center;
  color: var(--ink);
}
.car { min-width: 0; }
.car .nm { font-family: var(--cond); font-weight: 700; font-size: 17px; letter-spacing: 0.02em; text-transform: uppercase; line-height: 1; }
.car .role { font-size: 10.5px; color: var(--dim); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tyre {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--mono); font-size: 11px; color: var(--dim);
}
.tyre .compound {
  width: 18px; height: 18px; border-radius: 50%;
  display: grid; place-items: center; font-family: var(--cond); font-weight: 800; font-size: 9px;
  border: 1.5px solid; flex: none;
}
.c-soft { border-color: var(--red); color: var(--red); }
.c-med { border-color: var(--yellow); color: var(--yellow); }
.c-hard { border-color: #dfe6f0; color: #dfe6f0; }
.gap { font-family: var(--mono); font-size: 13px; color: var(--dim); text-align: right; }
.laptime { font-family: var(--mono); font-weight: 500; font-size: 15px; text-align: right; }
.laptime.pb { color: var(--green); }
.laptime.sb { color: var(--purple); }
.sectors { display: flex; gap: 3px; justify-content: center; }
.sec { width: 14px; height: 5px; border-radius: 1px; background: var(--dimmer); }
.sec.g { background: var(--green); }
.sec.p { background: var(--purple); box-shadow: 0 0 6px var(--purple); }
.sec.y { background: var(--yellow); }
.drs {
  font-family: var(--cond); font-weight: 800; font-size: 10px; text-align: center;
  letter-spacing: 0.06em; color: var(--dimmer); border: 1px solid var(--line); border-radius: 2px; padding: 2px 0;
}
.drs.on { color: var(--green); border-color: var(--green); }
.tt-row.dnf { opacity: 0.62; }
.tt-row.dnf .nm { color: var(--red); }
.tt-row.reserve { opacity: 0.72; }
.flag {
  font-family: var(--cond); font-weight: 800; font-size: 10px; letter-spacing: 0.08em;
  padding: 2px 6px; border-radius: 2px; text-transform: uppercase; white-space: nowrap;
}
.flag.dnf { background: rgba(255,59,71,0.14); color: var(--red); border: 1px solid rgba(255,59,71,0.4); }
.flag.res { background: rgba(127,184,64,0.12); color: var(--gaia); border: 1px solid rgba(127,184,64,0.35); }

/* ---------- Team radio ---------- */
.radio-body { padding: 6px 0; max-height: 320px; overflow: auto; }
.radio-body::-webkit-scrollbar { width: 6px; }
.radio-body::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 3px; }
.msg {
  display: grid; grid-template-columns: 8px 1fr; gap: 10px;
  padding: 9px 12px; border-bottom: 1px solid var(--line);
  animation: msgin 0.5s ease both;
}
@keyframes msgin { from { opacity: 0; transform: translateX(-6px); } }
.msg .side { width: 3px; border-radius: 2px; background: var(--dimmer); }
.msg .who { font-family: var(--cond); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; font-size: 11px; }
.msg .txt { font-size: 13.5px; line-height: 1.4; color: var(--ink); margin-top: 2px; }
.msg .t { font-family: var(--mono); font-size: 10px; color: var(--dimmer); float: right; }
.msg.eng .who { color: var(--pegasus); }
.msg.car .who { color: var(--zeus); }
.msg.crit .who { color: var(--red); }
.msg.crit .side { background: var(--red); }
.msg.warn .side { background: var(--yellow); }

/* ---------- Track map ---------- */
.track-wrap { padding: 12px; display: grid; grid-template-columns: 1.3fr 1fr; gap: 12px; align-items: center; }
.track-wrap svg { width: 100%; height: auto; }
.car-dot { animation: lap 6s linear infinite; }
.sector-legend { display: flex; flex-direction: column; gap: 8px; }
.sl-row { display: flex; align-items: center; gap: 9px; font-size: 12px; }
.sl-row .k { width: 22px; height: 6px; border-radius: 2px; }
.sl-row .lab { font-family: var(--cond); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; font-size: 12px; }
.sl-row .val { margin-left: auto; font-family: var(--mono); font-size: 12px; color: var(--dim); }

/* ---------- Standings ---------- */
.stand-row {
  display: grid; grid-template-columns: 22px 4px 1fr auto; align-items: center; gap: 9px;
  padding: 8px 12px; border-bottom: 1px solid var(--line);
}
.stand-row:last-child { border-bottom: 0; }
.stand-row .p { font-family: var(--cond); font-weight: 800; font-size: 15px; text-align: center; color: var(--dim); }
.stand-row .b { width: 4px; height: 20px; border-radius: 2px; }
.stand-row .n { font-family: var(--cond); font-weight: 600; text-transform: uppercase; font-size: 14px; letter-spacing: 0.03em; }
.stand-row .pts { font-family: var(--mono); font-weight: 700; font-size: 14px; }
.stand-row .pts small { color: var(--dimmer); font-weight: 400; font-size: 10px; }
.stand-row .delta { font-family: var(--mono); font-size: 10px; margin-left: 6px; }
.up { color: var(--green); } .down { color: var(--red); } .same { color: var(--dimmer); }

/* ---------- Stewards ---------- */
.steward { padding: 12px; }
.steward .doc {
  border: 1px solid var(--line-strong); border-radius: 3px; padding: 12px;
  background: repeating-linear-gradient(180deg, rgba(255,255,255,0.02) 0 26px, transparent 26px 27px);
}
.steward .doc h3 {
  margin: 0 0 8px; font-family: var(--cond); font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.1em; font-size: 13px; color: var(--yellow);
  display: flex; justify-content: space-between; align-items: baseline;
}
.steward .doc h3 span { font-family: var(--mono); font-size: 10px; color: var(--dimmer); letter-spacing: 0; }
.steward .doc p { margin: 0 0 8px; font-size: 12.5px; line-height: 1.5; color: var(--ink); }
.steward .verdict {
  font-family: var(--cond); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  font-size: 12px; color: var(--red); padding-top: 8px; border-top: 1px solid var(--line);
}

/* ---------- Telemetry tiles ---------- */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); }
.tile { background: var(--panel); padding: 11px 12px; }
.tile .k { font-family: var(--cond); font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; font-size: 10px; color: var(--dim); }
.tile .v { font-family: var(--cond); font-weight: 800; font-size: 22px; margin-top: 3px; line-height: 1; }
.tile .v small { font-size: 12px; color: var(--dim); font-weight: 600; }
.tile .v.ok { color: var(--green); } .tile .v.warn { color: var(--yellow); } .tile .v.bad { color: var(--red); }
.spark { height: 30px; width: 100%; margin-top: 6px; display: block; }
.flags-mini { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.mini-flag { font-family: var(--cond); font-weight: 700; font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; padding: 3px 7px; border-radius: 2px; border: 1px solid var(--line-strong); color: var(--dim); }
.mini-flag.active { color: var(--yellow); border-color: var(--yellow); background: rgba(255,194,30,0.08); }

/* ---------- Ticker ---------- */
.ticker {
  margin-top: 12px; border: 1px solid var(--line); border-radius: 4px; overflow: hidden;
  background: var(--panel); display: flex; align-items: center;
}
.ticker .badge {
  flex: none; font-family: var(--cond); font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.1em; font-size: 12px; padding: 10px 14px; color: var(--bg);
  background: var(--purple); align-self: stretch; display: flex; align-items: center;
}
.ticker .track { overflow: hidden; flex: 1; }
.ticker .move {
  display: inline-flex; gap: 40px; white-space: nowrap;
  padding-left: 100%; animation: scroll 34s linear infinite;
  font-family: var(--mono); font-size: 12px; color: var(--dim);
}
.ticker .move b { color: var(--ink); font-weight: 700; }
@keyframes scroll { to { transform: translateX(-100%); } }

.foot { margin-top: 14px; text-align: center; color: var(--dimmer); font-size: 11px; font-family: var(--mono); }

@media (max-width: 1080px) {
  .board { grid-template-columns: 1fr; }
  .session { grid-template-columns: 1fr; text-align: center; gap: 10px; }
  .right-head { justify-content: center; flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; }
}

/* ---------- Drill-down: clickable rows ---------- */
/* Verbatim from the mockup — the timing-tower rows are the click targets that open
 * the per-service garage overlay (issue #4). app.js wires click/Enter/Space on a
 * row to open the garage for its data-service; the cursor/hover/focus affordance
 * below is that seam. */
section[aria-label="Live timing"] .tt-row:not(.tt-head) { cursor: pointer; transition: background .12s ease; }
section[aria-label="Live timing"] .tt-row:not(.tt-head):hover { background: rgba(255,255,255,0.035); }
section[aria-label="Live timing"] .tt-row:not(.tt-head):focus-visible { outline: 2px solid var(--pegasus); outline-offset: -2px; }

/* ---------- Drill-down: garage overlay (issue #4) ---------- */
/* VERBATIM from the mockup's garage CSS block (the look is a hard requirement —
 * re-prove any visual change against wesolv-infra/docs/olympus/olympus-pit-wall.html,
 * do not "tidy"). app.js fills #garageInner from the live /api/garage/* endpoints;
 * these rules render it. */
.overlay {
  position: fixed; inset: 0; z-index: 500; display: none;
  background: rgba(4,6,12,0.74);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.overlay.open { display: block; animation: fade .2s ease both; }
@keyframes fade { from { opacity: 0; } }
.garage { position: absolute; inset: 0; overflow-y: auto; }
.garage-inner { max-width: 1240px; margin: 0 auto; padding: 14px 16px 48px; animation: rise .28s cubic-bezier(.2,.7,.2,1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

.g-head {
  position: relative; border: 1px solid var(--line); border-radius: 4px; overflow: hidden;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  padding: 14px 16px 14px 20px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.g-head::before { content:""; position:absolute; left:0; top:0; bottom:0; width:6px; background: var(--accent); }
.g-back {
  font-family: var(--cond); font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em;
  font-size: 12px; color: var(--dim); background: var(--bg-2); border: 1px solid var(--line-strong);
  border-radius: 3px; padding: 8px 12px; cursor: pointer;
}
.g-back:hover { color: var(--ink); border-color: var(--accent); }
.g-title { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.g-title .num { font-family: var(--cond); font-weight: 800; font-size: 22px; color: var(--accent); }
.g-title .nm { font-family: var(--cond); font-weight: 800; font-size: 30px; text-transform: uppercase; letter-spacing: 0.02em; line-height: 1; }
.g-title .role { font-size: 12px; color: var(--dim); }
.g-ns { font-family: var(--mono); font-size: 11px; color: var(--dimmer); }
.g-status {
  margin-left: auto; font-family: var(--cond); font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.08em; font-size: 13px; padding: 7px 12px; border-radius: 3px; border: 1px solid;
}
.g-status.ok { color: var(--green); border-color: rgba(43,224,138,0.5); background: rgba(43,224,138,0.08); }
.g-status.warn { color: var(--yellow); border-color: rgba(255,194,30,0.5); background: rgba(255,194,30,0.08); }
.g-status.bad { color: var(--red); border-color: rgba(255,59,71,0.5); background: rgba(255,59,71,0.08); }
.g-status.res { color: var(--gaia); border-color: rgba(127,184,64,0.5); background: rgba(127,184,64,0.08); }

.g-stats { display: grid; grid-template-columns: repeat(6,1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 4px; overflow: hidden; margin-top: 12px; }
.g-stat { background: var(--panel); padding: 12px 14px; }
.g-stat .k { font-family: var(--cond); font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; font-size: 10px; color: var(--dim); }
.g-stat .v { font-family: var(--cond); font-weight: 800; font-size: 24px; margin-top: 4px; line-height: 1; }
.g-stat .v small { font-size: 12px; color: var(--dim); font-weight: 600; }

.g-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 12px; margin-top: 12px; }
.g-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
@media (max-width: 980px) { .g-grid { grid-template-columns: 1fr; } .g-stats { grid-template-columns: repeat(3,1fr); } }

.trace-box { padding: 12px; }
.trace-legend { display: flex; gap: 16px; margin-bottom: 8px; flex-wrap: wrap; }
.trace-legend span { font-family: var(--mono); font-size: 11px; color: var(--dim); display: inline-flex; align-items: center; gap: 6px; }
.trace-legend i { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }
.trace-box svg { width: 100%; height: auto; display: block; }

.sect-anal { padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.sect-anal .r { display: grid; grid-template-columns: 96px 1fr 62px; align-items: center; gap: 10px; }
.sect-anal .lab { font-family: var(--cond); font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; font-size: 12px; }
.sect-anal .track { height: 8px; background: var(--bg-2); border-radius: 4px; overflow: hidden; }
.sect-anal .fill { height: 100%; border-radius: 4px; }
.sect-anal .ms { font-family: var(--mono); font-size: 12px; text-align: right; }
.sect-anal .ms.p { color: var(--purple); }

.tyres { padding: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tyre-g { display: flex; align-items: center; gap: 12px; }
.tyre-g svg { flex: none; }
.tyre-g .meta .pos { font-family: var(--cond); font-weight: 800; font-size: 13px; letter-spacing: 0.06em; }
.tyre-g .meta .pod { font-family: var(--mono); font-size: 10px; color: var(--dimmer); }
.tyre-g .meta .kv { font-family: var(--mono); font-size: 11px; color: var(--dim); margin-top: 3px; }

.kv-sheet { padding: 4px 0; }
.kv-sheet .row { display: grid; grid-template-columns: 40% 60%; padding: 8px 14px; border-bottom: 1px solid var(--line); }
.kv-sheet .row:last-child { border-bottom: 0; }
.kv-sheet .kk { font-family: var(--cond); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; font-size: 11px; color: var(--dim); }
.kv-sheet .vv { font-family: var(--mono); font-size: 12px; color: var(--ink); text-align: right; word-break: break-all; }

.ers { padding: 12px; }
.ers .bar-l { height: 12px; background: var(--bg-2); border-radius: 6px; overflow: hidden; margin: 8px 0 6px; }
.ers .bar-f { height: 100%; background: linear-gradient(90deg, var(--green), var(--accent)); border-radius: 6px; }
.ers .hpa { font-family: var(--mono); font-size: 12px; color: var(--dim); }

.faults { overflow: hidden; }
.faults table { width: 100%; border-collapse: collapse; }
.faults th {
  text-align: left; font-family: var(--cond); font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; font-size: 10px; color: var(--dimmer); padding: 8px 12px; border-bottom: 1px solid var(--line-strong);
}
.faults td { padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 12px; vertical-align: top; }
.faults tr:last-child td { border-bottom: 0; }
.faults .fx { font-family: var(--mono); font-size: 11.5px; color: var(--ink); }
.faults .ep { font-family: var(--mono); font-size: 11px; color: var(--dim); }
.faults .cnt { font-family: var(--mono); font-weight: 700; text-align: right; }
.faults .t { font-family: var(--mono); font-size: 11px; color: var(--dimmer); white-space: nowrap; }
.sev { width: 4px; padding: 0 !important; }
.sev.e { background: var(--red); } .sev.w { background: var(--yellow); } .sev.i { background: var(--dimmer); }
.faults .clean { padding: 22px; text-align: center; color: var(--dim); font-family: var(--cond); text-transform: uppercase; letter-spacing: 0.1em; font-size: 13px; }

.g-banner {
  margin-top: 12px; border: 1px solid; border-radius: 4px; padding: 12px 16px;
  font-size: 13px; line-height: 1.5;
}
.g-banner.bad { border-color: rgba(255,59,71,0.45); background: rgba(255,59,71,0.07); }
.g-banner.res { border-color: rgba(127,184,64,0.4); background: rgba(127,184,64,0.06); }
.g-banner b { font-family: var(--cond); font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; }
.g-banner.bad b { color: var(--red); } .g-banner.res b { color: var(--gaia); }

/* ---------- Deploy history / lap chart ---------- */
.deploys { padding: 14px; }
.deploy-legend { display: flex; gap: 14px; margin-bottom: 10px; flex-wrap: wrap; }
.deploy-legend span { font-family: var(--mono); font-size: 10px; color: var(--dim); display: inline-flex; align-items: center; gap: 5px; }
.deploy-legend i { width: 10px; height: 10px; border-radius: 2px; }
.deploy-strip { display: flex; gap: 3px; align-items: flex-end; height: 68px; }
.deploy-seg { flex: 1 1 0; min-width: 5px; border-radius: 2px 2px 0 0; cursor: pointer; opacity: 0.9; transition: opacity .1s, transform .1s; }
.deploy-seg:hover, .deploy-seg.sel { opacity: 1; transform: scaleY(1.03); }
.deploy-seg.sel { outline: 1px solid rgba(255,255,255,0.5); outline-offset: 1px; }
.d-clean { background: var(--green); } .d-record { background: var(--purple); }
.d-rollback { background: var(--yellow); } .d-failed { background: var(--red); }
.deploy-cap { margin-top: 10px; font-family: var(--mono); font-size: 12px; color: var(--ink); display: flex; gap: 14px; flex-wrap: wrap; }
.deploy-cap .lab { color: var(--dimmer); }
.deploy-cap b.o-clean { color: var(--green); } .deploy-cap b.o-record { color: var(--purple); }
.deploy-cap b.o-rollback { color: var(--yellow); } .deploy-cap b.o-failed { color: var(--red); }

/* ---------- Expandable faults ---------- */
.fault { border-bottom: 1px solid var(--line); }
.fault:last-child { border-bottom: 0; }
.fault-h {
  width: 100%; text-align: left; background: none; border: 0; cursor: pointer; color: inherit;
  display: grid; grid-template-columns: 4px 78px 1fr 40px 16px; align-items: center; gap: 12px;
  padding: 11px 12px; font-family: inherit;
}
.fault-h:hover { background: rgba(255,255,255,0.025); }
.fault-h:focus-visible { outline: 2px solid var(--pegasus); outline-offset: -2px; }
.fault-h .dot { width: 4px; height: 26px; border-radius: 2px; }
.fault-h .dot.e { background: var(--red); } .fault-h .dot.w { background: var(--yellow); } .fault-h .dot.i { background: var(--dimmer); }
.fault-h .t { font-family: var(--mono); font-size: 11px; color: var(--dimmer); }
.fault-h .fx { font-family: var(--mono); font-size: 12px; color: var(--ink); }
.fault-h .fx .ep { display: block; font-size: 10.5px; color: var(--dim); margin-top: 2px; }
.fault-h .cnt { font-family: var(--mono); font-weight: 700; font-size: 12px; text-align: right; }
.fault-h .chev { font-family: var(--cond); font-weight: 800; color: var(--dimmer); transition: transform .15s; text-align: center; }
.fault-h[aria-expanded="true"] .chev { transform: rotate(90deg); color: var(--ink); }
.fault-d { padding: 0 12px 14px 30px; display: none; }
.fault-d.open { display: block; animation: fade .18s ease both; }
.fault-d .cap { font-family: var(--cond); font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em; font-size: 10px; color: var(--dim); margin: 10px 0 5px; }
.fault-d .code {
  font-family: var(--mono); font-size: 11px; line-height: 1.6; color: #c7d0de;
  background: #05070d; border: 1px solid var(--line); border-radius: 3px; padding: 10px 12px;
  overflow-x: auto; white-space: pre; margin: 0;
}
.fault-d .code .err { color: var(--red); }
.fault-d .code .at { color: var(--dim); }
.fault-d .code .hl { color: var(--yellow); }
.fault-d .log .lv-e { color: var(--red); } .fault-d .log .lv-w { color: var(--yellow); } .fault-d .log .lv-i { color: var(--pegasus); }

/* ======================================================================== */
/* pitwall-ui additions — NOT in the static mockup. The live board needs a   */
/* few states the fixtures never showed: coming-soon tiles for panels with   */
/* no proven query, a non-blocking upstream-error banner, and a quiet empty  */
/* state for the tower. Same tokens, same visual language.                   */
/* ======================================================================== */

/* Coming-soon tile — a panel whose query is not proven yet (Team Radio,
 * Constructors' Standings, Strategy/Iris). Laid out IN its slot so the panel is
 * not lost, and unmistakably not-yet-live. */
.placeholder {
  padding: 26px 16px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.placeholder .cs {
  font-family: var(--cond); font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.14em; font-size: 12px; color: var(--dim);
  border: 1px dashed var(--line-strong); border-radius: 3px; padding: 5px 12px;
}
.placeholder .why { font-size: 11.5px; line-height: 1.5; color: var(--dimmer); max-width: 34ch; }

/* Non-blocking upstream banner — shown when an /api/* call 502s (pitwall-api
 * could not reach AMW / Log Analytics, e.g. before wesolv-infra #109 grants the
 * workload identity). The board keeps its last-good render; this strip just says
 * the data may be stale. Hidden by default; app.js toggles [hidden]. */
.board-banner {
  margin-top: 12px; border: 1px solid rgba(255,194,30,0.45);
  background: rgba(255,194,30,0.07); border-radius: 4px;
  padding: 10px 16px; font-size: 12.5px; line-height: 1.5; color: var(--ink);
}
.board-banner b {
  font-family: var(--cond); font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--yellow);
}
.board-banner[hidden] { display: none; }

/* Quiet-platform empty state for the tower — nothing flowing right now is a
 * valid board (see the pitwall-api empty→200 contract), not an error. */
.tt-empty {
  padding: 26px 16px; text-align: center;
  font-family: var(--cond); text-transform: uppercase; letter-spacing: 0.12em;
  font-size: 13px; color: var(--dim);
}

/* ======================================================================== */
/* Auth gate (issue #5) — the Keycloak SSO states. Shown fullscreen INSTEAD  */
/* of the board (#wrap) while signing in, and for the access-denied / config- */
/* error terminal states, so no unauthorised user ever sees a working board.  */
/* Same tokens and typographic language as the rest of the board.            */
/* ======================================================================== */
.auth-gate {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(255,194,30,0.06), transparent),
    var(--bg);
}
.auth-gate[hidden] { display: none; }
.auth-card {
  max-width: 460px; text-align: center;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line-strong); border-radius: 8px;
  padding: 34px 30px; box-shadow: 0 24px 60px rgba(0,0,0,0.5);
}
.auth-badge {
  display: inline-block; font-family: var(--cond); font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.16em; font-size: 12px;
  color: var(--dim); border: 1px solid var(--line-strong); border-radius: 3px;
  padding: 5px 12px; margin-bottom: 18px;
}
.auth-card h1 {
  font-family: var(--cond); font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.06em; font-size: 26px; margin: 0 0 10px; color: var(--ink);
}
.auth-card p {
  font-size: 13px; line-height: 1.6; color: var(--dimmer); margin: 0 auto;
  max-width: 40ch;
}
.auth-btn {
  margin-top: 20px; cursor: pointer;
  font-family: var(--cond); font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; font-size: 12px; color: var(--bg);
  background: var(--yellow); border: none; border-radius: 4px;
  padding: 10px 20px;
}
.auth-btn:hover { filter: brightness(1.06); }

/* Access-denied leans red; config/IdP error leans neutral-red; signing-in keeps
 * the calm default. Only the accent differs — the layout is shared. */
.auth-gate.denied .auth-card { border-color: rgba(255,59,71,0.5); }
.auth-gate.denied h1 { color: var(--red); }
.auth-gate.error .auth-card { border-color: rgba(255,194,30,0.5); }
.auth-gate.error h1 { color: var(--yellow); }

/* Who's-signed-in chip in the session bar (filled by app.js from the token). */
.whoami { color: var(--dim); font-weight: 500; }
