:root {
  --pine: #1E4D3A; --pine-dark: #143528; --pine-night: #10241B; --pine-tint: #E8F0EB;
  --berry: #A4262C; --berry-dark: #7E1D22; --berry-tint: #FBEDEE;
  --gold: #E0B556; --gold-tint: #FDF6E7; --gold-ink: #6B4E12;
  --ink: #1B1F1C; --ink-2: #3A423D; --muted: #5B635E; --line: #E2E5E0; --field: #C9CFC9;
  --bg: #F6F7F4; --card: #FFFFFF;
  --serif: 'DM Serif Display', Georgia, serif;
  --sans: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.5; }
a { color: var(--pine); }
a:hover { color: var(--pine-dark); }
h1, h2, h3 { line-height: 1.2; }
.serif { font-family: var(--serif); font-weight: 400; }

/* layout */
.topbar { background: var(--card); border-bottom: 1px solid var(--line); }
.topbar .inner { max-width: 720px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand .t { font-family: var(--serif); font-size: 20px; color: var(--pine); display: block; line-height: 1.1; }
.brand .s { font-size: 12px; color: var(--muted); display: block; }
.wrap { max-width: 720px; margin: 0 auto; padding: 16px; display: flex; flex-direction: column; gap: 16px; }
.wide { max-width: 1200px; }
.footer { text-align: center; font-size: 13px; color: var(--muted); padding: 24px 16px 40px; }

/* cards and text */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.card h2 { margin: 0; font-size: 17px; }
.hero { background: var(--pine); color: #fff; border-radius: 18px; padding: 24px 20px; }
.hero h1 { margin: 0 0 6px; font-family: var(--serif); font-weight: 400; font-size: 28px; }
.hero p { margin: 0; color: #D5E4DA; }
.label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* Registration: other families at the same house */
.extra-fam { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px 14px; margin: 0; display: flex; flex-direction: column; gap: 10px; background: var(--pine-tint); }
.extra-fam .fam-label { color: var(--pine); }
.extra-fam .row { align-items: center; }

/* My registration: songs chosen at the same address */
.stop-songs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; counter-reset: s; }
.stop-songs li { counter-increment: s; display: flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; }
.stop-songs li::before { content: counter(s); flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--pine-tint); color: var(--pine); display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.stop-songs li a { flex: 1; color: inherit; font-weight: 600; text-decoration: none; }
.stop-songs li .small { color: var(--muted); white-space: nowrap; }
.stop-songs li.mine { border-color: var(--berry); background: var(--berry-tint); }
.stop-songs li.mine::before { background: var(--berry); color: #fff; }
.stop-songs li.mine .small { color: var(--berry-dark); font-weight: 600; }

/* Songs page: tap a heading to show the words */
.song-tools { display: flex; gap: 8px; justify-content: flex-end; }
.song-tool { background: none; border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px; font: inherit; font-size: 13px; color: var(--pine); cursor: pointer; }
.song-tool:hover { background: var(--card); }
.song-list { display: flex; flex-direction: column; gap: 10px; }
.song { background: var(--card); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.song summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 14px 18px; cursor: pointer; font-weight: 600; font-size: 16px; }
.song summary::-webkit-details-marker { display: none; }
.song summary:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
.song-num { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--pine); color: #fff; display: grid; place-items: center; font-size: 13px; }
.song-title { flex: 1; }
.song-chev { color: var(--berry); transition: transform .2s; }
.song[open] .song-chev { transform: rotate(180deg); }
.song[open] summary { border-bottom: 1px solid var(--line); }
.song-body { padding: 14px 18px 18px 58px; }
.song-body p { margin: 0; white-space: pre-line; line-height: 1.6; }
.num { color: var(--berry); font-weight: 700; margin-right: 6px; }
.row { display: flex; justify-content: space-between; gap: 12px; align-items: center; flex-wrap: wrap; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.kv:last-child { border-bottom: 0; }
.kv span:first-child { color: var(--muted); }
.kv span:last-child { font-weight: 600; text-align: right; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.stat b { display: block; font-size: 28px; color: var(--pine-dark); }

/* badges and notices */
.methods { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.methods legend { font-weight: 600; font-size: 14px; margin-bottom: 6px; padding: 0; }
.methods label, .methods-cell label { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; margin-right: 10px; }
.coord { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.contact-icons { display: inline-flex; gap: 8px; vertical-align: middle; }
.contact-icons .ci { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 50%; color: #fff; text-decoration: none; }
.contact-icons .ci svg { width: 22px; height: 22px; }
.contact-icons.sm .ci { width: 36px; height: 36px; }
.contact-icons.sm .ci svg { width: 18px; height: 18px; }
.contact-icons .ci:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.contact-icons .call { background: var(--pine); }
.contact-icons .wa { background: #1FA855; }
.contact-icons .sms { background: #2F6FD0; }
.contact-icons .mail { background: #6B6F6A; }
.contact-icons .ci:hover, .contact-icons .ci-group:hover { filter: brightness(1.1); }
.contact-icons { flex-wrap: wrap; align-items: center; }
.btn.wa-btn { background: #1FA855; border-color: #1FA855; color: #fff; }
.btn.wa-btn:hover { background: #178A45; color: #fff; }
.ci-group { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: 999px; background: #1FA855; color: #fff; font-weight: 600; font-size: 14px; text-decoration: none; }
.ci-group.sm, .contact-icons.sm .ci-group { min-height: 36px; font-size: 13px; padding: 0 12px; }
.ci-group svg { width: 18px; height: 18px; }
.ci-group:hover { filter: brightness(1.1); color: #fff; }
.ci-group:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.badge { display: inline-block; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px; background: var(--pine-tint); color: #1E5C3F; white-space: nowrap; }
.badge.closed { background: #F0F1EE; color: var(--ink-2); }
.badge.warn { background: var(--gold-tint); color: var(--gold-ink); }
.badge.blue { background: #E5ECF7; color: #1F3F73; }
.badge.red { background: var(--berry-tint); color: var(--berry-dark); }
.notice { border-radius: 12px; padding: 12px 14px; font-size: 14px; background: var(--pine-tint); color: var(--pine-dark); }
.notice.warn { background: var(--gold-tint); color: var(--gold-ink); }
.notice.err { background: var(--berry-tint); color: var(--berry-dark); }
.notice ul { margin: 4px 0 0; padding-left: 18px; }
.members-note { border-left: 4px solid var(--berry); line-height: 1.5; white-space: pre-line; }
.members-note strong { font-size: 15px; }
.countdown { display: inline-flex; flex-direction: column; align-items: flex-end; line-height: 1.25; text-align: right; }
.countdown .cd-left { font-weight: 700; color: var(--pine); }
.countdown.soon .cd-left { color: var(--berry); }
.countdown .cd-date { font-size: 12px; font-weight: 400; color: var(--muted, #6b7280); }
.reg-by { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.reg-by .countdown { align-items: flex-start; text-align: left; }

/* forms */
label.f { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
input[type=text], input[type=email], input[type=tel], input[type=password], input[type=date], input[type=time],
input[type=datetime-local], input[type=number], select, textarea {
  font: inherit; font-size: 16px; font-weight: 400; color: var(--ink); background: #fff;
  border: 1px solid var(--field); border-radius: 10px; padding: 10px 12px; min-height: 46px; width: 100%; min-width: 0;
}
textarea { min-height: 80px; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--pine); outline-offset: 2px; }
.choice { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 14px; border: 1px solid var(--field); border-radius: 12px; background: #fff; cursor: pointer; font-size: 15px; }
.choice input { width: 18px; height: 18px; accent-color: var(--pine); margin: 0; flex: none; }
.choice:has(input:checked) { border: 2px solid var(--pine); background: var(--pine-tint); font-weight: 600; }
.choice.song { justify-content: space-between; }
.choice.song:has(input:checked) { border-color: var(--berry); background: var(--berry-tint); color: var(--berry-dark); }
.song-meta { display: flex; align-items: center; gap: 8px; flex: none; }
.pop-badge { background: var(--gold-tint); color: var(--gold-ink); border: 1px solid var(--gold); border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pop-count { color: var(--muted); font-size: 12px; white-space: nowrap; }
.choice.song.top:not(:has(input:checked)) { border-color: var(--gold); }
.choice.taken .pop-badge, .choice.taken .pop-count { display: none; }
.choice.taken { background: #F0F1EE; color: var(--muted); border-style: dashed; cursor: default; }
.seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.seg .choice { justify-content: center; text-align: center; padding: 6px; font-size: 14px; }
.seg .choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg .choice:has(input:checked) { background: var(--pine); color: #fff; border-color: var(--pine); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--pine); flex: none; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--field); background: #fff; color: var(--ink); font: inherit; font-size: 15px; font-weight: 600; text-decoration: none; cursor: pointer; }
.btn:hover { background: #F0F1EE; color: var(--ink); }
.btn.primary { background: var(--berry); border-color: var(--berry); color: #fff; }
.btn.primary:hover { background: var(--berry-dark); color: #fff; }
.btn.green { background: var(--pine); border-color: var(--pine); color: #fff; }
.btn.green:hover { background: var(--pine-dark); color: #fff; }
.btn.outline { border-color: var(--pine); color: var(--pine); }
.btn.link { border: 0; background: none; color: var(--berry); min-height: 44px; }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 13px; border-radius: 9px; }
.btn.block { width: 100%; }
.btn.big { min-height: 56px; font-size: 17px; }
form.inline { display: inline; margin: 0; }

/* timeline (track page) */
.tl { list-style: none; margin: 0; padding: 0; }
.tl li { display: flex; gap: 12px; }
.tl .rail { width: 22px; display: flex; flex-direction: column; align-items: center; flex: none; }
.tl .dot { width: 14px; height: 14px; border-radius: 7px; border: 3px solid var(--pine); background: #fff; margin-top: 4px; flex: none; }
.tl .bar { width: 2px; flex: 1; background: var(--field); }
.tl li:last-child .bar { background: transparent; }
.tl .body { flex: 1; display: flex; justify-content: space-between; gap: 12px; padding-bottom: 14px; font-size: 15px; }
.tl .done .dot, .tl .skipped .dot { background: #8A928D; border-color: #8A928D; }
.tl .done .bar { background: #8A928D; }
.tl .done .body, .tl .skipped .body { color: var(--muted); }
.tl .done .name, .tl .skipped .name { text-decoration: line-through; }
.tl .here .dot, .tl .next .dot { background: var(--gold); border-color: var(--gold); box-shadow: 0 0 0 4px #F7E7C2; }
.tl .here .body, .tl .next .body { font-weight: 700; }
.tl .mine .dot { border-color: var(--berry); }
.tl .mine .body { color: var(--berry); font-weight: 700; }

.livehead { background: var(--pine-dark); color: #fff; padding: 20px 16px; }
.livehead .inner { max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: 8px; }
.livehead h1 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 24px; }
.livehead .st { color: #CFE8D8; font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.pulse { width: 10px; height: 10px; border-radius: 5px; background: #6FD39A; display: inline-block; }
.progress { height: 8px; border-radius: 4px; background: #2C5743; overflow: hidden; }
.progress div { height: 8px; background: var(--gold); }
.mystop { background: var(--berry); color: #fff; border-radius: 18px; padding: 20px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.mystop .l { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: #F6D9DB; }
.mystop .big { font-size: 30px; font-weight: 700; }

/* bus team (dark) */
body.bus { background: var(--pine-night); color: #fff; }
body.bus a { color: #CFE8D8; }
.bus .panel { background: #1A3A2B; border-radius: 20px; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.bus .tile { background: var(--pine-night); border-radius: 12px; padding: 12px; }
.bus .tile .l { font-size: 12px; color: #A9C2B2; }
.bus .tile b { font-size: 20px; display: block; }
.bus .muted { color: #A9C2B2; }
.bus .btn { background: #1A3A2B; border: 0; color: #fff; }
.bus .btn:hover { background: #24503B; }
.bus .btn.go { background: #fff; color: var(--pine-night); min-height: 72px; font-size: 20px; border-radius: 18px; }
.bus .btn.go.done { background: var(--gold); }
.bus h1 { font-family: var(--serif); font-weight: 400; font-size: 32px; margin: 0; }

/* admin */
.admin-shell { display: flex; flex-wrap: wrap; min-height: 100vh; }
.admin-nav { flex: 1 1 220px; background: var(--pine-dark); color: #fff; padding: 20px 12px; display: flex; flex-direction: column; gap: 2px; }
.admin-nav a { color: #CFE8D8; text-decoration: none; padding: 10px 12px; border-radius: 10px; min-height: 44px; display: flex; align-items: center; }
.admin-nav a.on, .admin-nav a:hover { background: var(--pine); color: #fff; }
.admin-nav .brand-t { font-family: var(--serif); font-size: 20px; padding: 0 12px 16px; color: #fff; }
.admin-main { flex: 999 1 560px; min-width: 0; padding: 24px; display: flex; flex-direction: column; gap: 18px; }
.admin-main h1 { margin: 0; font-family: var(--serif); font-weight: 400; font-size: 32px; color: var(--pine-dark); }
.tablebox { overflow-x: auto; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 10px; border-bottom: 1px solid #EEF0EC; vertical-align: top; }
table.t tr:last-child td { border-bottom: 0; }
.formgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
#map { height: 420px; border-radius: 14px; border: 1px solid var(--line); z-index: 0; }
#map.preview-map { height: 360px; }
.fixbox { margin-top: 6px; }
.fixbox summary { cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.fixbox-body { display: flex; flex-direction: column; gap: 10px; padding: 10px; margin-top: 6px; border: 1px dashed var(--gold); border-radius: 10px; background: var(--gold-tint); min-width: 240px; }
.fix-addr { display: flex; flex-direction: column; gap: 6px; }
.day-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.day-tabs a { display: flex; flex-direction: column; gap: 2px; min-width: 150px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); text-decoration: none; }
.day-tabs a span { font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.day-tabs a:hover { border-color: var(--pine); }
.day-tabs a.on { background: var(--pine); border-color: var(--pine); color: #fff; }
.day-tabs a.on span { color: #DDEDE3; }
.day-tabs a:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
details > summary { cursor: pointer; color: var(--pine); font-weight: 600; font-size: 13px; }

@media (max-width: 420px) {
  .seg { grid-template-columns: 1fr; }
  .hero h1 { font-size: 24px; }
}

/* ---------- trip planner ---------- */
.trip-summary { background: var(--pine-dark); color: #fff; border-radius: 16px; padding: 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.trip-summary .l { display: block; font-size: 12px; color: #BFD6C8; }
.trip-summary b { display: block; font-size: 20px; line-height: 1.2; }
.trip-summary .s { display: block; font-size: 12px; color: #DDEDE3; }
.trip-summary .muted { color: #BFD6C8; }
.ts-main { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 12px; }
.ts-total { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; border-top: 1px solid rgba(255,255,255,.15); padding-top: 12px; }
.ts-total b { font-size: 24px; }
.actionbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.actionbar .btn.big { min-height: 52px; font-size: 17px; }
.options-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
.opt { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 4px; background: #fff; }
.opt b { font-size: 22px; }
.opt-h { font-weight: 700; font-size: 13px; letter-spacing: .03em; }
.opt.rec { border: 2px solid var(--pine); background: var(--pine-tint); }
.opt.on { box-shadow: 0 0 0 3px var(--gold-tint); }
.planner { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.planner-list, .planner-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
@media (min-width: 1100px) {
  .planner { grid-template-columns: minmax(0, 1.25fr) minmax(320px, 1fr); align-items: start; }
  .planner-side { position: sticky; top: 12px; }
}
.route-flow { list-style: none; margin: 8px 0; padding: 0; }
.flow-end { font-weight: 600; color: var(--pine-dark); background: var(--pine-tint); border-radius: 10px; padding: 8px 12px; }
.stop-cards { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; position: relative; }
.stop-card { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.stop-card.conflict { border-color: var(--berry); box-shadow: inset 4px 0 0 var(--berry); }
.stop-card.dragging { opacity: .5; }
.sc-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sc-num { font-size: 12px; font-weight: 700; letter-spacing: .08em; color: var(--muted); }
.sc-name { font-size: 17px; }
.drag { cursor: grab; color: var(--muted); font-size: 18px; line-height: 1; user-select: none; }
.stop-card[draggable="false"] .drag { visibility: hidden; }
.sc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 4px 14px; font-size: 14px; }
.sc-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: flex-start; }
.break-row { background: var(--gold-tint); color: var(--gold-ink); border-radius: 10px; padding: 6px 10px; font-size: 14px; }
.tools { position: relative; }
.tools > summary { list-style: none; cursor: pointer; }
.tools > summary::-webkit-details-marker { display: none; }
.tools-body { display: flex; flex-direction: column; gap: 8px; padding: 10px; margin-top: 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); min-width: 240px; }
.stopopts { max-width: 420px; }
.unit { display: flex; align-items: center; gap: 6px; font-weight: 400; }
.unit input { max-width: 90px; }
.sliders { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.sliders legend { font-weight: 600; font-size: 14px; margin-bottom: 4px; padding: 0; }
.sliders label { display: grid; grid-template-columns: 130px minmax(0, 1fr) 28px; align-items: center; gap: 10px; font-size: 14px; }
.sliders output { font-weight: 700; text-align: right; }
#advanced > summary { cursor: pointer; }

/* ---------- bus extras ---------- */
.bus .report { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; }
.bus .report th, .bus .report td { text-align: left; padding: 6px 4px; border-top: 1px solid rgba(255,255,255,.1); }
.bus .badge.blue { background: #DCE7F7; }
.skipbox { position: relative; }
.skipbox > summary { list-style: none; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.skipbox > summary::-webkit-details-marker { display: none; }
.skipmenu { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; padding: 12px; border-radius: 14px; background: #1A3A2B; }
.bus .maps-btn { text-decoration: none; display: flex; align-items: center; justify-content: center; }
