/*
  tbay.events
  Neutral paper and ink so event photos carry the colour. One warm accent, kept for things that are
  live, soon or featured. Thunder Bay shows up quietly: the Sleeping Giant as the mark, and soft
  lake, amethyst and granite tints behind events that have no photo.
  Type: Archivo, slightly widened for headings.
*/
:root {
  color-scheme: light;
  --bg: #ffffff;
  --soft: #f4f4f3;
  --ink: #111214;
  --ink-2: #41454a;
  --muted: #6f747a;
  --line: #e6e6e4;
  --accent: #dd4a26;
  --accent-soft: #fdece6;
  --danger: #c2331b;
  --tint-1: #e4ecf1; --tint-2: #ebe6f3; --tint-3: #f1e8df; --tint-4: #e3eee7; --tint-5: #f2e4e2; --tint-6: #e9eaec;
  --shadow: 0 1px 2px rgba(17,18,20,.06), 0 6px 20px -8px rgba(17,18,20,.18);
  --radius: 12px;
  --gutter: clamp(16px, 4vw, 48px);
  --ease: cubic-bezier(.2, .8, .2, 1);
  font-family: 'Archivo', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0f1012; --soft: #18191c; --ink: #eeefef; --ink-2: #c5c8cb; --muted: #8c9197; --line: #26282b;
    --accent: #ff7a57; --accent-soft: #2c1a14; --danger: #ff8a73;
    --tint-1: #18232a; --tint-2: #201c29; --tint-3: #26201b; --tint-4: #19231d; --tint-5: #2a1e1d; --tint-6: #1d1f22;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -10px rgba(0,0,0,.7);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html.locked { overflow: hidden; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-underline-offset: .18em; text-decoration-thickness: 1px; }
button, input, select { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 8px; }
h1, h2, h3 { font-stretch: 108%; letter-spacing: -.015em; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; left: 12px; top: -80px; z-index: 100; background: var(--ink); color: var(--bg); padding: 10px 14px; border-radius: 10px; }
.skip:focus { top: 12px; }
.icon { display: inline-flex; width: 1.1em; height: 1.1em; flex: none; }
.icon svg { width: 100%; height: 100%; }
.wrap { max-width: 1320px; margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }

/* ---------- Buttons ---------- */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink);
  font-weight: 600; font-size: 15px; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .15s, border-color .15s, transform .15s;
}
.button:hover { border-color: var(--ink-2); }
.button:active { transform: scale(.98); }
.button.primary { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.button.primary:hover { background: var(--ink-2); border-color: var(--ink-2); }
.button.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.button[disabled] { opacity: .45; cursor: not-allowed; transform: none; }
.button .icon { width: 18px; height: 18px; }

/* ---------- Header ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 16px; padding-bottom: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; font-size: 18px; letter-spacing: -.01em; }
.brand svg { width: 34px; height: 13px; color: var(--ink); }
.brand span span { color: var(--muted); font-weight: 500; }
.top nav { display: flex; align-items: center; gap: 8px; }
.navlink { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px; border-radius: 10px; text-decoration: none; font-size: 15px; font-weight: 600; color: var(--ink-2); }
.navlink:hover { background: var(--soft); color: var(--ink); }
.navlink .icon { width: 18px; height: 18px; color: var(--accent); }
.navlink .count { font-weight: 500; color: var(--muted); }
.top .button { min-height: 40px; }
body[data-page="submit"] .top .button { display: none; }

/* ---------- Intro ---------- */
.intro { padding-top: 20px; padding-bottom: 20px; }
.intro h1 { margin: 0; font-size: clamp(25px, 3.6vw, 42px); line-height: 1.1; font-weight: 700; }
.lede { margin: 8px 0 0; color: var(--muted); font-size: 16px; }
.lede.hello { max-width: 60ch; }
.back { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; }

/* ---------- Controls ---------- */
.bar { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.bar.stuck { border-bottom-color: var(--line); }
.bar-row { position: relative; display: flex; align-items: center; gap: 12px; padding-top: 10px; padding-bottom: 10px; }
/* The date filter: shaped like a dropdown (icon, label, arrow) so it reads as one, and first in the row. */
.when-pick { position: relative; flex: none; display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 10px 0 12px;
  border: 1px solid color-mix(in srgb, var(--ink) 35%, var(--line)); border-radius: 10px; background: var(--bg); color: var(--ink); font-size: 14px; font-weight: 650; cursor: pointer; box-shadow: 0 1px 2px rgba(17,18,20,.06); }
.when-pick:hover { border-color: var(--ink); }
.when-pick:focus-within { outline: 2px solid var(--ink); outline-offset: 2px; }
.when-pick select { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; font-size: 16px; appearance: none; }
.when-pick .icon { width: 17px; height: 17px; }
.when-pick .icon:last-of-type { width: 15px; height: 15px; opacity: .75; }
.date-proxy { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.date-proxy.shown { position: static; width: auto; height: 44px; opacity: 1; pointer-events: auto; margin-top: 12px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); }
.search { position: relative; flex: none; }
.search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 18px; height: 18px; pointer-events: none; }
.search input { height: 40px; width: 240px; padding: 0 12px 0 38px; border: 1px solid transparent; border-radius: 10px; background: var(--soft); font-size: 15px; }
.search input:focus { outline: none; border-color: var(--ink-2); background: var(--bg); }
.search-open { display: none; }

.chips::-webkit-scrollbar { display: none; }
.chips { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; overflow-x: auto; scrollbar-width: none;
  -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 40px), transparent); }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 13px; border-radius: 999px; /* unslop-ignore: filters are the one pill shape */
  border: 1px solid var(--line); background: var(--bg); cursor: pointer; font-size: 14px; font-weight: 500; color: var(--ink-2);
  transition: background-color .15s, border-color .15s, color .15s;
}
.chip:hover { border-color: var(--ink-2); color: var(--ink); }
.chip small { color: var(--muted); font-size: 12px; }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chip[aria-pressed="true"] small { color: inherit; opacity: .65; }
.chip.toggle .icon { width: 16px; height: 16px; }
.chip.toggle[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.divider { flex: none; width: 1px; height: 20px; background: var(--line); margin: 0 2px; }

/* ---------- Board ---------- */
.board { padding-bottom: 80px; min-height: 60vh; }
.swap { animation: swap .2s var(--ease); }
@keyframes swap { from { opacity: .3; } }
.group { margin-top: 28px; }
.group h2 { display: flex; align-items: baseline; gap: 10px; margin: 0 0 16px; font-size: 20px; font-weight: 700; }
.group h2 small { font-size: 14px; font-weight: 500; color: var(--muted); letter-spacing: 0; }

.cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 232px), 1fr)); gap: 30px 20px; }
.card { position: relative; min-width: 0; }
.thumb { position: relative; aspect-ratio: 4 / 3; border-radius: var(--radius); overflow: hidden; background: var(--soft); transition: transform .25s var(--ease), box-shadow .25s var(--ease); }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .35s ease; }
.thumb.loaded img { opacity: 1; }
.thumb.loaded .tile { visibility: hidden; }
.card:hover .thumb { transform: translateY(-3px); box-shadow: var(--shadow); }
.tile { position: absolute; inset: 0; display: flex; align-items: flex-end; padding: 14px; background: var(--tint, var(--tint-6)); color: var(--ink-2); }
.tile span { position: relative; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.tile svg { position: absolute; left: 0; right: 0; top: 34%; width: 100%; height: 26%; opacity: .28; }
.tag { position: absolute; top: 10px; left: 10px; z-index: 2; width: 24px; height: 24px; padding: 5px; display: inline-flex; border-radius: 50%; background: var(--accent); color: #fff; }
.tag svg { width: 100%; height: 100%; }

.info { padding-top: 12px; }
.when { margin: 0 0 3px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.when .live, .when .soon { color: var(--accent); }
.elapsed { position: absolute; left: 0; right: 0; bottom: 0; z-index: 1; height: 4px; background: color-mix(in srgb, #fff 55%, transparent); }
.elapsed::before { content: ''; position: absolute; inset: 0 auto 0 0; width: var(--done); background: var(--accent); }
.when .flag { color: var(--danger); }
.card h3 { margin: 0; font-size: 17px; line-height: 1.3; font-weight: 650; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.open { text-decoration: none; }
.open::after { content: ''; position: absolute; inset: 0; z-index: 1; }
.card:hover .open { text-decoration: underline; }
.card:has(.open:focus-visible) { outline: 2px solid var(--ink); outline-offset: 4px; border-radius: var(--radius); }
.open:focus-visible { outline: none; }
.where { margin: 3px 0 0; font-size: 14px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meta { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.meta b { font-weight: 600; color: var(--ink-2); }
.card.is-cancelled h3 { text-decoration: line-through; }
.card.is-cancelled .thumb { opacity: .5; filter: grayscale(1); }

.save {
  position: absolute; top: 8px; right: 8px; z-index: 2; width: 36px; height: 36px; display: grid; place-items: center;
  border: 0; border-radius: 50%; background: color-mix(in srgb, var(--bg) 92%, transparent); color: var(--ink); cursor: pointer; box-shadow: var(--shadow);
  opacity: 0; transition: opacity .15s;
}
.save .icon { width: 19px; height: 19px; }
.card:hover .save, .save:focus-visible, .save[aria-pressed="true"] { opacity: 1; }
.save[aria-pressed="true"] .icon, .action[aria-pressed="true"] .icon { color: var(--accent); }
@media (hover: none) { .save { opacity: 1; } }
.going {
  position: relative; z-index: 2; display: inline-flex; align-items: center; gap: 6px; height: 32px; margin-top: 8px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--bg); cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink-2);
  transition: background-color .15s, border-color .15s, color .15s;
}
.going:hover { border-color: var(--ink-2); color: var(--ink); }
.going .icon { width: 16px; height: 16px; }
.going[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.pop .icon { animation: pop .35s var(--ease); }
@keyframes pop { 50% { transform: scale(1.3); } }

.skeleton .thumb { animation: shimmer 1.2s ease-in-out infinite alternate; }
.skeleton .bar-1, .skeleton .bar-2 { height: 12px; margin-top: 14px; width: 40%; border-radius: 6px; background: var(--soft); }
.skeleton .bar-2 { width: 80%; height: 16px; margin-top: 8px; }
@keyframes shimmer { to { opacity: .5; } }

.empty { padding: 64px 0 16px; text-align: center; }
.empty h2 { margin: 0; font-size: 22px; }
.empty p { margin: 8px 0 18px; color: var(--muted); }
.suggest { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.load-more { display: flex; margin: 40px auto 0; }

/* ---------- Details panel ---------- */
.panel { padding: 0; margin: 0 0 0 auto; border: 0; width: min(480px, 100%); max-width: none; height: 100%; max-height: none; background: var(--bg); color: var(--ink); box-shadow: -20px 0 60px -20px rgba(0,0,0,.35); }
.panel[open] { animation: panel-in .25s var(--ease); }
.panel.closing { animation: panel-out .2s ease-in forwards; }
.panel::backdrop { background: rgba(10,11,12,.45); }
.panel[open]::backdrop { animation: fade .25s ease; }
.panel.closing::backdrop { animation: fade .2s ease reverse forwards; }
@keyframes panel-in { from { transform: translateX(28px); opacity: 0; } }
@keyframes panel-out { to { transform: translateX(28px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.panel-body { height: 100%; overflow-y: auto; overscroll-behavior: contain; }
.panel-media { position: relative; }
.panel-media .thumb { aspect-ratio: 16 / 10; border-radius: 0; }
.panel-media .tile svg { top: 30%; }
.panel-close { position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--bg); color: var(--ink); cursor: pointer; box-shadow: var(--shadow); }
.panel-close .icon { width: 22px; height: 22px; }
.panel-text { padding: 20px 24px 32px; display: grid; gap: 16px; }
.panel-text h2 { margin: 0; font-size: 26px; line-height: 1.15; font-weight: 700; }
.fact { display: grid; grid-template-columns: 22px 1fr; gap: 12px; }
.fact > .icon { width: 20px; height: 20px; color: var(--muted); margin-top: 2px; }
.fact strong { display: block; font-weight: 600; }
.fact span { display: block; color: var(--muted); font-size: 15px; }
.inline-link { display: inline-block; margin-top: 2px; font-size: 14px; font-weight: 600; justify-self: start; }
.dates { list-style: none; margin: 4px 0 0; padding: 0; font-size: 14px; color: var(--ink-2); }
.panel-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.wide { flex: 1 1 180px; min-height: 48px; }
.panel-small { display: flex; flex-wrap: wrap; gap: 4px; padding-top: 12px; border-top: 1px solid var(--line); }
.action { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.action:hover { background: var(--soft); color: var(--ink); }
.action .icon { width: 18px; height: 18px; }
.fine { margin: 0; font-size: 13px; color: var(--muted); }

/* ---------- Plain pages ---------- */
.split { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: clamp(28px, 6vw, 88px); align-items: start; padding-top: 8px; padding-bottom: 80px; }
.aside { position: sticky; top: 24px; }
.aside-label { margin: 0 0 12px; font-size: 13px; font-weight: 600; color: var(--muted); }
.aside .cards { grid-template-columns: 1fr; }
.aside .card { pointer-events: none; }
.aside .save { display: none; }

fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; }
.form { display: grid; gap: 32px; max-width: 640px; }
.step { display: grid; gap: 14px; }
.step legend, .step-title { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-size: 17px; font-weight: 700; font-stretch: 108%; }
.num { width: 26px; height: 26px; border-radius: 50%; display: inline-grid; place-items: center; background: var(--soft); font-size: 13px; font-weight: 700; transition: background-color .2s, color .2s; }
.step.done .num { background: var(--ink); color: var(--bg); }
.step legend small { font-weight: 400; color: var(--muted); font-size: 14px; }
.field { display: grid; gap: 6px; }
.field > span { font-weight: 600; font-size: 14px; }
.field > span small { font-weight: 400; color: var(--muted); }
.field input, .field select { width: 100%; height: 48px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); font-size: 16px; }
.field input:focus, .field select:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--soft); }
.field input[aria-invalid="true"] { border-color: var(--danger); }
.field input:disabled { background: var(--soft); color: var(--muted); cursor: not-allowed; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; }
.money { position: relative; display: block; }
.money::before { content: '$'; position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.money input { padding-left: 28px; }
.drop { position: relative; display: grid; justify-items: center; gap: 4px; padding: 22px; border: 1.5px dashed var(--line); border-radius: var(--radius); text-align: center; color: var(--muted); cursor: pointer; font-size: 14px; }
.drop:hover, .drop.over { border-color: var(--ink-2); background: var(--soft); }
.drop .icon { width: 26px; height: 26px; color: var(--ink-2); }
.drop strong { color: var(--ink); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.offer { padding: 18px; border-radius: var(--radius); background: var(--soft); display: grid; gap: 12px; }
.offer h3 { margin: 0; font-size: 16px; }
.hint { margin: 0; font-size: 14px; color: var(--muted); }
.error { margin: 0; color: var(--danger); font-weight: 600; min-height: 1.5em; }
.shake { animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.submit-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.submit-row .button { min-height: 50px; padding: 0 24px; }
.trap { position: absolute; left: -9999px; }
.success { display: grid; justify-items: start; gap: 10px; padding: 12px 0; animation: fade .3s ease; }
.success .check { width: 48px; height: 48px; color: var(--accent); }
.success h2 { margin: 0; font-size: 28px; }
.success p { margin: 0; color: var(--muted); max-width: 44ch; }
.success .buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

.rules { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 8px; color: var(--ink-2); max-width: 60ch; }
.rules li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; }
.rules .icon { width: 20px; height: 20px; color: var(--muted); margin-top: 2px; }
.standings { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.standings li { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 10px; background: var(--soft); font-size: 14px; }
.standings b { color: var(--muted); }
.standings span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.standings em { font-style: normal; font-weight: 700; }
.standings .pay-end { display: flex; align-items: center; gap: 10px; }
.standings .you { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.standings .open span { color: var(--muted); font-weight: 400; }
.picker .search input { width: 100%; height: 48px; }
.options { list-style: none; margin: 6px 0 0; padding: 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); max-height: 320px; overflow: auto; box-shadow: var(--shadow); }
.options button { display: grid; grid-template-columns: 48px 1fr; gap: 12px; align-items: center; width: 100%; padding: 6px; border: 0; border-radius: 8px; background: none; text-align: left; cursor: pointer; }
.options button:hover, .options button:focus-visible { background: var(--soft); }
.options .thumb, .chosen .thumb { aspect-ratio: 1; border-radius: 8px; }
.options .tile span, .chosen .tile span { display: none; }
.options small, .chosen small { display: block; color: var(--muted); font-size: 13px; }
.chosen { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center; padding: 8px; border: 1px solid var(--ink); border-radius: var(--radius); }
.chosen button { border: 0; background: none; font-weight: 600; cursor: pointer; padding: 8px; text-decoration: underline; }
.amounts { display: flex; flex-wrap: wrap; gap: 8px; }
.amounts .chip { height: 42px; padding: 0 16px; font-size: 15px; }
.rank { margin: 0; min-height: 1.5em; font-weight: 600; }

.prose { max-width: 720px; padding-bottom: 80px; }
.prose p { color: var(--ink-2); }
.signup { padding-top: 8px; padding-bottom: 80px; }
.signup .form { gap: 20px; }
.sources { margin-top: 16px; border-top: 1px solid var(--line); }
.sources .row { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.sources .row a { font-weight: 600; text-decoration: none; }
.sources .row a:hover { text-decoration: underline; }
.sources .row span { color: var(--muted); font-size: 14px; white-space: nowrap; }
.review { display: grid; gap: 12px; padding-bottom: 80px; }
.review h2 { margin: 16px 0 0; font-size: 18px; }
.review article { display: grid; grid-template-columns: 110px 1fr; gap: 14px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); }
.review img, .review .noimg { width: 110px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; background: var(--soft); }
.review h3 { margin: 0 0 4px; font-size: 17px; }
.review p { margin: 0; font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.review .buttons { display: flex; gap: 8px; margin-top: 10px; }
.login { max-width: 380px; }
.event-admin { max-width: 640px; margin: 8px 0 32px; }
.event-admin h2 { margin: 0 0 16px; font-size: 18px; }
.event-search { display: flex; align-items: flex-end; gap: 12px; }
.event-search .field { flex: 1; min-width: 0; }
.event-search .button { min-height: 48px; }
#event-message { margin-top: 12px; }
.event-result:not(:empty) { margin-top: 20px; }
.event-result h3 { margin: 0 0 6px; font-size: 20px; overflow-wrap: anywhere; }
.event-result p { margin: 4px 0; color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.event-result code { font-size: 13px; overflow-wrap: anywhere; }
.event-result .buttons { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.event-result .delete, .event-delete .delete { color: var(--danger); }
.event-delete { width: min(420px, calc(100% - 32px)); padding: 24px; border: 0; border-radius: var(--radius); background: var(--bg); color: var(--ink); box-shadow: var(--shadow); }
.event-delete::backdrop { background: rgba(10,11,12,.45); }
.event-delete h2 { margin: 0; font-size: 22px; }
.event-delete p { margin: 12px 0 24px; overflow-wrap: anywhere; }
.event-delete .buttons { display: flex; justify-content: flex-end; gap: 8px; }

/* ---------- Footer ---------- */
.bottom { border-top: 1px solid var(--line); }
.bottom .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-top: 24px; padding-bottom: 32px; color: var(--muted); font-size: 14px; }
.bottom p { margin: 0; }
.bottom a { color: var(--ink-2); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after, *::backdrop { animation: none !important; transition: none !important; }
}

/* ---------- Tablet ---------- */
@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; }
  .aside { position: static; order: -1; max-width: 300px; }
}

/* ---------- Phone: events become compact rows, so several fit on one screen ---------- */
@media (max-width: 640px) {
  .top { padding-top: 12px; padding-bottom: 8px; }
  .navlink .label { display: none; }
  .intro { padding-top: 8px; padding-bottom: 12px; }
  .lede { font-size: 15px; }
  .bar-row { gap: 8px; }
  .search { position: static; }
  .search > label { display: none; }
  .search-open { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border: 0; border-radius: 10px; background: var(--soft); cursor: pointer; }
  .search-open .icon { position: static; transform: none; width: 19px; height: 19px; color: var(--ink); }
  .search.open > label { display: block; position: absolute; inset: 10px var(--gutter); z-index: 2; }
  .search.open input { width: 100%; background: var(--bg); border-color: var(--ink-2); }
  .cards { grid-template-columns: 1fr; gap: 16px; }
  .card { display: grid; grid-template-columns: 96px 1fr; gap: 14px; align-items: start; }
  .card .thumb { aspect-ratio: 1; border-radius: 10px; }
  .card .tile { padding: 8px; }
  .card .tile span { font-size: 9px; letter-spacing: .06em; }
  .card:hover .thumb { transform: none; box-shadow: none; }
  .info { padding: 2px 36px 0 0; }
  .card h3 { font-size: 16px; }
  .save { top: 0; right: -6px; background: transparent; box-shadow: none; color: var(--muted); opacity: 1; }
  .tag { top: 6px; left: 6px; width: 20px; height: 20px; padding: 4px; }
  .group h2 { font-size: 18px; }
  .panel { width: 100%; height: auto; max-height: 90vh; margin: auto 0 0; border-radius: 16px 16px 0 0; }
  .panel-body { max-height: 90vh; }
  .panel[open] { animation-name: sheet-in; }
  .panel.closing { animation-name: sheet-out; }
  @keyframes sheet-in { from { transform: translateY(40px); opacity: 0; } }
  @keyframes sheet-out { to { transform: translateY(40px); opacity: 0; } }
  .row2 { grid-template-columns: 1fr; }
  .review article { grid-template-columns: 1fr; }
}
