/* Translator app shell — "Departure Board" world.
   Black-glass split-flap board in a brushed-steel frame, paint-white letters,
   amber lamps for live/new, dim red for failures. */

:root {
  --board: #0a0b0d;
  --board-2: #111317;
  --flap: #1b1d22;
  --flap-hi: #262a31;
  --flap-lo: #141619;
  --seam: rgba(0, 0, 0, .72);
  --paint: #f5f3ea;
  --paint-2: #c9c6bb;
  --steel: #9aa3ad;
  --steel-2: #6c747e;
  --rule: rgba(245, 243, 234, .08);
  --rule-2: rgba(245, 243, 234, .14);
  --amber: #ffb020;
  --amber-hi: #ffd27a;
  --amber-lo: #c97c00;
  --amber-glow: rgba(255, 176, 32, .35);
  --red: #e0443a;
  --red-dim: #b9786f;
  --steel-a: #4a4f57;
  --steel-b: #2b2f35;

  --f-sign: "Barlow Condensed", "Noto Sans Tamil", "Arial Narrow", sans-serif;
  --f-read: "Barlow", "Noto Sans Tamil", system-ui, sans-serif;

  --tab-h: 62px;
  --head-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body.tr {
  margin: 0;
  background: var(--board);
  color: var(--paint);
  font: 400 16px/1.45 var(--f-read);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
.tr ::selection { background: var(--amber); color: #120c00; }
.tr :focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 6px; }
.tr a { color: var(--paint); }
.tr :where(button) { font: inherit; color: inherit; }
.tr * { scrollbar-width: thin; scrollbar-color: var(--steel-b) transparent; }
.tr ::-webkit-scrollbar { width: 8px; }
.tr ::-webkit-scrollbar-thumb { background: var(--steel-b); border-radius: 8px; }
.tr .tnum { font-variant-numeric: tabular-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Painted steel ---------- */
.steel {
  background: linear-gradient(180deg, #4a5058 0%, #383d44 48%, #2a2e34 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.22), inset 0 -1px 0 rgba(0,0,0,.6);
}

/* ---------- App frame ---------- */
.app {
  min-height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr;
  max-width: 820px;
  margin: 0 auto;
  background: var(--board);
  position: relative;
}
@media (min-width: 900px) {
  body.tr { background: radial-gradient(1200px 600px at 50% -10%, #1a1d22 0%, #060708 60%); }
  .app { border-left: 6px solid #383d44; border-right: 6px solid #383d44; box-shadow: inset 1px 0 0 rgba(255,255,255,.12), inset -1px 0 0 rgba(255,255,255,.12), 0 30px 80px rgba(0,0,0,.7); }
}

/* ---------- Header ---------- */
.hd {
  position: sticky; top: 0; z-index: 30;
  padding: calc(var(--safe-t) + 10px) 14px 10px;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid #000;
}
.hd-title { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.hd-name { font: 700 13px/1 var(--f-sign); letter-spacing: .22em; text-transform: uppercase; color: #e9e6dc; text-shadow: 0 1px 0 rgba(0,0,0,.6); }
.hd-sub { font: 500 12px/1.2 var(--f-sign); letter-spacing: .08em; color: #c1c7ce; text-transform: uppercase; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hd-actions { display: flex; gap: 8px; align-items: center; }

/* Small steel key (icon button) */
.key {
  --sz: 42px;
  width: var(--sz); height: var(--sz);
  display: inline-grid; place-items: center;
  border-radius: 12px; border: 1px solid #0b0c0e;
  background: linear-gradient(180deg, #3d424a, #24282d);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18), 0 2px 4px rgba(0,0,0,.5);
  color: var(--paint); font-size: 18px; cursor: pointer; text-decoration: none;
  transition: transform .12s var(--ease-out), background .2s;
  position: relative; flex: 0 0 auto;
}
.key:active { transform: translateY(1px) scale(.97); box-shadow: inset 0 1px 3px rgba(0,0,0,.6); }
.key[aria-pressed="true"] { color: var(--amber); }
.key[aria-pressed="true"]::after {
  content: ""; position: absolute; top: 6px; right: 6px; width: 6px; height: 6px; border-radius: 50%;
  background: var(--amber); box-shadow: 0 0 6px var(--amber-glow);
}
.key:disabled { opacity: .4; cursor: default; }
.key-label { display: block; font: 600 10px/1 var(--f-sign); letter-spacing: .14em; text-transform: uppercase; color: var(--steel); margin-top: 6px; text-align: center; }

/* ---------- Lamps ---------- */
.lamp { width: 9px; height: 9px; border-radius: 50%; background: #3a3d42; box-shadow: inset 0 1px 1px rgba(0,0,0,.6); flex: 0 0 auto; }
.lamp.on { background: radial-gradient(circle at 35% 30%, var(--amber-hi), var(--amber) 55%, var(--amber-lo)); box-shadow: 0 0 10px var(--amber-glow), 0 0 2px var(--amber); }
.lamp.err { background: radial-gradient(circle at 35% 30%, #ff9a90, var(--red) 60%); box-shadow: 0 0 10px rgba(224,68,58,.4); }
.lamp.blink { animation: lampBlink 1.1s steps(2, jump-none) infinite; }
@keyframes lampBlink { 50% { opacity: .25; } }

/* ---------- Flap cells ---------- */
.flaps { display: inline-flex; gap: 3px; }
.flap {
  position: relative;
  display: inline-grid; place-items: center;
  min-width: .78em; height: 1.32em; padding: 0 .08em;
  font: 600 1em/1 var(--f-sign); text-transform: uppercase; color: var(--paint);
  background: linear-gradient(180deg, var(--flap-hi) 0%, var(--flap) 49.6%, var(--flap-lo) 50.4%, var(--flap) 100%);
  border-radius: .12em;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.07), 0 2px 3px rgba(0,0,0,.55);
  transform-origin: 50% 50%;
}
.flap::after { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--seam); }
.flap.gap { background: none; box-shadow: none; min-width: .4em; }
.flap.gap::after { display: none; }
.flap.amber { color: var(--amber); }
.flap.tick { animation: flapTick 70ms linear; }
@keyframes flapTick {
  0% { transform: perspective(200px) rotateX(0); }
  50% { transform: perspective(200px) rotateX(-70deg); filter: brightness(.6); }
  100% { transform: perspective(200px) rotateX(0); }
}

/* ---------- Route (language pair) board ---------- */
.route {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: stretch; gap: 10px;
  padding: 16px 14px 14px;
  border-bottom: 1px solid var(--rule);
  background: linear-gradient(180deg, var(--board-2), var(--board));
}
.route.two { grid-template-columns: 1fr 1fr; }
.route-cell { position: relative; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.route-cell.to { align-items: flex-end; text-align: right; }
.route-label { font: 600 11px/1 var(--f-sign); letter-spacing: .18em; text-transform: uppercase; color: var(--steel); }
.route-code { font-size: 44px; }
.route-name { font: 500 14px/1.1 var(--f-sign); letter-spacing: .06em; text-transform: uppercase; color: var(--paint-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.route-pick { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; font-size: 16px; }
.route-pick:focus-visible + .route-code { outline: 2px solid var(--amber); outline-offset: 4px; border-radius: 6px; }
.route-arrow { display: grid; place-items: center; color: var(--amber); font-size: 26px; padding-top: 14px; }
.route-cell:active .route-code { transform: scale(.98); }

/* ---------- Status strip ---------- */
.strip {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; border-bottom: 1px solid var(--rule);
  font: 600 13px/1.2 var(--f-sign); letter-spacing: .12em; text-transform: uppercase; color: var(--steel);
}
.strip .msg { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.strip .count { color: var(--paint-2); }
.strip.live .msg { color: var(--amber); }
.strip.err .msg { color: #ff8a80; }

/* ---------- Board rows ---------- */
.board { padding: 0 0 calc(var(--tab-h) + var(--safe-b) + 150px); }
.row {
  display: grid; grid-template-columns: 44px 1fr auto; gap: 4px 10px;
  padding: 14px 14px 14px 10px;
  border-bottom: 1px solid var(--rule);
  align-items: start;
}
.row-meta { display: flex; flex-direction: column; align-items: center; gap: 7px; padding-top: 3px; }
.row-time { font: 600 12px/1 var(--f-sign); letter-spacing: .04em; color: var(--steel-2); font-variant-numeric: tabular-nums; }
.row.is-new .row-time { color: var(--amber); }
.row-src { grid-column: 2; display: flex; gap: 8px; align-items: baseline; color: var(--steel); font-size: 15px; line-height: 1.4; min-width: 0; }
.row-src .code { font-size: 15px; flex: 0 0 auto; }
.row-src .txt { min-width: 0; overflow-wrap: anywhere; }
.row-tgt { grid-column: 2; font: 500 clamp(21px, 5.4vw, 26px)/1.28 var(--f-read); color: var(--paint); overflow-wrap: anywhere; margin-top: 2px; text-wrap: pretty; }
.row-tgt .w { display: inline-block; white-space: pre; }
.row-tgt .w.in { animation: wordIn .32s var(--ease-out) both; }
@keyframes wordIn { from { transform: perspective(300px) rotateX(-80deg); opacity: 0; filter: brightness(2); } to { transform: none; opacity: 1; } }
.row-tgt.pending { color: var(--steel); font-size: 18px; }
.row-tgt.pending::after { content: ""; display: inline-block; width: .55em; height: .9em; margin-left: 4px; vertical-align: -2px; background: var(--amber); animation: lampBlink 1s steps(2, jump-none) infinite; }
.row.failed .row-tgt { color: var(--red-dim); font-size: 16px; }
.row-act { grid-row: 1 / span 2; grid-column: 3; display: flex; flex-direction: column; gap: 6px; }
.row-act .key { --sz: 40px; font-size: 17px; }
.row.interim .row-src { color: var(--paint-2); font-style: italic; }

/* Empty board */
.empty { padding: 44px 24px; text-align: center; color: var(--steel); }
.empty .flaps { font-size: 26px; margin-bottom: 18px; }
.empty p { margin: 0 auto; max-width: 30ch; font-size: 15px; }

/* ---------- Control deck ---------- */
.deck {
  position: fixed; left: 0; right: 0; bottom: calc(var(--tab-h) + var(--safe-b)); z-index: 25;
  max-width: 820px; margin: 0 auto;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: end;
  padding: 12px 18px 30px;
  background: linear-gradient(180deg, rgba(10,11,13,0) 0%, rgba(10,11,13,.92) 28%, var(--board) 60%);
  pointer-events: none;
}
.deck > * { pointer-events: auto; }
.deck-side { display: flex; gap: 14px; align-items: end; }
.deck-side.r { justify-content: flex-end; }
.deck .key { --sz: 52px; border-radius: 16px; font-size: 21px; }

.talk {
  --sz: 92px;
  width: var(--sz); height: var(--sz); border-radius: 50%;
  border: 0; cursor: pointer; position: relative;
  display: grid; place-items: center; color: #2a1900;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(255,255,255,.75) 0%, rgba(255,255,255,0) 46%),
    radial-gradient(circle at 50% 60%, var(--amber) 0%, #f39a00 62%, var(--amber-lo) 100%);
  box-shadow:
    0 0 0 6px #1d2025, 0 0 0 7px #000,
    0 10px 24px rgba(0,0,0,.6),
    inset 0 -6px 12px rgba(120,60,0,.45);
  transition: transform .15s var(--ease-out), box-shadow .3s;
}
.talk i { font-size: 34px; filter: drop-shadow(0 1px 0 rgba(255,255,255,.4)); }
.talk:active { transform: scale(.95); }
.talk-label { position: absolute; bottom: -22px; left: 50%; transform: translateX(-50%); font: 700 11px/1 var(--f-sign); letter-spacing: .24em; color: var(--steel); white-space: nowrap; }
.talk.listening {
  color: #fff;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(255,255,255,.55) 0%, rgba(255,255,255,0) 46%),
    radial-gradient(circle at 50% 60%, #ff5a4e 0%, var(--red) 62%, #9b221a 100%);
  box-shadow: 0 0 0 6px #1d2025, 0 0 0 7px #000, 0 10px 24px rgba(0,0,0,.6), 0 4px 30px rgba(224,68,58,.45), inset 0 -6px 12px rgba(80,0,0,.45);
}
.talk.listening::before {
  content: ""; position: absolute; inset: -14px; border-radius: 50%;
  border: 2px solid rgba(224,68,58,.55);
  animation: ring 1.4s var(--ease-out) infinite;
}
@keyframes ring { from { transform: scale(.85); opacity: 1; } to { transform: scale(1.25); opacity: 0; } }
.talk.listening .talk-label { color: #ff8a80; }
.key.rec { color: #fff; background: linear-gradient(180deg, #e0574e, #a8261e); }

/* ---------- Tab bar ---------- */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  max-width: 820px; margin: 0 auto;
  height: calc(var(--tab-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  border-top: 1px solid #000;
}
.tab {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  text-decoration: none; color: #c6ccd3;
  font: 600 11px/1 var(--f-sign); letter-spacing: .16em; text-transform: uppercase;
  position: relative;
}
.tab i { font-size: 21px; line-height: 1; }
.tab[aria-current="page"] { color: #fff; }
.tab[aria-current="page"]::before {
  content: ""; position: absolute; top: 7px; width: 6px; height: 6px; border-radius: 50%;
  background: var(--amber); box-shadow: 0 0 8px var(--amber-glow);
}
.tab[aria-current="page"] i { color: var(--amber); }
.tab:active { background: rgba(0,0,0,.15); }

/* ---------- Pages (non-live) ---------- */
.page { padding: 0 0 calc(var(--tab-h) + var(--safe-b) + 28px); }
.sect { padding: 18px 14px 6px; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.sect h2 { margin: 0; font: 700 15px/1 var(--f-sign); letter-spacing: .2em; text-transform: uppercase; color: var(--steel); }
.sect .hint { font-size: 13px; color: var(--steel); }

/* Board list (sessions) */
.blist { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.blist a {
  display: grid; grid-template-columns: auto 1fr auto; gap: 4px 14px; align-items: center;
  padding: 14px; border-bottom: 1px solid var(--rule); text-decoration: none; color: var(--paint);
}
.blist a:active { background: var(--board-2); }
.blist .no { font-size: 20px; grid-row: 1 / span 2; }
.blist .t { font: 600 18px/1.25 var(--f-read); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.blist .m { grid-column: 2; font: 500 13px/1.2 var(--f-sign); letter-spacing: .08em; text-transform: uppercase; color: var(--steel); display: flex; gap: 12px; flex-wrap: wrap; }
.blist .m b { color: var(--amber); font-weight: 600; }
.blist .chev { grid-row: 1 / span 2; grid-column: 3; color: var(--steel-2); font-size: 18px; }

/* Settings form */
.form { padding: 4px 14px 0; display: grid; gap: 16px; }
.fld { display: grid; gap: 7px; }
.fld > label, .fld > .lbl { font: 600 12px/1 var(--f-sign); letter-spacing: .16em; text-transform: uppercase; color: var(--steel); }
.fld .help { font-size: 13px; color: var(--steel); line-height: 1.4; }
.fld .help.ok { color: var(--amber); }
.inp {
  width: 100%; min-height: 50px; padding: 12px 14px;
  font: 500 16px/1.2 var(--f-read); color: var(--paint);
  background: linear-gradient(180deg, var(--flap-lo), var(--flap));
  border: 1px solid #000; border-radius: 10px;
  box-shadow: inset 0 2px 4px rgba(0,0,0,.55), 0 1px 0 rgba(255,255,255,.05);
  caret-color: var(--amber);
}
.inp::placeholder { color: #8a929b; }
.inp:focus { outline: none; border-color: var(--amber); box-shadow: inset 0 2px 4px rgba(0,0,0,.55), 0 0 0 3px rgba(255,176,32,.18); }
.grid2 { display: grid; gap: 16px; }
@media (min-width: 640px) { .grid2 { grid-template-columns: 1fr 1fr; } }

/* Lamp switch */
.switch { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px; border: 1px solid var(--rule-2); border-radius: 12px; background: var(--board-2); cursor: pointer; }
.switch .txt { font: 600 17px/1.25 var(--f-read); }
.switch .txt small { display: block; font: 400 13px/1.35 var(--f-read); color: var(--steel); margin-top: 3px; }
.switch input { appearance: none; -webkit-appearance: none; width: 58px; height: 32px; border-radius: 32px; flex: 0 0 auto; position: relative; cursor: pointer;
  background: linear-gradient(180deg, #15171a, #22252a); border: 1px solid #000; box-shadow: inset 0 2px 4px rgba(0,0,0,.6); transition: background .25s; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%;
  background: linear-gradient(180deg, #6a7078, #3b4047); box-shadow: 0 2px 3px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.3); transition: transform .25s var(--ease-out), background .25s; }
.switch input:checked { background: linear-gradient(180deg, #3d2800, #5a3a00); }
.switch input:checked::after { transform: translateX(26px); background: radial-gradient(circle at 40% 30%, var(--amber-hi), var(--amber) 60%, var(--amber-lo)); box-shadow: 0 0 10px var(--amber-glow), 0 2px 3px rgba(0,0,0,.5); }

/* Buttons */
.btn-amber, .btn-steel {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 22px; border-radius: 14px; cursor: pointer; text-decoration: none;
  font: 700 15px/1 var(--f-sign); letter-spacing: .16em; text-transform: uppercase;
  transition: transform .12s var(--ease-out), filter .2s;
}
.btn-amber { border: 0; color: #2a1900;
  background: radial-gradient(140% 90% at 50% 0%, rgba(255,255,255,.55) 0%, rgba(255,255,255,0) 50%), linear-gradient(180deg, var(--amber), #f39a00);
  box-shadow: 0 6px 16px rgba(0,0,0,.5), inset 0 -3px 6px rgba(120,60,0,.35); }
.btn-steel { border: 1px solid #000; color: var(--paint); background: linear-gradient(180deg, #3d424a, #24282d); box-shadow: inset 0 1px 0 rgba(255,255,255,.16), 0 3px 8px rgba(0,0,0,.45); }
.btn-amber:active, .btn-steel:active { transform: translateY(1px) scale(.99); }
.btn-amber:hover, .btn-steel:hover { filter: brightness(1.06); }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-row > * { flex: 1 1 160px; }

/* Notice plate */
.plate { margin: 14px; padding: 14px; border-radius: 12px; border: 1px solid var(--rule-2); background: var(--board-2); display: flex; gap: 12px; align-items: flex-start; font-size: 15px; line-height: 1.45; color: var(--paint-2); }
.plate .lamp { margin-top: 6px; }
.plate a { color: var(--amber); }
.plate.err { border-color: rgba(224,68,58,.4); }

/* Info list */
.info { margin: 0; padding: 0 14px; list-style: none; }
.info li { padding: 12px 0; border-bottom: 1px solid var(--rule); color: var(--paint-2); font-size: 15px; line-height: 1.45; }
.info li b { color: var(--paint); font-weight: 600; }

/* ---------- Toast ---------- */
.toast-dock { position: fixed; left: 0; right: 0; top: calc(var(--safe-t) + 74px); z-index: 60; display: grid; justify-items: center; pointer-events: none; padding: 0 14px; }
.toast {
  max-width: 520px; display: flex; gap: 10px; align-items: center;
  padding: 12px 16px; border-radius: 12px; background: #1d2025; border: 1px solid #000;
  box-shadow: 0 12px 30px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.08);
  font: 500 15px/1.35 var(--f-read); color: var(--paint);
  animation: toastIn .35s var(--ease-out);
}
@keyframes toastIn { from { transform: translateY(-12px); opacity: 0; } }

/* ---------- Bottom sheet ---------- */
.sheet-scrim { position: fixed; inset: 0; z-index: 70; background: rgba(0,0,0,.6); display: none; }
.sheet-scrim.open { display: block; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 71; max-width: 620px; margin: 0 auto;
  padding: 10px 18px calc(22px + var(--safe-b));
  border-radius: 20px 20px 0 0; background: var(--board-2); border-top: 1px solid var(--rule-2);
  box-shadow: 0 -20px 50px rgba(0,0,0,.6);
  transform: translateY(105%); transition: transform .35s var(--ease-out);
}
.sheet.open { transform: none; }
.sheet .grab { width: 42px; height: 5px; border-radius: 5px; background: var(--steel-b); margin: 0 auto 14px; }
.sheet h3 { margin: 0 0 14px; font: 700 15px/1 var(--f-sign); letter-spacing: .2em; text-transform: uppercase; color: var(--steel); }

/* ---------- Show mode (turn the phone to the other person) ---------- */
.show {
  position: fixed; inset: 0; z-index: 80; display: none;
  background: var(--board); padding: calc(var(--safe-t) + 24px) 22px calc(var(--safe-b) + 24px);
  flex-direction: column; gap: 18px;
}
.show.open { display: flex; animation: fade .2s; }
.show .lang { font-size: 22px; }
.show .big { flex: 1; display: flex; align-items: center; font: 600 clamp(32px, 9vw, 64px)/1.18 var(--f-read); color: var(--paint); overflow-wrap: anywhere; overflow: auto; }
.show .src { color: var(--steel); font-size: 17px; }
.show .close { align-self: stretch; }

/* ---------- Hold-to-clear ---------- */
.hold { position: relative; overflow: hidden; }
.hold::before {
  content: ""; position: absolute; inset: 0; background: rgba(224,68,58,.55);
  transform: scaleX(0); transform-origin: left; pointer-events: none;
}
.hold.holding::before { transform: scaleX(1); transition: transform .9s linear; }
.hold.holding { color: #fff; }

/* ---------- Install prompt ---------- */
.install { display: none; }
.install.ready { display: inline-grid; }

/* ---------- Print (session detail) ---------- */
@media print {
  body.tr { background: #fff; color: #000; }
  .hd, .tabs, .deck, .no-print { display: none !important; }
  .row { border-color: #ddd; }
  .row-tgt, .row-src { color: #000 !important; }
  .flap { background: #eee; color: #000; box-shadow: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- Review fixes ---------- */
/* Arrival times as flap cells; amber while the row is new */
.row { grid-template-columns: 52px 1fr auto; }
.row-time { display: inline-flex; gap: 1px; font-size: 12px; }
.row-time .flap { min-width: .72em; padding: 0 .06em; color: var(--steel); }
.row.is-new .row-time .flap { color: var(--amber); }
/* Failed status stamped in red cells, recovery text beneath in reading type */
.flap.red { color: #ff8a80; }
.row.failed .row-tgt { display: grid; gap: 8px; }
.row-tgt .stamp { font-size: 15px; }
.row-tgt .why { color: var(--red-dim); font-size: 16px; line-height: 1.4; }
/* Desktop: one centred control cluster */
@media (min-width: 900px) {
  .deck { max-width: 460px; }
}
