#tickets {
  --bg: #F4F1EA; --surface: #FFFFFF; --surface-2: #ECE7DC;
  --ink: #1B1C1E; --ink-muted: #55575B; --rule: #D6D0C3;
  --accent: #C2410C; --accent-text: #B33A0A; --on-accent: #FFFFFF; --focus: #C2410C;
  --ok: #23753A; --warn: #8A5A00; --warn-fill: #E8A100; --alert: #B42323; --paused: #55575B; --hand-ink: #24408E;
  --shadow: 0 1px 0 rgba(0,0,0,.06), 0 6px 18px -10px rgba(0,0,0,.25);
  background: var(--bg);
  color: var(--ink);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) #tickets {
    --bg: #111315; --surface: #1A1D20; --surface-2: #23272B;
    --ink: #ECEAE4; --ink-muted: #A6A8A4; --rule: #2E3337;
    --accent: #FF7A1A; --accent-text: #FF8C3A; --on-accent: #111315; --focus: #FFC233;
    --ok: #51CF66; --warn: #FFC233; --warn-fill: #FFC233; --alert: #FF6B6B; --paused: #A6A8A4; --hand-ink: #A9BEFF;
    --shadow: 0 0 0 1px #2E3337, 0 10px 30px -12px rgba(0,0,0,.6);
  }
}
:root[data-theme="dark"] #tickets {
  --bg: #111315; --surface: #1A1D20; --surface-2: #23272B;
  --ink: #ECEAE4; --ink-muted: #A6A8A4; --rule: #2E3337;
  --accent: #FF7A1A; --accent-text: #FF8C3A; --on-accent: #111315; --focus: #FFC233;
  --ok: #51CF66; --warn: #FFC233; --warn-fill: #FFC233; --alert: #FF6B6B; --paused: #A6A8A4; --hand-ink: #A9BEFF;
  --shadow: 0 0 0 1px #2E3337, 0 10px 30px -12px rgba(0,0,0,.6);
}

.kbd-hint { font-size: var(--step--1); color: var(--ink-muted); margin: 0 0 1.75rem; }
.rail { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.75rem 1.5rem; grid-auto-flow: dense; align-items: start; }
@media (min-width: 700px)  { .rail { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .rail { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.ticket {
  --ink: #1B1C1E; --ink-muted: #55575B; --rule: #D6D0C3;
  --accent-text: #B33A0A; --ok: #23753A; --warn: #8A5A00; --alert: #B42323; --paused: #55575B;
  --focus: #B33A0A; --hand-ink: #24408E;
  position: relative; display: flex; flex-direction: column;
  padding: 1.5rem 1.1rem 1.1rem;
  color: var(--ink);
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='.05'/%3E%3C/svg%3E"),
    #FFFDF7;
  box-shadow: var(--shadow);
  font-family: var(--font-mono); font-size: .88rem; line-height: 1.55;
  -webkit-mask: radial-gradient(circle 6px at 9px 0, transparent 5.5px, #000 6px) top left / 18px 100% repeat-x;
          mask: radial-gradient(circle 6px at 9px 0, transparent 5.5px, #000 6px) top left / 18px 100% repeat-x;
  transition: opacity var(--t-panel) var(--ease);
}
.ticket--wide { grid-column: 1 / -1; padding-top: 1.75rem; }
.rail > .ticket:nth-child(odd)  { rotate: -.6deg; }
.rail > .ticket:nth-child(even) { rotate: .8deg; }
.rail > .ticket[data-state="open"], .rail > .ticket:focus-within { rotate: 0deg; }

.ticket__head { display: flex; justify-content: space-between; align-items: center; gap: .5rem; flex-wrap: wrap; padding-bottom: .6rem; border-bottom: 1px dashed var(--rule); margin-bottom: .9rem; }
.ticket__no { font-weight: 700; font-size: 1rem; }
.badge {
  font-family: var(--font-mono); font-size: .72rem; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase; white-space: nowrap;
  padding: .25em .5em; border-radius: 3px; border: 1px solid currentColor;
}
.badge--warn { color: var(--warn); background: color-mix(in srgb, var(--warn-fill, #E8A100) 16%, transparent); }
.badge--paused { color: var(--paused); }
.badge--neutral { color: var(--ink); }
.badge--shipped { color: var(--ok); background: rgba(35, 117, 58, .1); }
.ticket .badge--warn { background: rgba(232, 161, 0, .16); }

.ticket__brand { display: flex; flex-wrap: wrap; align-items: center; gap: .9rem; margin-bottom: .2rem; }
.ticket__logo { width: 56px; height: 56px; border-radius: 12px; flex: none; }
.ticket__logo--wordmark { width: auto; height: 34px; border-radius: 0; }
.ticket__title { font-family: var(--font-sans); font-size: var(--step-2); font-weight: 800; font-variation-settings: "wdth" 108; margin-bottom: .2rem; }
.ticket__brand .ticket__title { margin: 0; }
.ticket__kicker { color: var(--ink-muted); font-size: .8rem; margin-bottom: .8rem; }
.ticket__problem { font-family: var(--font-sans); font-size: .98rem; }
.ticket__items { list-style: none; margin: 0 0 1rem; padding: .75rem 0 0; border-top: 1px dashed var(--rule); }
.ticket__items li { padding-left: 1.6em; position: relative; margin-bottom: .2rem; }
.ticket__items li::before { content: "1×"; position: absolute; left: 0; font-weight: 700; color: var(--accent-text); }
.ticket__note { font-size: .78rem; color: var(--ink-muted); }

.ticket__more { margin-top: auto; }
.ticket__open {
  display: flex; align-items: center; justify-content: space-between; min-height: 44px;
  padding: .5rem .8rem; cursor: pointer; list-style: none;
  border: 1px solid var(--ink); border-radius: 4px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: .78rem;
}
.ticket__open::-webkit-details-marker { display: none; }
.ticket__open::after { content: "+"; font-size: 1.1rem; line-height: 1; }
.ticket__more[open] > .ticket__open::after { content: "−"; }
.ticket__open:hover { background: rgba(0,0,0,.04); }
.ticket__detail { padding-top: 1rem; font-family: var(--font-sans); font-size: .95rem; }
.ticket__detail .why { border-left: 3px solid var(--accent); padding-left: .75rem; }

.ticket[data-state="open"] { grid-column: 1 / -1; }
.ticket[data-state="open"] .ticket__detail > :not(.gallery, .diagram) { max-width: 72ch; }
.ticket[data-state="bumped"] .ticket__head::after {
  content: "Bumped ✓"; font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ok);
}
.ticket.is-lit { outline: 3px solid var(--accent); outline-offset: 4px; }
::view-transition-group(*) { animation-duration: var(--t-panel); animation-timing-function: var(--ease); }

@media (min-width: 760px) {
  .ticket--wide .ticket__body { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 0 2.5rem; align-items: start; }
}
.ticket--wide .ticket__logo { width: 88px; height: 88px; border-radius: 20px; }
.ticket__lede { font-family: var(--font-sans); font-size: 1.1rem; line-height: 1.5; }
.facts { margin: 0; display: grid; gap: .1rem; border-top: 1px dashed var(--rule); padding-top: .75rem; }
@media (min-width: 760px) { .facts { border-top: 0; border-left: 1px dashed var(--rule); padding: 0 0 0 1.5rem; } }
.facts div { display: flex; align-items: baseline; gap: .75rem; padding: .3rem 0; }
.facts dt { font-family: var(--font-sans); font-weight: 800; font-variation-settings: "wdth" 112; font-size: 1.5rem; min-width: 6.5rem; white-space: nowrap; flex: none; }
.facts dd { margin: 0; color: var(--ink-muted); font-size: .85rem; }
.stamp-86 {
  margin: 0 0 0 .75rem;
  font: 700 1.5rem/1 var(--font-mono); letter-spacing: .08em;
  color: var(--alert); border: 3px double currentColor; border-radius: 4px; padding: .3rem .6rem;
  rotate: -9deg; opacity: .85; pointer-events: none;
}

.gallery { list-style: none; margin: 1rem 0; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.gallery figure { margin: 0; }
.gallery figcaption { font: 400 .75rem/1.4 var(--font-mono); color: var(--ink-muted); margin-top: .4rem; }
.shot { display: block; border: 1px solid var(--rule); background: #fff; cursor: zoom-in; }
.shot img { width: 100%; height: auto; }
.shot:hover { border-color: var(--ink); }

.howto { margin: 0 0 1rem; padding: 0; list-style: none; counter-reset: how; }
.howto li { counter-increment: how; position: relative; padding: 0 0 .6rem 2.2rem; }
.howto li::before { content: counter(how); position: absolute; left: 0; top: .1rem; width: 1.5rem; height: 1.5rem; display: grid; place-items: center; font: 700 .75rem/1 var(--font-mono); border: 1.5px solid var(--ink); border-radius: 50%; }
.diagram { margin: 1rem 0; padding: .75rem; background: #fff; border: 1px solid var(--rule); }
.diagram img { width: 100%; height: auto; }
.diagram figcaption { font: 400 .75rem/1.4 var(--font-mono); color: var(--ink-muted); margin-top: .4rem; }

.order-ticket {
  --surface: #FFFFFF; --bg: #FFFDF7; --accent: #C2410C; --on-accent: #FFFFFF; --warn-fill: #E8A100;
  gap: 1rem; padding: 1.75rem 1.25rem 1.25rem; max-width: 640px; rotate: -.4deg;
}
.order-ticket:focus-within { rotate: 0deg; }
.order-ticket .ticket__head { margin-bottom: 0; }
.order-ticket .btn { justify-self: start; align-self: flex-start; }
.order-ticket select {
  width: 100%; min-height: 44px; padding: .5rem .65rem; font: inherit; font-size: 1rem; color: var(--ink);
  background: var(--surface); border: 1px solid var(--ink-muted); border-radius: var(--radius);
}
.order-ticket .contact__status a { color: var(--accent-text); }

.lightbox {
  width: min(1240px, calc(100% - 1.5rem)); max-height: calc(100% - 1.5rem); padding: 0;
  border: 1px solid var(--rule); background: var(--surface); color: var(--ink);
}
.lightbox::backdrop { background: rgba(10, 11, 12, .8); }
.lightbox__img { display: block; width: 100%; height: auto; max-height: 74vh; object-fit: contain; background: #fff; }
.lightbox__bar { display: flex; align-items: center; gap: .5rem; padding: .6rem; flex-wrap: wrap; }
.lightbox__caption { flex: 1 1 100%; margin: 0 0 .25rem .4rem; font-size: var(--step--1); }
.lightbox__count { margin-right: auto; font: 400 .75rem/1 var(--font-mono); color: var(--ink-muted); }
.lightbox__prev, .lightbox__next { min-width: 44px; }
.lightbox__full { font: 400 .8rem/1 var(--font-mono); color: var(--accent-text); display: inline-flex; align-items: center; min-height: 44px; padding: 0 .5rem; }

@media (prefers-reduced-motion: reduce) {
  .rail > .ticket, .stamp-86, .order-ticket { rotate: 0deg !important; }
}
