/* Ticket pages: buying, and the buyer's tickets. Nunito Sans only. */
:root {
  --bg: #FFFFFF;
  --ink: #0A0A0A;
  --muted: #5C5C5C;
  --line: #E8E8E8;
  --fill: #F4F4F4;
  --brand: #0B1F4F;
  --ok: #067647;
  --danger: #B42318;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
/* Header and footer come from the public site (site.css); the page itself stays in Nunito Sans. */
.footer { margin-top: 24px; }
.tk h1, .tk h2 { font-family: 'Nunito Sans', system-ui, sans-serif; }
.tk-venue-link { display: inline-flex; margin-top: 12px; font-weight: 800; color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
body { font-family: 'Nunito Sans', system-ui, sans-serif; font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
button, input { font: inherit; color: inherit; }

.tk { max-width: 520px; margin: 0 auto; padding: 24px 16px calc(32px + env(safe-area-inset-bottom, 0px)); }
.tk-head { padding-bottom: 18px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.tk-venue { margin: 0; font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.tk-head h1 { margin: 4px 0 6px; font-size: 26px; line-height: 1.2; font-weight: 800; }
.tk-when { margin: 0; font-weight: 700; }
.tk-info { margin: 4px 0 0; color: var(--muted); }
.tk-info b { color: var(--ink); font-weight: 800; font-variant-numeric: tabular-nums; }
.tk-details { margin: 10px 0 0; color: var(--muted); white-space: pre-line; overflow-wrap: anywhere; }
.tk-poster { display: block; width: 100%; max-height: 70vh; object-fit: contain; border-radius: 16px; background: var(--fill); margin-bottom: 18px; }

.tk-types { display: flex; flex-direction: column; gap: 10px; margin-bottom: 22px; }
.tk-type { display: flex; align-items: center; gap: 12px; padding: 14px 14px 14px 16px; border: 1px solid var(--line); border-radius: 12px; }
.tk-type.off { opacity: .55; }
.tk-type .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tk-type strong { font-size: 16px; }
.tk-type small { color: var(--muted); font-size: 13px; }
.tk-type .tk-price { margin-top: 2px; font-size: 17px; font-weight: 800; color: var(--brand); font-variant-numeric: tabular-nums; }
.tk-type small { margin-top: 1px; }
.tk-type .tk-left { color: #B54708; font-weight: 700; white-space: nowrap; }
.tk-step { display: flex; align-items: center; gap: 4px; }
.tk-step button { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: #fff; font-size: 18px; font-weight: 700; cursor: pointer; display: grid; place-items: center; }
.tk-step button:disabled { opacity: .35; cursor: default; }
.tk-step output { min-width: 26px; text-align: center; font-weight: 800; font-size: 16px; }

.tk-form { display: flex; flex-direction: column; gap: 12px; }
.tk-field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 700; }
.tk-field input { min-height: 46px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); font-weight: 400; font-size: 16px; }
.tk-field input:focus { outline: 2px solid var(--ink); outline-offset: 0; border-color: transparent; }
.tk-pay { display: flex; gap: 8px; }
.tk-pay label { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; border: 1px solid var(--line); border-radius: 10px; font-weight: 700; cursor: pointer; }
.tk-pay input { accent-color: var(--brand); }
.tk-pay label:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.tk-consent { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--muted); }
.tk-consent input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--brand); flex: none; }
.tk-consent a { color: var(--ink); }
.tk-btn { min-height: 52px; border: 0; border-radius: 999px; background: var(--brand); color: #fff; font-weight: 800; font-size: 16px; cursor: pointer; }
.tk-btn:disabled { opacity: .4; cursor: default; }
.tk-error { margin: 0; color: var(--danger); font-size: 14px; font-weight: 600; }
.tk-note { margin: 6px 0 0; text-align: center; color: var(--muted); font-size: 12px; }

.tk-list { display: flex; flex-direction: column; gap: 14px; }
.tk-ticket { border: 1px solid var(--line); border-radius: 16px; padding: 18px; text-align: center; position: relative; }
.tk-ticket img { width: 220px; height: 220px; display: block; margin: 8px auto; image-rendering: pixelated; }
.tk-ticket .code { font: 800 18px ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: 3px; margin: 4px 0 0; }
.tk-ticket .type { margin: 0; font-weight: 700; }
.tk-ticket.gone img { opacity: .15; }
.tk-pill { display: inline-block; margin-top: 8px; font-size: 12px; font-weight: 800; padding: 4px 10px; border-radius: 999px; background: var(--fill); color: var(--muted); }
.tk-pill.ok { background: #ECFDF3; color: var(--ok); }
.tk-pill.bad { background: #FEF3F2; color: var(--danger); }
.tk-pill.due { background: #FFF6E5; color: #93370D; }
.tk-due { margin: 0 0 14px; padding: 12px 14px; border-radius: 12px; background: #FFF6E5; color: #93370D; font-weight: 700; text-align: center; }
.tk-reserved { margin: 0 0 14px; padding: 12px 14px; border-radius: 12px; background: var(--fill); color: var(--ink); font-weight: 700; text-align: center; }
.tk-wait { display: flex; align-items: center; gap: 10px; justify-content: center; color: var(--muted); }

.tk-state { min-height: 60vh; display: grid; place-items: center; text-align: center; }
.spin { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--ink); animation: spin .8s linear infinite; display: inline-block; }
.spin.sm { width: 18px; height: 18px; border-width: 2px; }
@keyframes spin { to { transform: rotate(360deg); } }

.tk-sheet { width: min(480px, 100vw); height: min(760px, 100dvh); max-width: 100vw; max-height: 100dvh; padding: 0; border: 0; border-radius: 16px; overflow: hidden; }
.tk-sheet::backdrop { background: rgba(0,0,0,.45); }
.tk-sheet iframe { width: 100%; height: 100%; border: 0; display: block; }
.tk-close { position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--fill); display: grid; place-items: center; cursor: pointer; z-index: 1; }
@media (max-width: 520px) { .tk-sheet { border-radius: 0; } }

@media print {
  .tk-ticket { break-inside: avoid; }
  .tk-note, .tk-pill.due { background: #FFF6E5; color: #93370D; }
.tk-due { margin: 0 0 14px; padding: 12px 14px; border-radius: 12px; background: #FFF6E5; color: #93370D; font-weight: 700; text-align: center; }
.tk-wait { display: none; }
}

/* Venues near an organiser's event: small cards that scroll sideways. */
.tk-near { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); }
.tk-near h2 { margin: 0; font-size: 19px; font-weight: 900; }
.tk-near .tk-note { margin: 2px 0 12px; text-align: left; }
.tk-near-list { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 16px; padding-bottom: 6px; margin: 0 -16px; padding-inline: 16px; scrollbar-width: none; }
.tk-near-list::-webkit-scrollbar { display: none; }
.tk-near-card { flex: none; width: 150px; scroll-snap-align: start; display: flex; flex-direction: column; gap: 2px; color: inherit; text-decoration: none; }
.tk-near-ph { display: grid; place-items: center; aspect-ratio: 4 / 3; border-radius: 12px; background: var(--line) center / cover no-repeat; font-size: 28px; font-weight: 900; color: var(--muted); margin-bottom: 6px; }
/* Only the logo (no photo): shown whole, centred, never cut. */
.tk-near-ph.is-logo { background-size: contain; background-origin: content-box; padding: 10px; }
.tk-near-card b { font-size: 15px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-near-card small { color: var(--muted); font-size: 13px; }
