:root {
  --navy: #1b2a4a; --orange: #f08a24; --green: #2fb36b; --red: #e0463a; --bg: #f4f6fb; --card: #fff; --muted: #6b7890; --line: #d9e0ea;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--navy);
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); overflow-x: hidden; }
body { padding: 0 max(12px, env(safe-area-inset-left)) 40px; max-width: 520px; margin: 0 auto; }
.top { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 10px 2px 6px; }
.brand { font-size: 15px; letter-spacing: .3px; }
.muted { color: var(--muted); font-weight: 500; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; margin: 10px 0; box-shadow: 0 1px 2px rgba(20, 30, 60, .05); }
h2 { margin: 4px 0 6px; font-size: 20px; }
h3 { margin: 10px 0 6px; font-size: 14px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); }
p { line-height: 1.45; margin: 6px 0; }
.btn { appearance: none; border: 2px solid var(--navy); background: #fff; color: var(--navy); border-radius: 12px; padding: 11px 14px; font-weight: 800; font-size: 15px; cursor: pointer; }
.btn-primary { background: var(--orange); border-color: var(--orange); color: #fff; }
.btn-small { padding: 7px 10px; font-size: 13px; border-width: 1.5px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.pill { display: inline-block; border: 1px solid var(--line); border-radius: 99px; padding: 3px 9px; font-size: 12px; font-weight: 700; background: #fff; }
.pill.ff { background: var(--orange); color: #fff; border-color: var(--orange); }
.status { border-radius: 12px; padding: 10px 12px; margin: 8px 0; font-weight: 700; font-size: 14px; line-height: 1.35; background: #fff; border: 1.5px solid var(--line); min-height: 44px; }
.status.coach { border-color: var(--orange); background: #fff7ee; color: #8a4a0a; }
.status.bad { border-color: var(--red); background: #fdeceb; color: #8d2a22; }
.status.good { border-color: var(--green); background: #e9f7ef; color: #1c6b41; }
.scene { background: #fff; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; margin: 8px 0; touch-action: none; user-select: none; -webkit-user-select: none; }
.station-svg { display: block; }
.tabs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 8px 0; }
.tab { border: 1.5px solid var(--line); background: #fff; border-radius: 10px; padding: 8px 2px; font-size: 11.5px; font-weight: 800; text-align: center; cursor: pointer; color: var(--navy); }
.tab.on { border-color: var(--navy); background: var(--navy); color: #fff; }
.tab.next { border-color: var(--orange); box-shadow: 0 0 0 2px rgba(240, 138, 36, .35); }
.tab.alarm { border-color: var(--red); background: #fdeceb; color: var(--red); }
.part { cursor: pointer; }
.part.hint > :not(.hit) { animation: hint 1.1s ease-in-out infinite; }
@keyframes hint { 50% { filter: drop-shadow(0 0 5px #f08a24) drop-shadow(0 0 2px #f08a24); } }
.pin-next circle { animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .55; } }
.flow { animation: flow 0.9s linear infinite; }
.flow.vapor { animation-duration: 1.6s; }
@keyframes flow { to { stroke-dashoffset: -28; } }
.spin { animation: spin 0.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.drawer { display: grid; gap: 8px; }
.drawer .btn.hint { border-color: var(--orange); box-shadow: 0 0 0 3px rgba(240, 138, 36, .4); }
.drawer .done { opacity: .55; }
.paper { font-size: 13px; background: #fffdf5; border: 1px dashed #d8c68a; border-radius: 10px; padding: 8px 10px; }
.paper b { font-variant-numeric: tabular-nums; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 10px 14px; border-radius: 12px; font-weight: 700; font-size: 14px; max-width: 92vw; z-index: 20; box-shadow: 0 6px 20px rgba(0, 0, 0, .25); }
.toast.bad { background: var(--red); }
.modal { position: fixed; inset: 0; background: rgba(10, 18, 36, .55); display: grid; place-items: center; z-index: 30; padding: 16px; }
.modal .card { width: min(420px, 100%); }
.keypad input { font-size: 28px; width: 100%; padding: 10px; border-radius: 10px; border: 2px solid var(--navy); font-variant-numeric: tabular-nums; }
.score { width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; font-size: 32px; font-weight: 900; color: #fff; }
.score.ok { background: var(--green); } .score.bad { background: var(--red); }
.line { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.timeline { font-size: 12.5px; max-height: 320px; overflow: auto; }
.timeline .flag { color: var(--red); font-weight: 800; }
.crit { border-left: 4px solid var(--red); padding: 6px 10px; margin: 8px 0; background: #fdeceb; border-radius: 8px; }
.minor { border-left: 4px solid var(--orange); padding: 6px 10px; margin: 8px 0; background: #fff7ee; border-radius: 8px; }
.src { color: var(--muted); font-size: 12px; }
