:root {
  --blue: #1b36e8;
  --blue-deep: #0f1f9c;
  --ink: #0c1220;
  --paper: #f3f4f1;
  --card: #ffffff;
  --line: #0c1220;
  --muted: #4a5163;
  --signal: #ff5b1f;
  --yellow: #ffe14d;
  --sans: "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --rail: 380px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p, ol, ul, dl, dd { margin: 0; padding: 0; }
ol, ul { list-style: none; }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; margin: -1px; padding: 0; border: 0;
}
.skip {
  position: absolute; left: 8px; top: -60px; z-index: 100;
  background: var(--yellow); color: var(--ink); padding: 10px 14px; font-weight: 700;
}
.skip:focus { top: 8px; }

:focus-visible { outline: 3px solid var(--signal); outline-offset: 2px; }
.rail :focus-visible, .drawer :focus-visible { outline-color: var(--yellow); }
.drawer :focus-visible { outline-color: var(--signal); }

/* ---------- layout ---------- */
.shell { display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); min-height: 100vh; }

.rail {
  background: var(--blue);
  color: #fff;
  padding: 36px 32px 32px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 28px;
}
.brand-kicker {
  font-family: var(--mono); font-size: 12.5px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--yellow); margin-bottom: 14px;
}
.brand-name {
  font-weight: 900; text-transform: uppercase; line-height: .86; letter-spacing: -.04em;
  font-size: 84px; display: flex; flex-direction: column; margin-left: -4px;
}
.brand-name .amp { font-size: 44px; line-height: 1; color: var(--yellow); letter-spacing: 0; padding: 6px 0 6px 6px; }
.brand-line { margin-top: 18px; font-size: 15.5px; line-height: 1.45; color: #e3e7ff; max-width: 31ch; }

.controls { display: flex; flex-direction: column; gap: 16px; }
.field { border: 0; margin: 0; padding: 0; min-width: 0; }
.field label, .field legend {
  display: block; padding: 0; margin-bottom: 6px;
  font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: #cfd6ff;
}
input[type="search"], select {
  width: 100%; height: 48px; padding: 0 14px; background: #fff; color: var(--ink);
  border: 2px solid var(--ink); border-radius: 0; font-size: 16px;
}
select {
  appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 22px) 21px, calc(100% - 16px) 21px;
  background-size: 6px 6px; background-repeat: no-repeat; padding-right: 40px;
}
input::placeholder { color: #6a7184; }

.seg { display: grid; grid-template-columns: repeat(3, 1fr); border: 2px solid var(--ink); background: #fff; }
.seg-btn {
  height: 44px; border: 0; background: #fff; color: var(--ink); font-weight: 700; font-size: 15px;
  border-right: 2px solid var(--ink); border-radius: 0;
}
.seg-btn:last-child { border-right: 0; }
.seg-btn[aria-pressed="true"] { background: var(--ink); color: var(--yellow); }
.seg-btn:hover:not([aria-pressed="true"]) { background: var(--yellow); }

.saved-toggle {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 8px 14px;
  background: transparent; color: #fff; border: 2px solid #fff; border-radius: 0; text-align: left; font-weight: 700;
}
.saved-toggle:hover { background: rgba(255,255,255,.12); }
.saved-mark {
  width: 22px; height: 22px; border: 2px solid #fff; flex: none; position: relative; background: transparent;
}
.saved-toggle[aria-pressed="true"] { background: var(--yellow); color: var(--ink); border-color: var(--yellow); }
.saved-toggle[aria-pressed="true"] .saved-mark { background: var(--ink); border-color: var(--ink); }
.saved-toggle[aria-pressed="true"] .saved-mark::after {
  content: ""; position: absolute; left: 5px; top: 1px; width: 6px; height: 11px;
  border: solid var(--yellow); border-width: 0 3px 3px 0; transform: rotate(40deg);
}
.saved-text { flex: 1; }
.saved-count {
  font-family: var(--mono); min-width: 28px; height: 28px; display: grid; place-items: center; padding: 0 6px;
  background: var(--ink); color: #fff; font-size: 14px;
}
.saved-toggle[aria-pressed="true"] .saved-count { background: var(--ink); color: var(--yellow); }

.plan { border-top: 2px solid rgba(255,255,255,.35); padding-top: 18px; margin-top: auto; }
.plan h2 { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--yellow); margin-bottom: 10px; font-weight: 400; }
.plan-empty { font-size: 14.5px; color: #dbe0ff; }
.plan-list { display: flex; flex-direction: column; gap: 6px; }
.plan-list li { display: grid; grid-template-columns: 74px 1fr; gap: 8px; font-size: 14.5px; line-height: 1.3; }
.plan-list .t { font-family: var(--mono); color: var(--yellow); font-size: 13px; padding-top: 1px; }
.plan-list .warn { color: var(--yellow); font-weight: 700; }
.plan-total { margin-top: 12px; font-family: var(--mono); font-size: 13px; color: #fff; }

/* ---------- board ---------- */
.board-wrap { padding: 36px 48px 56px; max-width: 1060px; width: 100%; outline: none; }
.board-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 20px; min-height: 28px; }
.status { font-family: var(--mono); font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.link-btn { background: none; border: 0; padding: 4px 0; text-decoration: underline; text-underline-offset: 3px; font-weight: 700; color: var(--blue-deep); }

.day { margin-bottom: 40px; }
.day-head {
  display: flex; align-items: stretch; background: var(--ink); color: #fff;
}
.day-num {
  background: var(--signal); color: var(--ink); font-weight: 900; font-size: 54px; line-height: 1; letter-spacing: -.04em;
  padding: 10px 18px; display: grid; place-items: center; min-width: 88px;
}
.day-meta { padding: 10px 18px; display: flex; flex-direction: column; justify-content: center; }
.day-name { font-weight: 900; text-transform: uppercase; font-size: 26px; letter-spacing: -.01em; line-height: 1.1; }
.day-sub { font-family: var(--mono); font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase; color: #c3c9db; }

.rows { border: 2px solid var(--ink); border-top: 0; background: var(--card); }
.row {
  --cat: #888;
  display: grid; grid-template-columns: 148px minmax(0, 1fr) auto; gap: 8px 24px; align-items: center;
  padding: 16px 20px 16px 22px; border-bottom: 2px solid var(--ink); position: relative;
  background: var(--card);
}
.row:last-child { border-bottom: 0; }
.row::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 8px; background: var(--cat); }
.row:hover { background: #fffbe0; }
.row[data-cat="Art"] { --cat: #e0307a; }
.row[data-cat="Film"] { --cat: #7a3cf0; }
.row[data-cat="Food"] { --cat: #ff9a00; }
.row[data-cat="Literature"] { --cat: #0f9d8a; }
.row[data-cat="Music"] { --cat: #1b36e8; }
.row[data-cat="Outdoors"] { --cat: #2f9e2f; }
.row[data-cat="Walks"] { --cat: #ff5b1f; }

.when { font-family: var(--mono); }
.when .start { font-size: 22px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.when .span { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.track { margin-top: 8px; height: 6px; background: #dde0e8; position: relative; }
.track i { position: absolute; top: 0; bottom: 0; background: var(--ink); }

.what { min-width: 0; }
.open-item {
  display: block; text-align: left; background: none; border: 0; padding: 0; color: var(--ink);
  font-weight: 800; font-size: 21px; line-height: 1.2; letter-spacing: -.01em;
}
.open-item::after { content: ""; position: absolute; inset: 0; } /* whole row is the hit area */
.open-item:hover { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 2px; }
.open-item:focus-visible { outline: none; }
.row:has(.open-item:focus-visible) { outline: 3px solid var(--signal); outline-offset: -3px; }
.where { margin-top: 4px; color: var(--muted); font-size: 15px; }
.blurb { margin-top: 6px; font-size: 15px; color: #2b3244; max-width: 56ch; }
.flag { margin-top: 8px; font-size: 13.5px; font-weight: 700; color: #a63200; }

.side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; text-align: right; }
.tag {
  font-family: var(--mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase;
  padding: 3px 8px; border: 2px solid var(--ink); background: #fff; white-space: nowrap;
}
.price { font-weight: 900; font-size: 22px; letter-spacing: -.02em; }
.price.free { color: #0a7a2d; }
.saved-pill {
  font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: .06em;
  background: var(--ink); color: var(--yellow); padding: 3px 8px;
}

.empty { border: 2px solid var(--ink); background: #fff; padding: 36px 28px; }
.empty[hidden] { display: none; }
.empty-big { font-weight: 900; font-size: 40px; text-transform: uppercase; letter-spacing: -.03em; line-height: 1; margin-bottom: 10px; }
.empty p + p { color: var(--muted); margin-bottom: 20px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 20px;
  background: var(--ink); color: #fff; border: 2px solid var(--ink); border-radius: 0; font-weight: 800;
}
.btn:hover { background: var(--blue); border-color: var(--blue); }
.btn.ghost { background: #fff; color: var(--ink); }
.btn.ghost:hover { background: var(--yellow); border-color: var(--ink); }

.foot { margin-top: 24px; font-size: 13.5px; color: var(--muted); max-width: 62ch; }

/* ---------- detail drawer ---------- */
.drawer {
  border: 0; padding: 0; margin: 0 0 0 auto; width: min(560px, 100vw); max-width: 100vw;
  height: 100vh; height: 100dvh; max-height: none; background: #fff; color: var(--ink);
  border-left: 4px solid var(--ink);
}
.drawer::backdrop { background: rgba(12, 18, 32, .6); }
.drawer-inner { min-height: 100%; display: flex; flex-direction: column; padding: 0 0 28px; }
.drawer-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--cat, var(--blue)); color: #fff; padding: 12px 20px; position: sticky; top: 0; z-index: 2;
}
.drawer-bar { background: var(--ink); }
.drawer-kind { font-family: var(--mono); font-size: 12.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--yellow); }
.close {
  min-height: 44px; min-width: 44px; padding: 0 14px; background: #fff; color: var(--ink);
  border: 2px solid #fff; border-radius: 0; font-weight: 800;
}
.close:hover { background: var(--yellow); border-color: var(--yellow); }
.drawer-bar .close:focus-visible { outline-color: var(--yellow); }
.drawer-title { font-weight: 900; font-size: 40px; line-height: 1.02; letter-spacing: -.035em; padding: 28px 24px 18px; text-transform: none; }

.facts { display: grid; grid-template-columns: 1fr 1fr; margin: 0 24px; border: 2px solid var(--ink); }
.facts div { padding: 10px 12px; border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); min-width: 0; }
.facts div:nth-child(2n) { border-right: 0; }
.facts div:nth-last-child(-n+2) { border-bottom: 0; }
.facts dt { font-family: var(--mono); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.facts dd { font-weight: 700; font-size: 16.5px; line-height: 1.3; }

.drawer-body { padding: 22px 24px 0; font-size: 17px; line-height: 1.6; }
.drawer-body p + p { margin-top: 14px; }
.drawer-body p.access { border-left: 6px solid var(--blue); padding: 6px 0 6px 14px; background: #eef0ff; padding-right: 12px; }
.drawer-body .access-label { display: block; font-family: var(--mono); font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--blue-deep); margin-bottom: 2px; }
.clash { margin: 16px 24px 0; padding: 10px 12px; border: 2px solid var(--signal); background: #fff1ea; font-weight: 700; font-size: 15px; }
.clash[hidden] { display: none; }

.drawer-actions { margin: auto 24px 0; padding-top: 28px; display: flex; flex-direction: column; gap: 10px; }
.save {
  min-height: 56px; padding: 0 20px; border: 2px solid var(--ink); border-radius: 0; background: var(--yellow);
  color: var(--ink); font-weight: 900; font-size: 17px; text-align: left; display: flex; align-items: center; gap: 12px;
}
.save::before { content: "+"; font-family: var(--mono); font-size: 24px; line-height: 1; width: 24px; text-align: center; }
.save:hover { background: #ffd51a; }
.save[aria-pressed="true"] { background: var(--ink); color: var(--yellow); }
.save[aria-pressed="true"]::before { content: "✓"; }

/* ---------- mobile ---------- */
@media (max-width: 900px) {
  .shell { display: block; }
  .rail { position: static; height: auto; overflow: visible; padding: 22px 16px 20px; gap: 18px; }
  .brand-name { flex-direction: row; align-items: baseline; gap: 8px; font-size: 52px; margin-left: -2px; }
  .brand-name .amp { font-size: 30px; padding: 0; }
  .brand-kicker { font-size: 11.5px; margin-bottom: 10px; }
  .brand-line { font-size: 14.5px; margin-top: 12px; max-width: none; }
  .controls { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .controls .field:first-child, .saved-toggle, .days { grid-column: 1 / -1; }
  .controls .field:nth-child(2) { grid-column: 1 / -1; }
  .plan { margin-top: 0; }
  .board-wrap { padding: 20px 16px 40px; max-width: none; }
  .day { margin-bottom: 28px; }
  .day-num { font-size: 40px; min-width: 68px; padding: 8px 12px; }
  .day-name { font-size: 21px; }
  .row { grid-template-columns: minmax(0, 1fr) auto; padding: 14px 14px 14px 20px; gap: 6px 12px; }
  .when { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
  .when .start { font-size: 19px; }
  .when .span { margin-top: 0; }
  .track { display: none; }
  .open-item { font-size: 19px; }
  .blurb { display: none; }
  .side { align-items: flex-end; justify-content: space-between; }
  .drawer { width: 100vw; border-left: 0; }
  .drawer-title { font-size: 32px; padding: 22px 16px 14px; }
  .facts { margin: 0 16px; }
  .drawer-body { padding: 18px 16px 0; font-size: 16.5px; }
  .clash { margin: 14px 16px 0; }
  .drawer-actions { margin: auto 16px 0; }
  .drawer-bar { padding: 8px 16px; }
}

@media (max-width: 420px) {
  .brand-name { font-size: 46px; }
  .controls { grid-template-columns: 1fr; }
  .facts { grid-template-columns: 1fr; }
  .facts div { border-right: 0 !important; border-bottom: 2px solid var(--ink) !important; }
  .facts div:last-child { border-bottom: 0 !important; }
}

@media (prefers-reduced-motion: no-preference) {
  .drawer[open] { animation: slide .22s ease-out; }
  .drawer[open]::backdrop { animation: fade .22s ease-out; }
  @keyframes slide { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
  @keyframes fade { from { opacity: 0; } to { opacity: 1; } }
}
