@font-face {
  font-family: 'Oswald';
  src: url('assets/oswald.ttf') format('truetype');
  font-weight: 200 700;
  font-display: swap;
}
@font-face {
  font-family: 'Plex Mono';
  src: url('assets/ibm-plex-mono.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Literata';
  src: url('assets/literata.ttf') format('truetype');
  font-weight: 200 900;
  font-display: swap;
}

:root {
  --paper: #f2e8d0;
  --paper-2: #e6d9b8;
  --card: #fffaf0;
  --ink: #17140f;
  --hot: #e8400f;
  --blue: #3b4bff;
  --yellow: #ffc933;
  --kraft: #d4a96a;
  --red: #c4160f;
  --display: 'Oswald', 'Arial Narrow', Impact, sans-serif;
  --mono: 'Plex Mono', ui-monospace, Menlo, monospace;
  --text: 'Literata', Georgia, serif;
  --r: 11px;
}

[data-cat='Music'] { --cc: #3b4bff; --cf: #ffffff; }
[data-cat='Art'] { --cc: #ff8fc0; --cf: #17140f; }
[data-cat='Film'] { --cc: #17140f; --cf: #fffaf0; }
[data-cat='Food'] { --cc: #ffc933; --cf: #17140f; }
[data-cat='Literature'] { --cc: #86d98f; --cf: #17140f; }
[data-cat='Outdoors'] { --cc: #14705a; --cf: #ffffff; }
[data-cat='Walks'] { --cc: #ff6a2b; --cf: #17140f; }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background-color: var(--paper);
  background-image: radial-gradient(rgba(23, 20, 15, 0.09) 1px, transparent 1.5px);
  background-size: 14px 14px;
  color: var(--ink);
  font-family: var(--text);
  font-size: 1rem;
  line-height: 1.5;
}
body:has(dialog[open]) { overflow: hidden; }

h1, h2, h3, h4, p, dl, dd, ol, ul { margin: 0; padding: 0; }
ol, ul { list-style: none; }

button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }

:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
  box-shadow: 0 0 0 6px #fff;
}
.masthead :focus-visible { outline-color: var(--yellow); box-shadow: none; }

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

.g { font-family: var(--text); }

/* ---------- masthead ---------- */

.masthead {
  position: relative;
  background: var(--ink);
  color: var(--card);
  padding: 28px 24px 56px;
  margin-bottom: 18px;
}
.masthead::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: -1px; height: 14px;
  background: radial-gradient(circle at 10px 0, var(--paper) 7px, transparent 7.5px) 0 0 / 20px 14px repeat-x;
}
.masthead-inner {
  max-width: 1280px; margin: 0 auto;
  display: grid; grid-template-columns: auto 1fr; align-items: end; gap: 24px 56px;
}
.wordmark {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(5.2rem, 17vw, 12.5rem);
  line-height: 0.82;
  letter-spacing: 0.01em;
  color: var(--hot);
  text-shadow: 0.04em 0.04em 0 var(--yellow);
  transform: rotate(-2deg);
  transform-origin: left bottom;
  margin: 8px 0 0 -4px;
}
.tagline {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.5rem, 3vw, 2.4rem);
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  max-width: 20ch;
}
.facts {
  display: flex; flex-wrap: wrap; gap: 8px 28px; margin-top: 18px;
  font-family: var(--mono); font-size: 0.8rem; text-transform: uppercase;
}
.facts div { border-top: 2px dashed var(--yellow); padding-top: 6px; min-width: 76px; }
.facts dt { color: #cfc6ad; letter-spacing: 0.08em; font-size: 0.7rem; }
.facts dd { font-size: 1.15rem; color: var(--yellow); }

/* ---------- layout bits ---------- */

main { max-width: 1280px; margin: 0 auto; padding: 0 24px; }

.section-head {
  display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 4px 20px;
  margin-bottom: 10px;
}
.section-head h2 {
  font-family: var(--display); font-weight: 700; font-size: 1.9rem; text-transform: uppercase; letter-spacing: 0.03em; line-height: 1.1;
}
.count, .legend { font-family: var(--mono); font-size: 0.8rem; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.lg-saved::before, .lg-clash::before {
  content: ''; display: inline-block; width: 12px; height: 12px; border: 2px solid var(--ink);
  margin-right: 6px; vertical-align: -1px; background: var(--yellow);
}
.lg-clash::before { background: var(--card); outline: 2px solid var(--red); outline-offset: 0; }

/* ---------- controls ---------- */

.controls {
  display: grid;
  grid-template-columns: minmax(220px, 1.6fr) minmax(160px, 1fr) auto auto;
  gap: 14px 18px;
  align-items: end;
  background: var(--card);
  border: 3px solid var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
  padding: 18px 20px;
  margin-bottom: 34px;
}
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; border: 0; padding: 0; margin: 0; }
.field label, .field legend {
  font-family: var(--mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; padding: 0;
}
.field input[type='text'], .field select {
  height: 48px; width: 100%;
  background: #fff; border: 2px solid var(--ink); border-radius: 0; padding: 0 12px;
  font-family: var(--mono); font-size: 1rem;
}
.field select {
  appearance: none; -webkit-appearance: none;
  padding-right: 38px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 20px) 21px, calc(100% - 14px) 21px;
  background-size: 6px 6px; background-repeat: no-repeat;
}
.field input::placeholder { color: #6d6556; }

.seg { display: flex; height: 48px; border: 2px solid var(--ink); background: #fff; }
.seg label { position: relative; display: block; margin: 0; }
.seg label + label { border-left: 2px solid var(--ink); }
.seg input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.seg span {
  display: flex; align-items: center; height: 100%; padding: 0 14px;
  font-family: var(--mono); font-size: 0.95rem; text-transform: none; letter-spacing: 0;
}
.seg input:checked + span { background: var(--ink); color: var(--yellow); }
.seg input:focus-visible + span { outline: 3px solid var(--blue); outline-offset: 3px; box-shadow: 0 0 0 6px #fff; }

.field-actions { flex-direction: row; gap: 10px; flex-wrap: wrap; }

.btn {
  min-height: 48px; padding: 0 16px;
  background: var(--card); border: 2px solid var(--ink); border-radius: 0;
  font-family: var(--display); font-weight: 600; font-size: 1.05rem; text-transform: uppercase; letter-spacing: 0.05em;
  box-shadow: 3px 3px 0 var(--ink);
  display: inline-flex; align-items: center; gap: 8px;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-hot { background: var(--hot); }
.btn .n {
  font-family: var(--mono); font-weight: 400; font-size: 0.85rem;
  background: var(--ink); color: var(--card); min-width: 24px; height: 24px; padding: 0 6px;
  display: inline-flex; align-items: center; justify-content: center; border-radius: 12px;
}
.btn-toggle[aria-pressed='true'] { background: var(--ink); color: var(--yellow); }
.btn-toggle[aria-pressed='true'] .n { background: var(--yellow); color: var(--ink); }

@media (prefers-reduced-motion: no-preference) {
  .btn { transition: transform 0.08s, box-shadow 0.08s; }
  .btn:not(:disabled):hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--ink); }
  .btn:not(:disabled):active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--ink); }
}

/* ---------- ribbon ---------- */

.ribbon-section { margin-bottom: 38px; }
.ribbon {
  overflow-x: auto;
  background: var(--card);
  border: 3px solid var(--ink);
  padding: 14px 16px 10px;
  background-image: repeating-linear-gradient(0deg, transparent 0 31px, rgba(23, 20, 15, 0.08) 31px 32px);
}
.ribbon-inner { min-width: 900px; }
.lane { display: grid; grid-template-columns: 56px 1fr; gap: 10px; margin-bottom: 6px; }
.lane-label {
  font-family: var(--mono); font-size: 0.72rem; text-transform: uppercase; line-height: 1;
  padding-top: 8px; display: flex; flex-direction: column; gap: 3px;
}
.lane-label b { font-family: var(--display); font-weight: 700; font-size: 1.7rem; line-height: 1; }
.track {
  position: relative;
  background-image: repeating-linear-gradient(90deg, rgba(23, 20, 15, 0.22) 0 1px, transparent 1px calc(100% / 7));
  border-bottom: 2px solid var(--ink);
}
.track-none { position: absolute; left: 10px; top: 8px; font-family: var(--mono); font-size: 0.8rem; color: #6d6556; }
.bar {
  position: absolute; left: var(--l); width: var(--w); top: calc(var(--row) * 32px + 2px); height: 28px;
  background: var(--cc); color: var(--cf); border: 2px solid var(--ink);
  font-family: var(--mono); font-size: 0.72rem; line-height: 24px; padding: 0 6px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer;
  opacity: 0.88;
}
.bar.is-saved { opacity: 1; box-shadow: 3px 3px 0 var(--ink); z-index: 2; }
.bar.is-clash { outline: 3px solid var(--red); outline-offset: 1px; z-index: 3; }
.bar.is-linked { opacity: 1; box-shadow: 0 0 0 3px var(--yellow), 0 0 0 5px var(--ink); z-index: 4; }
.axis { position: relative; height: 22px; }
.axis span {
  position: absolute; top: 4px; transform: translateX(-50%);
  font-family: var(--mono); font-size: 0.72rem;
}
.axis span:first-child { transform: none; }
.axis span:last-child { transform: translateX(-100%); }

/* ---------- roll ---------- */

.layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 40px; align-items: start; margin-bottom: 70px; }
.roll { min-width: 0; }
.roll:focus { outline: none; }

.slot {
  height: 22px; background: var(--ink); border-radius: 11px;
  box-shadow: inset 0 6px 0 #000, 0 3px 0 rgba(23, 20, 15, 0.25);
  margin: 0 -10px 26px;
  position: relative; z-index: 2;
}

.day { margin-bottom: 34px; }
.day h3 {
  display: flex; align-items: baseline; gap: 12px;
  font-family: var(--display); text-transform: uppercase; line-height: 1;
  margin-bottom: 18px; padding-bottom: 10px; border-bottom: 3px dashed var(--ink);
}
.scissors { font-family: var(--text); font-size: 1.4rem; transform: scaleX(-1); display: inline-block; }
.day-name { font-weight: 700; font-size: 2.4rem; letter-spacing: 0.02em; }
.day-date { font-weight: 400; font-size: 1.5rem; color: var(--hot); }
.day-n { margin-left: auto; font-family: var(--mono); font-size: 0.8rem; text-transform: none; }

.tickets { display: grid; gap: 22px; }

.stub {
  position: relative;
  filter: drop-shadow(5px 6px 0 var(--ink));
  transform: rotate(var(--tilt, 0deg));
}
.stub:nth-child(odd) { --tilt: -0.3deg; }
.stub:nth-child(even) { --tilt: 0.25deg; }
@media (prefers-reduced-motion: no-preference) {
  .stub { transition: transform 0.15s; }
}
.stub:hover, .stub.is-linked { transform: translateY(-3px) rotate(0deg); }
.stub.is-linked .ticket-main { background: #fff3c4; }

.ticket {
  --sw: 138px;
  position: relative;
  display: grid; grid-template-columns: minmax(0, 1fr) var(--sw);
  background: var(--card);
  -webkit-mask:
    radial-gradient(circle var(--r) at calc(100% - var(--sw)) 0, #0000 97%, #000) ,
    radial-gradient(circle var(--r) at calc(100% - var(--sw)) 100%, #0000 97%, #000),
    radial-gradient(circle var(--r) at 0 50%, #0000 97%, #000),
    radial-gradient(circle var(--r) at 100% 50%, #0000 97%, #000);
  -webkit-mask-composite: source-in;
  mask:
    radial-gradient(circle var(--r) at calc(100% - var(--sw)) 0, #0000 97%, #000),
    radial-gradient(circle var(--r) at calc(100% - var(--sw)) 100%, #0000 97%, #000),
    radial-gradient(circle var(--r) at 0 50%, #0000 97%, #000),
    radial-gradient(circle var(--r) at 100% 50%, #0000 97%, #000);
  mask-composite: intersect;
}
.ticket:has(.open:focus-visible)::before {
  content: ''; position: absolute; inset: 7px; border: 3px dashed var(--blue); pointer-events: none; z-index: 3;
}

.ticket-main { padding: 18px 22px 16px 30px; border-right: 3px dotted rgba(23, 20, 15, 0.65); }
.when { font-family: var(--mono); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; }
.t { margin: 4px 0 2px; font-family: var(--display); font-weight: 700; font-size: clamp(1.55rem, 2.6vw, 2.15rem); line-height: 1.05; text-transform: uppercase; letter-spacing: 0.01em; }
.open {
  background: none; border: 0; padding: 0; text-align: left;
  font: inherit; text-transform: inherit; letter-spacing: inherit; color: inherit;
}
.open::after { content: ''; position: absolute; inset: 0; z-index: 2; }
.open:focus-visible { outline: none; box-shadow: none; text-decoration: underline 4px var(--blue); text-underline-offset: 4px; }
.where { font-family: var(--mono); font-size: 0.85rem; color: #4a4336; }
.sum { margin-top: 8px; font-size: 0.95rem; line-height: 1.45; max-width: 60ch; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tag {
  display: inline-block; font-family: var(--mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em;
  background: var(--cc, var(--ink)); color: var(--cf, var(--card)); padding: 2px 8px; border: 2px solid var(--ink);
}
.tag-line { background: transparent; color: var(--ink); }

.ticket-side {
  background: var(--cc); color: var(--cf);
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  padding: 16px 10px; text-align: center; gap: 8px;
}
.no { font-family: var(--mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; }
.pr { font-family: var(--display); font-weight: 700; font-size: 2.7rem; line-height: 1; text-transform: uppercase; }
.side-hint { font-family: var(--mono); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.1em; opacity: 0.85; }
.stamp {
  font-family: var(--display); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.95rem;
  border: 3px double currentColor; padding: 3px 8px; transform: rotate(-7deg);
  background: var(--yellow); color: var(--ink); border-color: var(--ink);
}

.empty {
  background: var(--card); border: 3px dashed var(--ink); padding: 34px 26px; text-align: left;
  display: grid; gap: 10px; justify-items: start;
}
.empty-big { font-family: var(--display); font-weight: 700; font-size: 3rem; text-transform: uppercase; line-height: 1; color: var(--hot); }
.load-error { font-family: var(--mono); padding: 20px; border: 3px dashed var(--red); background: var(--card); }

/* ---------- pocket ---------- */

.pocket {
  position: sticky; top: 16px;
  max-height: calc(100vh - 32px); overflow: auto;
  background: var(--kraft);
  background-image: repeating-linear-gradient(135deg, rgba(23, 20, 15, 0.05) 0 2px, transparent 2px 9px);
  border: 3px solid var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
  padding: 0 0 18px;
}
.pocket-flap {
  background: var(--ink); color: var(--card);
  padding: 16px 20px 14px; margin-bottom: 18px;
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  border-bottom: 4px solid var(--yellow);
}
.pocket-flap h2 { font-family: var(--display); font-weight: 700; font-size: 1.9rem; text-transform: uppercase; line-height: 1.05; }
.pocket-count { font-family: var(--mono); font-size: 0.8rem; color: var(--yellow); }
.pocket-empty, .slips, .totals { margin: 0 18px; }
.pocket-empty { font-size: 0.95rem; background: rgba(255, 250, 240, 0.6); padding: 14px; border: 2px dashed var(--ink); }
.slips { display: grid; gap: 12px; }
.slip { background: var(--card); border: 2px solid var(--ink); border-left: 10px solid var(--cc); padding: 10px 12px; }
.slip-row { display: flex; gap: 10px; justify-content: space-between; align-items: flex-start; }
.slip-text { min-width: 0; }
.slip-when { font-family: var(--mono); font-size: 0.72rem; text-transform: uppercase; }
.slip-open {
  display: block; text-align: left; background: none; border: 0; padding: 2px 0;
  font-family: var(--display); font-weight: 700; font-size: 1.15rem; line-height: 1.1; text-transform: uppercase;
  text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px;
}
.slip-where { font-family: var(--mono); font-size: 0.78rem; color: #4a4336; }
.slip-x {
  flex: none; min-height: 36px; padding: 0 10px; background: transparent; border: 2px solid var(--ink);
  font-family: var(--mono); font-size: 0.75rem; text-transform: uppercase;
}
.slip-x:hover { background: var(--yellow); }
.warn, .note { font-family: var(--mono); font-size: 0.75rem; margin-top: 6px; padding: 3px 6px; }
.warn { background: var(--red); color: #fff; }
.note { background: var(--yellow); color: var(--ink); }
.totals { display: flex; gap: 12px; margin-top: 16px; }
.totals div { flex: 1; border-top: 3px dashed var(--ink); padding-top: 6px; }
.totals dt { font-family: var(--mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; }
.totals dd { font-family: var(--display); font-weight: 700; font-size: 1.8rem; line-height: 1.1; }
.totals dd.bad { color: var(--red); }

.pill { display: none; }

.foot { max-width: 1280px; margin: 0 auto; padding: 0 24px 40px; font-family: var(--mono); font-size: 0.8rem; border-top: 3px dashed var(--ink); padding-top: 18px; }
.foot p { max-width: 70ch; }

/* ---------- detail dialog ---------- */

dialog#detail {
  --fh: 112px;
  border: 0; padding: 0; background: transparent; color: var(--ink);
  width: min(700px, calc(100vw - 32px));
  max-width: none; max-height: none;
  margin: auto;
  overflow: visible;
}
dialog#detail[open] { display: flex; flex-direction: column; max-height: calc(100dvh - 40px); filter: drop-shadow(8px 9px 0 rgba(0, 0, 0, 0.9)); }
dialog#detail::backdrop {
  background-color: rgba(23, 20, 15, 0.8);
  background-image: repeating-linear-gradient(45deg, rgba(255, 201, 51, 0.07) 0 12px, transparent 12px 24px);
}
@media (prefers-reduced-motion: no-preference) {
  dialog#detail[open] { animation: pop 0.22s ease-out; }
  @keyframes pop { from { transform: translateY(22px) rotate(-1.5deg); opacity: 0; } to { transform: none; opacity: 1; } }
}

.sheet-top {
  background: var(--card); padding: 22px 30px 26px; overflow-y: auto; min-height: 0; flex: 1 1 auto;
  border-top: 14px solid var(--cc);
  -webkit-mask:
    radial-gradient(circle var(--r) at 0 100%, #0000 97%, #000),
    radial-gradient(circle var(--r) at 100% 100%, #0000 97%, #000);
  -webkit-mask-composite: source-in;
  mask:
    radial-gradient(circle var(--r) at 0 100%, #0000 97%, #000),
    radial-gradient(circle var(--r) at 100% 100%, #0000 97%, #000);
  mask-composite: intersect;
}
.d-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.d-meta { display: flex; align-items: center; gap: 12px; }
.d-no { font-family: var(--mono); font-size: 0.8rem; text-transform: uppercase; }
.d-close {
  min-height: 44px; padding: 0 14px; background: var(--card); border: 2px solid var(--ink);
  font-family: var(--mono); font-size: 0.85rem; text-transform: uppercase;
}
.d-close:hover { background: var(--yellow); }
.d-title {
  font-family: var(--display); font-weight: 700; text-transform: uppercase; line-height: 1;
  font-size: clamp(2.2rem, 6vw, 3.6rem); letter-spacing: 0.01em; margin-bottom: 18px;
}
.d-when { display: flex; flex-wrap: wrap; gap: 8px 28px; align-items: baseline; padding: 12px 0; border-top: 3px dashed var(--ink); border-bottom: 3px dashed var(--ink); }
.d-day { font-family: var(--mono); font-size: 0.8rem; text-transform: uppercase; display: flex; flex-direction: column; }
.d-day b { font-family: var(--display); font-size: 1.9rem; font-weight: 700; line-height: 1.05; color: var(--hot); }
.d-time { font-family: var(--display); font-weight: 600; font-size: 1.9rem; line-height: 1.05; display: flex; flex-direction: column; }
.d-time span { font-family: var(--mono); font-weight: 400; font-size: 0.8rem; text-transform: uppercase; }
.d-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 16px 0 18px; }
.d-facts dt { font-family: var(--mono); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em; color: #4a4336; }
.d-facts dd { font-family: var(--display); font-weight: 600; font-size: 1.25rem; line-height: 1.15; text-transform: uppercase; }
.d-body p { margin-bottom: 12px; font-size: 1.05rem; line-height: 1.55; max-width: 60ch; }
.access { background: var(--paper); border-left: 8px solid var(--ink); padding: 10px 14px; margin-top: 4px; }
.access p { margin-bottom: 0; font-size: 1rem; }
.access .access-label { font-family: var(--mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 4px; }
.fit { font-family: var(--mono); font-size: 0.85rem; margin-top: 14px; padding: 8px 12px; border: 2px solid var(--ink); }
.fit-bad { background: var(--red); color: #fff; }
.fit-warn { background: var(--yellow); }
.fit-ok { background: #d8f0d5; }

.sheet-stub {
  flex: none; min-height: var(--fh);
  background: var(--cc); color: var(--cf);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 18px 30px;
  position: relative;
  transform-origin: 0 0;
  -webkit-mask:
    radial-gradient(circle var(--r) at 0 0, #0000 97%, #000),
    radial-gradient(circle var(--r) at 100% 0, #0000 97%, #000);
  -webkit-mask-composite: source-in;
  mask:
    radial-gradient(circle var(--r) at 0 0, #0000 97%, #000),
    radial-gradient(circle var(--r) at 100% 0, #0000 97%, #000);
  mask-composite: intersect;
}
.sheet-stub::before {
  content: ''; position: absolute; left: 20px; right: 20px; top: 0; border-top: 3px dotted rgba(23, 20, 15, 0.7);
}
@media (prefers-reduced-motion: no-preference) {
  .sheet-stub { transition: transform 0.35s cubic-bezier(0.3, 1.6, 0.5, 1); }
}
.sheet-stub.torn { transform: translate(10px, 12px) rotate(2.2deg); }
.admit { font-family: var(--mono); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.12em; }
.stub-price { font-family: var(--display); font-weight: 700; font-size: 2.6rem; line-height: 1; text-transform: uppercase; }
.save {
  min-height: 56px; padding: 0 20px;
  background: var(--card); color: var(--ink); border: 3px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  font-family: var(--display); font-weight: 700; font-size: 1.25rem; text-transform: uppercase; letter-spacing: 0.04em;
  display: inline-flex; align-items: center; gap: 10px;
}
.save .g { font-size: 1.3rem; display: inline-block; transform: scaleX(-1); }
.save[aria-pressed='true'] { background: var(--yellow); }
.save:focus-visible { outline-color: var(--blue); box-shadow: 4px 4px 0 var(--ink), 0 0 0 6px #fff; }

/* ---------- tablet / mobile ---------- */

@media (max-width: 1080px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .pocket { position: static; max-height: none; }
  .controls { grid-template-columns: 1fr 1fr; }
  .field-search { grid-column: 1 / -1; }
  .field-actions { grid-column: 1 / -1; }
  .pill {
    display: inline-flex; align-items: center; gap: 8px;
    position: fixed; right: 14px; bottom: 14px; z-index: 20;
    min-height: 48px; padding: 0 16px;
    background: var(--ink); color: var(--yellow); border: 2px solid var(--yellow);
    font-family: var(--display); font-weight: 700; font-size: 1.1rem; text-transform: uppercase; letter-spacing: 0.05em;
    text-decoration: none; box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.5);
  }
  .pill span { font-family: var(--mono); font-weight: 400; font-size: 0.85rem; background: var(--yellow); color: var(--ink); min-width: 24px; height: 24px; padding: 0 6px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; }
}

@media (max-width: 640px) {
  .masthead { padding: 20px 16px 46px; }
  .masthead-inner { grid-template-columns: 1fr; gap: 14px; }
  .wordmark { font-size: 5.6rem; }
  main { padding: 0 14px; }
  .foot { padding-left: 14px; padding-right: 14px; }
  .controls { grid-template-columns: 1fr; padding: 14px; box-shadow: 4px 4px 0 var(--ink); }
  .field-day, .field-actions { grid-column: auto; }
  .seg { width: 100%; }
  .seg label { flex: 1; }
  .seg span { justify-content: center; padding: 0; }
  .field-actions .btn { flex: 1 1 100%; justify-content: center; }
  .section-head h2 { font-size: 1.6rem; }
  .day-name { font-size: 1.9rem; }
  .day-date { font-size: 1.2rem; }
  .slot { margin: 0 -4px 22px; }

  .ticket { --sw: 92px; --r: 9px; }
  .ticket-main { padding: 14px 12px 14px 22px; }
  .t { font-size: 1.45rem; }
  .sum { font-size: 0.9rem; }
  .pr { font-size: 1.9rem; }
  .ticket-side { padding: 12px 6px; }
  .stamp { font-size: 0.78rem; padding: 2px 5px; }
  .stub { filter: drop-shadow(3px 4px 0 var(--ink)); }

  dialog#detail { width: 100vw; --fh: 150px; }
  dialog#detail[open] { height: 100dvh; max-height: none; filter: none; }
  .sheet-top { padding: 16px 18px 22px; }
  .d-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .d-time, .d-day b { font-size: 1.6rem; }
  .sheet-stub { flex-wrap: wrap; padding: 16px 18px 20px; gap: 10px; }
  .stub-price { font-size: 2rem; }
  .save { width: 100%; justify-content: center; }
  .sheet-top, .sheet-stub { -webkit-mask: none; mask: none; }
}

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