:root { --bg: #F7FAFF; --surface: #FFFFFF; --ink: #192B49; --muted: #5B6B84; --primary: #287CCB; --border: #DCE6F4; }
@media (prefers-color-scheme: dark) { :root { --bg: #0E1726; --surface: #172338; --ink: #EEF4FF; --muted: #9FB0C9; --primary: #4C9BE4; --border: #26364F; } }
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: grid; place-items: center; background: var(--bg); color: var(--ink); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
main { width: 100%; max-width: 420px; padding: 32px 20px; }
.brand { margin: 0 0 20px; font-weight: 800; color: var(--primary); letter-spacing: 0.02em; }
h1 { margin: 0 0 10px; font-size: 26px; line-height: 1.2; letter-spacing: -0.01em; text-wrap: balance; }
p { margin: 0 0 16px; color: var(--muted); }
.button { display: block; margin: 24px 0; padding: 15px 20px; border-radius: 16px; background: var(--primary); color: #fff; font-weight: 700; text-align: center; text-decoration: none; }
.button:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
#manual { margin-bottom: 20px; padding: 16px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.label { margin-bottom: 8px; font-size: 13px; }
.code { margin: 0 0 8px; color: var(--ink); font: 600 24px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.08em; }
.hint { margin: 0; font-size: 13px; }
[hidden] { display: none !important; }
/* Terms and Privacy: a page to read, so it starts at the top and runs wider. */
body.doc { display: block; }
.doc main { max-width: 640px; margin: 0 auto; padding: 40px 20px 64px; }
.doc h2 { margin: 28px 0 8px; font-size: 18px; line-height: 1.3; }
.doc p, .doc li { color: var(--ink); }
.doc ul { margin: 0 0 16px; padding-left: 20px; }
.doc li { margin-bottom: 6px; }
.doc .meta, .links { color: var(--muted); font-size: 14px; }
a { color: var(--primary); }
/* I'm OK page: a short timeline, newest first. */
body.ok { display: block; }
.ok main { margin: 0 auto; padding-top: 40px; }
.ok #lead { color: var(--ink); }
.route { display: block; width: 100%; height: auto; margin: 4px 0 20px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.route polyline { fill: none; stroke: var(--primary); stroke-width: 2; stroke-dasharray: 5 5; stroke-linecap: round; }
.route circle { fill: var(--surface); stroke: var(--primary); stroke-width: 2; }
.route circle.now { fill: var(--primary); }
.list { margin: 0 0 24px; padding: 0; list-style: none; }
.list li { position: relative; padding: 12px 0 12px 20px; border-top: 1px solid var(--border); }
.list li::before { content: ""; position: absolute; left: 2px; top: 20px; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }
.list li.sos::before { background: #D9503F; }
.list p { margin: 0; }
.list .t { color: var(--ink); font-weight: 650; }
.list .sos .t { color: #D9503F; }
.list .n { margin-top: 2px; color: var(--ink); overflow-wrap: anywhere; }
.list .m { margin-top: 2px; font-size: 13px; }
.box { margin-bottom: 20px; padding: 16px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.box p { margin: 0; font-size: 14px; }
.box .button { margin: 14px 0 0; }
.pin { margin: 8px 0 24px; }
.pin label { display: block; margin-bottom: 10px; color: var(--muted); font-size: 15px; }
.pin input { width: 100%; max-width: 220px; height: 64px; padding: 0 16px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); color: var(--ink); font: 600 32px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 0.5em; text-indent: 0.5em; text-align: center; }
.pin input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 30%, transparent); }
.pin input:disabled { opacity: 0.6; }
.pin .msg { min-height: 22px; margin: 10px 0 0; font-size: 14px; }
.shake input { animation: shake 0.32s ease-in-out; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
@media (prefers-reduced-motion: reduce) { .shake input { animation: none; } }
.linkish { padding: 0; border: 0; background: none; color: var(--primary); font: inherit; text-decoration: underline; cursor: pointer; }
