:root { color-scheme: light; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; --accent: #2563eb; --accent-dark: #1d4ed8; --ink: #17212b; --muted: #63707d; --line: #dce4ea; --page: #f3f6f8; --surface: #fff; --danger: #a12525; --radius: 14px; }
    * { box-sizing: border-box; }
    body { margin: 0; background: var(--page); color: var(--ink); }
    button, input { font: inherit; }
    button { cursor: pointer; }
    button:disabled { cursor: not-allowed; opacity: .55; }
    a { color: var(--accent-dark); }
    .checkout-app { width: min(1120px, calc(100% - 2rem)); margin: 2rem auto 4rem; }
    .bytehiker-branding { margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .8rem; line-height: 1.5; text-align: center; overflow-wrap: anywhere; }
    .bytehiker-branding a { color: var(--accent-dark); text-decoration: underline; }
    .event-header { position: relative; isolation: isolate; overflow: hidden; min-height: 190px; display: flex; align-items: flex-end; padding: 2rem; border-radius: var(--radius); color: white; background: #1e3a5f; }
    .event-header::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(15, 23, 42, .88), rgba(15, 23, 42, .42)); }
    .event-cover-image { position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%; object-fit: cover; }
    .event-header-content { min-width: 0; }
    .organizer { display: flex; align-items: center; gap: .7rem; margin-bottom: 1.2rem; font-size: .92rem; }
    .organizer img { width: 42px; height: 42px; border-radius: 8px; object-fit: contain; background: white; padding: .2rem; }
    h1, h2, h3, p { margin-top: 0; }
    h1 { margin-bottom: .5rem; font-size: clamp(1.6rem, 3vw, 2.3rem); line-height: 1.1; overflow-wrap: anywhere; }
    h2 { font-size: 1.25rem; margin-bottom: 1.25rem; }
    h3 { font-size: 1rem; line-height: 1.35; margin-bottom: .35rem; overflow-wrap: anywhere; }
    .muted { color: var(--muted); }
    .event-header .event-subtitle { margin-bottom: 0; color: rgba(255, 255, 255, .88); }
    .event-meta { margin: 0 0 .3rem; color: rgba(255, 255, 255, .8); font-size: .92rem; }
    .status { min-height: 1.5rem; margin: .8rem 0; }
    .status.error { color: var(--danger); }
    .status.success { color: #166534; }
    .steps { display: flex; gap: .65rem; align-items: center; margin: 1.5rem 0; color: var(--muted); }
    .step { display: inline-flex; align-items: center; gap: .45rem; border: 0; padding: .35rem 0; color: inherit; background: transparent; }
    .step[aria-current="step"] { color: var(--ink); font-weight: 700; }
    .step-number { display: grid; place-items: center; width: 1.75rem; height: 1.75rem; border: 1px solid currentColor; border-radius: 50%; font-size: .85rem; }
    .step-divider { flex: 0 1 5rem; height: 1px; background: var(--line); }
    .step-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1.25rem; align-items: start; }
    .panel { min-width: 0; padding: clamp(1rem, 3vw, 1.5rem); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
    .panel > :last-child { margin-bottom: 0; }
    .ticket-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1.25rem; align-items: center; margin: .75rem 0; padding: 1rem; border: 1px solid var(--line); border-radius: 12px; }
    .voucher-toggle { margin: 1rem 0 .25rem; padding: 0; border: 0; background: none; color: var(--accent); font: inherit; text-decoration: underline; cursor: pointer; }
    .voucher-panel { padding: .75rem 1rem; border: 1px solid var(--line); border-radius: 12px; }
    .voucher-unit { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: .5rem 0; }
    .voucher-unit > span { min-width: 10rem; }
    .voucher-unit input { flex: 1 1 13rem; min-width: 0; }
    .voucher-unit button { flex: 0 0 auto; min-width: 7.5rem; }
    .voucher-unit small { color: var(--accent); }
    .ticket-copy p { margin-bottom: .4rem; }
    .ticket-price { margin: .5rem 0 0; font-weight: 750; white-space: nowrap; }
    .ticket-original-price { margin-right: .35rem; color: var(--muted); font-size: .9em; font-weight: 500; }
    .ticket-discounted-total { margin: .35rem 0 0; color: var(--accent-dark); font-size: .88rem; }
    .tax-note { font-size: .84rem; color: var(--muted); }
    .quantity { display: inline-flex; align-items: center; gap: .45rem; }
    .quantity button { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: #f7f9fb; font-size: 1.25rem; }
    .quantity-value { min-width: 2rem; text-align: center; font-weight: 700; }
    .summary-panel { position: sticky; top: 1rem; }
    .summary-item { padding: .8rem 0; border-bottom: 1px solid var(--line); }
    .summary-item-title { margin-bottom: .25rem; font-weight: 650; overflow-wrap: anywhere; }
    .summary-item-meta { display: flex; justify-content: space-between; gap: 1rem; color: var(--muted); font-size: .9rem; }
    .summary-row { display: flex; justify-content: space-between; gap: 1rem; margin-top: .75rem; }
    .summary-row span:first-child { overflow-wrap: anywhere; }
    .summary-voucher-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(8rem, max-content); align-items: baseline; gap: .15rem .5rem; }
    .summary-voucher-title { grid-column: 1 / -1; white-space: nowrap; }
    .summary-voucher-code { grid-column: 1; min-width: 0; overflow-x: auto; color: var(--muted); font-size: .7rem; letter-spacing: -.01em; white-space: nowrap; }
    .summary-voucher-amount { grid-column: 2; min-width: 8rem; text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
    .summary-total { margin-top: 1rem; padding-top: 1rem; border-top: 2px solid var(--ink); font-size: 1.15rem; font-weight: 750; }
    .tax-lines { color: var(--muted); font-size: .9rem; }
    .form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
    .field { min-width: 0; }
    .field.full { grid-column: 1 / -1; }
    label { display: block; margin-bottom: .4rem; font-weight: 650; }
    .optional-label { color: var(--muted); font-size: calc(1em - 2px); font-weight: 400; }
    input[type="text"], input[type="email"], input[type="tel"] { width: 100%; min-height: 46px; border: 1px solid #b9c6d0; border-radius: 9px; padding: .65rem .75rem; color: var(--ink); background: white; }
    input:focus, button:focus-visible, a:focus-visible { outline: 3px solid rgba(37, 99, 235, .28); outline-offset: 2px; }
    input[aria-invalid="true"] { border-color: var(--danger); }
    .checkbox-row { display: flex; align-items: flex-start; gap: .7rem; margin: 1.25rem 0; padding: .9rem; border: 1px solid var(--line); border-radius: 10px; }
    .checkbox-row.legal-consent-error { animation: legal-consent-border-attention 1s ease forwards; }
    @keyframes legal-consent-border-attention {
      0%, 49% { border-color: var(--line); }
      50%, 100% { border-color: var(--danger); }
    }
    .checkbox-row input { width: 20px; height: 20px; margin: .1rem 0 0; accent-color: var(--accent); flex: 0 0 auto; }
    .checkbox-row label { margin: 0; font-weight: 500; }
    .legal-consent-copy { min-width: 0; }
    .checkbox-row .legal-consent-label { font-size: calc(1em - 1px); font-weight: 400; }
    .legal-consent-links { margin: .4rem 0 0 calc(20px + .7rem); font-size: calc(1em - 2px); font-weight: 400; overflow-wrap: anywhere; }
    .legal-confirmation a { color: var(--accent-dark); text-decoration: underline; }
    .help-text { display: block; margin: .35rem 0 0; color: var(--muted); font-size: .9rem; font-weight: 400; }
    .error-text { min-height: 1.25rem; margin: .75rem 0 0; color: var(--danger); }
    .step-actions { display: flex; justify-content: space-between; gap: .75rem; margin-top: 1.5rem; }
    .button { min-height: 46px; border: 1px solid var(--line); border-radius: 9px; padding: .7rem 1rem; color: var(--ink); background: white; font-weight: 700; }
    .button.primary { border-color: var(--accent); color: white; background: var(--accent); }
    .button.primary:hover { background: var(--accent-dark); }
    .payment-intro { margin-bottom: 1.25rem; }
    .payment-method-selector { min-width: 0; margin: 0; padding: 0; border: 0; }
    .payment-method-options { display: grid; gap: .65rem; margin-bottom: .9rem; }
    .payment-method-choice { display: flex; align-items: center; gap: .85rem; min-height: 56px; margin: 0; padding: .9rem 1rem; border: 1px solid var(--line); border-radius: 12px; cursor: pointer; background: white; transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease; }
    .payment-method-choice:hover { border-color: #93b4f5; }
    .payment-method-choice:has(input:checked) { border-color: var(--accent); background: #eff6ff; box-shadow: 0 0 0 1px var(--accent); }
    .payment-method-choice:focus-within { outline: 3px solid rgba(37, 99, 235, .2); outline-offset: 2px; }
    .payment-method-choice:has(input:disabled) { cursor: default; }
    .payment-method-choice input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); flex: 0 0 auto; }
    .payment-method-brand-wrap { display: grid; place-items: center; width: 58px; min-width: 58px; height: 38px; }
    .payment-method-brand { display: block; width: 42px; height: 30px; }
    .paypal-brand { width: auto; height: auto; color: #003087; font-size: .93rem; font-style: italic; font-weight: 800; letter-spacing: -.05em; }
    .card-brand { fill: none; stroke: #425466; stroke-width: 1.6; }
    .payment-method-copy { flex: 1; min-width: 0; font-weight: 400; line-height: 1.3; overflow-wrap: anywhere; }
    .payment-method-icons { --payment-mark-height: 25px; display: flex; flex-wrap: nowrap; align-items: center; gap: .25rem; margin-inline-start: auto; flex-shrink: 0; }
    .payment-method-icons img { display: block; width: 40px; height: 25px; object-fit: contain; }
    .payment-provider-option, .stripe-provider-option { min-width: 0; margin-top: .8rem; padding: 1rem; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
    .payment-provider-heading { margin-bottom: .65rem; }
    .payment-provider-heading h4 { margin: 0 0 .25rem; font-size: 1rem; }
    .payment-provider-heading p { margin: 0; font-size: .9rem; }
    .payment-provider-action { display: grid; gap: .75rem; margin-top: 1rem; }
    .payment-provider-action .payment-provider-option { margin-top: 0; }
    #paypal-button { min-height: 46px; margin-top: .25rem; }
    .stripe-payment-form { min-width: 0; margin: .85rem 0 1rem; }
    .payment-method-choice.payment-method-expanded:has(input:checked) { border-bottom: 0; border-radius: 12px 12px 0 0; box-shadow: none; }
    .stripe-payment-form.payment-method-inline-form { margin: -.65rem 0 0; padding: 0 1rem 1rem; border: 1px solid var(--accent); border-top: 0; border-radius: 0 0 12px 12px; background: #eff6ff; }
    #payment-panel > .step-actions { margin-top: .75rem; }
    #payment-error:empty { display: none; }
    .stripe-payment-element { min-width: 0; }
    .stripe-express-action { min-width: 0; min-height: 48px; }
    .stripe-express-action [id^="stripe-express-active-"] { min-width: 0; }
    .payment-loading { margin: .5rem 0; }
    .payment-method-retry { margin-top: .6rem; color: var(--danger); }
    .payment-method-retry .button { margin-left: .4rem; }
    .legal-confirmation { margin-top: 1.25rem; padding: .9rem; border: 1px solid var(--line); border-radius: 10px; }
    .legal-confirmation .checkbox-row { margin: 0; padding: 0; border-color: transparent; border-radius: 4px; }
    .legal-confirmation #legal-consent-row { margin: -.4rem -.4rem 0; padding: .4rem; border-radius: 7px; }
    .legal-confirmation label { min-width: 0; min-height: 44px; cursor: pointer; }
    .stripe-provider-option { display: grid; gap: .75rem; }
    .stripe-provider-option h3 { margin-bottom: .5rem; }
    .stripe-express-section { min-width: 0; padding-bottom: .85rem; border-bottom: 1px solid var(--line); }
    .stripe-wallet-options { min-height: 48px; }
    .stripe-regular-section { min-width: 0; }
    .stripe-payment-element { min-width: 0; }
    .stripe-wallet-options { min-width: 0; margin: 0 0 .25rem; padding: .25rem 0; }
    .payment-loading { min-height: 1.25rem; margin: 0; font-size: .9rem; }
    .payment-submit { width: 100%; min-height: 50px; white-space: normal; }
    .payment-security { margin: 1rem 0 0; font-size: .86rem; line-height: 1.45; }
    #stripe-unavailable { margin: 0; }
    .result-heading { display: flex; align-items: flex-start; gap: .8rem; margin-bottom: 1.25rem; }
    .result-heading h2 { margin-bottom: .35rem; }
    .result-heading p { margin-bottom: 0; color: var(--muted); }
    .result-icon { display: grid; place-items: center; flex: 0 0 auto; width: 2rem; height: 2rem; border-radius: 50%; color: white; background: var(--accent); font-weight: 800; }
    .failure-result .result-icon { background: var(--danger); }
    .pending-result .result-icon { color: var(--ink); background: #dbeafe; }
    .confirmation-notice, .registered-participant { margin-top: 1.25rem; padding: 1rem; border: 1px solid var(--line); border-radius: 10px; background: #f8fafc; }
    .confirmation-notice h3, .registered-participant h3 { margin-bottom: .4rem; }
    .confirmation-notice p { margin-bottom: 0; color: var(--muted); overflow-wrap: anywhere; }
    .registered-participant > strong, .registered-participant > span, .registered-participant > small { display: block; }
    .registered-participant > span, .registered-participant > small { margin-top: .25rem; color: var(--muted); }
    .registered-participant h4 { margin: 1rem 0 .45rem; font-size: .9rem; }
    .allocation-chips { display: flex; flex-wrap: wrap; gap: .45rem; }
    .allocation-chip { max-width: 100%; padding: .35rem .55rem; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); background: white; overflow-wrap: anywhere; }
    .result-actions { flex-wrap: wrap; justify-content: flex-start; }
    .legal-links { display: flex; flex-wrap: wrap; gap: .75rem 1.2rem; margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--line); font-size: .9rem; }
    .empty { padding: 1rem; border: 1px dashed var(--line); border-radius: 10px; color: var(--muted); }
    [hidden] { display: none !important; }
    @media (max-width: 760px) {
      .checkout-app { width: min(100% - 1rem, 560px); margin-top: .5rem; }
      .event-header { min-height: 170px; padding: 1.25rem; border-radius: 12px; }
      .steps { justify-content: space-between; gap: .35rem; margin: 1rem 0; }
      .step-divider { flex: 1; }
      .step { font-size: .9rem; }
      .step-number { width: 1.6rem; height: 1.6rem; }
      .step-layout, .form-grid { grid-template-columns: 1fr; }
      .summary-panel { position: static; order: -1; }
      .ticket-card { grid-template-columns: 1fr; gap: .8rem; align-items: start; }
      .ticket-price { white-space: normal; }
      .quantity { justify-content: flex-start; }
      .step-actions { flex-direction: column-reverse; }
      .step-actions .button { width: 100%; }
      .payment-method-choice { min-height: 56px; padding: .85rem; }
      .payment-method-icons img { width: 32px; height: 20px; }
      .payment-method-icons { --payment-mark-height: 20px; }
      .payment-provider-option, .stripe-provider-option { padding: .85rem; }
      .payment-submit { min-height: 50px; }
      .result-actions { flex-direction: column; }
      .field.full { grid-column: auto; }
    }
    @media (max-width: 360px) {
      .checkout-app { width: calc(100% - .75rem); }
      .panel { padding: .85rem; }
      .step { font-size: .78rem; }
      .step-divider { min-width: .4rem; }
      .payment-method-icons img { width: 28px; height: 17.5px; }
      .payment-method-icons { --payment-mark-height: 17.5px; }
    }
    @container (max-width: 600px) {
      .payment-method-icons img { width: 32px; height: 20px; }
      .payment-method-icons { --payment-mark-height: 20px; }
    }
    @container (max-width: 360px) {
      .payment-method-icons img { width: 28px; height: 17.5px; }
      .payment-method-icons { --payment-mark-height: 17.5px; }
    }
    /* Official provider artwork scales by height and keeps its original aspect ratio. */
    .payment-method-icons .payment-method-provider-mark { width: auto; }
    /* Google's unchanged SVG includes clear space: the visible mark is 400 of
       its 742 units high. Match the visible height without cropping that space. */
    .payment-method-icons .payment-method-provider-mark[src$="/google-pay.svg"] { height: calc(var(--payment-mark-height) * 1.855); margin-block: calc(var(--payment-mark-height) * -.4275); }
    /* The transparent derivative includes extra transparent vertical padding.
       Display the original 700:155 strip proportions without stretching logos. */
    .payment-method-icons .payment-method-card-strip { width: calc(var(--payment-mark-height) * 7.2258); height: calc(var(--payment-mark-height) * 1.6); object-fit: cover; margin-block: calc(var(--payment-mark-height) * -.3); }

    .organizer-email-consent { margin: 0; }
    .organizer-email-consent .organizer-email-consent-row { min-height: 44px; align-items: flex-start; }
    .organizer-email-consent-row label { min-height: 44px; font-size: calc(1em - 1px); font-weight: 400; cursor: pointer; }
    .organizer-email-consent .help-text { display: inline; margin: 0; font-size: calc(1em - 1px); line-height: 1.45; }
