/* LEDdays 2027 – Tickets, Bestellung, Bestellstatus, Widerruf.
   Design „C – Hell mit Bühne“ (Design-Varianten/designsystem-C.md 8.6, 9.5, 10.5): Ticketbestellung als Konfigurator nach LEDBRIX
   (weiße Karten auf Stein, Chips, Options-Zeile, Summenblock, Türkis-Knopf), Ticket mit Abriss (4.15) statt Lila-Pass.
   Nur Tokens und Bausteine aus site.css (.cfg, .cfg-row, .chip, .sum, .badge, .sq-list, .ticket). Kein Punkteraster, kein Leuchten,
   keine Dauer-Animation außer dem Lade-Kreisel (tk-spin) beim Warten auf die Zahlung. */

/* ---------- Auf einen Blick (Faktenkarten, Lila-Kante 3 px) ---------- */
.tk-glance { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
.tk-fact { position: relative; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-l); padding: 20px 22px 22px; min-width: 0; }
.tk-fact::before { content: ""; position: absolute; left: -1px; top: 20px; width: 3px; height: 24px; border-radius: 0 3px 3px 0; background: var(--lila); }
.tk-fact h3 { margin: 2px 0 12px; font-size: .75rem; font-weight: 600; line-height: 1.35; letter-spacing: var(--tr-caps); text-transform: uppercase; color: var(--ink-2); }
.tk-fact p { margin: 0 0 .9em; font-size: var(--fs-sm); color: var(--ink-2); }
.tk-fact .more { font-size: var(--fs-sm); }
/* Tagesliste als Konfigurator-Zeilen: Tag links, Uhrzeit rechts fett */
.tk-days { margin: 0; }
.tk-days .cfg-row:first-child { padding-top: 0; }
.tk-days .cfg-row:last-child { border-bottom: 0; padding-bottom: 0; }
.tk-days dt { color: var(--ink-2); }
.tk-days dd { white-space: nowrap; }

/* ---------- Bestellbereich (Stein, links Formular, rechts Ticket + Summe, sticky) ---------- */
.tk-layout { display: grid; gap: clamp(28px, 4vw, 56px); grid-template-columns: minmax(0, 1fr) minmax(290px, 360px); align-items: start; }
.tk-main { min-width: 0; }
.tk-main > h2 { margin-bottom: .35em; }
.tk-aside { position: sticky; top: 88px; display: grid; gap: 16px; min-width: 0; }
@media (max-width: 960px) {
  .tk-layout { grid-template-columns: minmax(0, 1fr); }
  .tk-aside { position: static; order: -1; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); align-items: start; }
  .tk-aside .tk-sum { display: none; }          /* Handy/Tablet: die Summe steht kompakt direkt über dem Knopf */
}
.tk-h1 { font-size: clamp(1.9rem, 1.3rem + 2.2vw, 2.75rem); }

/* Schrittanzeige: aktuell Lila-Pille mit Nummer, erledigt Lila-Rand, offen leise */
.tk-steps { list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 26px; margin: 0 0 24px; padding: 0; font-size: var(--fs-s); font-weight: 600; line-height: 1.2; }
.tk-steps li { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 4px 14px 4px 4px; border: 1.5px solid var(--line-2); border-radius: var(--r-pill); color: var(--muted); }
.tk-steps li + li::before { content: ""; position: absolute; left: -21px; top: 50%; width: 16px; height: 1.5px; background: var(--line-2); }
.tk-step-no { display: inline-grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--stone-2); color: var(--ink-2);
  font-size: .78rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.tk-steps .is-current { background: var(--grad-lila); background-origin: border-box; border-color: transparent; color: #fff; }
.tk-steps .is-current .tk-step-no { background: #fff; color: var(--lila-deep); }
.tk-steps .is-done { border-color: var(--lila); color: var(--lila-deep); }
.tk-steps .is-done .tk-step-no { background: var(--lila-tint); color: var(--lila-deep); }
.tk-steps .is-done + li::before, .tk-steps .is-current + li::before { background: var(--lila); }
@media (max-width: 560px) {
  /* schmal: nur der aktuelle Schritt mit Text, die anderen als Nummer (Text bleibt für Screenreader) */
  .tk-steps { gap: 8px 22px; }
  .tk-steps li:not(.is-current) { padding: 4px; }
  .tk-steps li:not(.is-current) .tk-step-t { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .tk-steps li + li::before { left: -18px; width: 14px; }
}

/* Formular: Gruppen als weiße Karten (Radius 16) auf Stein */
.tk-form { margin-top: 18px; }
.tk-form .form-grid { align-items: start; }
.tk-form .field, .tk-confirm .field, .tk-wd-fn .field { align-content: start; }
.tk-block { margin-top: 14px; padding: clamp(18px, 2.4vw, 28px); background: var(--paper); border-radius: var(--r-l); }
.tk-block:first-of-type { margin-top: 0; }
.tk-block > h3 { font-size: 1.1rem; margin-bottom: .3em; }
.tk-block > :last-child { margin-bottom: 0; }
.tk-block .check span { font-size: var(--fs-sm); }

/* Anzahl: Chips 1–10 als Radiogruppe (LEDBRIX), aktiv Lila-Verlauf */
.tk-qty { display: block; min-width: 0; margin: 0 0 18px; padding: 0; border: 0; }
.tk-qty[hidden], .tk-scarce[hidden] { display: none; }
/* Hinweis bei gültigem Einladungscode (Jacek 13.11.2026: „extra fett drauf hinweisen“) – dunkel wie der Kopf des Mail-Banners, türkise Kachel */
.tk-scarce { display: flex; align-items: center; gap: .6em; margin: 0 0 14px; padding: .75em 1em; border-radius: var(--r-m); background: var(--ink); color: #fff; font-weight: 800; line-height: 1.3; }
.tk-scarce::before { content: ""; flex: 0 0 auto; width: .7em; height: .7em; border-radius: 2px; background: var(--teal); }
.tk-qty legend { padding: 0; margin: 0 0 10px; font-size: var(--fs-label); font-weight: 600; letter-spacing: var(--tr-label); color: var(--ink); }
.tk-qty legend .req { color: var(--lila); }
.tk-qty .chip { justify-content: center; min-width: 42px; min-height: 40px; padding: .5em .7em; font-size: .95rem; font-variant-numeric: tabular-nums; }   /* 10 Chips passen ab ~480 px Kartenbreite in eine Zeile */
.tk-qty .error-text { display: block; margin-top: 8px; }
.tk-qty.has-error .chip { border-color: var(--bad); }
/* mit Einladungscode gesperrte Anzahl (ein Ticket je Bestellung, CODE_MAX_PER_ORDER) */
.tk-qty input:disabled + .chip { opacity: .35; cursor: not-allowed; }
.tk-holder .tk-holder-mail { grid-column: 1 / -1; }

/* Einladungscode: Feld in Großbuchstaben, Status als Badge */
.tk-code { max-width: 520px; }
.tk-code input { text-transform: uppercase; letter-spacing: .06em; font-variant-numeric: tabular-nums; }
.tk-code input::placeholder { text-transform: none; letter-spacing: var(--tr-body); }
.tk-code-status { justify-self: start; min-width: 0; }
.tk-code-status .badge { white-space: normal; border-radius: var(--r-m); padding: .45em .85em; font-size: var(--fs-s); line-height: 1.4; }

/* Ticketinhaber: Kacheln (Radius 12, Haarlinie), Nummer als Lila-Badge; Legende steht in der Kachel */
.tk-holders { display: grid; gap: 10px; margin-top: 14px; }
.tk-holder { min-width: 0; margin: 0; padding: 14px 16px 16px; border: 1px solid var(--hairline); border-radius: var(--r-m); background: var(--paper); }
.tk-holder .form-grid { row-gap: 12px; }
.tk-holder .field { margin-bottom: 0; }
.tk-holder legend { float: left; width: 100%; display: flex; align-items: center; gap: 8px; margin: 0 0 10px; padding: 0; font-size: .95rem; font-weight: 700; color: var(--ink); }
.tk-holder legend + * { clear: both; }
.tk-holder-no { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 6px; border-radius: var(--r-pill); background: var(--lila-tint);
  color: var(--lila-deep); font-size: .75rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.tk-grid-3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); }

/* Rechnungsadresse: Options-Zeile (details.acc) mit Badge „OPTIONAL“ */
.tk-addr { margin-top: 4px; }
.tk-addr .acc-body .field:last-child { margin-bottom: 0; }
.tk-grid-zip { grid-template-columns: minmax(0, 120px) minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 620px) { .tk-grid-zip { grid-template-columns: minmax(0, 1fr); } }

/* Abschluss des Formulars: Knopf + Hinweis; am Handy kompakter Summenblock darüber (10.5) */
.tk-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: 20px; }
.tk-form .tk-inline-total { display: none; }
.tk-btn-big { min-height: 48px; }
@media (max-width: 960px) {
  .tk-form .tk-actions { display: grid; gap: 12px; padding: clamp(18px, 4vw, 24px); background: var(--paper); border-radius: var(--r-l); box-shadow: var(--sh-2); }
  .tk-form .tk-inline-total { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 2px 12px; margin: 0; padding: 0; border: 0; }
  .tk-inline-total .sum-k, .tk-inline-total .sum-note { grid-column: 1; }
  .tk-inline-total .sum-v { grid-column: 2; grid-row: 1 / span 2; font-size: 1.75rem; }
  .tk-form .tk-actions .btn { width: 100%; }
}
@media (max-width: 520px) { .tk-btn-big { width: 100%; white-space: normal; text-align: center; line-height: 1.25; } }
.tk-errsum ul { margin: .5em 0 0; padding-left: 1.2em; }
.tk-errsum a { color: inherit; }
.tk-errsum:focus { outline: 3px solid var(--bad); outline-offset: 3px; }
.tk-closed { margin-top: 12px; }

/* ---------- Ticket mit Abriss, hochkant (Seitenleiste) ---------- */
/* Basis .ticket/.t-main/.t-stub/.t-k/.t-p/.t-s in site.css; hier gestapelt: Abriss unten, Kerben links und rechts auf der Perforation */
/* Übersicht der Bestellung: Merch-Auswahl als eigene Zeile unter dem Ticket (volle Breite statt schmaler Namensspalte) */
.tk-table .tk-merch-tr td { border-top: 0; padding-top: 0; }
.tk-merch-line { color: var(--ink-2); }
/* Merch-Fenster auf der Bestellseite: Hinweis über der Ticketliste, je Ticket ein Knopf */
.tk-merch-box { margin: 18px 0 10px; padding: 14px 16px; border-radius: 14px; background: var(--lila-tint, #F2ECFA); text-align: left; }
.tk-merch-box .h3 { margin: 0 0 4px; }
.tk-merch-box p { margin: 0; }
.tk-tcard-merch { grid-column: 1 / -1; margin: 0; padding-top: 10px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
/* Ticket-Seite zum QR-Code des PDF-Tickets (routes/29-ticket-link.js) */
.tl-card { max-width: 320px; margin: 20px auto 22px; padding: 16px 16px 12px; background: #fff; border: 1px solid var(--line-2); border-radius: 20px; text-align: center; }
.tl-qr svg { display: block; width: 100%; height: auto; }
.tl-code { margin: 8px 0 2px; font-weight: 700; letter-spacing: .08em; font-variant-numeric: tabular-nums; }
.tl-facts { display: grid; gap: 8px; margin: 0 0 22px; }
.tl-facts > div { display: grid; grid-template-columns: minmax(72px, 24%) 1fr; gap: 10px; padding: 10px 14px; border-radius: 12px; background: var(--stone); }
.tl-facts dt { font-weight: 700; color: var(--ink-2); }
.tl-facts dd { margin: 0; }
.tl-wallet { margin: 0 0 20px; }
.tk-ticket { grid-template-columns: minmax(0, 1fr); }
.tk-ticket::before, .tk-ticket::after { display: none; }
.tk-ticket .t-main { padding: clamp(20px, 2.2vw, 26px); }
.tk-ticket-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 12px; }
.tk-ticket-days { font-size: .75rem; font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tk-ticket .t-main .t-p { margin: 14px 0 8px; white-space: nowrap; }
.tk-pass-list { margin-top: 16px; gap: 7px; font-size: var(--fs-sm); line-height: 1.4; }
.tk-pass-list li { padding-left: 19px; }
.tk-pass-list li::before { top: .45em; }
.tk-ticket .t-stub { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 18px clamp(20px, 2.2vw, 26px) 20px; border-left: 0; border-top: 2px dashed var(--line-2); }
.tk-ticket .t-stub::before, .tk-ticket .t-stub::after { content: ""; position: absolute; top: -14px; width: 26px; height: 26px; border-radius: 50%; background: var(--notch); }
.tk-ticket .t-stub::before { left: -13px; }
.tk-ticket .t-stub::after { right: -13px; }
.tk-ticket .t-stub .t-s { margin-top: 4px; }
.tk-ticket .t-stub .t-p { flex: none; margin: 0; font-size: clamp(2rem, 1.5rem + 1.2vw, 2.6rem); color: var(--teal-ink); white-space: nowrap; }   /* Türkis-Ink auf Türkis-Tönung 5,5:1 */

/* ---------- Summenblock (Konfigurator-Karte) und Zahlung ---------- */
.tk-sum-h { margin: 0 0 6px; }
.tk-sum-list { margin: 0; }
.tk-sum-list .cfg-row dd { white-space: nowrap; }
.tk-sum .sum { margin-top: 4px; padding-top: 14px; border-top: 0; }
.tk-sum .sum-v { font-size: clamp(2rem, 1.5rem + 1.1vw, 2.5rem); }
.tk-sum .btn { margin-top: 14px; }
.tk-sum-after { margin-top: 4px; line-height: 1.45; }
.tk-paybox { padding: 2px 4px 0; }
.tk-paybox p { color: var(--ink-2); }

/* ---------- Übersicht (Schritt 2) ---------- */
.tk-review .lead { margin-bottom: 1em; }
.tk-review-card { margin-top: 18px; }
.tk-dl { margin: 0; display: grid; }
.tk-dl > div { display: grid; grid-template-columns: minmax(0, 150px) minmax(0, 1fr); gap: 4px 18px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.tk-dl > div:first-child { padding-top: 0; }
.tk-dl dt { padding-top: 3px; font-size: .72rem; font-weight: 600; letter-spacing: var(--tr-caps); text-transform: uppercase; color: var(--ink-2); }
.tk-dl dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 560px) { .tk-dl > div { grid-template-columns: minmax(0, 1fr); } }
.tk-table { margin: 18px 0 12px; }
.tk-table td:first-child { width: 3.5em; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.tk-table .badge { margin-right: 6px; }
.tk-codeline { color: var(--ok); font-weight: 600; }
.tk-total { margin-top: 16px; }
.tk-review-meta { margin-top: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.tk-review-meta .card { padding: clamp(18px, 2.2vw, 24px); }
@media (max-width: 960px) { .tk-layout-review .tk-aside { display: none; } }
@media (max-width: 560px) { .tk-table th, .tk-table td { padding: 10px; } .tk-table td:first-child { width: 2.2em; } }
.tk-confirm { margin-top: 18px; }
.tk-confirm .check a { font-weight: 600; }
.tk-buy { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 20px; margin-top: 10px; padding-top: 18px; border-top: 1px solid var(--line); }
.tk-buy-sum { display: grid; gap: 4px; }
.tk-buy-sum .sum-v { font-size: clamp(1.75rem, 1.3rem + 1.2vw, 2.25rem); }

/* ---------- Bestellstatus ---------- */
.tk-orderpage .tk-steps { margin-bottom: 28px; }
.tk-state { position: relative; }
.tk-state .lead { margin-bottom: 1.1em; }
.tk-dl-row { margin: 6px 0 12px; }
.tk-spinner { width: 46px; height: 46px; margin-bottom: 22px; border-radius: 50%; border: 3px solid var(--line-2); border-top-color: var(--lila); animation: tk-spin .9s linear infinite; }
@keyframes tk-spin { to { transform: rotate(360deg); } }
/* Status-Icons: Tönung + Rand in Statusfarbe, ohne Schein */
.tk-check, .tk-cross { position: relative; width: 52px; height: 52px; margin-bottom: 20px; border-radius: 50%; }
.tk-check { background: var(--ok-tint); border: 2px solid var(--ok); }
.tk-check::after { content: ""; position: absolute; left: 17px; top: 10px; width: 12px; height: 22px; border: solid var(--ok); border-width: 0 3px 3px 0; transform: rotate(45deg); }
.tk-cross { background: var(--bad-tint); border: 2px solid var(--bad); }
.tk-cross::before, .tk-cross::after { content: ""; position: absolute; left: 50%; top: 50%; width: 22px; height: 3px; border-radius: 2px; background: var(--bad); transform: translate(-50%, -50%) rotate(45deg); }
.tk-cross::after { transform: translate(-50%, -50%) rotate(-45deg); }
.tk-sub { font-size: 1.5rem; margin-top: 2em; }
/* Ticket-Karten: weiß, QR auf Weiß */
.tk-tcards { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.tk-tcard { display: grid; grid-template-columns: 116px minmax(0, 1fr); gap: 16px; align-items: center; padding: 14px; background: var(--paper);
  border: 1px solid var(--line); border-radius: var(--r-l); box-shadow: var(--sh-1); }
.tk-tcard-qr { background: #fff; border: 1px solid var(--line); border-radius: var(--r-m); padding: 6px; line-height: 0; }
.tk-tcard-qr svg { width: 100%; height: auto; }
.tk-tcard-body { display: grid; gap: 2px; min-width: 0; }
.tk-tcard-no { font-size: .72rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--teal-ink); }
.tk-tcard-name { font-size: 1.08rem; overflow-wrap: anywhere; }
.tk-tcard-code { margin-top: 6px; font: 600 .82rem/1.3 var(--font); letter-spacing: .08em; color: var(--ink-2); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
@media (max-width: 400px) { .tk-tcard { grid-template-columns: 96px minmax(0, 1fr); gap: 12px; } }
/* Handy-Wallet (lib/wallet.js): offizielle Badges unverändert und unverzerrt, 48 px hoch (Google: mindestens 48 dp und nicht
   kleiner als andere Knöpfe), Freiraum mindestens 8 px (Google 8 dp, Apple 0,1 × Höhe). Gleiche Regeln in portal.css. */
.wallet-btns { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.wallet-btn { display: inline-block; line-height: 0; border-radius: 8px; }
.wallet-btn img { display: block; height: 48px; width: auto; max-width: none; }
.tk-tcard .wallet-btns { grid-column: 1 / -1; padding-top: 2px; }
.wallet-all { margin: 4px 0 14px; }
.wallet-all-btn { white-space: normal; }
.tk-tcard-type { display: block; font-weight: 600; color: var(--ink-2); }
/* Einladungsseite LEDTEK Night (pages/invitation.js) */
.inv-grid { display: grid; gap: 24px; grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 920px) { .inv-grid { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); } }
.inv-form { display: grid; gap: 6px; }
.inv-form > .btn, .inv-form .row { justify-self: start; margin-top: 8px; }
.inv-code-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 6px; }
.inv-seats { list-style: none; margin: 0 0 6px; padding: 0; display: grid; gap: 8px; }
.inv-seat { padding: 10px 12px 2px; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--paper); }
.inv-seat-no { display: block; margin-bottom: 4px; font-size: .72rem; font-weight: 600; letter-spacing: var(--tr-caps); text-transform: uppercase; color: var(--ink-2); }
.inv-facts { margin: 0; }
.inv-facts .cfg-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
.inv-facts dd { overflow-wrap: anywhere; text-align: left; font-weight: 600; font-variant-numeric: normal; }
/* Handy: Termin und Bändchen-Hinweis vor dem Formular */
@media (max-width: 919px) { .inv-grid > aside { order: -1; } }
.tk-wallet-hint { margin: 0 0 4px; color: var(--ink-2); }
.tk-wallet-marks { margin-top: 12px; }
@media print { .wallet-btns, .tk-wallet-hint, .tk-wallet-marks { display: none !important; } }
.tk-next { margin-top: 22px; }
.tk-next .tk-days { margin-top: 6px; }
.tk-checklist { margin-top: 18px; color: var(--ink-2); }
.tk-wd-link { margin-top: 18px; }
.tk-wd-link a { color: var(--ink-2); }
.tk-wd-link a:hover { color: var(--lila-deep); }

/* ---------- Widerruf ---------- */
.tk-draft { display: inline-block; margin: 0 0 18px; padding: 10px 16px; border: 2px dashed var(--warn); border-left: 4px solid var(--warn); border-radius: var(--r-s);
  background: var(--warn-tint); color: var(--ink); font-size: var(--fs-sm); font-weight: 600; }
.tk-jump { margin-bottom: 24px; }
.tk-wd-layout { display: grid; gap: clamp(20px, 3vw, 40px); grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 900px) { .tk-wd-layout { grid-template-columns: minmax(0, 1fr); } }
.tk-wd-fn { min-width: 0; }
.tk-wd-fn h2 { font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2rem); }
.tk-wd-side { padding: 6px 0; }
.tk-wd-side .tk-checklist { margin-top: 12px; }
.tk-modelform { padding: clamp(16px, 2.4vw, 26px); background: var(--paper); border: 1px solid var(--line-2); border-radius: var(--r-l); }
.tk-modelform ul { list-style: none; margin: 0 0 1em; padding: 0; }
.tk-modelform li { margin: .7em 0; overflow-wrap: anywhere; }

/* Testzahlung (nur lokal) */
.tk-dev { max-width: 640px; }

@media (prefers-reduced-motion: reduce) { .tk-spinner { animation: none; } }
@media print {
  .tk-modelform, .card, .tk-holder, .tk-tcard { background: #fff !important; color: #000 !important; border-color: #999 !important; box-shadow: none !important; }
  .tk-jump, .tk-wd-fn, .tk-wd-side, .tk-draft, .page-hero { display: none !important; }
  .section.alt { background: #fff; }
}
