/* Layout: a wall of pasted Weltformat gig posters, indexed by a two-week date strip.
   Left-aligned Swiss grid; one condensed grotesk at several widths. The posters are
   the loud part, everything around them stays quiet. */
:root {
  --wall: #E2E3DE;      /* concrete the posters are pasted on */
  --sheet: #F4F4F1;     /* panels, dialogs */
  --ink: #1B1F3B;       /* riso "federal blue" black, used for all text */
  --ink-2: #565B73;
  --rule: #C3C5BD;
  --mark: #FF48B0;      /* fluorescent pink: today, saved, new */
  --ok: #00875A;
  --bad: #D7263D;
  --paper: #F6F5EF;     /* poster stock; stays light in dark mode */
  --poster-ink: #1B1F3B;
  --sticker: #FFE800;

  --sans: 'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --narrow: 62%;
  --semi: 80%;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --wall: #191B26; --sheet: #222533; --ink: #ECEBE4; --ink-2: #A3A6B8; --rule: #383C50;
    --mark: #FF5CBA; --ok: #3CC98C; --bad: #FF6B7D;
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --wall: #191B26; --sheet: #222533; --ink: #ECEBE4; --ink-2: #A3A6B8; --rule: #383C50;
  --mark: #FF5CBA; --ok: #3CC98C; --bad: #FF6B7D;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--wall);
  color: var(--ink);
  font: 400 15px/1.5 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
svg { display: block; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--mark); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.wrap {
  max-width: 1360px; margin: 0 auto;
  padding-left: max(24px, env(safe-area-inset-left, 0px));
  padding-right: max(24px, env(safe-area-inset-right, 0px));
}
@media (max-width: 640px) {
  .wrap { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
}
.tab { font-variant-numeric: tabular-nums; }

/* ── Bar ──────────────────────────────────────────────────── */
.bar { position: sticky; top: 0; z-index: 40; background: var(--wall); border-bottom: 1px solid var(--rule); }
.bar-in {
  max-width: 1360px; margin: 0 auto; display: flex; align-items: center; gap: 24px; height: 60px;
  padding-left: max(24px, env(safe-area-inset-left, 0px)); padding-right: max(24px, env(safe-area-inset-right, 0px));
}
.mark { font: 900 30px/1 var(--sans); font-stretch: var(--narrow); letter-spacing: -0.01em; text-decoration: none; }
.search { flex: 1; max-width: 460px; display: flex; align-items: center; gap: 8px; border-bottom: 2px solid var(--ink); height: 36px; }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 16px; }
.search input::placeholder { color: var(--ink-2); }
.search:focus-within { border-color: var(--mark); }
kbd { font: 500 12px var(--sans); color: var(--ink-2); border: 1px solid var(--rule); border-radius: 3px; padding: 0 6px; }
.nav { display: flex; align-items: center; gap: 18px; margin-left: auto; }
.link { border: 0; background: none; padding: 4px 0; font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.link:hover { text-decoration: underline; text-underline-offset: 4px; }
.account { position: relative; }
.avatar { width: 32px; height: 32px; border-radius: 50%; border: 0; padding: 0; background: var(--ink); color: var(--wall); font-weight: 800; overflow: hidden; display: grid; place-items: center; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.menu { position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; min-width: 220px; padding: 12px 14px; display: grid; gap: 8px; background: var(--sheet); border: 1px solid var(--ink); border-radius: 2px; box-shadow: 0 18px 40px -16px rgba(20, 22, 40, .45); font-size: 14px; }
.menu small { color: var(--ink-2); overflow-wrap: anywhere; }
.menu .link { justify-content: flex-start; }
.count { min-width: 20px; padding: 0 5px; border-radius: 10px; background: var(--mark); color: #fff; font-size: 12px; font-weight: 700; text-align: center; line-height: 20px; }
.live { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: .2; } }
#lang { border: 1px solid var(--rule); background: transparent; border-radius: 3px; height: 30px; padding: 0 4px; font-weight: 600; font-size: 13px; }
.theme { width: 30px; height: 30px; border: 0; background: none; display: grid; place-items: center; }
.theme svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.theme svg path { fill: currentColor; }
@media (max-width: 820px) {
  .bar-in { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 10px; gap: 10px 16px; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .search kbd { display: none; }
  .nav { gap: 14px; font-size: 14px; }
  #prefsBtn { display: none; }
}

/* ── Head ─────────────────────────────────────────────────── */
.head { padding-top: 44px; padding-bottom: 28px; display: grid; gap: 10px; }
.lede { margin: 0; max-width: 58ch; color: var(--ink-2); font-size: 17px; }
.head h1 {
  margin: 6px 0 0; font: 850 clamp(52px, 9vw, 128px)/.86 var(--sans); font-stretch: var(--narrow);
  letter-spacing: -0.015em; text-wrap: balance;
}
.meta { margin: 6px 0 0; color: var(--ink-2); font-size: 14px; }
.note { margin: 10px 0 0; max-width: 72ch; padding: 10px 14px; border-left: 4px solid var(--sticker); background: var(--sheet); font-size: 14px; }

/* ── Controls: date strip + one filter row, pinned under the bar ── */
.controls { position: sticky; top: 61px; z-index: 30; background: var(--wall); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.strip { display: flex; overflow-x: auto; scrollbar-width: none; margin: 0 -6px; }
.strip::-webkit-scrollbar { display: none; }
.day {
  flex: none; display: grid; grid-template-rows: auto auto auto; justify-items: start; gap: 1px;
  min-width: 64px; padding: 8px 10px 9px; border: 0; background: none; text-align: left; position: relative;
}
.day small { font-size: 12px; color: var(--ink-2); font-weight: 600; }
.day b { font: 800 26px/1 var(--sans); font-stretch: var(--narrow); font-variant-numeric: tabular-nums; }
.day i { font-style: normal; font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.day.word b { font-size: 20px; padding-top: 6px; }
.day.no-events { opacity: .45; }
.day:hover { background: var(--sheet); }
.day[aria-pressed='true'] { background: var(--ink); color: var(--wall); }
.day[aria-pressed='true'] small, .day[aria-pressed='true'] i { color: inherit; opacity: .75; }
.day.today::after { content: ''; position: absolute; left: 10px; right: 10px; bottom: 0; height: 4px; background: var(--mark); }
.day.weekend-start { margin-left: 10px; border-left: 1px solid var(--rule); }

.fbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-top: 1px solid var(--rule); }
.fgroup { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.dd { position: relative; }
.dd-btn, .tog {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border: 1px solid var(--ink-2); border-radius: 2px;
  background: transparent; font-size: 14px; font-weight: 600; white-space: nowrap;
}
.dd-btn svg { width: 10px; height: 10px; fill: none; stroke: currentColor; stroke-width: 2; transition: transform .15s; }
.dd-btn[aria-expanded='true'] svg { transform: rotate(180deg); }
.dd-btn:hover, .tog:hover { border-color: var(--ink); }
.dd-btn.is-set, .tog[aria-pressed='true'] { background: var(--ink); border-color: var(--ink); color: var(--wall); }
.dd-panel {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 50; width: 280px; max-height: min(420px, 60vh); display: flex; flex-direction: column;
  background: var(--sheet); border: 1px solid var(--ink); border-radius: 2px; box-shadow: 0 18px 40px -16px rgba(20, 22, 40, .45);
}
.dd-list { overflow: auto; padding: 6px 0; }
.dd-opt { display: grid; grid-template-columns: 18px 1fr auto; gap: 10px; align-items: center; padding: 8px 14px; cursor: pointer; font-size: 15px; }
.dd-opt:hover { background: var(--wall); }
.dd-opt input { width: 16px; height: 16px; margin: 0; accent-color: var(--ink); }
.dd-opt small { color: var(--ink-2); font-size: 13px; font-variant-numeric: tabular-nums; }
.dd-opt.zero { color: var(--ink-2); }
.dd-foot { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-top: 1px solid var(--rule); }
.dd-foot .btn { height: 34px; }
.seg { display: flex; flex: none; border: 1px solid var(--ink); border-radius: 2px; }
.seg button { border: 0; background: none; padding: 0 14px; height: 34px; font-weight: 600; font-size: 14px; }
.seg button + button { border-left: 1px solid var(--ink); }
.seg button[aria-selected='true'] { background: var(--ink); color: var(--wall); }
.active { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 0 0 10px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 6px 0 10px; border-radius: 14px;
  border: 0; background: var(--sheet); font-size: 13px; font-weight: 600;
}
.chip span { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; font-size: 12px; color: var(--ink-2); }
.chip:hover span { background: var(--ink); color: var(--wall); }
.active .link { font-size: 13px; text-decoration: underline; text-underline-offset: 3px; margin-left: 4px; }
.dd-scrim { position: fixed; inset: 0; z-index: 29; background: rgba(20, 22, 40, .45); }
@media (max-width: 640px) {
  .fbar { flex-wrap: wrap; }
  .fgroup { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; flex: 1 1 100%; }
  .fgroup::-webkit-scrollbar { display: none; }
  .seg { flex: 1 1 100%; } .seg button { flex: 1; }
  .dd { position: static; }
  .dd-panel {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: auto; max-height: 75vh; border-width: 1px 0 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
}

/* ── Programme ────────────────────────────────────────────── */
main { min-height: 50vh; padding-bottom: 64px; }
.block { margin-top: 36px; }
.block-head { display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.block-head h2 { margin: 0; font: 800 34px/1 var(--sans); font-stretch: var(--narrow); }
.block-head p { margin: 0; color: var(--ink-2); font-size: 14px; }
.cta { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 14px; margin-top: 28px; padding: 14px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); color: var(--ink-2); }
.cta .link { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }

.dayblock { display: grid; grid-template-columns: 132px 1fr; gap: 24px; padding-top: 22px; margin-top: 22px; border-top: 2px solid var(--ink); }
.daylabel { position: sticky; top: calc(var(--stick, 140px) + 12px); align-self: start; display: grid; gap: 2px; }
.daylabel small { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.daylabel b { font: 850 48px/.9 var(--sans); font-stretch: var(--narrow); font-variant-numeric: tabular-nums; }
.daylabel span { font-size: 13px; color: var(--ink-2); }
.daylabel.is-today small { color: var(--mark); }
@media (max-width: 720px) {
  .dayblock { grid-template-columns: 1fr; gap: 14px; }
  .daylabel { position: static; grid-auto-flow: column; justify-content: start; align-items: baseline; gap: 10px; }
  .daylabel b { font-size: 34px; }
}

.wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(188px, 1fr)); gap: 30px 16px; }
@media (max-width: 480px) { .wall { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 12px; } }
.item { display: grid; gap: 8px; min-width: 0; cursor: pointer; }
.cap { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); min-width: 0; }
.cap span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.save {
  flex: none; display: inline-flex; align-items: center; gap: 5px; border: 0; background: none; padding: 2px 0;
  font-size: 13px; font-weight: 600; color: var(--ink);
}
.save svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.save.on { color: var(--mark); }
.save.on svg { fill: currentColor; }
.save:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ── The poster ───────────────────────────────────────────── */
.poster {
  container-type: inline-size; position: relative; aspect-ratio: 895 / 1280; max-width: 100%; overflow: hidden;
  background: var(--paper); color: var(--poster-ink);
  box-shadow: 0 1px 1px rgba(27, 31, 59, .18), 0 6px 14px -8px rgba(27, 31, 59, .35);
  transition: transform .18s ease;
}
.item:hover .poster, .item:focus-visible .poster { transform: translateY(-3px) rotate(-.6deg); }
.item:focus-visible { outline: none; }
.item:focus-visible .poster { outline: 3px solid var(--mark); outline-offset: 3px; }
.art { position: absolute; inset: 0 0 42% 0; background-size: cover; background-position: center top; overflow: hidden; }
.art.photo { background-color: var(--ink-a); }
.art.photo img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) contrast(1.25) brightness(1.08); mix-blend-mode: multiply; }
.type { position: absolute; inset: 58% 0 0 0; padding: 4cqi 5.5cqi 5cqi; display: flex; flex-direction: column; }
.p-when { font: 800 5.6cqi/1 var(--sans); font-stretch: var(--semi); font-variant-numeric: tabular-nums; display: flex; justify-content: space-between; }
.p-title {
  margin: 2.6cqi 0 0; font-weight: 900; font-stretch: var(--narrow); font-size: var(--fs, 11cqi); line-height: .88; letter-spacing: -0.005em;
  overflow-wrap: anywhere; hyphens: auto; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.p-foot { margin-top: auto; display: flex; justify-content: space-between; gap: 3cqi; font: 600 4.4cqi/1.15 var(--sans); }
.p-foot span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sticker {
  position: absolute; top: 4cqi; right: 4cqi; width: 19cqi; height: 19cqi; border-radius: 50%; display: grid; place-items: center;
  background: var(--sticker); color: var(--poster-ink); font: 800 4.6cqi/1 var(--sans); transform: rotate(12deg);
}
.strap {
  position: absolute; left: -8%; right: -8%; top: 30%; padding: 2.4cqi 0; text-align: center; transform: rotate(-7deg);
  background: var(--poster-ink); color: var(--paper); font: 900 8cqi/1 var(--sans); font-stretch: var(--narrow); letter-spacing: .01em;
}
.strap.cancelled { background: var(--bad); }
.poster.is-cancelled .p-title { text-decoration: line-through; text-decoration-thickness: .08em; }

/* ── List view ────────────────────────────────────────────── */
.list { display: grid; }
.lrow {
  display: grid; grid-template-columns: 64px minmax(0, 2.2fr) minmax(0, 1.4fr) 110px 84px; gap: 18px; align-items: baseline;
  padding: 12px 6px; border-bottom: 1px solid var(--rule); cursor: pointer;
}
.lrow:hover { background: var(--sheet); }
.lrow .t { font: 800 20px/1 var(--sans); font-stretch: var(--semi); font-variant-numeric: tabular-nums; }
.lrow h4 { margin: 0; font: 800 20px/1.1 var(--sans); font-stretch: var(--semi); }
.lrow h4 em { font-style: normal; font-size: 12px; font-weight: 700; color: var(--bad); margin-left: 8px; font-stretch: 100%; }
.lrow p { margin: 2px 0 0; font-size: 13px; color: var(--ink-2); }
.lrow .v { font-size: 14px; }
.lrow .v small { display: block; color: var(--ink-2); font-size: 13px; }
.lrow .pr { font-size: 14px; font-variant-numeric: tabular-nums; text-align: right; }
.lrow .save { justify-self: end; }
@media (max-width: 760px) {
  .lrow { grid-template-columns: 52px minmax(0, 1fr) auto; gap: 4px 12px; }
  .lrow .v { grid-column: 2; }
  .lrow .pr { display: none; }
  .lrow .save { grid-row: 1; grid-column: 3; }
}

/* ── Map ──────────────────────────────────────────────────── */
.map-wrap { margin-top: 28px; height: calc(100vh - 300px); min-height: 460px; border: 1px solid var(--rule); }
#map { width: 100%; height: 100%; background: var(--sheet); }
.leaflet-container { font-family: var(--sans) !important; }
.pin { display: grid; place-items: center; width: 100%; height: 100%; border-radius: 50%; background: var(--mark); color: #1B1F3B; font: 800 13px var(--sans); border: 2px solid #1B1F3B; }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { border-radius: 2px !important; background: var(--sheet) !important; color: var(--ink) !important; }
.leaflet-popup-content { margin: 12px 14px !important; min-width: 220px; }
.pop h4 { margin: 0 0 6px; font: 800 18px var(--sans); font-stretch: var(--semi); }
.pop button { display: grid; width: 100%; text-align: left; border: 0; background: none; padding: 6px 0; border-top: 1px solid var(--rule); font-size: 13px; }
.pop button:hover b { text-decoration: underline; }
.pop button span { color: var(--ink-2); font-size: 12px; }

/* ── Empty, more ──────────────────────────────────────────── */
.empty { padding: 64px 0; display: grid; gap: 14px; justify-items: start; }
.empty p { margin: 0; font: 800 34px/1.05 var(--sans); font-stretch: var(--narrow); max-width: 20ch; }
.more { margin-top: 36px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 2px;
  border: 2px solid var(--ink); background: none; font-weight: 700; text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--sheet); }
.btn.solid { background: var(--ink); color: var(--wall); }
.btn.solid:hover { background: var(--ink-2); border-color: var(--ink-2); }
.btn.small { height: 34px; padding: 0 12px; font-size: 14px; }

/* ── Event dialog ─────────────────────────────────────────── */
dialog.sheet {
  padding: 0; border: 0; border-radius: 2px; background: var(--sheet); color: var(--ink);
  width: min(1000px, calc(100vw - 32px)); max-height: calc(100vh - 48px);
  box-shadow: 0 30px 80px -20px rgba(10, 12, 30, .55);
}
dialog::backdrop { background: rgba(20, 22, 40, .55); }
dialog.sheet[open] { animation: open .2s ease-out; }
@keyframes open { from { opacity: 0; transform: translateY(10px); } }
.event-dlg .layout { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: 36px; padding: 32px; }
.event-dlg .poster { width: 100%; }
.event-dlg .x { position: absolute; top: 14px; right: 18px; }
.info { min-width: 0; display: grid; gap: 18px; align-content: start; }
.info .genre { font-size: 14px; color: var(--ink-2); font-weight: 600; margin: 0; }
.info h2 { margin: -8px 0 0; font: 900 clamp(40px, 5vw, 64px)/.88 var(--sans); font-stretch: var(--narrow); text-wrap: balance; overflow-wrap: anywhere; }
.info .artists { margin: -6px 0 0; color: var(--ink-2); }
.facts { display: grid; grid-template-columns: 72px 1fr; gap: 10px 16px; margin: 0; padding: 16px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.facts dt { color: var(--ink-2); font-size: 14px; }
.facts dd { margin: 0; font-weight: 600; }
.facts dd span { display: block; font-weight: 400; color: var(--ink-2); font-size: 14px; }
.facts dd .ln { display: inline; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; margin-right: 12px; font-size: 14px; font-weight: 500; }
.status { color: var(--bad); font-weight: 700; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.actions .btn.solid { min-width: 200px; }
.links { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: 14px; }
.links a, .links button { border: 0; background: none; padding: 0; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.desc { margin: 0; color: var(--ink); white-space: pre-line; max-width: 62ch; font-size: 15px; line-height: 1.6; }
.found { font-size: 13px; color: var(--ink-2); }
.found a { color: var(--ink-2); margin-right: 10px; }
.similar { padding: 0 32px 32px; }
.similar h3 { margin: 0 0 14px; font: 800 24px var(--sans); font-stretch: var(--narrow); padding-top: 18px; border-top: 2px solid var(--ink); }
.similar .wall { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
@media (max-width: 760px) {
  dialog.sheet { width: 100vw; max-width: 100vw; max-height: 94vh; margin: auto 0 0; }
  .event-dlg .layout { grid-template-columns: 1fr; padding: 52px 16px 20px; gap: 22px; }
  .event-dlg .poster { width: min(240px, 70%); }
  .similar { padding: 0 16px 24px; }
}

.prefs-dlg form { padding: 32px; display: grid; gap: 8px; }
.prefs-dlg h2 { margin: 0; font: 900 44px/.9 var(--sans); font-stretch: var(--narrow); }
.prefs-dlg h3 { margin: 18px 0 4px; font-size: 15px; color: var(--ink-2); font-weight: 600; }
.picks { display: flex; flex-wrap: wrap; gap: 6px; }
.pick { border: 1px solid var(--ink); background: none; border-radius: 2px; padding: 7px 12px; font-weight: 600; font-size: 15px; }
.pick sup { font-size: 10px; color: var(--ink-2); margin-left: 3px; }
.pick[aria-pressed='true'] { background: var(--ink); color: var(--sheet); }
.pick[aria-pressed='true'] sup { color: inherit; opacity: .7; }
.dlg-actions { margin-top: 22px; }

/* ── Drawers ──────────────────────────────────────────────── */
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 60; width: min(440px, 100vw); display: flex; flex-direction: column;
  background: var(--sheet); border-left: 2px solid var(--ink); transform: translateX(102%); transition: transform .22s ease-out;
  padding-top: env(safe-area-inset-top, 0px); padding-right: env(safe-area-inset-right, 0px);
}
.drawer.open { transform: none; }
.drawer-head { display: flex; align-items: baseline; justify-content: space-between; padding: 20px 22px 14px; border-bottom: 1px solid var(--rule); }
.drawer-head h2 { margin: 0; font: 900 34px/1 var(--sans); font-stretch: var(--narrow); }
.drawer-body { flex: 1; overflow: auto; padding: 8px 22px 28px; }
.scrim { position: fixed; inset: 0; z-index: 55; background: rgba(20, 22, 40, .4); }
.saved-item { display: grid; grid-template-columns: 56px 1fr auto; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--rule); cursor: pointer; }
.saved-item .poster { width: 56px; }
.saved-item .poster .type, .saved-item .poster .sticker, .saved-item .poster .strap { display: none; }
.saved-item .poster .art { inset: 0; }
.saved-item b { display: block; font: 800 18px/1.1 var(--sans); font-stretch: var(--semi); }
.saved-item span { color: var(--ink-2); font-size: 13px; }
.subscribe { margin-top: 20px; display: grid; gap: 10px; justify-items: start; font-size: 14px; color: var(--ink-2); }
.crawl { display: grid; gap: 4px; padding: 14px 0 18px; border-bottom: 1px solid var(--rule); font-size: 14px; }
.crawl dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 0 0 10px; }
.crawl dt { color: var(--ink-2); }
.crawl dd { margin: 0; font-weight: 600; }
.src-group { margin: 22px 0 2px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.src { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.src .st { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--ink-2); }
.src .st.ok { background: var(--ok); border-color: var(--ok); }
.src .st.err { background: var(--bad); border-color: var(--bad); }
.src b { font-size: 14px; font-weight: 600; }
.src small { display: block; color: var(--ink-2); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.src small.err { color: var(--bad); }
.src .acts { display: flex; gap: 12px; align-items: center; font-size: 13px; }
.src .acts input { width: 16px; height: 16px; accent-color: var(--ink); margin: 0; }
.token { display: grid; gap: 8px; justify-items: start; }
.token label { display: grid; gap: 3px; width: 100%; font-size: 13px; color: var(--ink-2); }
.add-src { display: grid; gap: 8px; margin-top: 26px; }
.add-src h3 { margin: 0 0 4px; font: 800 22px var(--sans); font-stretch: var(--narrow); }
.add-src label { display: grid; gap: 3px; font-size: 13px; color: var(--ink-2); }
.add-src .two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.field { width: 100%; height: 40px; padding: 0 10px; border-radius: 2px; border: 1px solid var(--ink-2); background: var(--wall); color: var(--ink); font-size: 15px; }
.add-src .btn { justify-self: start; margin-top: 6px; }

/* ── Toast, footer ────────────────────────────────────────── */
.toast {
  position: fixed; left: max(16px, env(safe-area-inset-left, 0px)); bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 90;
  padding: 10px 16px; background: var(--ink); color: var(--wall); font-weight: 600; border-radius: 2px;
  transform: translateY(calc(100% + 40px)); visibility: hidden; transition: transform .2s ease-out, visibility .2s;
}
.toast.show { transform: none; visibility: visible; }
.footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding-top: 18px; padding-bottom: 40px; border-top: 2px solid var(--ink); font-size: 13px; color: var(--ink-2); }
.footer span:first-child { font-weight: 800; color: var(--ink); }
.skeleton { aspect-ratio: 895 / 1280; background: var(--sheet); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
