:root {
  --bg: #f6f7fb;
  --card: #fff;
  --ink: #14213d;
  --muted: #6b7280;
  --accent: #0c1b33;
  --max: #a1006b;
  --ter: #0074b7;
  --ok: #138a36;
  --warn: #b45309;
  color-scheme: light dark;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0b1020; --card: #141b2e; --ink: #e5e7eb; --muted: #9ca3af; --accent: #e5e7eb; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); }
a { color: inherit; }
.top {
  display: flex; justify-content: space-between; align-items: center;
  padding: max(12px, env(safe-area-inset-top)) 16px 12px; background: #0c1b33; color: #fff;
}
.top a { text-decoration: none; font-weight: 600; }
.brand { font-size: 1.15rem; }
main { max-width: 760px; margin: 0 auto; padding: 16px; }
.status { display: flex; gap: 12px; justify-content: space-between; align-items: center; font-size: .9rem; color: var(--muted); }
.notice { background: #e8f5ec; color: #14532d; padding: 8px 12px; border-radius: 8px; }
.error, .error-box { color: #b91c1c; }
.error-box { background: #fde8e8; padding: 8px 12px; border-radius: 8px; }
.watch { background: var(--card); border-radius: 12px; padding: 12px 16px; margin: 16px 0; box-shadow: 0 1px 3px #0001; }
.watch h2 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 1.15rem; }
.watch h2 .edit { margin-left: auto; font-size: .85rem; font-weight: 400; color: var(--muted); }
.day h3 { margin: 14px 0 6px; font-size: .95rem; text-transform: capitalize; }
.day ul { list-style: none; margin: 0; padding: 0; }
.itinerary { padding: 8px 0; border-top: 1px solid #8882; }
.legs { margin: 4px 0 0; padding-left: 18px; font-size: .9rem; }
.legs li { margin: 2px 0; }
.mode { font-weight: 600; }
.mode.max { color: var(--max); }
.mode.ter { color: var(--ter); }
.book { margin-left: 4px; font-weight: 600; color: var(--ok); white-space: nowrap; }
.tag { font-size: .7rem; font-weight: 600; padding: 1px 6px; border-radius: 999px; margin-left: 6px; vertical-align: middle; }
.tag.direct { background: #e0f2fe; color: #075985; }
.tag.new { background: #dcfce7; color: #166534; }
.tag.off { background: #fef3c7; color: var(--warn); }
.muted { color: var(--muted); font-weight: 400; }
.empty { color: var(--muted); }
button { background: var(--accent); color: var(--bg); border: 0; border-radius: 8px; padding: 8px 14px; font: inherit; cursor: pointer; }
.watch-form { display: grid; gap: 12px; }
.watch-form label { display: grid; gap: 4px; font-weight: 600; font-size: .9rem; }
.watch-form label.check { display: flex; align-items: center; gap: 8px; }
.watch-form input, .watch-form textarea, .watch-form select { font: inherit; font-weight: 400; padding: 8px; border-radius: 8px; border: 1px solid #8886; background: var(--card); color: var(--ink); width: 100%; }
.watch-form input[type=checkbox] { width: auto; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.actions { display: flex; gap: 16px; align-items: center; }
.danger { margin-top: 32px; }
.danger button { background: #b91c1c; color: #fff; }
.top nav { display: flex; gap: 16px; }
.devices { list-style: none; margin: 8px 0 16px; padding: 0; }
.devices li { display: flex; gap: 12px; justify-content: space-between; align-items: center; padding: 8px 0; border-top: 1px solid #8882; font-size: .9rem; }
button.secondary { background: transparent; color: var(--ink); border: 1px solid #8886; }
button[disabled] { opacity: .6; }
