@font-face {
  font-family: "DM Serif Display";
  src: url("assets/dm-serif.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "DM Sans";
  src: url("assets/dm-sans.ttf") format("truetype");
  font-weight: 100 1000;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("assets/ibm-plex-mono.ttf") format("truetype");
  font-weight: 400;
  font-display: swap;
}

:root {
  --paper: #f5efe4;
  --paper-2: #ece3d3;
  --card: #fffaf2;
  --ink: #1e1b16;
  --ink-2: #4a443a;
  --ink-3: #6b6356;
  --rule: #d6cab4;
  --accent: #c63d25;
  --accent-ink: #a32f1a;
  --green: #22473a;
  --warn-bg: #fbe6c9;
  --warn-ink: #6d3d00;
  --focus: #1c5bd8;

  --cat-Art: #b8456b;
  --cat-Film: #4b4f9e;
  --cat-Food: #b86a12;
  --cat-Literature: #6b5b2e;
  --cat-Music: #1f6f78;
  --cat-Outdoors: #3c7a36;
  --cat-Walks: #7b4a8f;

  --serif: "DM Serif Display", Georgia, "Times New Roman", serif;
  --sans: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --radius: 14px;
  --wrap: 1240px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 110px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body:has(dialog[open]) { overflow: hidden; }

img, svg { display: block; max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { margin: 0; font-weight: 400; }
p { margin: 0; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 6px;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: clamp(18px, 4vw, 40px);
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: 12px; top: -60px;
  z-index: 100;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 16px;
  border-radius: 8px;
  text-decoration: none;
}
.skip:focus { top: 12px; }

/* ---------- Masthead ---------- */

.masthead { border-bottom: 2px solid var(--ink); }

.masthead__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 18px;
  border-bottom: 1px solid var(--rule);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-family: var(--serif);
  font-size: 1.6rem;
  line-height: 1;
}
.brand__mark { width: 32px; height: 32px; color: var(--accent); }

.topnav { display: flex; gap: 4px; align-items: center; }
.topnav a {
  color: var(--ink-2);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 8px 12px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.topnav a:hover { background: var(--paper-2); color: var(--ink); }
.topnav__plan { border: 1.5px solid var(--ink); color: var(--ink) !important; }

.count {
  display: inline-grid;
  place-items: center;
  min-width: 1.6em;
  height: 1.6em;
  padding-inline: 0.4em;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 0.78rem;
  line-height: 1;
}

.hero {
  padding-block: clamp(28px, 6vw, 60px) clamp(26px, 4vw, 44px);
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 48px;
  align-items: end;
}
.hero__text { display: grid; gap: 18px; }

/* ---------- At a glance ---------- */

.glance {
  background: var(--card);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  padding: 18px 20px 16px;
}
.glance__head h2 { font-family: var(--serif); font-size: 1.45rem; line-height: 1.1; }
.glance__head p { font-size: 0.88rem; color: var(--ink-3); margin-top: 2px; }
.glance__chart { margin-top: 16px; display: grid; gap: 12px; }

.glance__row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}
.glance__day {
  font-family: var(--mono);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding-top: 4px;
}
.glance__track {
  position: relative;
  height: calc(var(--lanes, 1) * 30px - 6px);
  background:
    repeating-linear-gradient(90deg, var(--rule) 0 1px, transparent 1px calc(100% / var(--hours, 13)));
  border-right: 1px solid var(--rule);
}
.glance__bar {
  --cat: var(--ink);
  position: absolute;
  top: calc(var(--lane) * 30px);
  left: var(--left);
  width: var(--width);
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: var(--cat);
  box-shadow: inset 0 0 0 1.5px rgb(0 0 0 / 0.12);
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.glance__bar:hover { transform: translateY(-2px); }
.glance__bar.is-dim { opacity: 0.2; }
.glance__bar.is-saved::after {
  content: "";
  position: absolute;
  right: 5px; top: 50%;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #fff;
  transform: translateY(-50%);
}
.glance__axis {
  position: relative;
  height: 16px;
  margin-left: 50px;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--ink-3);
}
.glance__axis span { position: absolute; transform: translateX(-50%); }
.glance__axis span:first-child { transform: none; }

.glance__legend {
  list-style: none;
  margin: 14px 0 0;
  padding: 12px 0 0;
  border-top: 1px dashed var(--rule);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-size: 0.82rem;
  color: var(--ink-2);
}
.glance__legend li { display: inline-flex; align-items: center; gap: 6px; }
.glance__legend li::before {
  content: "";
  width: 10px; height: 10px;
  border-radius: 3px;
  background: var(--cat);
}

.day__none { padding: 16px 0; color: var(--ink-3); }
.hero__kicker {
  font-family: var(--mono);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent-ink);
}
.hero__title {
  font-family: var(--serif);
  font-size: clamp(2.6rem, 6.4vw, 5.6rem);
  line-height: 0.95;
  letter-spacing: -0.015em;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 0.25em;
}
.hero__amp { color: var(--accent); font-style: italic; }
.hero__lede {
  max-width: 44ch;
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  color: var(--ink-2);
}
.hero__stats {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
  font-family: var(--mono);
  font-size: 0.88rem;
  color: var(--ink-2);
}
.hero__stats strong {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.7rem;
  color: var(--ink);
  margin-right: 6px;
  vertical-align: -2px;
}

/* ---------- Toolbar ---------- */

.toolbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.toolbar__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px auto;
  gap: 14px;
  align-items: end;
  padding-block: 14px;
}

.field { display: grid; gap: 4px; min-width: 0; }
.field label {
  font-family: var(--mono);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.field__control { position: relative; }
.field__control > svg {
  position: absolute;
  left: 14px; top: 50%;
  width: 20px; height: 20px;
  transform: translateY(-50%);
  color: var(--ink-3);
  pointer-events: none;
}
.field input,
.field select {
  width: 100%;
  height: 48px;
  border: 1.5px solid var(--ink);
  border-radius: 12px;
  background: var(--card);
  padding: 0 14px;
  font-size: 1rem;
}
.field input { padding-left: 44px; }
.field input::placeholder { color: var(--ink-3); }
.field select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='%231e1b16' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 20px;
}
.field input:focus-visible,
.field select:focus-visible { outline-offset: 1px; }

.toggle {
  height: 48px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border-radius: 12px;
  border: 1.5px solid var(--ink);
  background: var(--card);
  font-weight: 600;
  white-space: nowrap;
}
.toggle svg { width: 20px; height: 20px; }
.toggle:hover { background: var(--paper-2); }
.toggle[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
}
.toggle[aria-pressed="true"] svg path { fill: currentColor; }
.toggle[aria-pressed="true"] .count { background: var(--accent); color: #fff; }

/* ---------- Layout ---------- */

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 48px;
  align-items: start;
  padding-block: 28px 64px;
}
.listings:focus { outline: none; }

.results-status {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--ink-2);
  margin-bottom: 8px;
  min-height: 1.4em;
}

/* ---------- Day sections ---------- */

.day { margin-top: 28px; }
.day:first-child { margin-top: 8px; }
.day__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--ink);
}
.day__title {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 3.4vw, 2.5rem);
  line-height: 1.05;
}
.day__title small {
  font-family: var(--sans);
  font-size: 0.5em;
  color: var(--ink-3);
  margin-left: 6px;
  letter-spacing: 0.01em;
}
.day__count {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--ink-3);
  white-space: nowrap;
}

.events { list-style: none; margin: 0; padding: 0; }

.event {
  --cat: var(--ink);
  position: relative;
  display: grid;
  grid-template-columns: 124px minmax(0, 1fr) auto;
  gap: 4px 24px;
  padding: 22px 12px 22px 0;
  border-bottom: 1px solid var(--rule);
  transition: background-color 0.18s ease;
}
.event:hover { background: color-mix(in srgb, var(--card) 70%, transparent); }
.event.is-saved { background: color-mix(in srgb, var(--accent) 6%, transparent); }

.event__time {
  font-family: var(--mono);
  font-size: 0.95rem;
  line-height: 1.3;
  padding-top: 6px;
  padding-left: 12px;
  border-left: 4px solid var(--cat);
}
.event__time span { display: block; color: var(--ink-3); font-size: 0.82rem; }

.event__main { min-width: 0; }
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cat);
  font-weight: 400;
}
.tag::before {
  content: "";
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--cat);
}

.event__open {
  display: block;
  margin: 4px 0 6px;
  padding: 0;
  border: 0;
  background: none;
  text-align: left;
  font-family: var(--serif);
  font-size: clamp(1.35rem, 2.2vw, 1.7rem);
  line-height: 1.12;
  color: var(--ink);
}
.event__open::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}
.event__open:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; text-decoration-color: var(--accent); }
.event__open:focus-visible { outline: none; }
.event__open:focus-visible::after {
  outline: 3px solid var(--focus);
  outline-offset: -3px;
  border-radius: 8px;
}

.event__summary { color: var(--ink-2); max-width: 62ch; }
.event__where {
  margin-top: 8px;
  font-size: 0.92rem;
  color: var(--ink-3);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
}
.event__where span { display: inline-flex; align-items: center; gap: 5px; }
.event__where svg { width: 15px; height: 15px; }

.event__side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}
.price {
  font-family: var(--mono);
  font-size: 0.95rem;
  padding: 3px 10px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  white-space: nowrap;
}
.price--free { background: var(--green); border-color: var(--green); color: #fff; }

.quick-save {
  position: relative;
  z-index: 2;
  width: 44px; height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1.5px solid var(--rule);
  background: var(--card);
  color: var(--ink-2);
}
.quick-save svg { width: 20px; height: 20px; }
.quick-save:hover { border-color: var(--ink); color: var(--ink); }
.quick-save[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.quick-save[aria-pressed="true"] svg path { fill: currentColor; }

/* ---------- Empty state ---------- */

.empty {
  margin-top: 16px;
  padding: 44px 24px;
  border: 2px dashed var(--rule);
  border-radius: var(--radius);
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 10px;
}
.empty[hidden] { display: none; }
.empty svg { width: 72px; height: 72px; color: var(--ink-3); }
.empty h2 { font-family: var(--serif); font-size: 1.8rem; }
.empty p { color: var(--ink-2); max-width: 40ch; }
.empty .btn { margin-top: 8px; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 12px;
  border: 1.5px solid var(--ink);
  background: var(--card);
  font-weight: 600;
  text-decoration: none;
}
.btn svg { width: 20px; height: 20px; }
.btn--solid { background: var(--ink); color: var(--paper); }
.btn--solid:hover { background: #000; }
.btn--ghost { background: transparent; }
.btn--ghost:hover { background: var(--paper-2); }
.btn--save { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--save:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.btn--save[aria-pressed="true"] { background: var(--card); color: var(--accent-ink); border-color: var(--accent); }
.btn--save[aria-pressed="true"] svg path { fill: currentColor; }
.btn--save[aria-pressed="true"]:hover { background: var(--paper-2); }

.icon-btn {
  width: 44px; height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1.5px solid var(--ink);
  background: var(--card);
}
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:hover { background: var(--paper-2); }

.link-btn {
  border: 0;
  background: none;
  padding: 2px 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  color: var(--ink-2);
  font-size: 0.88rem;
}
.link-btn:hover { color: var(--accent-ink); }

/* ---------- Plan ---------- */

.plan {
  position: sticky;
  top: 118px;
  max-height: calc(100vh - 136px);
  overflow-y: auto;
  padding: 0 8px 8px 0;
  display: grid;
  gap: 14px;
}
.plan:focus { outline: none; }
.plan__card {
  background: var(--card);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 6px 6px 0 var(--ink);
  overflow: hidden;
}
.plan__head {
  padding: 18px 20px 14px;
  border-bottom: 1px dashed var(--rule);
}
.plan__head h2 { font-family: var(--serif); font-size: 1.8rem; line-height: 1.1; }
.plan__meta { font-family: var(--mono); font-size: 0.82rem; color: var(--ink-3); margin-top: 4px; }

.plan__empty { padding: 18px 20px 22px; color: var(--ink-2); font-size: 0.97rem; }
.plan__empty p + p { margin-top: 8px; }
.plan__empty svg { display: inline; width: 16px; height: 16px; vertical-align: -3px; }

.plan__day { padding: 12px 20px 6px; }
.plan__day + .plan__day { border-top: 1px dashed var(--rule); }
.plan__day h3 {
  font-family: var(--mono);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-3);
  margin-bottom: 4px;
}
.plan__list { list-style: none; margin: 0; padding: 0; }
.plan__item {
  --cat: var(--ink);
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 2px 10px;
  align-items: start;
  padding: 8px 0;
}
.plan__time { font-family: var(--mono); font-size: 0.85rem; padding-top: 3px; border-left: 3px solid var(--cat); padding-left: 7px; }
.plan__open {
  border: 0;
  background: none;
  padding: 0;
  text-align: left;
  font-weight: 600;
  line-height: 1.3;
}
.plan__open:hover { text-decoration: underline; text-underline-offset: 3px; }
.plan__sub { grid-column: 2; font-size: 0.85rem; color: var(--ink-3); }
.plan__clash {
  grid-column: 2 / -1;
  margin-top: 4px;
  font-size: 0.83rem;
  color: var(--warn-ink);
  background: var(--warn-bg);
  border-radius: 8px;
  padding: 4px 8px;
}
.plan__remove {
  width: 32px; height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--ink-3);
}
.plan__remove svg { width: 14px; height: 14px; }
.plan__remove:hover { color: var(--accent-ink); border-color: var(--accent); }

.plan__foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 12px 20px 16px;
  border-top: 1px solid var(--rule);
  background: var(--paper-2);
  font-size: 0.92rem;
}
.plan__foot strong { font-family: var(--mono); font-weight: 400; }

.fineprint { font-size: 0.8rem; color: var(--ink-3); padding-inline: 4px; }

.footer {
  border-top: 2px solid var(--ink);
  padding-block: 22px 40px;
  font-size: 0.9rem;
  color: var(--ink-2);
}

/* ---------- Detail dialog ---------- */

.detail {
  --cat: var(--ink);
  width: min(720px, calc(100vw - 48px));
  max-height: calc(100dvh - 48px);
  padding: 0;
  border: 1.5px solid var(--ink);
  border-radius: 18px;
  background: var(--card);
  color: var(--ink);
  box-shadow: 10px 10px 0 var(--ink);
  overflow: hidden;
}
.detail::backdrop { background: rgb(30 27 22 / 0.55); }
.detail[open] { animation: detail-in 0.22s ease-out; }
.detail[open]::backdrop { animation: fade-in 0.22s ease-out; }

@keyframes detail-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.detail__frame {
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 48px);
}
.detail__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px 12px 22px;
  border-bottom: 1px solid var(--rule);
}
.detail__crumb {
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.detail__crumb .tag { font-size: 0.8rem; }

.detail__scroll { overflow-y: auto; overscroll-behavior: contain; }

.detail__figure { margin: 0; position: relative; }
.detail__figure img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  filter: saturate(0.85) contrast(1.02);
}
.detail__figure figcaption {
  position: absolute;
  right: 10px; bottom: 10px;
  font-size: 0.72rem;
  font-family: var(--mono);
  background: rgb(30 27 22 / 0.78);
  color: #fff;
  padding: 3px 8px;
  border-radius: 6px;
}
.detail__figure .art {
  height: 160px;
  background:
    repeating-linear-gradient(90deg, rgb(255 255 255 / 0.12) 0 14px, transparent 14px 28px),
    linear-gradient(135deg, var(--cat), color-mix(in srgb, var(--cat) 55%, #000));
}

.detail__content { padding: 22px 26px 8px; }
.detail__title {
  font-family: var(--serif);
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  line-height: 1.08;
}

.facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin: 18px 0 0;
  border-top: 1px solid var(--rule);
}
.facts > div {
  padding: 12px 12px 12px 0;
  border-bottom: 1px solid var(--rule);
}
.facts > div:nth-child(odd) { padding-right: 16px; }
.facts > div:nth-child(even) { padding-left: 16px; border-left: 1px solid var(--rule); }
.facts dt {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.facts dd { margin: 2px 0 0; font-weight: 600; }
.facts dd span { display: block; font-weight: 400; color: var(--ink-2); font-size: 0.93rem; }

.detail__clash {
  margin-top: 16px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--warn-bg);
  color: var(--warn-ink);
  font-size: 0.95rem;
}
.detail__clash[hidden] { display: none; }

.detail__body { padding: 18px 0 16px; }
.detail__body h3 {
  font-family: var(--mono);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-3);
  margin-bottom: 6px;
}
.detail__body p { max-width: 60ch; }
.detail__body p + p { margin-top: 12px; }
.detail__body p:first-of-type { font-size: 1.12rem; }
.detail__body p.note {
  font-size: 0.98rem;
  padding: 12px 14px;
  border-left: 4px solid var(--cat);
  background: var(--paper);
  border-radius: 0 10px 10px 0;
}

.detail__actions {
  display: flex;
  gap: 10px;
  padding: 14px 22px;
  border-top: 1px solid var(--rule);
  background: var(--paper);
}
.detail__actions .btn--save { flex: 1; }

/* ---------- Responsive ---------- */

@media (max-width: 1040px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .plan { position: static; max-height: none; overflow: visible; }
  .hero { grid-template-columns: minmax(0, 1fr); gap: 28px; }
}

@media (max-width: 720px) {
  html { scroll-padding-top: 20px; }
  body { font-size: 1rem; }
  .masthead__bar { padding-block: 12px; }
  .brand { font-size: 1.35rem; }
  .brand__mark { width: 28px; height: 28px; }
  .topnav a:not(.topnav__plan) { display: none; }
  .topnav__plan { padding: 6px 10px; font-size: 0.9rem; }

  .hero { gap: 12px; }
  .hero__stats { gap: 6px 18px; font-size: 0.8rem; }
  .hero__stats strong { font-size: 1.35rem; }

  .toolbar { position: static; backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--paper); }
  .toolbar__inner {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding-block: 12px;
  }
  .field--search { grid-column: 1 / -1; }
  .toggle { padding: 0 12px; gap: 8px; }

  .layout { padding-block: 16px 44px; }

  .event {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px 12px;
    padding: 18px 0;
  }
  .event__time {
    grid-column: 1 / -1;
    display: flex;
    gap: 8px;
    align-items: baseline;
    padding-top: 0;
    padding-left: 10px;
  }
  .event__time span { display: inline; }
  .event__main { grid-column: 1; }
  .event__side { grid-column: 2; grid-row: 2; justify-content: flex-start; }
  .event__open { font-size: 1.3rem; }
  .event__summary { font-size: 0.95rem; }

  .detail {
    width: 100vw;
    max-width: 100vw;
    max-height: 100dvh;
    height: 100dvh;
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .detail__frame { max-height: 100dvh; height: 100%; }
  .detail__scroll { flex: 1; }
  .detail__figure img { height: 170px; }
  .detail__figure .art { height: 110px; }
  .detail__content { padding: 18px 18px 4px; }
  .facts { grid-template-columns: minmax(0, 1fr); }
  .facts > div:nth-child(n) { padding: 10px 0; border-left: 0; }
  .detail__actions { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); }
  .detail__actions .btn--ghost { display: none; }
  .detail[open] { animation-name: sheet-in; }
}

@keyframes sheet-in {
  from { transform: translateY(24px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
