/* Arrow Motors brand tokens (Brand Guide 2026 v1.0; build brief section 3.3) */
:root {
  --arrow-blue: #1D4E9F;
  --coral: #DC4A4F;
  --coral-tint: #F4948C;
  --asphalt: #333132;
  --frost: #F8F8F8;

  /* On Arrow Blue */
  --b-panel: #173F82;
  --b-line: #3C68B3;
  --b-input: #5E84C6;
  --b-text-2: #C9D6EE;
  --b-done: #9DB5DE;
  --b-text: #FFFFFF;

  /* On light pages */
  --l-card: #FFFFFF;
  --l-line: #E3E3E3;
  --l-input: #8C8A8B;
  --l-text-2: #5F5D5E;
  --l-missed: #B8343A;
  --l-missed-strong: #A12B30;
  --l-missed-fill: #FBE3E1;

  --font-head: 'Bricolage Grotesque', sans-serif;
  --font-body: 'Nunito Sans', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: var(--font-body); }

/* Docked window screens: sign in, start, live. Hold up from 360 to 420 px wide. */
body.docked { background: var(--arrow-blue); color: var(--b-text); }
.dock {
  min-height: 100dvh;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}
.head { font-family: var(--font-head); font-weight: 800; letter-spacing: -0.03em; }
.eyebrow { font-weight: 600; text-transform: uppercase; color: var(--b-text-2); }
.panel { background: var(--b-panel); border: 1px solid var(--b-line); border-radius: 8px; }
a { color: var(--b-text-2); }
a:hover { color: var(--b-text); }
button { font: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid var(--coral-tint); outline-offset: 2px; }

.btn-coral {
  border: 0; border-radius: 6px; background: var(--coral); color: #fff;
  font-family: var(--font-head); font-weight: 800; letter-spacing: -0.03em;
}
.btn-coral:disabled { opacity: 0.6; cursor: default; }

/* Sign in */
.signin { padding: 32px 28px; justify-content: center; gap: 36px; }
.signin form { display: flex; flex-direction: column; gap: 20px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { font-size: 16px; font-weight: 600; color: var(--b-text-2); }
.field input {
  height: 56px; padding: 0 16px; font: 500 20px var(--font-body); color: #fff;
  background: var(--b-panel); border: 2px solid var(--b-input); border-radius: 6px; width: 100%;
}
.form-error { min-height: 22px; font-size: 16px; font-weight: 600; color: var(--coral-tint); margin: -8px 0 0; }

/* Start */
.start { padding: 24px 20px; gap: 22px; }
.meter { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 5px; height: 28px; }
.meter div { background: var(--b-line); border-radius: 2px; }
.meter div.on { background: #fff; }
.start-btn {
  height: 132px; border-radius: 8px; font-size: 52px; display: flex; align-items: center; justify-content: center;
}
.session-row {
  text-decoration: none; display: flex; justify-content: space-between; align-items: center;
  min-height: 64px; padding: 0 16px; background: var(--b-panel); border: 1px solid var(--b-line); border-radius: 8px; color: #fff;
}
.session-row:hover { color: #fff; border-color: var(--b-input); }

/* Live: no scrolling, readable at a glance */
body.live-body { overflow: hidden; }
.live { height: 100dvh; min-height: 0; padding: 20px; gap: 18px; }
.stages { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
/* Each bar is a 44 px tap target; the visible bar stays 6 px. Tap a bar to move to that stage. */
.stages { margin: -19px 0; }
.stages button { height: 44px; padding: 0; border: 0; background: transparent; display: flex; align-items: center; }
.stages button div { width: 100%; height: 6px; border-radius: 3px; background: var(--b-line); }
.stages button.done div { background: var(--b-done); }
.stages button.now div { background: #fff; }
.card {
  flex: 1 1 auto; min-height: 0; overflow: hidden;
  background: var(--b-panel); border: 2px solid var(--coral-tint); border-radius: 10px; padding: 22px;
  display: flex; flex-direction: column; gap: 14px;
}
.card-quiet {
  flex: 1 1 auto; min-height: 0; border: 2px dashed var(--b-line); border-radius: 10px; padding: 22px;
  display: flex; flex-direction: column; justify-content: center; gap: 10px;
}
.btn-dismiss {
  flex: none; height: 56px; border: 2px solid var(--b-input); border-radius: 8px; background: transparent;
  color: #fff; font-size: 20px; font-weight: 600;
}
.btn-stop {
  flex: none; height: 68px; border: 0; border-radius: 8px; background: #fff; color: var(--arrow-blue);
  display: flex; align-items: center; justify-content: center; gap: 12px;
  font: 800 30px var(--font-head); letter-spacing: -0.03em;
}
.btn-stop:disabled { opacity: 0.7; cursor: default; }

/* Small controls on the live screen: 44 px tap targets, quiet styling */
.btn-arrow {
  flex: none; width: 44px; height: 44px; border: 0; border-radius: 8px; background: transparent;
  color: var(--b-text-2); font-size: 30px; line-height: 1; display: flex; align-items: center; justify-content: center;
}
.btn-arrow:hover:not(:disabled) { color: #fff; background: var(--b-panel); }
.btn-arrow:disabled { opacity: 0.3; cursor: default; }
.btn-ghost {
  flex: none; height: 44px; padding: 0 12px; border: 1px solid var(--b-line); border-radius: 8px; background: transparent;
  color: var(--b-text-2); font-size: 16px; font-weight: 600; margin-left: auto; margin-right: 12px;
}
.btn-ghost:hover { color: #fff; border-color: var(--b-input); }

/* Phase 1 check only: running transcript in the card area */
.transcript { flex: 1 1 auto; min-height: 0; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; gap: 8px; }
.transcript p { margin: 0; font-size: 17px; line-height: 1.35; }
.transcript .who { font-weight: 700; color: var(--b-text-2); margin-right: 6px; }
.transcript .interim { color: var(--b-text-2); }

.notice { font-size: 16px; font-weight: 600; color: var(--coral-tint); }
[hidden] { display: none !important; }

/* Light pages: report, history, settings. Fluid, 720 px max, read on a phone. */
body.light { background: var(--frost); color: var(--asphalt); }
body.light a { color: var(--arrow-blue); }
body.light a:hover { color: var(--asphalt); }
.page {
  max-width: 720px; margin: 0 auto; padding: 20px 16px 48px;
  font-size: 17px; line-height: 1.4; display: flex; flex-direction: column; gap: 28px;
}
.stack-4 { display: flex; flex-direction: column; gap: 4px; }
.stack-10 { display: flex; flex-direction: column; gap: 10px; }
.stack-12 { display: flex; flex-direction: column; gap: 12px; }
.stack-28 { display: flex; flex-direction: column; gap: 28px; }
.back-link { font-size: 16px; font-weight: 600; padding: 11px 0; align-self: flex-start; }
.label-caps { font-size: 13px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--l-text-2); }
.page-title { margin: 0; font-size: 34px; line-height: 1.05; }
.muted { color: var(--l-text-2); }
.page h2 { margin: 0; font: 800 24px var(--font-head); letter-spacing: -0.03em; }
.lcard { background: var(--l-card); border: 1px solid var(--l-line); border-radius: 10px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }

.score-card { background: var(--arrow-blue); color: #fff; border-radius: 10px; padding: 20px; display: flex; flex-direction: column; gap: 18px; }
.score-big { font: 800 96px var(--font-head); line-height: 1; color: var(--coral-tint); letter-spacing: -0.03em; }
.score-of { font: 600 28px var(--font-head); color: var(--b-text-2); letter-spacing: -0.03em; }
.bar { height: 8px; border-radius: 4px; background: var(--b-line); }
.bar > div { height: 8px; border-radius: 4px; background: #fff; }
.bar > div.low { background: var(--coral-tint); }

.plan-num { font: 800 40px var(--font-head); line-height: 1; color: var(--l-missed); letter-spacing: -0.03em; flex: none; }
.beats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.beat { border-radius: 6px; padding: 8px 4px; text-align: center; background: var(--arrow-blue); color: #fff; }
.beat.missed { background: var(--l-missed-fill); color: var(--l-missed-strong); }
.beat b { display: block; font-size: 14px; font-weight: 600; }
.beat span { font-size: 13px; }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.small-label { font-size: 14px; color: var(--l-text-2); }

details.lrow { background: var(--l-card); border: 1px solid var(--l-line); border-radius: 10px; padding: 0 16px; }
details.lrow[open] { padding-bottom: 8px; }
details.lrow summary {
  min-height: 56px; display: flex; justify-content: space-between; align-items: center; gap: 12px;
  font-size: 18px; font-weight: 700; cursor: pointer; list-style: none;
}
details.lrow summary::-webkit-details-marker { display: none; }
.item-row { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--l-line); }
.item-pts { font-weight: 700; white-space: nowrap; }
.item-pts.missed { color: var(--l-missed-strong); }

.turn-meta { font-size: 13px; font-weight: 700; color: var(--l-text-2); }
.btn-outline {
  height: 52px; border: 2px solid var(--arrow-blue); border-radius: 8px; background: transparent;
  color: var(--arrow-blue); font: 600 18px var(--font-body);
}

/* Team admin (owner) */
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.page-head h1 { margin: 0; font: 800 38px var(--font-head); line-height: 1; letter-spacing: -0.03em; }
.tag { display: inline-block; font-size: 13px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; padding: 2px 8px; border-radius: 4px; background: #E8EEF8; color: var(--arrow-blue); vertical-align: middle; }
.tag.off { background: var(--l-missed-fill); color: var(--l-missed-strong); }
.emp-card { text-decoration: none; color: inherit; }
body.light a.emp-card { color: inherit; }
.emp-card:hover { border-color: var(--l-input); }
.emp-stats { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 15px; color: var(--l-text-2); }
.emp-stats b { color: var(--asphalt); }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile { background: var(--l-card); border: 1px solid var(--l-line); border-radius: 10px; padding: 12px 14px; }
.tile .num { font: 800 28px var(--font-head); letter-spacing: -0.03em; line-height: 1.1; }
.tile .lbl { font-size: 14px; color: var(--l-text-2); }
.log-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--l-line); text-decoration: none; min-height: 56px; }
.log-row:first-child { border-top: 0; }
body.light a.log-row { color: inherit; }
.log-score { font: 800 30px var(--font-head); letter-spacing: -0.03em; white-space: nowrap; }
.field-light { display: flex; flex-direction: column; gap: 6px; }
.field-light label { font-size: 15px; font-weight: 700; }
.field-light input, .field-light select {
  height: 48px; padding: 0 12px; font: 500 17px var(--font-body); color: var(--asphalt);
  background: #fff; border: 2px solid var(--l-input); border-radius: 6px; width: 100%;
}
.btn-blue { height: 48px; padding: 0 18px; border: 0; border-radius: 8px; background: var(--arrow-blue); color: #fff; font: 700 17px var(--font-body); }
.btn-line { height: 48px; padding: 0 18px; border: 2px solid var(--arrow-blue); border-radius: 8px; background: transparent; color: var(--arrow-blue); font: 700 17px var(--font-body); }
.btn-danger { height: 48px; padding: 0 18px; border: 2px solid var(--l-missed); border-radius: 8px; background: transparent; color: var(--l-missed-strong); font: 700 17px var(--font-body); }
.btn-blue:disabled, .btn-line:disabled, .btn-danger:disabled { opacity: 0.6; cursor: default; }
.notice-box { background: #E8EEF8; border: 1px solid #B9CBEA; border-radius: 10px; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.secret { font: 700 22px ui-monospace, 'Cascadia Mono', Consolas, monospace; letter-spacing: 0.04em; user-select: all; }
.error-text { color: var(--l-missed-strong); font-weight: 600; min-height: 22px; margin: 0; }
.header-links { display: flex; gap: 18px; align-items: center; }

/* Arrow Motors colour wordmark at the top of every light page (brand/wordmark-colour.png).
   Light grounds only: the blue screens need the reverse version, which is not supplied yet. */
body.light .page::before {
  content: ''; display: block; height: 30px; margin-bottom: -12px;
  background: url(arrow-wordmark-colour.png) left center / contain no-repeat;
  -webkit-print-color-adjust: exact; print-color-adjust: exact;
}

/* Report export */
.export-bar { display: flex; gap: 10px; flex-wrap: wrap; margin-top: -10px; }
.print-footer { display: none; }

@media print {
  @page { size: letter; margin: 14mm 14mm 16mm; }
  body.light { background: #fff; }
  .page { max-width: none; padding: 0; gap: 18px; font-size: 12pt; }
  body.light .page::before { margin-bottom: 0; }
  .back-link, .export-bar, .btn-outline, button, .practise-link { display: none !important; }
  .score-card, .beat, .bar, .bar > div, .tag { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .score-big { font-size: 64px; }
  .lcard, .score-card, details.lrow, .item-row, .page h2 { break-inside: avoid; }
  .page h2 { break-after: avoid; }
  details.lrow summary { min-height: 0; padding: 8px 0; }
  .print-footer { display: block; font-size: 9pt; color: var(--l-text-2); border-top: 1px solid var(--l-line); padding-top: 6px; }
}

/* History (owner) */
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: -8px; }
.chip { height: 44px; padding: 0 16px; border: 2px solid var(--arrow-blue); border-radius: 22px; background: transparent; color: var(--arrow-blue); font: 600 16px var(--font-body); }
.chip[aria-pressed="true"] { background: var(--arrow-blue); color: #fff; }
.obj-row { display: flex; flex-direction: column; gap: 6px; padding: 14px 0; border-top: 1px solid var(--l-line); }
.obj-row:first-child { border-top: 0; }
.lbar { height: 8px; border-radius: 4px; background: var(--l-line); }
.lbar > div { height: 8px; border-radius: 4px; background: var(--arrow-blue); }
.link-button { align-self: flex-start; min-height: 44px; padding: 0; border: 0; background: none; color: var(--arrow-blue); font: 600 16px var(--font-body); text-decoration: underline; }
.obj-report { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 44px; font-size: 15px; }
body.light a.obj-report { color: var(--asphalt); text-decoration: none; }

/* Settings (owner) */
.set-item { display: flex; flex-direction: column; gap: 2px; padding-top: 10px; border-top: 1px solid var(--l-line); }
.set-text { field-sizing: content; min-height: 3lh; flex-grow: 1; min-width: 0; padding: 10px 12px; font: 400 16px var(--font-body); color: var(--asphalt); background: #fff; border: 1px solid var(--l-input); border-radius: 6px; resize: vertical; }
.set-points { width: 64px; height: 48px; text-align: center; font: 700 18px var(--font-body); color: var(--asphalt); background: #fff; border: 1px solid var(--l-input); border-radius: 6px; flex: none; }
body.light a.btn-line { color: var(--arrow-blue); }

/* Training */
.lesson-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 12px 0; border: 0; border-top: 1px solid var(--l-line); background: none; text-align: left; color: var(--asphalt); font: inherit; }
.lesson-row:first-child { border-top: 0; }
.train-input { min-height: 6lh; font-size: 17px; }
.train-result { border-radius: 10px; padding: 16px; display: flex; flex-direction: column; gap: 12px; border: 2px solid; }
.train-result.pass { border-color: var(--arrow-blue); background: #EEF3FB; }
.train-result.fail { border-color: var(--l-missed); background: var(--l-missed-fill); }
.train-result .beat.missed { background: #fff; }
.train-link { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 64px; padding: 12px 16px; text-decoration: none; color: #fff; }
.train-link:hover { color: #fff; border-color: var(--b-input); }
.speak-btn { height: 52px; font-size: 18px; }
.speak-btn.btn-coral { font: 700 18px var(--font-body); letter-spacing: 0; }
.toggle-row { display: flex; gap: 12px; align-items: flex-start; min-height: 44px; padding: 10px 0; border-top: 1px solid var(--l-line); cursor: pointer; }
