:root { --fg: #1c1c1c; --muted: #666; --bg: #f6f6f4; --card: #fff; --accent: #0b6e4f; --danger: #a52a2a; --warn: #9a5b00; }
* { box-sizing: border-box; }
body { margin: 0; font: 17px/1.5 system-ui, -apple-system, "Segoe UI", Arial, sans-serif; color: var(--fg); background: var(--bg); }
main { padding: 12px 16px 48px; max-width: 720px; margin: 0 auto; }
h1 { font-size: 1.35rem; margin: 8px 0; }
h2 { font-size: 1.1rem; margin: 20px 0 8px; }
.top { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; background: var(--accent); color: #fff; flex-wrap: wrap; gap: 8px; }
.top nav { display: flex; gap: 14px; align-items: center; }
.top a, .top .link { color: #fff; }
.testbar { background: #fff4d6; padding: 8px 16px; font-size: .9rem; }
.testbar .row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.card { background: var(--card); border-radius: 10px; padding: 12px 14px; margin: 10px 0; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.card p { margin: 4px 0; }
.notice { background: #e6f4ee; border-radius: 8px; padding: 10px 12px; }
.warn { color: var(--warn); }
.hint { color: var(--muted); font-size: .92rem; }
.message { white-space: pre-wrap; background: #f0f0ec; border-radius: 8px; padding: 8px 10px; }
label { display: block; margin: 8px 0; }
input, select { font: inherit; padding: 8px; border: 1px solid #bbb; border-radius: 8px; width: 100%; }
input[size] { width: auto; }
button { font: inherit; padding: 10px 14px; border-radius: 8px; border: 1px solid #aaa; background: #fff; min-height: 44px; cursor: pointer; }
button.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
button.big { width: 100%; font-size: 1.1rem; }
button.danger { color: var(--danger); border-color: var(--danger); }
button.small { min-height: 36px; padding: 4px 10px; }
button.link { background: none; border: none; text-decoration: underline; padding: 4px; min-height: 0; }
form.inline { display: inline; }
.answers { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; align-items: center; }
.answers .other { display: inline-flex; gap: 6px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; align-items: end; }
.plain { list-style: none; padding: 0; }
.plain li { margin: 6px 0; }
.person { border-top: 1px solid #eee; padding-top: 8px; margin-top: 8px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin: 6px 0; }
details summary { cursor: pointer; font-weight: 600; margin: 12px 0; }
.free { color: var(--accent); font-size: .92rem; }

/* Desktop table layout (the worker uses Chrome on a computer, D29). */
main { max-width: 1280px; }
.pagehead { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 8px; }
.counters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.count, .badge { border-radius: 999px; padding: 2px 10px; font-size: .9rem; white-space: nowrap; }
.count.send, .badge.send { background: #fde7c7; color: #7a4a00; }
.count.waiting, .badge.waiting { background: #dbe9fb; color: #1d4f91; }
.count.booked, .badge.booked { background: #d8f0e4; color: #0b5a3f; }
.count.queued, .badge.queued { background: #eee; color: #555; }
.badge.closed { background: #f3e1e1; color: #7a2b2b; }
table.evening { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--card); border-radius: 10px; overflow: hidden; box-shadow: 0 1px 2px rgba(0,0,0,.08); margin-top: 10px; }
table.evening th { text-align: start; font-size: .85rem; color: var(--muted); font-weight: 600; padding: 8px 12px; background: #fafaf8; border-bottom: 1px solid #e6e6e2; position: sticky; top: 0; }
table.evening td { padding: 10px 12px; vertical-align: top; border-bottom: 1px solid #efefeb; }
table.evening tr:last-child td { border-bottom: none; }
table.evening td.who { width: 22%; }
table.evening td.status { width: 14%; }
table.evening td.message-cell { width: 30%; }
table.evening tr.send td { background: #fffaf2; }
table.evening tr.closed td { opacity: .55; }
table.evening .message { margin: 6px 0; font-size: .92rem; }
table.evening details summary { margin: 0; font-weight: 500; color: var(--muted); font-size: .9rem; }
table.evening .answers { margin-top: 0; margin-bottom: 6px; }
table.evening button { min-height: 36px; padding: 6px 10px; }
.free-windows .small { background: #f1f8f4; border-color: #b9dcc9; }
@media (max-width: 800px) {
  table.evening thead { display: none; }
  table.evening, table.evening tbody, table.evening tr, table.evening td { display: block; width: auto !important; }
  table.evening tr { border-bottom: 1px solid #e6e6e2; }
}
table.evening.plan td.when { width: 14%; white-space: nowrap; }
table.evening td.actions { width: 1%; white-space: nowrap; }
.reset-link { margin-inline-start: auto; color: var(--danger); align-self: center; }
.danger-card { border: 1px solid #e3b4b4; }

/* Day calendar beside the tables. */
.with-day { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.with-day > aside { position: sticky; top: 8px; background: var(--card); border-radius: 10px; padding: 10px; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.with-day > aside h2 { margin: 0 0 6px; font-size: 1rem; }
.daycal { margin: 0; }
.daycal svg { display: block; max-width: 100%; height: auto; font-family: inherit; }
.daycal .hour { stroke: #e6e6e2; stroke-width: 1; }
.daycal .hour-label { fill: var(--muted); font-size: 11px; }
.daycal .slot { stroke-width: 1.5; }
.daycal .slot.booked { fill: #d8f0e4; stroke: #0b6e4f; }
.daycal .slot.waiting { fill: #dbe9fb; stroke: #1d4f91; }
.daycal .slot.send { fill: #fde7c7; stroke: #b36b00; stroke-dasharray: 4 3; }
.daycal .slot-time { font-size: 11px; font-weight: 600; fill: #1c1c1c; }
.daycal .slot-name { font-size: 11px; fill: #333; }
.daycal a:hover .slot { stroke-width: 2.5; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; font-size: .8rem; color: var(--muted); margin-top: 8px; }
.legend .key { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-inline-end: 3px; border: 1.5px solid; }
.legend .key.booked { background: #d8f0e4; border-color: #0b6e4f; }
.legend .key.waiting { background: #dbe9fb; border-color: #1d4f91; }
.legend .key.send { background: #fde7c7; border-color: #b36b00; border-style: dashed; }
tr:target td { outline: 2px solid var(--accent); outline-offset: -2px; }
@media (max-width: 1000px) { .with-day { grid-template-columns: 1fr; } .with-day > aside { position: static; } }

/* Map above the calendar. */
.mapbox { margin: 0 0 12px; }
.daymap { height: 300px; border-radius: 8px; border: 1px solid #e6e6e2; }
.legend .key.queued { background: #eee; border-color: #8a8a8a; }
.legend .key.home { background: #fff; border-color: #1c1c1c; border-radius: 50%; }
.leaflet-container { font: inherit; }
.redirect { margin-top: 6px; }
.redirect-form { display: grid; gap: 6px; margin-top: 6px; }
.redirect-form .choice { display: block; }
.redirect-form .row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.redirect ul { margin: 4px 0; padding-inline-start: 18px; }
.legend .key.g1 { background: #d8f0e4; border-color: #0b6e4f; }
.legend .key.g2 { background: #dbe9fb; border-color: #1d4f91; }
.legend .key.g3 { background: #eedcf3; border-color: #8e3fa0; }
.groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.group { border: 2px solid #e6e6e2; border-radius: 8px; padding: 10px 12px; background: var(--card); }
.group.g1 { border-top: 6px solid #0b6e4f; }
.group.g2 { border-top: 6px solid #1d4f91; }
.group.g3 { border-top: 6px solid #8e3fa0; }
.group.chosen { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent) inset; }
.group h3 { margin: 0 0 6px; }
.group ol { margin: 6px 0; padding-inline-start: 20px; font-size: .9rem; }
