/* TrailDuck web: the same palette and type as the Android app (from the TrailDuck artwork). */
:root {
  --navy: #0F2238; --mallard: #127A55; --ochre: #E0821A; --glacier: #2F7FC8; --ember: #C2410C;
  --bg: #F3F7FA; --surface: #FFFFFF; --surface2: #E2EAF1; --text: #0F2238; --muted: #465668; --line: #CAD5DF;
  --ok-bg: #D3EDE2; --ok-text: #07402B; --warn-bg: #FBE4C6; --warn-text: #4A2A04; --err-bg: #FCE1D4;
  --sign: "Roboto Condensed", "Arial Narrow", "Helvetica Neue", system-ui, sans-serif;
  color-scheme: light;
}
/* Dark is the default (data-theme="dark" on <html>); Settings → Appearance can pick Light or Phone setting. */
:root[data-theme="dark"] {
  --mallard: #4FC08D; --ochre: #F0A04B; --glacier: #7DB6EE; --ember: #FF9466;
  --bg: #0B1A2B; --surface: #13263D; --surface2: #1A3049; --text: #E6EDF4; --muted: #B2C2D3; --line: #2B4562;
  --ok-bg: #0D5A3E; --ok-text: #C6F0DC; --warn-bg: #6A3E0A; --warn-text: #FFDDB8; --err-bg: #7A2A08;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] {
    --mallard: #4FC08D; --ochre: #F0A04B; --glacier: #7DB6EE; --ember: #FF9466;
    --bg: #0B1A2B; --surface: #13263D; --surface2: #1A3049; --text: #E6EDF4; --muted: #B2C2D3; --line: #2B4562;
    --ok-bg: #0D5A3E; --ok-text: #C6F0DC; --warn-bg: #6A3E0A; --warn-text: #FFDDB8; --err-bg: #7A2A08;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.45 system-ui, -apple-system, sans-serif; }
body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
h1, h2, h3, .sign { font-family: var(--sign); font-weight: 700; font-stretch: condensed; margin: 0; }
.bar { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 12px; background: var(--bg);
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; }
.bar h1 { flex: 1; font-size: 26px; }
.logo { width: 36px; height: 36px; border-radius: 9px; }
.icon-btn { background: none; border: 0; font-size: 26px; color: var(--muted); padding: 6px; }
main { padding: 4px 16px 24px; max-width: 640px; margin: 0 auto; }
.tabs { position: fixed; bottom: 0; left: 0; right: 0; display: flex; background: var(--surface2);
  padding-bottom: env(safe-area-inset-bottom); z-index: 3; }
.tabs a { flex: 1; text-align: center; padding: 8px 0 10px; color: var(--muted); text-decoration: none; font-size: 13px; }
.tabs a span { display: block; font-size: 20px; }
.tabs a.on { color: var(--text); font-weight: 600; }
.tabs a.on span { background: var(--ok-bg); border-radius: 14px; margin: 0 18%; }
.hero { position: relative; border-radius: 24px; overflow: hidden; height: 170px; margin-bottom: 18px;
  background: url(icons/hero.jpg) center 30%/cover; }
.hero h2 { position: absolute; left: 18px; bottom: 14px; color: #fff; font-size: 40px;
  text-shadow: 0 2px 12px rgba(15, 34, 56, .6); }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 45%, rgba(15,34,56,.8)); }
.hero h2 { z-index: 1; }
label.field { display: block; margin: 0 0 14px; }
label.field > span { display: block; font-size: 14px; color: var(--muted); margin-bottom: 4px; }
input, textarea, select { width: 100%; font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; }
textarea { min-height: 96px; resize: vertical; }
.return { display: flex; align-items: center; gap: 14px; border: 2px solid var(--ochre); background: var(--warn-bg);
  color: var(--warn-text); border-radius: 16px; padding: 14px 16px; margin-bottom: 16px; }
.return.set { border-color: var(--mallard); background: var(--ok-bg); color: var(--ok-text); }
.return .big { font-family: var(--sign); font-weight: 700; font-size: 22px; }
.return input { background: transparent; border: 0; padding: 0; color: inherit; font-size: 17px; }
.row { display: flex; gap: 10px; align-items: center; }
.tiles { display: flex; gap: 12px; margin-bottom: 8px; }
.tile { width: 92px; height: 92px; border: 1px solid var(--line); border-radius: 16px; display: grid; place-items: center;
  text-align: center; font-size: 13px; color: var(--muted); position: relative; overflow: hidden; background: var(--surface); }
.tile img { width: 100%; height: 100%; object-fit: cover; }
.tile input { position: absolute; inset: 0; opacity: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
.chip { border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; background: var(--surface); color: var(--text);
  font: 600 16px var(--sign); }
.chip.on { background: var(--ok-bg); border-color: var(--mallard); color: var(--ok-text); }
.chip.on::before { content: "✓ "; }
button { font: inherit; cursor: pointer; }
.primary { width: 100%; height: 72px; border: 0; border-radius: 36px; background: var(--mallard); color: #fff;
  font: 700 24px var(--sign); margin-top: 16px; }
.primary:disabled { opacity: .45; }
.status { width: 100%; min-height: 76px; border: 0; border-radius: 36px; display: flex; align-items: center; gap: 12px;
  padding: 0 24px; color: #fff; font: 700 24px var(--sign); background: var(--mallard); transition: background .4s; }
.status.waiting { background: var(--glacier); } .status.problem { background: var(--ember); }
.status .t { margin-left: auto; }
.actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 20px; }
.actions button { height: 84px; border: 0; border-radius: 16px; background: var(--surface2); color: var(--text);
  font: 700 17px var(--sign); }
.actions button b { display: block; font-size: 24px; }
.actions .accent { background: var(--ochre); color: var(--navy); }
.link { background: none; border: 0; color: var(--mallard); font: 700 18px var(--sign); padding: 12px; display: block; margin: 24px auto 0; }
.notice { background: var(--err-bg); border-radius: 16px; padding: 12px 14px; margin-bottom: 10px; display: flex; gap: 10px; align-items: center; }
.notice button { background: none; border: 0; color: var(--mallard); font-weight: 700; white-space: nowrap; }
.muted { color: var(--muted); font-size: 15px; }
.err { color: var(--ember); }
.trip-head { display: flex; gap: 14px; align-items: center; margin: 4px 0 16px; }
.trip-head img { width: 76px; height: 76px; border-radius: 50%; }
.card { background: var(--surface); border-radius: 24px; padding: 18px; margin-bottom: 14px; }
.mono { font-family: var(--sign); font-size: 22px; font-variant-numeric: tabular-nums; }
.big-num { font: 700 36px var(--sign); text-align: center; }
canvas.dial { width: 100%; max-width: 420px; aspect-ratio: 1; display: block; margin: 8px auto; }
.readout { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; }
.readout b { display: block; font: 700 28px var(--sign); }
.day { color: var(--mallard); font: 700 22px var(--sign); margin: 18px 0 6px; }
.entry { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.entry .what { flex: 1; } .entry .what b { font-family: var(--sign); font-size: 18px; }
.sheet[hidden] { display: none; }
.sheet { position: fixed; inset: 0; background: rgba(11, 26, 43, .5); z-index: 5; display: flex; align-items: flex-end; }
.sheet > div { background: var(--bg); width: 100%; border-radius: 24px 24px 0 0; padding: 20px 20px calc(24px + env(safe-area-inset-bottom));
  max-height: 85vh; overflow: auto; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 22px; overflow: hidden; margin-bottom: 12px; }
.seg button { flex: 1; border: 0; background: none; padding: 10px; color: var(--text); font: 600 17px var(--sign); }
.seg button.on { background: var(--warn-bg); color: var(--warn-text); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
:focus-visible { outline: 3px solid var(--glacier); outline-offset: 2px; }
