/* Seventy Three, State Highway 73 style: the calendar (index.html) and the people page (people.html).
   SH73 is a real road, Christchurch over Arthur's Pass to Kumara. Every kind of date wears the colour its sign has on the road:
   green guide signs for free Saturdays, brown tourist signs for graduation, yellow for someone away, blue for birthdays,
   a black-edged white plate for stat days. The logo is the red state highway shield with 73 in it. */
:root {
  --ground: #E3E6E1; --plate: #FAFBF9; --dust: #D3D7D1;
  --ink: #111412; --soft: #48504B;
  --green: #00663F; --green-dk: #004E30;
  --brown: #6A4024; --yellow: #FFC72C; --blue: #1D4E9E; --red: #C8102E;
  --face: Overpass, "Helvetica Neue", Arial, sans-serif;
  --s13: 13px; --s16: 17px; --s20: 21px; --s32: 32px; --s64: clamp(40px, 4.6vw, 68px);
  --m: clamp(14px, 2.4vw, 36px); --r: 8px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 400 var(--s16)/1.45 var(--face); -webkit-font-smoothing: antialiased; }
button, input { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
::selection { background: var(--yellow); color: var(--ink); }
a { color: inherit; text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

/* A sign: a coloured plate with a white border set just inside its edge. */
.sign { background: var(--green); color: #fff; border-radius: var(--r); box-shadow: inset 0 0 0 4px var(--green), inset 0 0 0 7px #fff; padding: 22px 26px; }
.sign.brown { background: var(--brown); box-shadow: inset 0 0 0 4px var(--brown), inset 0 0 0 7px #fff; }
.sign.blue { background: var(--blue); box-shadow: inset 0 0 0 4px var(--blue), inset 0 0 0 7px #fff; }
.sign.yellow { background: var(--yellow); color: var(--ink); box-shadow: inset 0 0 0 4px var(--yellow), inset 0 0 0 7px var(--ink); }

/* Header */
.bar { position: sticky; top: 0; z-index: 10; background: var(--green); color: #fff; display: flex; align-items: center; gap: 26px; padding: 10px var(--m); }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.shield { width: 40px; height: 44px; display: grid; place-items: center; background: url(/shield.svg) center / contain no-repeat; color: #fff; font: 900 17px/1 var(--face); padding-bottom: 4px; letter-spacing: -.02em; }
.brand b { font: 800 22px/1 var(--face); letter-spacing: -.01em; }
.bar nav { display: flex; gap: 6px; margin-left: auto; font-weight: 700; }
.bar nav a { text-decoration: none; padding: 9px 14px; border-radius: 6px; }
.bar nav a:hover { background: var(--green-dk); }
.bar nav a[aria-current] { background: var(--plate); color: var(--green); }
.btn { background: var(--yellow); color: var(--ink); border: 0; border-radius: 6px; padding: 11px 18px; font-weight: 800; cursor: pointer; white-space: nowrap; transition: transform .1s, background .15s; }
.btn:hover { background: #FFD45C; } .btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: progress; }
main { padding: 0 var(--m) 80px; max-width: 1400px; margin: 0 auto; }
footer { margin-top: 56px; color: var(--soft); }
footer a { font-weight: 700; color: var(--green); }

.welcome { padding: 34px 4px 12px; max-width: 760px; }
.welcome-kicker { margin: 0 0 10px; color: var(--green); font-size: var(--s13); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.welcome h1 { font: 900 var(--s64)/.98 var(--face); margin: 0 0 14px; letter-spacing: -.03em; }
.welcome > p:not(.welcome-kicker) { margin: 0; max-width: 32em; font-size: var(--s20); }
.welcome-links { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 20px; margin-top: 22px; }
.welcome-links .btn { text-decoration: none; }
.welcome-links a:not(.btn) { color: var(--green); font-weight: 800; }
.signs.highlights { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-top: 12px; }
.planning { margin-top: 16px; }

/* Calendar first screen: the signs */
.signs { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 16px; padding-top: 28px; align-items: stretch; }
/* minmax(0, 1fr), so a long note like "Reuben's birthday weekend" wraps instead of pushing the column past the sign. */
.route { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; }
.route button { width: 100%; display: flex; align-items: center; gap: 14px; padding: 9px 0; background: none; border: 0; color: inherit; cursor: pointer; text-align: left; }
.route button::before { content: ""; width: 26px; height: 26px; flex: none; background: url(/arrow.svg) center / contain no-repeat; }
.route b { font: 800 var(--s32)/1.05 var(--face); letter-spacing: -.01em; white-space: nowrap; }
.route span { margin-left: auto; min-width: 0; font-weight: 600; font-size: var(--s20); line-height: 1.2; opacity: .92; text-align: right; }
.route button:hover b { text-decoration: underline; text-decoration-thickness: 3px; }
.big p { margin: 18px 0 0; font-size: var(--s16); max-width: 40em; }
.highlights .sign h2, .planning .sign h2 { font: 800 var(--s20)/1.15 var(--face); margin: 2px 0 4px; }
.highlights .sign p { margin: 0; font-size: var(--s16); }
.highlights .sign .when { font: 900 var(--s32)/1.05 var(--face); letter-spacing: -.01em; margin-bottom: 4px; }
.highlights .next-sign { grid-column: 1 / -1; display: block; text-decoration: none; }
.highlights .next-sign:hover h2 { text-decoration: underline; }
.planning .plan { display: inline-block; margin-top: 14px; text-decoration: none; }
.diamond { width: 30px; height: 30px; background: var(--ink); transform: rotate(45deg) scale(.72); float: right; margin: -4px -4px 0 0; }
/* Lists inside the yellow and blue signs: each line opens that day. */
.lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.lines button { display: block; width: 100%; background: none; border: 0; padding: 0; color: inherit; text-align: left; cursor: pointer; }
.lines b { display: block; font: 900 var(--s20)/1.15 var(--face); }
.lines button:hover b { text-decoration: underline; }
.lines .empty { font-size: var(--s16); }
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 26px 0 0; padding: 0; list-style: none; font-weight: 600; }
.legend li { display: flex; align-items: center; gap: 8px; }
.legend i, .whatson i { width: 22px; height: 16px; border-radius: 3px; flex: none; }
.k-free { background: var(--green); } .k-away { background: var(--yellow); } .k-bday { background: var(--blue); } .k-omp { background: var(--brown); }
.k-stat { background: var(--plate); box-shadow: inset 0 0 0 3px var(--ink); }

/* The next 52 weeks on one white board: a column per week, a lane per kind of date, a red line for today. */
.board { margin-top: 16px; background: var(--plate); border-radius: var(--r); box-shadow: inset 0 0 0 3px var(--ink); padding: 20px 24px 30px; }
.board h2 { font: 900 var(--s20)/1 var(--face); margin: 0 0 14px; }
.year { --lane: 140px; --year-offset: 2; display: grid; grid-template-columns: var(--lane) repeat(52, minmax(0, 1fr)); row-gap: 6px; position: relative; }
.year .lane { font-weight: 700; font-size: 15px; align-self: center; color: var(--soft); }
.year .mon { font: 700 var(--s13)/1 var(--face); color: var(--soft); padding: 0 0 6px 4px; box-shadow: inset 2px 0 0 var(--dust); overflow: hidden; white-space: nowrap; }
.year .c { height: 26px; background: var(--ground); margin-right: 2px; border: 0; padding: 0; border-radius: 2px; min-width: 0; }
.year button.c { cursor: pointer; } .year button.c:hover { filter: brightness(1.2); }
.year .c.free { background: var(--green); }
.year .c.stat { background: var(--plate); box-shadow: inset 0 0 0 2px var(--ink); }
.year .c.away { background: var(--yellow); margin-right: 0; border-radius: 0; }
.year .c.bday { background: var(--blue); }
.year .tip { position: absolute; z-index: 3; transform: translate(-50%, calc(-100% - 8px)); background: var(--ink); color: #fff; padding: 9px 13px 7px; border-radius: 6px; pointer-events: none; white-space: nowrap; box-shadow: 0 8px 22px rgba(17,20,18,.28); }
.year .tip b { display: block; font-weight: 800; font-size: 16px; }
.year .tip span { font-size: var(--s13); opacity: .85; }
.year .tip.free { background: var(--green); } .year .tip.bday { background: var(--blue); }
.year .tip.away { background: var(--yellow); color: var(--ink); }
.year .now { position: absolute; top: 20px; bottom: -6px; width: 3px; background: var(--red); z-index: 1; pointer-events: none; }
.year .now span { position: absolute; bottom: -18px; left: -14px; font: 800 var(--s13)/1 var(--face); color: var(--red); white-space: nowrap; }

/* Months: three across, colour coded, with what is on listed underneath */
#months { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 44px 28px; margin-top: 44px; }
#months, .month { scroll-margin-top: 80px; }
.month h2 { font: 900 var(--s32)/1 var(--face); margin: 0 0 12px; letter-spacing: -.02em; }
.month h2 .yr { font-weight: 400; color: var(--soft); font-size: var(--s20); }
.grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.dow { font-size: var(--s13); font-weight: 700; color: var(--soft); text-align: center; padding-bottom: 2px; }
.day { aspect-ratio: 1 / .86; background: var(--plate); border: 0; border-radius: 6px; padding: 5px 7px; position: relative; overflow: hidden; text-align: left; cursor: pointer; display: flex; flex-direction: column; min-width: 0; transition: transform .12s; }
.day:hover { transform: translateY(-2px); }
.day.blank { visibility: hidden; cursor: default; }
.day.we { background: var(--dust); }
.day.past { opacity: .38; }
.num { font: 800 15px/1 var(--face); font-variant-numeric: tabular-nums; }
.day .tag { font-size: 0; }
.day.free, .day.omp { padding: 7px 9px; }
.day.free { background: var(--green); color: #fff; box-shadow: inset 0 0 0 2px var(--green), inset 0 0 0 4px #fff; }
.day.stat { box-shadow: inset 0 0 0 3px var(--ink); }
.day.omp { background: var(--brown); color: #fff; box-shadow: inset 0 0 0 2px var(--brown), inset 0 0 0 4px #fff; }
.day.today .num { background: var(--ink); color: var(--plate); border-radius: 4px; padding: 3px 5px 1px; align-self: flex-start; }
.day .tag.b { position: absolute; left: 5px; right: 5px; top: 24px; height: 8px; border-radius: 2px; background: var(--blue); }
.day.free .tag.b, .day.omp .tag.b { box-shadow: 0 0 0 2px #fff; }
/* Away dates draw one yellow bar across the days they cover, broken at the end of each week. */
.day.has-a { overflow: visible; }
.day .tag.a { position: absolute; left: 0; right: -4px; bottom: 6px; height: 12px; background: var(--yellow); }
.day .tag.a.a-start { left: 5px; } .day .tag.a.a-end { right: 5px; }
.whatson { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 4px; }
.whatson li { display: flex; gap: 10px; align-items: baseline; }
.whatson i { width: 12px; height: 12px; border-radius: 2px; transform: translateY(1px); }
.whatson .k-stat { box-shadow: inset 0 0 0 2px var(--ink); }
.whatson b { min-width: 2.2em; font-variant-numeric: tabular-nums; }
.whatson .none { color: var(--soft); }

/* People */
.phead { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 16px; padding-top: 28px; align-items: stretch; }
.phead .intro { padding: 8px 4px 0 0; }
.phead h1 { font: 900 var(--s64)/1 var(--face); margin: 0 0 16px; letter-spacing: -.02em; }
.phead p { margin: 0; font-size: var(--s20); max-width: 26em; }
.towns-h { font: 700 var(--s16)/1 var(--face); margin: 2px 10px 10px; }
/* A grid, not text columns, so every count sits in one straight line down the right of its column. */
.towns { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px 24px; }
.towns button { width: 100%; height: 100%; display: grid; grid-template-columns: minmax(0, 1fr) 2ch; align-items: baseline; gap: 8px; background: none; border: 0; color: #fff; padding: 7px 10px 5px; font: 800 var(--s20)/1.1 var(--face); cursor: pointer; border-radius: 4px; text-align: left; }
.towns button:hover, .towns button[aria-pressed=true] { background: var(--green-dk); }
.towns .n { font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.dir { display: grid; grid-template-columns: minmax(0, 1fr) 450px; gap: 16px; margin-top: 16px; align-items: start; }
#directory, #results { scroll-margin-top: 90px; }
.mapwrap { position: sticky; top: 76px; height: calc(100vh - 92px); min-height: 520px; border-radius: var(--r); overflow: hidden; background: #EDEFEB; }
#map { position: absolute; inset: 0; }
.near { position: absolute; z-index: 2; top: 14px; left: 14px; }
.maptag { position: absolute; z-index: 2; top: 16px; right: 16px; pointer-events: none; font-weight: 800; background: var(--plate); padding: 9px 14px 7px; border-radius: 5px; box-shadow: inset 0 0 0 2px var(--ink); }
.maptag:empty { display: none; }
.mapempty { position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; pointer-events: none; }
.mapempty .sign { pointer-events: auto; max-width: 330px; text-align: center; }
.mapempty h2 { font: 900 var(--s32)/1 var(--face); margin: 4px 0 10px; }
.mapempty p { margin: 0 0 16px; }
.you { width: 18px; height: 18px; border-radius: 50%; background: var(--blue); border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(29,78,158,.22); }
.search span { font: 800 var(--s20)/1.2 var(--face); display: block; margin-bottom: 8px; }
.search input { width: 100%; background: var(--plate); border: 0; border-radius: 6px; padding: 14px 16px; font-size: var(--s16); box-shadow: inset 0 0 0 3px var(--ink); }
.search input:focus { outline: 0; box-shadow: inset 0 0 0 3px var(--blue); }
.search input::placeholder { color: #5E6660; }
.meta { display: flex; gap: 12px; justify-content: space-between; margin: 12px 2px 8px; color: var(--soft); font-weight: 600; }
.meta .hit { color: var(--green); font-weight: 800; }
.cards { display: grid; gap: 8px; }
.card { background: var(--plate); border-radius: var(--r); padding: 18px; cursor: pointer; scroll-margin: 90px; transition: box-shadow .15s; }
.card:hover { box-shadow: inset 0 0 0 3px var(--dust); }
.card.on { box-shadow: inset 0 0 0 3px var(--green); }
.ctop { display: flex; gap: 14px; align-items: flex-start; }
.chead { min-width: 0; flex: 1; }
.mono { flex: none; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 6px; background: var(--green); color: #fff; font: 800 15px/1 var(--face); box-shadow: inset 0 0 0 2px var(--green), inset 0 0 0 4px #fff; padding-top: 2px; }
.eyebrow { font-size: var(--s13); font-weight: 700; color: var(--soft); }
.eyebrow em { font-style: normal; color: var(--green); font-weight: 800; }
.card h2 { font: 800 var(--s20)/1.15 var(--face); margin: 2px 0 3px; letter-spacing: -.01em; }
.who { margin: 0; font-weight: 700; } .who span { font-weight: 400; color: var(--soft); }
.addr { margin: 12px 0 0; }
.nopin { margin-left: 8px; background: var(--yellow); padding: 3px 8px 2px; border-radius: 3px; font-weight: 700; font-size: var(--s13); }
.acts { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.acts a { text-decoration: none; font-weight: 700; padding: 7px 11px 5px; border-radius: 5px; background: var(--ground); }
.acts a:hover { background: var(--dust); }
.acts a.call { background: var(--green); color: #fff; }
.acts a.go-dir { background: var(--blue); color: #fff; }
.acts .edit { margin-left: auto; background: none; border: 0; color: var(--soft); text-decoration: underline; padding: 6px 0; font-weight: 600; cursor: pointer; }
.none { background: var(--plate); border-radius: var(--r); padding: 22px; } .none b { display: block; }
.ghostcard { background: var(--plate); border-radius: var(--r); padding: 18px; display: flex; gap: 14px; opacity: .6; }
.ghostcard i { width: 46px; height: 46px; border-radius: 6px; background: var(--dust); }
.ghostcard s { display: block; height: 10px; margin: 6px 0 10px; border-radius: 3px; background: var(--dust); }
/* Map controls and the card that pops up from a pin */
.maplibregl-ctrl-attrib { font-size: 11px; }
.mapwrap:has(.maplibregl-popup) :is(.maptag, .near) { display: none; }
.maplibregl-popup-content { background: none; padding: 0; box-shadow: none; }
.maplibregl-popup-tip { border-top-color: var(--plate) !important; border-bottom-color: var(--plate) !important; }
.maplibregl-popup .card { width: 320px; max-width: calc(100vw - 60px); overflow-y: auto; cursor: default; box-shadow: inset 0 0 0 3px var(--green), 0 20px 50px rgba(17,20,18,.3); }
.maplibregl-popup-close-button { font-size: 22px; right: 6px; top: 4px; z-index: 1; color: var(--soft); }

/* Next catch-up page: the plan on a green sign, then either the locked-in date or the dates to choose from. */
.next { max-width: 720px; }
.next .sign { margin-top: 24px; padding: 26px 28px 28px; }
.next .sign h1 { margin: 0; font: 900 var(--s64)/1 var(--face); letter-spacing: -.02em; overflow-wrap: anywhere; }
.next .sign p { margin: 10px 0 0; font-size: var(--s20); }
.next .sign .btn { margin-top: 18px; }
.next .facts { font-weight: 800; }
.next .map { display: inline-block; margin-top: 10px; font-weight: 800; }
.locked, .poll { margin-top: 16px; background: var(--plate); border-radius: var(--r); box-shadow: inset 0 0 0 3px var(--ink); padding: 22px 24px 24px; }
.locked .when { margin: 0; font: 900 var(--s32)/1.1 var(--face); }
.locked .count { margin: 8px 0 0; font: 800 var(--s20)/1.2 var(--face); color: var(--green); }
.locked .names { margin: 4px 0 0; color: var(--soft); }
.locked .yours { margin: 14px 0 0; font-weight: 800; }
.btn.big { display: block; width: 100%; min-height: 56px; margin-top: 16px; font-size: 22px; }
.poll h2 { margin: 0; font: 900 var(--s32)/1.1 var(--face); }
.poll .sub { margin-top: 6px; }
.poll ul { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 10px; }
.poll li button { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: baseline; padding: 14px 16px; border: 0; border-radius: 8px; background: var(--ground); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.poll li button b { font: 900 26px/1.1 var(--face); }
.poll li button .n { font-weight: 800; }
.poll li button .names, .poll li button .top { grid-column: 1 / -1; }
.poll li button .names { color: var(--soft); }
.poll li button .top { font-weight: 800; color: var(--green); }
.poll li button[aria-pressed=true] { background: var(--green); color: #fff; }
.poll li button[aria-pressed=true] .names, .poll li button[aria-pressed=true] .top { color: #fff; }
.poll li button[aria-pressed=true] b::before { content: "\2713  "; }
.poll > .btn { margin-top: 16px; }
.next .me { margin: 14px 0 0; color: var(--soft); }
.next .me:empty { display: none; }
.next .me .ghost { padding: 0 2px; }
#event > .ghost { margin-top: 6px; padding-left: 0; }
#later { margin-top: 32px; }
#later h2 { margin: 0 0 10px; font: 900 var(--s20)/1 var(--face); }
#later span { display: block; color: var(--soft); }
.pick4 { margin: 18px 0 0; padding: 0; border: 0; min-width: 0; }
.pick4 legend { padding: 0; font-weight: 800; font-size: var(--s20); }
.pick4 .sub { margin-top: 4px; }
.sats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.sats button { min-height: 52px; padding: 8px 10px; border: 0; border-radius: 8px; background: var(--ground); color: var(--ink); font: 800 19px/1.1 var(--face); cursor: pointer; }
.sats button[aria-pressed=true] { background: var(--green); color: #fff; }
.sats button[aria-pressed=true]::before { content: "\2713  "; }
.sats button:disabled { opacity: .4; cursor: default; }
.pick4 .other { font-weight: 600; }
/* Keep Save in reach on a phone: the buttons stay at the bottom of the form while it scrolls. */
main.next ~ dialog .row { position: sticky; bottom: -24px; margin: 12px -24px -24px; padding: 12px 24px 16px; background: var(--plate); box-shadow: 0 -8px 18px rgba(17,20,18,.08); }
dialog select { display: block; width: 100%; margin-top: 6px; border: 0; border-radius: 6px; padding: 12px; background: var(--ground); font: inherit; font-weight: 400; }

/* Dialogs */
dialog { background: var(--plate); color: var(--ink); border: 0; border-radius: 12px; padding: 0 24px 24px; width: min(470px, calc(100vw - 24px)); box-shadow: 0 24px 60px rgba(17,20,18,.35); }
dialog::backdrop { background: rgba(17,20,18,.5); }
dialog h2, dialog h3 { margin: 0 -24px 14px; padding: 22px 24px 18px; background: var(--green); color: #fff; font: 900 26px/1.05 var(--face); border-radius: 12px 12px 0 0; }
.calendar-dialog .dialog-head { position: relative; margin: 0 -24px 14px; padding: 22px 56px 18px 24px; background: var(--green); color: #fff; border-radius: 12px 12px 0 0; }
.calendar-dialog .dialog-head h3 { margin: 0; padding: 0; background: none; color: inherit; }
.calendar-dialog .dialog-head .sub { margin-top: 6px; color: rgba(255,255,255,.82); }
.calendar-dialog .dialog-close { position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; border: 0; border-radius: 6px; background: transparent; color: #fff; font-size: 30px; line-height: 1; cursor: pointer; }
.calendar-dialog .dialog-add { position: absolute; top: 12px; right: 12px; min-width: 56px; min-height: 44px; border: 0; border-radius: 6px; background: var(--yellow); color: var(--ink); font: inherit; font-weight: 800; cursor: pointer; }
.calendar-dialog[data-mode="events"] .dialog-head { padding-right: 84px; }
.calendar-dialog #dayEmpty { color: var(--soft); padding: 12px 0; }
.calendar-dialog .err:empty { display: none; }
.calendar-dialog .dialog-close:hover { background: rgba(255,255,255,.16); }
.calendar-dialog .dialog-scroll { min-height: 0; }
.sub { margin: 0; color: var(--soft); }
.sub:empty { display: none; }
.list { list-style: none; margin: 12px 0 0; padding: 0; }
.list:empty { display: none; }
.list li { position: relative; margin-bottom: 10px; padding: 18px 20px 20px; border-radius: var(--r); background: var(--blue); color: #fff; box-shadow: inset 0 0 0 4px var(--blue), inset 0 0 0 7px #fff; }
.list li.away { background: var(--yellow); color: var(--ink); box-shadow: inset 0 0 0 4px var(--yellow), inset 0 0 0 7px var(--ink); }
.list small { display: block; padding-right: 76px; font-size: var(--s16); font-weight: 700; }
.list b { display: block; margin-top: 6px; font: 900 34px/1.05 var(--face); overflow-wrap: anywhere; }
.list li > span { display: block; margin-top: 8px; font-size: var(--s20); }
.list .x { position: absolute; top: 14px; right: 16px; min-height: 32px; background: none; border: 0; padding: 0; color: inherit; font-weight: 700; cursor: pointer; text-decoration: underline; }
.seg { display: flex; margin-top: 16px; gap: 6px; }
.seg button { flex: 1; cursor: pointer; border: 0; padding: 11px; border-radius: 6px; background: var(--ground); font-weight: 800; }
.calendar-dialog .seg button { min-height: 44px; }
.seg button[aria-pressed=true][data-k=birthday] { background: var(--blue); color: #fff; }
.seg button[aria-pressed=true][data-k=away] { background: var(--yellow); }
label { display: block; margin-top: 14px; font-weight: 700; }
label small { font-weight: 400; color: var(--soft); }
.two { display: flex; gap: 12px; } .two label { flex: 1; min-width: 0; }
dialog input { display: block; width: 100%; margin-top: 6px; border: 0; border-radius: 6px; padding: 12px; background: var(--ground); font-weight: 400; }
.calendar-dialog input { font-size: 16px; }
dialog input:focus { outline: 0; box-shadow: inset 0 0 0 3px var(--blue); }
dialog input::placeholder { color: #5E6660; }
.err { color: var(--red); font-weight: 700; min-height: 1.4em; margin-top: 10px; }
.row { display: flex; gap: 12px; justify-content: flex-end; align-items: center; margin-top: 12px; }
.ghost { background: none; border: 0; font-weight: 700; padding: 11px 8px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.calendar-dialog .ghost { min-height: 44px; }
.ghost.rm { margin-right: auto; color: var(--red); }

/* Falkor, and the note with Undo */
.dragon { position: fixed; left: 0; top: 18vh; width: min(520px, 80vw); z-index: 50; pointer-events: none; animation: fly 3.6s cubic-bezier(.45,.05,.4,1) forwards; }
.dragon img { width: 100%; animation: swim .9s ease-in-out infinite alternate; }
.dragon span { position: absolute; top: 2%; left: 52%; white-space: nowrap; background: var(--green); color: #fff; font: 800 18px/1 var(--face); padding: 10px 14px 8px; border-radius: 6px; box-shadow: inset 0 0 0 2px var(--green), inset 0 0 0 4px #fff; }
@keyframes fly { 0% { transform: translate(-100%, 8vh); opacity: 0; } 12% { opacity: 1; } 50% { transform: translate(calc(50vw - 50%), -2vh); } 88% { opacity: 1; } 100% { transform: translate(100vw, -14vh); opacity: 0; } }
@keyframes swim { from { transform: rotate(-3deg) scaleY(.97); } to { transform: rotate(3deg) scaleY(1.03); } }
.toast { position: fixed; left: 50%; bottom: 24px; translate: -50% 0; z-index: 60; background: var(--ink); color: #fff; border-radius: 6px; padding: 13px 18px 11px; font-weight: 700; max-width: calc(100vw - 32px); box-shadow: 0 10px 30px rgba(17,20,18,.35); }
.toast button { margin-left: 14px; background: none; border: 0; padding: 0; color: var(--yellow); font: inherit; text-decoration: underline; cursor: pointer; }
.install-banner { position: fixed; left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 55; display: flex; align-items: center; gap: 12px; max-width: 480px; margin: auto; padding: 12px 12px 12px 16px; background: var(--ink); color: #fff; border-radius: 8px; box-shadow: 0 10px 30px rgba(17,20,18,.3); }
.install-banner p { flex: 1; margin: 0; font-weight: 700; }
.install-banner button { min-height: 44px; border: 0; border-radius: 5px; padding: 9px 12px; background: var(--yellow); color: var(--ink); font: inherit; font-weight: 800; cursor: pointer; }
.install-banner .install-dismiss { flex: none; width: 44px; padding: 0; background: transparent; color: #fff; font-size: 24px; }

/* Months rise into place as they scroll in (app.js adds .anim and .in). */
.anim [data-rise] { opacity: 0; transform: translateY(28px); transition: opacity .5s, transform .5s; }
.anim [data-rise].in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .dragon { display: none; } .day, .btn { transition: none; } }

@media (max-width: 1100px) { #months { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1000px) {
  .signs, .signs.highlights, .phead, .dir { grid-template-columns: minmax(0, 1fr); }
  .mapwrap { position: relative; top: 0; height: 56vh; min-height: 360px; }
}
@media (max-width: 640px) {
  /* Phones: logo and the yellow button on top, Home and People as two equal tabs underneath. Not sticky, so it does not eat the screen. */
  .bar { position: static; flex-wrap: wrap; gap: 10px; padding: 8px 12px 12px; }
  .brand { flex: none; gap: 8px; } .brand b { font-size: 18px; }
  .shield { width: 34px; height: 38px; font-size: 15px; }
  .bar .btn { margin-left: auto; padding: 0 16px; }
  .bar nav { order: 3; width: 100%; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .bar nav a { justify-content: center; padding: 0 8px; border-radius: 6px; box-shadow: inset 0 0 0 2px rgba(255,255,255,.6); }
  .bar nav a[aria-current] { box-shadow: none; }
  .bar nav a, .bar .btn { min-height: 44px; display: inline-flex; align-items: center; font-size: 17px; }
  #months, .month, #directory, #results { scroll-margin-top: 12px; }
  .sign { padding: 18px; }
  .welcome { padding: 24px 0 4px; }
  .welcome h1 { font-size: 46px; }
  .welcome > p:not(.welcome-kicker) { font-size: 18px; }
  .welcome-links { margin-top: 18px; }
  .welcome-links a { min-height: 44px; display: inline-flex; align-items: center; }
  .highlights { padding-top: 12px; }
  .route { grid-template-columns: minmax(0, 1fr); }
  .route b { font-size: 26px; } .route button { padding: 7px 0; }
  .highlights .sign .when { font-size: 25px; }
  #months { grid-template-columns: minmax(0, 1fr); }
  .towns { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 10px; }
  .towns button { font-size: 18px; padding: 8px 8px 6px; }
  .mapwrap { margin: 0 calc(-1 * var(--m)); border-radius: 0; height: clamp(320px, 56svh, 420px); min-height: 320px; }
  .maptag { top: 70px; left: 14px; right: auto; max-width: calc(100% - 28px); }
  .two { flex-direction: column; gap: 0; }
  .board { display: none; } /* too small to read on a phone; the month calendar below shows the same days */
  .day { min-height: 44px; }
  dialog { max-height: calc(100dvh - 24px); overflow-y: auto; padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
  dialog.calendar-dialog[open] { inset: auto 0; top: var(--dialog-top, 0px); display: flex; flex-direction: column; width: 100%; max-width: none; height: var(--dialog-height, min(680px, calc(100dvh - 12px))); max-height: none; margin: 0; padding: 0; border-radius: 16px 16px 0 0; overflow: hidden; }
  dialog.calendar-dialog[open][data-mode="events"] { top: auto; bottom: 0; height: auto; max-height: var(--dialog-height, calc(100dvh - 12px)); }
  .calendar-dialog .dialog-head { flex: none; margin: 0; padding: 18px 56px 18px 18px; border-radius: 16px 16px 0 0; }
  .calendar-dialog .dialog-close { top: 8px; right: 8px; }
  .calendar-dialog .dialog-scroll { flex: 1; overflow-y: auto; padding: 0 18px; overscroll-behavior: contain; }
  .calendar-dialog .dialog-scroll .list { margin-top: 12px; }
  .calendar-dialog .dialog-scroll .seg { margin-top: 16px; }
  .calendar-dialog .row { flex: none; margin: 0; padding: 10px 18px calc(10px + env(safe-area-inset-bottom)); background: var(--plate); box-shadow: 0 -8px 18px rgba(17,20,18,.1); }
  .calendar-dialog .row .btn, .calendar-dialog .row .ghost { min-height: 44px; }
}
@media (max-width: 380px) { .brand b { display: none; } }
@media (pointer: coarse) { .year .tip { display: none !important; } }

/* Usage page (/stats) */
.stats { max-width: 900px; }
.stats h1 { font: 900 var(--s64)/1 var(--face); margin: 32px 0 12px; }
.stats h2 { font: 900 var(--s20)/1 var(--face); margin: 36px 0 10px; }
.tally { list-style: none; margin: 24px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.tally li { background: var(--plate); border-radius: var(--r); box-shadow: inset 0 0 0 3px var(--ink); padding: 16px 18px; font-weight: 700; color: var(--soft); }
.tally b { display: block; font: 900 var(--s32)/1 var(--face); color: var(--ink); margin-bottom: 4px; }
.stats table { width: 100%; border-collapse: collapse; background: var(--plate); border-radius: var(--r); overflow: hidden; }
.stats th, .stats td { text-align: left; padding: 10px 14px; border-bottom: 2px solid var(--ground); font-variant-numeric: tabular-nums; }
.stats td:first-child { white-space: nowrap; }
.stats th { background: var(--green); color: #fff; }
