/* Crew app styles, in light glass (docs/design.md section 11; docs/app-glass.md
   step 6, 27 Nov 2026). Colours, fonts and the glass come from packages/ui
   (tokens.css, fonts.css, glass.css). These pages are used outdoors, so panels
   use the more solid glass (White about 80%) for bright sunlight. Pill buttons
   48 px+, fields 52 px+, labels above fields, Cobalt focus outline.
   The temporary /office pages stay plain (no glass background; their tables
   and lists keep their plain look until they move into the dashboard). */

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background-color: var(--fw-chalk);
  color: var(--fw-ink);
  font-family: var(--fw-font-body);
  font-size: 17px;
  line-height: 1.5;
}

/* Secondary text on Chalk: Ink at reduced strength (Slate fails contrast on Chalk). */
:root {
  --muted: var(--fw-glass-muted); --rule: var(--fw-glass-rule); --field-border: var(--fw-glass-field-edge);
  --panel: var(--fw-glass-solid); /* outdoors: the more solid panel */
  --r: var(--fw-radius-panel); --r2: var(--fw-radius-box); --pill: var(--fw-radius-pill);
}

/* Glass panels: everything people read sits on one. */
.top, .checks, .panel, .changed, .booking-details, .location, .unsafe-toggle, .defects li, .van-chip, .sticky-actions {
  background: var(--panel);
  border: 1px solid var(--fw-glass-edge);
  border-radius: var(--r);
  box-shadow: var(--fw-glass-shadow);
  -webkit-backdrop-filter: var(--fw-glass-blur);
  backdrop-filter: var(--fw-glass-blur);
}

main { max-width: 560px; margin: 0 auto; padding: 8px 16px 48px; }
body.wide main { max-width: 1240px; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; background: var(--fw-white); padding: 8px 12px; z-index: 10; }

:focus-visible { outline: 3px solid var(--fw-cobalt); outline-offset: 2px; }

.top {
  display: flex; align-items: center; justify-content: space-between;
  width: calc(100% - 32px); max-width: 528px; margin: max(16px, env(safe-area-inset-top)) auto 8px; padding: 10px 20px 10px 18px; min-height: 60px;
  border-radius: var(--pill);
}
body.wide .top { max-width: 1208px; }
/* The office pages stay plain: no glass bar. */
body:not(.fw-glass) .top { background: none; border: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; padding: 16px 0 8px; }
.logo img { display: block; height: 26px; width: auto; }
.who { font-weight: 600; font-size: 15px; color: var(--muted); }

h1, h2 { font-family: var(--fw-font-heading); font-weight: 800; line-height: 1; margin: 24px 0 12px; }
h1 { font-size: 40px; text-transform: uppercase; letter-spacing: -0.005em; }
h2 { font-size: 28px; text-transform: uppercase; margin-top: 36px; }
p { margin: 0 0 12px; }
.lead { font-size: 18px; color: var(--muted); }
.small, small { font-size: 14px; color: var(--muted); }
a { color: var(--fw-orange-dark); font-weight: 600; }
a:hover { color: var(--fw-ink); }
.back { margin: 8px 0 0; }
.back a { text-decoration: none; }
.center { text-align: center; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
code { font-size: 15px; background: var(--fw-glass-field); padding: 1px 6px; border-radius: 6px; }

/* Buttons */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 12px 28px; border: 1px solid var(--fw-orange-dark);
  background: var(--fw-orange-dark); color: var(--fw-white);
  font: 600 18px/1.2 var(--fw-font-body); text-decoration: none; cursor: pointer; border-radius: var(--pill);
}
.button:hover { background: var(--fw-ink); border-color: var(--fw-ink); color: var(--fw-white); }
.button-big { width: 100%; min-height: 64px; font-size: 20px; }
/* Glass has two kinds of button: Orange Dark (main) and frosted White with a thin Ink edge. */
.button-outline { background: var(--fw-glass-field); color: var(--fw-ink); border-color: var(--fw-glass-line); }
.button-outline:hover { background: var(--fw-white); color: var(--fw-ink); border-color: var(--fw-ink); }
.button-small { min-height: 48px; padding: 8px 18px; font-size: 15px; }
.link {
  background: none; border: 0; padding: 12px 0; min-height: 44px; cursor: pointer;
  font: 600 16px var(--fw-font-body); color: var(--fw-orange-dark);
  text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px;
}
.inline-form { margin: 8px 0; }
.actions { display: grid; gap: 12px; margin-top: 24px; }
.actions .button { width: 100%; }

/* Forms */
.stack { display: grid; gap: 20px; }
.narrow { max-width: 420px; }
.field { display: grid; gap: 8px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field > label, .field > legend, .field > .label, .detail > label:not(.file-button):not(.unsafe-toggle) { font-weight: 600; font-size: 15px; padding: 0; }
input[type="text"], input[type="tel"], input[type="email"], input[type="password"], input:not([type]), textarea {
  width: 100%; min-height: 56px; padding: 12px 16px; border: 1px solid var(--field-border); border-radius: var(--r2);
  background: var(--fw-glass-field); color: var(--fw-ink); font: 400 19px/1.3 var(--fw-font-body);
}
textarea { min-height: 80px; font-size: 17px; resize: vertical; }
input:focus, textarea:focus { border-color: var(--fw-ink); }
.hint { font-size: 14px; color: var(--muted); margin: 0; }
.with-button { display: flex; gap: 8px; }
.with-button input { flex: 1; min-width: 0; font-weight: 600; font-size: 22px; }

.square-button, .file-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer;
  border: 2px dashed var(--fw-glass-line); border-radius: var(--r2); background: var(--fw-glass-tile); font-weight: 600; font-size: 15px;
}
.square-button { width: 56px; min-height: 56px; flex: none; }
.file-button { min-height: 56px; padding: 8px 16px; }
.square-button input, .file-button input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.square-button:focus-within, .file-button:focus-within { outline: 3px solid var(--fw-cobalt); outline-offset: 2px; }
.has-file { border-style: solid; border-color: var(--fw-ink); background: var(--fw-glass-field); }

.segments { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.segments.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.segments input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.segments label {
  display: flex; align-items: center; justify-content: center; min-height: 52px; cursor: pointer;
  background: var(--fw-glass-field); border: 1px solid var(--fw-glass-line); border-radius: var(--pill); font-weight: 600; font-size: 17px;
}
.segments input:checked + label { background: var(--fw-ink); border-color: var(--fw-ink); color: var(--fw-white); }
.segments input:focus-visible + label { outline: 3px solid var(--fw-cobalt); outline-offset: 2px; }

.confirm, .unsafe-toggle { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.confirm input, .unsafe-toggle input { width: 24px; height: 24px; margin: 2px 0 0; accent-color: var(--fw-orange-dark); flex: none; }
.unsafe-toggle { padding: 12px 16px; border-radius: var(--r2); }
.unsafe-toggle span { display: grid; }
.unsafe-toggle:has(input:checked) { border: 2px solid var(--fw-orange); }

/* Messages */
.errors {
  background: var(--panel); border: 1px solid var(--fw-orange); border-radius: var(--r2);
  padding: 14px 16px; margin: 12px 0 16px; color: var(--fw-ink);
}
.errors strong { color: var(--fw-orange-dark); }
.errors ul { margin: 6px 0 0; padding-left: 20px; }
.notice { background: var(--fw-glass-mist); border: 1px solid var(--fw-glass-edge); border-radius: var(--r2); padding: 14px 16px; margin: 12px 0 16px; }
.notice .code { display: block; font: 800 44px/1.1 var(--fw-font-heading); letter-spacing: 0.12em; margin-top: 6px; }
.blocked { background: var(--fw-ink); color: var(--fw-white); padding: 16px 18px; border-radius: var(--r2); font-weight: 600; margin: 0; }

/* Van card */
.van-chip { display: inline-block; padding: 8px 16px; border-radius: var(--pill); font-weight: 600; font-size: 15px; margin-top: 16px; }
.van-card { background: var(--fw-ink); color: var(--fw-white); padding: 22px; margin-top: 16px; border-radius: var(--r); box-shadow: var(--fw-glass-shadow); }
.van-card p { margin: 0; }
.eyebrow { font: 600 14px var(--fw-font-body); letter-spacing: 0.14em; text-transform: uppercase; }
.van-card .eyebrow { color: var(--fw-white); opacity: 0.85; }
.reg { font: 800 52px/1 var(--fw-font-heading); margin: 6px 0 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px !important; }
.chip { display: inline-block; padding: 5px 12px; border-radius: var(--pill); font-size: 14px; font-weight: 600; }
.chip-in { background: var(--fw-chalk); color: var(--fw-ink); }
.chip-out { background: var(--fw-orange-dark); color: var(--fw-white); }
.chip-alert { background: var(--fw-orange-dark); color: var(--fw-white); text-transform: uppercase; letter-spacing: 0.04em; }
.chip-dim { border: 1px solid rgba(255, 255, 255, 0.5); }
.card-note { margin-top: 12px !important; color: rgba(255, 255, 255, 0.85); font-size: 15px; }

.defects h2 { font-size: 22px; margin-top: 24px; }
.defects ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.defects li { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--r2); color: var(--fw-orange-dark); }
.defects li span { display: grid; color: var(--fw-ink); }
.defects li.unsafe { border: 2px solid var(--fw-orange); }

/* Walkaround checklist */
.checks { overflow: hidden; }
.check { border-bottom: 1px solid var(--rule); padding: 12px 12px 12px 16px; }
.check:last-child { border-bottom: 0; }
.check.has-error { box-shadow: inset 4px 0 0 var(--fw-orange-dark); }
.check-head { display: flex; align-items: center; gap: 10px; }
.check-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.check-label { font-weight: 600; font-size: 17px; }
.check-hint { font-size: 14px; color: var(--muted); }
.tick-input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tick {
  width: 52px; height: 52px; flex: none; display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--fw-glass-line); border-radius: var(--r2); background: var(--fw-glass-field); color: var(--fw-ink); cursor: pointer;
}
/* OK ticked: a green tick on a green edge (docs/design.md section 2, Tick Green). */
.tick-input:checked + .tick-ok { background: var(--fw-white); border: 2px solid var(--fw-tick); color: var(--fw-tick); }
.tick-input:checked + .tick-fail { background: var(--fw-orange-dark); border-color: var(--fw-orange-dark); color: var(--fw-white); }
.tick-input:focus-visible + .tick { outline: 3px solid var(--fw-cobalt); outline-offset: 2px; }
.detail { display: none; gap: 10px; margin-top: 12px; }
.check:has(input[value="fail"]:checked) { background: rgba(192, 86, 46, 0.08); }
.check:has(input[value="fail"]:checked) .detail,
.damage:has(input[value="yes"]:checked) .detail { display: grid; }
.damage .detail { margin-top: 4px; }

.location { padding: 14px 16px; margin: 0; font-size: 15px; border-radius: var(--r2); }
.location.found { font-weight: 600; }

/* Office */
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.table-box { overflow-x: auto; background: var(--fw-white); margin: 12px 0 8px; }
table { border-collapse: collapse; width: 100%; font-size: 15px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid #ece6da; vertical-align: top; }
th { font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; border-bottom: 2px solid var(--fw-ink); white-space: nowrap; }
td small { color: #4f5559; }
.num { text-align: right; white-space: nowrap; }
.links a { white-space: nowrap; margin-right: 8px; }
.alert-block { border-top: 4px solid var(--fw-orange-dark); background: var(--fw-white); padding: 4px 16px 12px; margin: 20px 0; }
.alert-block.amber { border-top-color: var(--fw-ink); }
.alert-block h2 { font-size: 24px; margin-top: 16px; }
.defect-list { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 8px; }
.defect-list li { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; background: var(--fw-white); border: 1px solid #ece6da; padding: 12px 14px; }
.defect-list li.unsafe { border: 2px solid var(--fw-orange-dark); }
.defect-list p { margin: 4px 0; }
.defect-list small { color: #4f5559; }
.two-col { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 40px; }
.crew-list { list-style: none; padding: 0; margin: 0 0 16px; background: var(--fw-white); }
.crew-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 4px 14px; border-bottom: 1px solid #ece6da; }

/* QR code sheet */
.qr-sheet { background: var(--fw-white); padding: 32px; text-align: center; max-width: 420px; margin: 16px auto; border: 1px solid var(--rule); }
.qr-sheet h1 { margin: 20px 0 4px; }
.qr-sheet .reg { font-size: 44px; }
.qr { margin: 20px auto 12px; width: 300px; }
.qr svg { display: block; width: 100%; height: auto; }
.qr-text { font: 700 24px/1.15 var(--fw-font-heading); text-transform: uppercase; }
.no-print { text-align: center; }

/* Version label (docs/releases.md) */
.version { text-align: center; font-size: 13px; color: #4f5559; padding: 24px 16px 32px; }

@media print {
  body { background: #fff; }
  .top, .no-print, .skip, .version { display: none; }
  .qr-sheet { border: 0; margin: 0 auto; }
}

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }

/* Crew booking page (crew planner sketch, signed off 23 Nov 2026): the
   details, then the answer buttons kept at the bottom of the screen. */
body.booking main { padding-bottom: 200px; }
.panel { padding: 14px 18px; margin: 12px 0 16px; border-radius: var(--r2); }
.problem { color: var(--fw-orange-dark); font-weight: 600; }
.strong { font-weight: 600; }
.pre { white-space: pre-line; margin: 0; }
.line { display: block; }
.changed { padding: 16px 18px; margin: 0 0 16px; }
.changed p { margin: 0 0 4px; }
.booking-details { margin: 0 0 16px; padding: 4px 18px; }
.booking-details .row { padding: 10px 0; border-bottom: 1px solid var(--rule); }
.booking-details .row:last-child { border-bottom: 0; }
.booking-details dt { font-size: 14px; font-weight: 600; color: var(--muted); }
.booking-details dd { margin: 2px 0 0; }
.sticky-actions {
  position: fixed; left: calc(8px + env(safe-area-inset-left)); right: calc(8px + env(safe-area-inset-right)); bottom: calc(8px + env(safe-area-inset-bottom)); z-index: 5; display: grid; gap: 10px;
  max-width: 560px; margin: 0 auto; padding: 12px; border-radius: 28px;
}
.sticky-actions > * { max-width: 520px; width: 100%; margin: 0 auto; }
/* In glass the yes button is always the main (Orange Dark) one, so .button-dark
   looks like .button; the drop-out link is a frosted button. */
.button-grey { background: var(--fw-glass-field); color: var(--fw-ink); border-color: var(--fw-glass-line); }
.button-grey:hover { background: var(--fw-white); color: var(--fw-ink); border-color: var(--fw-ink); }
.note-box summary { cursor: pointer; font-weight: 600; font-size: 15px; color: var(--fw-orange-dark); min-height: 40px; display: flex; align-items: center; }
.note-box textarea { margin-top: 6px; }

/* Notifications page (docs/crew-notifications.md, 29 Nov 2026). */
.button-row { display: flex; flex-wrap: wrap; gap: 10px; }
.button-row [hidden] { display: none; }
.plain-list { list-style: none; margin: 0; padding: 0; }
.plain-list li { padding: 8px 0; border-top: 1px solid var(--fw-glass-rule); }
.plain-list li:first-child { border-top: 0; }
