/* Parea in the AlkyonStack colours: steel blue on a cool light ground, navy at night, and the
   lighthouse's lamp gold for "you". No framework. */
:root {
  --bg: #F3F6FA; --card: #FFFFFF; --ink: #17263A; --muted: #5B6B7C; --line: #DCE4EC;
  --accent: #0C5B90; --accent-hover: #00406E; --on-accent: #FFFFFF; --accent-soft: #E1EDF6;
  --olive: #6B4A00; --olive-soft: #FFF3D6; --danger: #A32A2A; --shade: rgba(0, 8, 36, .55);
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: var(--sans);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0A1626; --card: #12263F; --ink: #E6EDF5; --muted: #9FB0C3; --line: #22395A;
    --accent: #6FB1E0; --accent-hover: #7DBBEA; --on-accent: #0A1626; --accent-soft: #163556;
    --olive: #FFD866; --olive-soft: #3A3112; --danger: #F08A8A; --shade: rgba(0, 0, 0, .6);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--sans); }
h1, h2, h3 { font-family: var(--sans); font-weight: 700; line-height: 1.2; letter-spacing: -.02em; margin: 0; }
h1 { font-size: 1.9rem; } h2 { font-size: 1.35rem; } h3 { font-size: 1.1rem; }
p { margin: 0 0 .75rem; }
a { color: var(--accent); }
img { max-width: 100%; display: block; }
.boot { text-align: center; color: var(--muted); padding: 4rem 1rem; font-family: var(--serif); font-size: 1.4rem; }
.wrap { max-width: 720px; margin: 0 auto; padding: 0 16px 48px; }
.muted { color: var(--muted); } .small { font-size: .875rem; } .center { text-align: center; }
.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
[hidden] { display: none !important; }

/* top bar */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; }
.brand { font-family: var(--serif); font-size: 1.35rem; font-weight: 700; color: var(--ink); text-decoration: none; letter-spacing: -.02em; display: inline-flex; align-items: center; gap: 9px; }
.brand img { border-radius: 7px; }
.by { font-size: .8rem; color: var(--muted); text-decoration: none; }

/* buttons and fields */
button, .btn { font: inherit; cursor: pointer; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink);
  padding: 9px 14px; min-height: 42px; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
button:hover, .btn:hover { border-color: var(--muted); }
button.primary, .btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
button.primary:hover, .btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
button.danger { color: var(--danger); }
button.quiet, .btn.quiet { border-color: transparent; background: transparent; color: var(--accent); padding: 6px 8px; min-height: 36px; }
button.quiet:hover, .btn.quiet:hover { background: var(--accent-soft); border-color: transparent; }
button.icon { width: 38px; min-height: 38px; padding: 0; }
button:disabled { opacity: .5; cursor: default; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
label { display: block; font-size: .875rem; font-weight: 600; margin-bottom: 4px; }
input[type=text], input[type=email], input[type=date], input[type=time], textarea, select {
  font: inherit; width: 100%; padding: 9px 11px; min-height: 42px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); color: var(--ink); }
textarea { min-height: 88px; resize: vertical; }
label > input, label > textarea, label > select { display: block; margin-top: 4px; font-weight: 400; }
.field { margin-bottom: 12px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.err { color: var(--danger); font-size: .9rem; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.note { background: var(--accent-soft); border-radius: 12px; padding: 12px 14px; margin: 12px 0; }
.note.olive { background: var(--olive-soft); }

/* start page */
.hero { padding: 28px 0 8px; }
.hero h1 { font-size: 2.3rem; max-width: 18ch; }
.hero p.lead { font-size: 1.1rem; color: var(--muted); max-width: 46ch; margin-top: 12px; }
.promises { list-style: none; padding: 0; margin: 18px 0; display: grid; gap: 10px; }
.promises li { padding-left: 26px; position: relative; }
.promises li::before { content: ""; position: absolute; left: 2px; top: .45em; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); }
.home-cols { display: grid; gap: 24px; }
@media (min-width: 900px) { .wrap.wide { max-width: 1040px; } .home-cols { grid-template-columns: 1.05fr .95fr; align-items: start; } }
.example { border: 1px solid var(--line); border-radius: 18px; background: var(--card); overflow: hidden; }
.example-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 10px 16px 0; }
.example .prog { padding: 0 16px 8px; }

/* programme (what participants see) */
.cover { position: relative; margin: 0 -16px; background: var(--accent-soft); }
.cover img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.prog-head { padding: 18px 0 6px; }
.prog-head .hello { color: var(--accent); font-weight: 600; margin-bottom: 4px; }
.prog-head .desc { white-space: pre-wrap; color: var(--muted); margin-top: 8px; }
.people { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; padding: 0; list-style: none; }
.chip { font-size: .8rem; border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px; background: var(--card); white-space: nowrap; }
.chip.me { background: var(--olive-soft); border-color: transparent; color: var(--olive); font-weight: 600; }
.days { display: flex; gap: 8px; overflow-x: auto; padding: 10px 16px; margin: 8px -16px 0; position: sticky; top: 0; background: var(--bg); z-index: 2; border-bottom: 1px solid var(--line); scrollbar-width: none; }
.days::-webkit-scrollbar { display: none; }
.days button { flex: 0 0 auto; border-radius: 999px; min-height: 40px; padding: 4px 14px; flex-direction: column; gap: 0; line-height: 1.15; }
.days button small { font-size: .7rem; color: var(--muted); }
.days button[aria-selected=true] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.days button[aria-selected=true] small { color: var(--bg); opacity: .8; }
.day-title { margin: 18px 0 4px; }
.timeline { list-style: none; margin: 14px 0 0; padding: 0; }
.act { display: grid; grid-template-columns: 58px 1fr; gap: 0 14px; }
.act-time { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; padding-top: 1px; }
.act-time small { display: block; font-weight: 400; color: var(--muted); font-size: .8rem; }
.act-body { position: relative; border-left: 2px solid var(--line); padding: 0 0 24px 18px; min-width: 0; }
.act:last-child .act-body { border-left-color: transparent; }
.act-body::before { content: ""; position: absolute; left: -7px; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--bg); border: 2px solid var(--accent); }
.act.now .act-body::before { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.act.other { opacity: .62; }
.act h3 { margin-bottom: 2px; }
.act .place { color: var(--muted); font-size: .92rem; margin: 0 0 4px; }
.act .desc { white-space: pre-wrap; margin: 6px 0; overflow-wrap: anywhere; }
.act img.pic { border-radius: 12px; margin: 8px 0; max-height: 320px; width: 100%; object-fit: cover; background: var(--accent-soft); }
.badges { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.badges:empty { display: none; }
.badge { font-size: .7rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; border-radius: 6px; padding: 1px 7px; background: var(--accent-soft); color: var(--accent); }
.badge.now { background: var(--accent); color: var(--on-accent); }
.badge.you { background: var(--olive-soft); color: var(--olive); }
.act-tools { display: flex; gap: 2px; flex-wrap: wrap; margin: 4px 0 0 -8px; }
.empty { color: var(--muted); padding: 24px 0; text-align: center; }
.offline { background: var(--olive-soft); color: var(--olive); border-radius: 10px; padding: 8px 12px; margin-top: 12px; font-size: .9rem; }
.foot { margin-top: 36px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }
.foot a, .foot button.quiet { color: var(--muted); font-size: .85rem; padding: 0; min-height: 0; text-decoration: underline; background: none; }
.foot .links { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 8px; }
.fab { position: fixed; right: 16px; bottom: 16px; z-index: 5; box-shadow: 0 4px 14px var(--shade); }

/* centred message screens (invitation, locked, gone) */
.gate { max-width: 460px; margin: 8vh auto 0; text-align: center; }
.gate h1 { margin-bottom: 10px; }
.gate .card { text-align: left; margin-top: 18px; }

/* organiser page */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 6px 0 18px; overflow-x: auto; }
.tabs button { border: 0; border-bottom: 3px solid transparent; border-radius: 0; background: none; color: var(--muted); font-weight: 600; padding: 10px 12px; }
.tabs button[aria-selected=true] { color: var(--ink); border-bottom-color: var(--accent); }
.ed-day { margin-top: 16px; }
.ed-day > .row { margin-bottom: 10px; }
.ed-act { border: 1px solid var(--line); border-radius: 12px; margin-top: 8px; background: var(--bg); }
.ed-act > summary { list-style: none; cursor: pointer; padding: 10px 12px; display: flex; gap: 10px; align-items: center; }
.ed-act > summary::-webkit-details-marker { display: none; }
.ed-act > summary .t { font-variant-numeric: tabular-nums; color: var(--muted); min-width: 3.2em; }
.ed-act > summary .n { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ed-act[open] > summary { border-bottom: 1px solid var(--line); }
.ed-act .inner { padding: 12px; }
.pick { display: flex; flex-wrap: wrap; gap: 6px; }
.pick button { min-height: 34px; padding: 3px 12px; border-radius: 999px; font-size: .875rem; }
.pick button[aria-pressed=true] { background: var(--olive-soft); border-color: var(--olive); color: var(--olive); font-weight: 600; }
.photo-box { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.photo-box img { width: 96px; height: 64px; object-fit: cover; border-radius: 8px; background: var(--accent-soft); }
.savebar { position: sticky; bottom: 0; z-index: 4; margin: 20px -16px 0; padding: 10px 16px; background: var(--card); border-top: 1px solid var(--line);
  display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.person { padding: 12px 0; border-top: 1px solid var(--line); }
.person:first-child { border-top: 0; }
.person .name { font-weight: 600; }
.person select { width: auto; min-height: 36px; padding: 4px 8px; }
.person .acts { margin-top: 8px; display: flex; gap: 6px; flex-wrap: wrap; }
.person .acts button { min-height: 36px; padding: 4px 11px; font-size: .9rem; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--line); margin-right: 6px; }
.status-dot.on { background: var(--olive); } .status-dot.off { background: var(--danger); }

/* overlay: questions, QR code */
.overlay { position: fixed; inset: 0; background: var(--shade); z-index: 20; display: flex; align-items: center; justify-content: center; padding: 16px; }
.dialog { background: var(--card); border-radius: 16px; padding: 20px; max-width: 420px; width: 100%; max-height: 90vh; overflow: auto; }
.dialog h2 { margin-bottom: 8px; }
.dialog .row { justify-content: flex-end; margin-top: 16px; }
.qr { background: #fff; border-radius: 12px; padding: 4px; max-width: 280px; margin: 12px auto; }
.qr svg { display: block; width: 100%; height: auto; }
.toast { position: fixed; left: 50%; bottom: 76px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 9px 16px; border-radius: 999px; z-index: 30; font-size: .9rem; max-width: 90vw; }

/* printing the QR sheet: one card per person */
.print-sheet { display: none; }
@media print {
  body.printing > #app { display: none; }
  body.printing .print-sheet { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8mm; padding: 6mm; color: #000; background: #fff; }
  .print-sheet .ticket { border: 1px dashed #999; border-radius: 3mm; padding: 4mm; text-align: center; break-inside: avoid; }
  .print-sheet .ticket b { display: block; font-size: 13pt; }
  .print-sheet .ticket span { font-size: 8pt; }
}
