:root {
  --bg: #eef3f6; --card: #fff; --ink: #14212b; --muted: #5b6b78; --line: #d5dde3;
  --accent: #0b4f6c; --accent-ink: #fff; --ok: #1b7a3d; --warn: #b3261e; --rehearse: #8a5a00;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0d1419; --card: #17222a; --ink: #e6edf2; --muted: #93a4b1; --line: #2a3a46; --accent: #4fb0d9; --accent-ink: #06121a; --ok: #5cc580; --warn: #ff7b72; --rehearse: #f0b54a; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; }
header { display: flex; align-items: center; justify-content: space-between; padding: max(12px, env(safe-area-inset-top)) 16px 12px; background: var(--accent); color: var(--accent-ink); }
header h1 { font-size: 19px; margin: 0; }
.badge { font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 99px; background: rgba(255,255,255,.2); }
.badge.rehearse { background: var(--rehearse); color: #fff; }
.badge.live { background: var(--warn); color: #fff; }
main { max-width: 600px; margin: 0 auto; padding: 8px 16px 40px; }
.tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; position: sticky; top: 0; background: var(--bg); padding: 8px 0; z-index: 2; }
.tabs button { padding: 10px 4px; font-weight: 600; }
.tabs button.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin: 12px 0; }
.card.sticky { position: sticky; bottom: 8px; box-shadow: 0 4px 16px rgba(0,0,0,.12); }
h2 { font-size: 14px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 0 0 10px; }
h3 { font-size: 16px; margin: 0; }
label { display: block; font-weight: 600; margin: 12px 0 6px; }
input, select { width: 100%; font: inherit; font-size: 17px; padding: 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); }
input[type=checkbox] { width: auto; }
button, .button { display: inline-block; font: inherit; padding: 10px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; text-decoration: none; text-align: center; margin: 0; font-weight: 500; }
button.primary, .primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.big { display: block; width: 100%; font-size: 19px; padding: 14px; margin-top: 14px; }
.capture { border-radius: 12px; padding: 28px 14px; font-size: 21px; margin: 0; }
button.danger { color: var(--warn); }
button.ok { background: var(--ok); color: #fff; border-color: var(--ok); }
button:disabled { opacity: .5; }
#retake { width: 100%; margin-top: 8px; }
#preview { width: 100%; max-height: 50vh; object-fit: contain; border-radius: 8px; background: #000; }
.row { display: flex; gap: 8px; align-items: center; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.row.wrap { flex-wrap: wrap; margin-top: 12px; }
.hint { color: var(--muted); font-size: 14px; margin: 8px 0 0; }
.total { font-size: 18px; margin: 12px 0 0; text-align: center; }
.total b { font-size: 28px; }
.err { color: var(--warn); }
.toast { background: var(--accent); color: var(--accent-ink); padding: 12px 14px; border-radius: 10px; margin: 4px 0; }
.toast.bad { background: var(--warn); color: #fff; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list.small li { font-size: 14px; padding: 8px 0; }
.list time { color: var(--muted); display: block; font-size: 12px; }
.list .failed { color: var(--warn); }
.list .submitted, .list .drafted { color: var(--ok); font-weight: 600; }
.receipt { display: flex; gap: 10px; align-items: center; }
.receipt img { width: 52px; height: 52px; object-fit: cover; border-radius: 6px; }
.receipt .grow { flex: 1; }
.receipt .meta { color: var(--muted); font-size: 13px; }
.day h3 span { color: var(--muted); font-weight: 400; font-size: 14px; float: right; }
.leg { display: grid; grid-template-columns: 1fr auto; gap: 6px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.leg:last-of-type { border-bottom: 0; }
.leg .from { font-size: 14px; padding: 7px; }
.leg .est { grid-column: 1 / -1; font-size: 13px; color: var(--muted); }
.leg .x { padding: 6px 12px; color: var(--warn); align-self: start; }
.addLeg { width: 100%; margin-top: 8px; border-style: dashed; }
.stations { width: 100%; border-collapse: collapse; }
.stations td, .stations th { padding: 3px 2px; text-align: left; font-size: 14px; }
.stations input { font-size: 14px; padding: 7px; }
.stations td:nth-child(2) { width: 30%; }
.stations td:nth-child(3) { width: 17%; }
.stations .x { padding: 6px 9px; color: var(--warn); }
.check { font-weight: 400; display: flex; gap: 8px; align-items: center; }
.claim-lines { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 14px; }
.claim-lines td { padding: 6px 4px; border-bottom: 1px solid var(--line); }
.claim-lines td:last-child { text-align: right; }
.grand { font-size: 30px; font-weight: 700; margin: 6px 0; }
.status { display: inline-block; padding: 3px 10px; border-radius: 99px; font-size: 13px; font-weight: 700; background: var(--bg); }
.status.submitted { background: var(--ok); color: #fff; }
.status.failed, .status.submit-failed { background: var(--warn); color: #fff; }
.actions { display: grid; gap: 8px; margin-top: 14px; }
.tools { display: grid; gap: 8px; margin-top: 12px; }
.ntfy code { display: block; word-break: break-all; background: var(--bg); padding: 8px; border-radius: 6px; margin: 6px 0 8px; font-size: 13px; }
.ntfy a { color: var(--accent); }
summary { cursor: pointer; font-weight: 600; }
dialog { border: 0; border-radius: 14px; padding: 18px; max-width: min(420px, calc(100vw - 32px)); background: var(--card); color: var(--ink); }
dialog::backdrop { background: rgba(0,0,0,.45); }
#confirmText { font-size: 17px; margin: 0 0 16px; }
#confirmText b { font-size: 22px; display: block; margin: 6px 0; }
