:root {
  color-scheme: light dark;
  --bg: #f6efe6;
  --card: #fffaf3;
  --ink: #2b1a10;
  --muted: #7a6150;
  --line: #e4d6c6;
  --brand: #3b2418;
  --here: #2f8a4c;
  --here-bg: #e3f4e7;
  --away: #8a7464;
  --away-bg: #efe6dc;
  --accent: #c8752a;
  --shadow: 0 2px 10px rgba(59, 36, 24, 0.08);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17100b;
    --card: #221812;
    --ink: #f4e9dd;
    --muted: #b49b88;
    --line: #3a2a1f;
    --brand: #f4e9dd;
    --here: #5cc27c;
    --here-bg: #16301f;
    --away: #b49b88;
    --away-bg: #2b2019;
    --accent: #e39a52;
    --shadow: none;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}
.wrap { max-width: 480px; margin: 0 auto; padding: 20px 16px 40px; display: flex; flex-direction: column; gap: 16px; }

.top { text-align: center; padding-top: 8px; }
.kicker { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
h1 { font-size: 28px; line-height: 1.15; color: var(--brand); margin-top: 4px; }
h2 { font-size: 17px; margin-bottom: 12px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 18px; box-shadow: var(--shadow); }

.status { text-align: center; padding: 28px 18px; transition: background .3s; }
.status-icon { font-size: 52px; line-height: 1; }
.status-title { font-size: 26px; font-weight: 800; margin-top: 10px; }
.status-detail { color: var(--muted); margin-top: 6px; font-size: 15px; }
.status.here { background: var(--here-bg); border-color: var(--here); }
.status.here .status-title { color: var(--here); }
.status.away { background: var(--away-bg); }
.status.away .status-title { color: var(--away); }
.status.loading .status-title { color: var(--muted); }

.actions { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.btn {
  appearance: none; border: 0; border-radius: 14px; cursor: pointer;
  background: var(--accent); color: #fff; font: inherit; font-weight: 700;
  padding: 14px 18px; font-size: 17px; touch-action: manipulation;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: default; }
.btn.big { font-size: 21px; padding: 20px; border-radius: 18px; box-shadow: 0 4px 14px rgba(200, 117, 42, .35); }
.btn.big.done { background: var(--here); box-shadow: none; }
.btn.link { background: none; color: var(--muted); font-weight: 600; font-size: 15px; padding: 8px; text-decoration: underline; }

.toast { min-height: 1.4em; text-align: center; font-size: 14px; color: var(--muted); }

.alert-copy { font-size: 15px; color: var(--muted); margin-bottom: 14px; }
#alerts > .btn:not(.link) { width: 100%; }
#alerts .btn.on { background: var(--here); }
.steps { margin: 14px 0 4px 20px; display: flex; flex-direction: column; gap: 8px; font-size: 15px; }
.sub-msg { margin-top: 10px; font-size: 14px; text-align: center; }
.sub-msg.err { color: #c0392b; }

.recent { list-style: none; display: flex; flex-direction: column; }
.recent li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 15px; }
.recent li:first-child { border-top: 0; }
.recent .when { font-weight: 600; }
.recent .meta { color: var(--muted); text-align: right; white-space: nowrap; }
.muted { color: var(--muted); }
.fine { font-size: 13px; color: var(--muted); margin-top: 10px; }

.foot { text-align: center; font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 6px; padding: 8px 8px 0; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
