/*
 * Shared app stylesheet. Per-tenant colors come in as CSS custom properties
 * (--primary-color / --accent-color) set inline in templates/base.html from
 * request.organization, so this file itself stays tenant-agnostic.
 */

:root {
    --primary-color: #111111;
    --accent-color: #e11d48;
    --bg-color: #ffffff;
    --text-color: #1a1a1a;
    --muted-color: #6b7280;
    --border-color: #e5e7eb;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--text-color);
    background: var(--bg-color);
    line-height: 1.5;
    /* Pairs with the locked viewport meta (templates/base.html): drops the
       double-tap-zoom gesture (and its ~300ms click delay) so taps register
       immediately -- important for the seating editor's on-canvas handles on
       touch. `pan-x pan-y` still allows normal page scrolling. */
    touch-action: pan-x pan-y;
    -webkit-text-size-adjust: 100%;
}

a {
    color: var(--accent-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

.skip-link {
    position: absolute;
    left: -999px;
    top: 0;
    background: #fff;
    color: var(--text-color);
    padding: 0.75rem 1rem;
    z-index: 100;
    border-radius: 0 0 0.375rem 0;
}

.skip-link:focus {
    left: 0;
}

/* -- TEST CHECKOUT (env-gated fake-payment mode) ------------------------ */
/* Deliberately NOT themed with --primary-color/--accent-color: this must
   stay visually unmistakable across every tenant's branding, since it's
   telling the operator/buyer "no real money is moving here". */

.test-mode-banner {
    background: #f59e0b;
    color: #111111;
    font-weight: 800;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.6rem 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 6px solid;
    border-image: repeating-linear-gradient(
        45deg, #111111, #111111 10px, #f59e0b 10px, #f59e0b 20px
    ) 6;
}

.test-mode-banner::before,
.test-mode-banner::after {
    content: "⚠";
    margin: 0 0.5rem;
}

.checkout-item__test-form {
    border: 2px dashed #f59e0b;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-top: 0.75rem;
    background: #fffbeb;
}

.checkout-item__test-form .field {
    margin-bottom: 0.75rem;
}

.checkout-item__test-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.checkout-item__test-form input {
    width: 100%;
    max-width: 24rem;
    padding: 0.5rem 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-family: inherit;
    font-size: 1rem;
}

/* Simulated (Stripe-less) checkout page -- see orders/checkout_stub.html.
   Framed like the test-checkout form so it reads unmistakably as "not a
   real payment", while still laying out like a normal hosted-checkout. */
.checkout-stub {
    max-width: 34rem;
    border: 2px dashed #f59e0b;
    border-radius: 0.5rem;
    padding: 1.25rem;
    background: #fffbeb;
}

.checkout-stub__notice {
    margin-top: 0;
}

.checkout-stub__summary {
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 0;
    margin: 1rem 0;
}

.checkout-stub__form .field {
    margin-bottom: 0.75rem;
}

.checkout-stub__form label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.checkout-stub__form input {
    width: 100%;
    max-width: 24rem;
    padding: 0.5rem 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-family: inherit;
    font-size: 1rem;
}

.checkout-stub__form input:disabled {
    background: #f3f4f6;
    color: var(--muted-color);
}

/* .button.button--test (not just .button--test): matches .button's own
   specificity so this reliably wins regardless of stylesheet source order,
   instead of depending on this block appearing after the .button rule
   below. */
.button.button--test {
    background: #f59e0b;
    color: #111111;
}

.button.button--test:hover {
    opacity: 0.85;
}

/* -- site header / nav ------------------------------------------------- */

.site-header {
    background: var(--primary-color);
    color: #fff;
}

.site-header__inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.site-header__brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #fff;
    font-weight: 700;
    font-size: 1.25rem;
    margin-right: auto;
}

.site-header__brand:hover {
    text-decoration: none;
    opacity: 0.9;
}

.site-header__logo {
    height: 2rem;
    width: auto;
}

.site-header__toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 0.375rem;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    cursor: pointer;
}

.site-header__toggle-bar {
    display: block;
    width: 1.25rem;
    height: 2px;
    background: #fff;
    margin: 0 auto;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.site-nav__link {
    color: #fff;
    font-weight: 600;
    opacity: 0.85;
    background: none;
    border: none;
    font: inherit;
    cursor: pointer;
    padding: 0;
}

.site-nav__link:hover,
.site-nav__link:focus-visible {
    opacity: 1;
    text-decoration: none;
}

.site-nav__link.is-active {
    opacity: 1;
    box-shadow: 0 2px 0 0 currentColor;
    padding-bottom: 0.2rem;
}

.site-nav__cart {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.site-nav__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: var(--accent-color);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
}

.site-nav__account {
    position: relative;
}

.site-nav__account-toggle::after {
    content: " ▾";
}

.site-nav__account-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 0.5rem);
    background: #fff;
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    min-width: 10rem;
    padding: 0.5rem;
    display: flex;
    flex-direction: column;
    z-index: 20;
}

.site-nav__account-menu a,
.site-nav__account-menu button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.5rem 0.6rem;
    border-radius: 0.375rem;
    border: none;
    background: none;
    font: inherit;
    color: var(--text-color);
    cursor: pointer;
}

.site-nav__account-menu a:hover,
.site-nav__account-menu button:hover {
    background: #f3f4f6;
    text-decoration: none;
}

[x-cloak] {
    display: none !important;
}

@media (max-width: 720px) {
    .site-header__toggle {
        display: flex;
    }

    .site-nav {
        display: none;
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
        margin-top: 0.75rem;
        padding-top: 0.75rem;
    }

    .site-nav--open {
        display: flex;
    }

    .site-nav__link,
    .site-nav__account {
        padding: 0.6rem 0;
    }

    .site-nav__account-menu {
        position: static;
        box-shadow: none;
        margin-top: 0.5rem;
        color: var(--text-color);
    }
}

.site-main {
    max-width: 1080px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    min-height: 60vh;
}

.hero h1 {
    margin-top: 0;
    color: var(--primary-color);
}

.hero p {
    color: var(--muted-color);
    max-width: 40em;
}

.site-footer {
    border-top: 1px solid var(--border-color);
    color: var(--muted-color);
    font-size: 0.875rem;
}

.site-footer__inner {
    max-width: 1080px;
    margin: 0 auto;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.site-footer__nav {
    display: flex;
    gap: 1rem;
}

.site-footer__nav a {
    color: var(--muted-color);
}

/* Small deploy stamp -- lets staff confirm which build a device is showing
   (config/version.py). Deliberately quiet: max-width'd inner sits above it. */
.site-footer__version {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 1.5rem 1.25rem;
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
    opacity: 0.7;
}

.button {
    display: inline-block;
    background: var(--accent-color);
    color: #fff;
    padding: 0.6rem 1.25rem;
    border-radius: 0.375rem;
    font-weight: 600;
}

.button:hover {
    text-decoration: none;
    opacity: 0.9;
}

.button[disabled],
.button--disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.button--secondary {
    background: transparent;
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

/* -- messages -------------------------------------------------------- */

.messages {
    list-style: none;
    margin: 0 0 1.5rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.messages__item {
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    border: 1px solid var(--border-color);
    background: #f9fafb;
}

.messages__item--success {
    border-color: #86efac;
    background: #f0fdf4;
    color: #166534;
}

.messages__item--error {
    border-color: #fca5a5;
    background: #fef2f2;
    color: #991b1b;
}

.messages__item--info {
    border-color: #93c5fd;
    background: #eff6ff;
    color: #1e40af;
}

/* -- hero / landing page ------------------------------------------------ */

.hero--landing {
    padding: 3rem 0 2.5rem;
    text-align: center;
    max-width: 46rem;
    margin: 0 auto;
}

.hero__eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent-color);
    margin: 0 0 0.75rem;
}

.hero__headline {
    margin: 0 0 1rem;
    color: var(--primary-color);
    font-size: clamp(2rem, 5vw + 1rem, 3.25rem);
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.hero__lede {
    font-size: 1.15rem;
    color: var(--muted-color);
    margin: 0 auto;
    max-width: 38em;
}

.hero__actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 1.75rem;
}

.hero--landing .button {
    padding: 0.7rem 1.5rem;
}

.hero__note {
    margin-top: 1.25rem;
    font-size: 0.85rem;
    color: var(--muted-color);
}

.landing-section {
    margin-top: 3.5rem;
    padding-top: 3rem;
    border-top: 1px solid var(--border-color);
}

.landing-section__eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent-color);
    margin: 0 0 0.4rem;
}

.landing-section__title,
.landing-section h2 {
    color: var(--primary-color);
    font-size: clamp(1.5rem, 2.5vw + 0.75rem, 2rem);
    letter-spacing: -0.01em;
    margin: 0;
}

.landing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
    margin-top: 2rem;
}

.landing-card {
    border: 1px solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1.5rem;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.landing-card:hover {
    border-color: var(--accent-color);
    box-shadow: 0 8px 24px -16px rgba(17, 17, 17, 0.35);
    transform: translateY(-2px);
}

.landing-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.6rem;
    background: color-mix(in srgb, var(--accent-color) 12%, transparent);
    color: var(--accent-color);
    margin-bottom: 1rem;
}

.landing-card__icon svg {
    width: 1.35rem;
    height: 1.35rem;
}

.landing-card h3 {
    margin: 0 0 0.5rem;
    color: var(--primary-color);
}

.landing-card p {
    color: var(--muted-color);
    margin-bottom: 0;
}

/* -- landing: how-it-works steps ---------------------------------------- */

.landing-steps {
    list-style: none;
    margin: 2rem 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

.landing-step {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.landing-step__num {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 999px;
    background: var(--primary-color);
    color: #fff;
    font-weight: 700;
}

.landing-step h3 {
    margin: 0.2rem 0 0.35rem;
    color: var(--primary-color);
}

.landing-step p {
    margin: 0;
    color: var(--muted-color);
}

/* -- landing: white-label split ----------------------------------------- */

.landing-split {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 2.5rem;
    align-items: center;
}

.landing-split__lede {
    color: var(--muted-color);
    margin: 1rem 0 1.25rem;
}

.landing-checklist {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.6rem;
}

.landing-checklist li {
    position: relative;
    padding-left: 1.75rem;
    color: var(--text-color);
}

.landing-checklist li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.35rem;
    width: 1.1rem;
    height: 1.1rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--accent-color) 15%, transparent)
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e11d48' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 0.7rem no-repeat;
}

/* Faux storefront preview -- pure decoration, kept aria-hidden. */
.landing-split__panel {
    display: flex;
    justify-content: center;
}

.brand-preview {
    width: 100%;
    max-width: 22rem;
    border: 1px solid var(--border-color);
    border-radius: 0.85rem;
    overflow: hidden;
    box-shadow: 0 20px 45px -30px rgba(17, 17, 17, 0.6);
    background: var(--bg-color);
}

.brand-preview__bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.85rem;
    border-bottom: 1px solid var(--border-color);
    background: #f9fafb;
}

.brand-preview__dot {
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 999px;
    background: var(--accent-color);
    flex: none;
}

.brand-preview__url {
    font-size: 0.8rem;
    color: var(--muted-color);
    font-variant-numeric: tabular-nums;
}

.brand-preview__body {
    padding: 1.5rem 1.25rem 1.75rem;
}

.brand-preview__kicker {
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--accent-color);
    margin: 0 0 0.4rem;
}

.brand-preview__title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0 0 0.4rem;
    line-height: 1.2;
}

.brand-preview__meta {
    color: var(--muted-color);
    font-size: 0.9rem;
    margin: 0 0 1.1rem;
}

.brand-preview__cta {
    display: inline-block;
    background: var(--accent-color);
    color: #fff;
    padding: 0.5rem 1.1rem;
    border-radius: 0.375rem;
    font-weight: 600;
    font-size: 0.9rem;
}

/* -- landing: closing CTA band ------------------------------------------ */

.landing-cta {
    margin-top: 3.5rem;
    padding: 3rem 1.5rem;
    border-radius: 1rem;
    text-align: center;
    background: var(--primary-color);
    color: #fff;
}

.landing-cta h2 {
    margin: 0 0 0.5rem;
    color: #fff;
    font-size: clamp(1.5rem, 2.5vw + 0.75rem, 2rem);
}

.landing-cta p {
    margin: 0 0 1.5rem;
    color: rgba(255, 255, 255, 0.75);
}

.landing-cta .button {
    background: #fff;
    color: var(--primary-color);
}

@media (max-width: 720px) {
    .landing-split {
        grid-template-columns: 1fr;
    }

    .landing-split__panel {
        order: -1;
    }
}

/* -- breadcrumbs / empty states ----------------------------------------- */

.breadcrumbs {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0;
    margin: 0 0 1.25rem;
    font-size: 0.875rem;
    color: var(--muted-color);
}

.breadcrumbs li:not(:last-child)::after {
    content: "/";
    margin-left: 0.4rem;
    color: var(--border-color);
}

.breadcrumbs a {
    color: var(--muted-color);
}

.breadcrumbs a:hover {
    color: var(--accent-color);
}

.breadcrumbs li:last-child {
    color: var(--text-color);
}

.back-link {
    display: inline-block;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    color: var(--muted-color);
}

.back-link:hover {
    color: var(--accent-color);
}

.empty-state {
    border: 1px dashed var(--border-color);
    border-radius: 0.5rem;
    padding: 2.5rem 1.5rem;
    text-align: center;
    color: var(--muted-color);
}

.empty-state p:first-child {
    color: var(--text-color);
    font-size: 1.1rem;
    font-weight: 600;
    margin-top: 0;
}

/* -- error pages (404/500) ------------------------------------------------ */

.error-page {
    text-align: center;
    padding: 3rem 1rem;
}

.error-page__code {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--accent-color);
    margin: 0;
    line-height: 1;
}

.error-page h1 {
    color: var(--primary-color);
    margin: 0.5rem 0 1rem;
}

.error-page p {
    color: var(--muted-color);
}

/* -- event grid / list ------------------------------------------------ */

.event-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
}

.event-card {
    display: block;
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    overflow: hidden;
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

.event-card:hover {
    text-decoration: none;
    border-color: var(--accent-color);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.event-card__image {
    width: 100%;
    height: 140px;
    object-fit: cover;
    display: block;
    background: #f3f4f6;
}

.event-card__image--placeholder {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    opacity: 0.15;
}

.event-card__body {
    padding: 1rem;
}

.event-card__body h2 {
    margin: 0 0 0.25rem;
    font-size: 1.1rem;
}

.event-card__category,
.event-card__next {
    color: var(--muted-color);
    font-size: 0.875rem;
    margin: 0.25rem 0;
}

.event-card__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.75rem;
}

.event-card__price {
    font-weight: 700;
    color: var(--primary-color);
}

.performance-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.performance-list__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    flex-wrap: wrap;
}

.badge {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    background: #f3f4f6;
    color: var(--muted-color);
    margin-left: 0.5rem;
}

.badge--available {
    background: #f0fdf4;
    color: #166534;
}

.badge--soldout {
    background: #fef2f2;
    color: #991b1b;
}

/* -- GA quantity form -------------------------------------------------- */

.ga-form__row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.ga-form__row select,
.ga-form__row input[type="number"] {
    padding: 0.4rem 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font: inherit;
}

.muted {
    color: var(--muted-color);
    font-size: 0.875rem;
}

/* -- seat map ------------------------------------------------------------ */

.seat-map__legend {
    display: flex;
    gap: 1.25rem;
    flex-wrap: wrap;
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
    font-size: 0.875rem;
    color: var(--muted-color);
}

.seat-map__summary {
    min-height: 1.5em;
}

.seat-map__form .button {
    margin-top: 0.5rem;
}

.seat-swatch {
    display: inline-block;
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    margin-right: 0.35rem;
    vertical-align: middle;
}

.seat-swatch--available {
    background: #fff;
    border: 2px solid var(--accent-color);
}

.seat-swatch--selected {
    background: var(--accent-color);
}

.seat-swatch--unavailable {
    background: #d1d5db;
}

/* Inert (GA display-only) seat -- see orders/_seat_map_inert.html. Neutral
   "house" fill; never interactive. */
.seat-swatch--inert {
    background: #e5e7eb;
    border: 2px solid var(--accent-color);
}

/* Scroll wrapper for the seat canvas. Seats are laid out by their real
   (continuous) world coordinates inside .seat-map__canvas -- see
   templates/orders/_seat_map.html -- so a wide chart simply scrolls
   horizontally instead of being crammed into an integer CSS grid. */
.seat-map__grid {
    max-width: 100%;
    overflow-x: auto;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.seat-map__canvas {
    position: relative;
    margin: 0 auto;
}

.seat-btn {
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 50%;
    border: 2px solid var(--accent-color);
    background: #fff;
    color: var(--text-color);
    font-size: 0.65rem;
    font-family: inherit;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.seat-btn--selected {
    background: var(--accent-color);
    color: #fff;
}

.seat-btn--unavailable {
    background: #d1d5db;
    border-color: #d1d5db;
    color: #9ca3af;
    cursor: not-allowed;
}

.seat-btn:disabled {
    pointer-events: none;
}

/* Inert seats (GA map) are a picture, not a control: no pointer, no focus,
   neutral fill so they don't read as "available to pick" like the reserved
   map's white seats do. */
.seat-btn--inert {
    background: #e5e7eb;
    border-color: var(--accent-color);
    color: var(--muted-color);
    cursor: default;
    pointer-events: none;
}

/* Phase C: a zoned seat's border/background tints toward its PricingZone's
   color (set via the --zone-color custom property inline, per-seat --
   templates/orders/_seat_map.html's seatStyle()); a selected zoned seat
   fills solid with the zone color instead of the generic accent so the
   picked seats visually match the legend swatch they came from. */
.seat-btn--zoned {
    border-color: var(--zone-color);
    background: color-mix(in srgb, var(--zone-color) 20%, #fff);
}

.seat-btn--zoned.seat-btn--selected {
    background: var(--zone-color);
    border-color: var(--zone-color);
    color: #fff;
}

/* -- cart / checkout ---------------------------------------------------- */

.cart-item,
.checkout-item {
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.cart-item__header h2 {
    margin: 0 0 0.25rem;
}

.cart-item__timer--warning {
    color: #b91c1c;
    font-weight: 700;
}

.cart-item__actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.cart-total {
    text-align: right;
    font-size: 1.1rem;
    padding-top: 0.5rem;
}

/* -- tickets -------------------------------------------------------------- */

.ticket-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.25rem;
    margin-top: 1.5rem;
}

.ticket {
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1.25rem;
    text-align: center;
}

.ticket h3 {
    margin-top: 0;
    font-size: 1rem;
}

.ticket__qr {
    max-width: 100%;
    height: auto;
    margin: 0.75rem 0;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    padding: 0.5rem;
    background: #fff;
}

/* The ticket code, shown for manual entry at the door. Monospace + wide
   tracking so each character reads distinctly (the token's alphabet already
   omits look-alike glyphs -- see orders.models.new_token). */
.ticket__code {
    font-family: ui-monospace, "SFMono-Regular", "Cascadia Code", "Consolas", monospace;
    letter-spacing: 0.15em;
    font-size: 1.05rem;
}

.ticket-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin: 1rem 0 1.5rem;
}

/* -- guest portal ("My tickets") + sign-in -------------------------------- */

.signin-form {
    max-width: 26rem;
    margin-top: 1.5rem;
}

/* Fallback panel shown when SMTP isn't configured: the magic link is surfaced
   on screen instead of emailed (guests/views.guest_request_link). */
.signin-link-panel {
    max-width: 32rem;
    margin: 1.5rem 0;
    padding: 1rem 1.25rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background: var(--bg-color);
}

.signin-link-panel > :first-child {
    margin-top: 0;
}

.signin-link-panel > :last-child {
    margin-bottom: 0;
}

.signin-link-panel .button {
    margin: 0.5rem 0;
}

.signin-form .field,
.field--email-capture {
    margin: 0.75rem 0;
}

.field--email-capture input,
.signin-form input {
    width: 100%;
    max-width: 26rem;
    padding: 0.5rem 0.625rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
}

.portal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.portal-header h1 {
    margin: 0;
}

.order-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}

.order-list__item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1.25rem;
}

.order-list__main h2 {
    margin: 0 0 0.25rem;
    font-size: 1.1rem;
}

.order-list__main p {
    margin: 0.15rem 0;
}

.order-list__actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Print: strip the site chrome so a browser "Print / Save as PDF" of the
   tickets page yields a clean ticket sheet (the server-rendered PDF at
   ticket_pdf is the other download path). */
@media print {
    .site-header,
    .site-footer,
    .messages,
    .back-link,
    .ticket-actions--no-print,
    .test-mode-banner {
        display: none !important;
    }

    .ticket {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}

/* -- staff dashboard ------------------------------------------------------ */

.dash-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.dash-header h1 {
    margin: 0;
    color: var(--primary-color);
}

.dash-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1.25rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.dash-nav a {
    color: var(--text-color);
    font-weight: 600;
}

.dash-nav a.is-active {
    color: var(--accent-color);
}

.dash-nav__storefront {
    color: var(--muted-color) !important;
    font-weight: 400 !important;
}

.dash-nav__whoami {
    margin-left: auto;
}

@media (max-width: 640px) {
    .dash-nav__whoami {
        margin-left: 0;
        width: 100%;
    }
}

.stat-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-tile {
    flex: 1 1 160px;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1rem 1.25rem;
}

.stat-tile__value {
    font-size: 1.75rem;
    font-weight: 700;
    display: block;
}

.stat-tile__label {
    color: var(--muted-color);
    font-size: 0.875rem;
}

.dash-table-wrap {
    width: 100%;
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

table.dash-table {
    width: 100%;
    min-width: 480px;
    border-collapse: collapse;
    margin-bottom: 0;
}

table.dash-table th,
table.dash-table td {
    text-align: left;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

table.dash-table th {
    color: var(--muted-color);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
}

.badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge--valid { background: #f0fdf4; color: #166534; }
.badge--used { background: #eff6ff; color: #1e40af; }
.badge--void { background: #f3f4f6; color: #6b7280; }
.badge--published { background: #f0fdf4; color: #166534; }
.badge--draft { background: #f3f4f6; color: #6b7280; }
.badge--paid { background: #f0fdf4; color: #166534; }
.badge--pending { background: #fffbeb; color: #92400e; }
.badge--cancelled,
.badge--refunded { background: #f3f4f6; color: #6b7280; }

.auth-card {
    max-width: 26rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1.75rem;
}

.auth-card h1 {
    margin-top: 0;
    color: var(--primary-color);
}

.dash-form .field {
    margin-bottom: 1rem;
}

.dash-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.dash-form input,
.dash-form select,
.dash-form textarea {
    width: 100%;
    max-width: 32rem;
    padding: 0.5rem 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-family: inherit;
    font-size: 1rem;
}

.dash-form .errorlist {
    list-style: none;
    padding: 0;
    margin: 0.25rem 0;
    color: #b91c1c;
    font-size: 0.875rem;
}

/* -- reserved-seating price grid ----------------------------------------- */

.price-input {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    color: var(--muted-color, #6b7280);
}

/* Override the full-width .dash-form input rule: these live in table cells. */
.dash-form .price-input input {
    width: 6rem;
    max-width: 6rem;
    padding: 0.35rem 0.5rem;
    text-align: right;
}

/* -- team / roles -------------------------------------------------------- */

.button--sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.875rem;
}

/* Inline add-member form: fields sit in a row instead of stacking. */
.dash-form--inline {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1rem;
}

.dash-form--inline .field {
    margin-bottom: 0;
}

.dash-form--inline input,
.dash-form--inline select {
    width: auto;
    min-width: 12rem;
}

/* Role dropdown + Save button, inline in a table cell. */
.team-inline-form {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.dash-form.team-inline-form select,
.team-inline-form select {
    width: auto;
    min-width: 9rem;
}

.dash-table__actions {
    text-align: right;
    white-space: nowrap;
}

.field-error {
    display: block;
    margin-top: 0.25rem;
    color: #b91c1c;
    font-size: 0.8125rem;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* -- dashboard seating chart builder (Phase A) ---------------------------- */

.chart-seat {
    width: 3.25rem;
    height: 3.25rem;
    border: 2px solid var(--accent-color);
    border-radius: 0.375rem;
    background: #fff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    font-size: 0.65rem;
}

.chart-seat--accessible {
    border-color: #2563eb;
    background: #eff6ff;
}

.chart-seat__label {
    font-weight: 600;
}

.chart-seat__actions {
    display: flex;
    gap: 0.25rem;
}

.chart-seat__actions form {
    margin: 0;
}

.chart-seat__btn {
    width: 1.1rem;
    height: 1.1rem;
    line-height: 1;
    padding: 0;
    font-size: 0.65rem;
    border: 1px solid var(--border-color);
    border-radius: 0.2rem;
    background: #fff;
    cursor: pointer;
}

.chart-seat__btn--delete {
    color: #b91c1c;
}

/* -- seating chart visual editor (Phase B) -------------------------------- */

.chart-editor {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    flex-wrap: wrap;
}

.chart-editor__stage {
    flex: 1 1 32rem;
    min-width: 0;
}

.chart-editor__toolbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.chart-editor__dirty {
    color: #b45309;
    font-weight: 600;
    font-size: 0.875rem;
}

.chart-editor__saved {
    color: #166534;
    font-size: 0.875rem;
}

.chart-editor__error {
    color: #b91c1c;
    font-size: 0.875rem;
}

.chart-editor__svg-wrap {
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background: #fafafa;
    max-width: 100%;
    overflow: auto;
    /* iOS Safari historically honors `touch-action` reliably only on HTML
       elements, NOT on the inner <svg> -- so the `touch-action: none` on
       .chart-editor__svg alone let single-finger handle drags on the real
       iPad get swallowed by page pan/zoom ("touch patchy, can't drag").
       Setting it on this HTML wrapper is the version Safari actually
       respects; the editor supplies its own pan (drag background) + wheel/
       pinch zoom, so giving up the wrapper's native touch-scroll costs
       nothing. */
    touch-action: none;
    overscroll-behavior: contain;
}

.chart-editor__svg {
    display: block;
    width: 100%;
    height: 70vh;
    min-height: 24rem;
    touch-action: none;
}

.editor-seat {
    cursor: pointer;
    stroke-width: 0.06;
}

.editor-seat:hover {
    filter: brightness(1.15);
}

.editor-seat--accessible {
    stroke: #2563eb;
}

.chart-editor__group--selected circle {
    stroke: #111827;
    stroke-width: 0.08;
}

.editor-seat-label {
    pointer-events: none;
    /* Fallback ink only. renderSection() sets `style.fill` per seat to black
       or white for WCAG contrast against the section's fill color (see
       seat_contrast.js); that inline style wins over this rule. */
    fill: #fff;
    font-family: inherit;
    /* Centering is done on the element itself: text-anchor="middle" +
       dy="0.35em" attributes (see chart_editor.js renderSection). No
       dominant-baseline here -- it's unreliable on iOS Safari and would
       fight the dy offset on engines that DO honor it. */
    text-anchor: middle;
    user-select: none;
}

/* Round 3 #5: hide seat labels once zoomed out far enough to be illegible
   (toggled by chart_editor.js's updateLabelVisibility()) instead of drawing
   unreadable sub-pixel text. */
.chart-editor__svg--labels-hidden .editor-seat-label {
    display: none;
}

.chart-editor__sidebar {
    flex: 0 0 20rem;
    max-width: 100%;
}

.chart-editor__legend {
    list-style: none;
    margin: 0 0 1.25rem;
    padding: 0;
    font-size: 0.875rem;
}

.chart-editor__legend li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.chart-editor__swatch {
    display: inline-block;
    width: 0.85rem;
    height: 0.85rem;
    border-radius: 50%;
    flex-shrink: 0;
}

.chart-editor__section-panel {
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.85rem 1rem;
    margin-bottom: 0.75rem;
}

.chart-editor__section-panel h3 {
    margin: 0 0 0.35rem;
    font-size: 0.95rem;
}

.chart-editor__section-panel dl {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.15rem 0.5rem;
    font-size: 0.8rem;
    color: var(--muted-color);
    margin: 0 0 0.5rem;
}

.chart-editor__section-panel dd {
    margin: 0;
}

.chart-editor__section-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.chart-editor__section-actions form {
    margin: 0;
}

.chart-editor__hint {
    margin-left: auto;
    font-size: 0.8rem;
}

/* -- live editor: transform box handles + pivot marker (docs/EDITOR.md) -- */

/* Round-2 refinement #3 (responsive handle size): the on-canvas control
   dots are too big for a mouse but need to stay comfortably tappable on
   touch/coarse pointers. `r` is a real CSS geometry property on SVG
   <circle>s (overrides any `r=""` presentation attribute, of which the
   handles below deliberately have none), so a single scale variable here
   covers every handle without touching chart_editor.js. `(hover: none)`
   catches touchscreens that report as neither strictly coarse nor fine on
   some browsers; `pointer: coarse` covers the common case directly. */
:root {
    --chart-editor-handle-scale: 1;
    /* Round 3 #3: the INVISIBLE hit-zone multiplier -- always noticeably
       bigger than the visible-dot scale above so every handle's grabbable
       area extends well beyond what you can see, on every pointer type. */
    --chart-editor-hit-scale: 1;
}

@media (pointer: coarse), (hover: none) {
    :root {
        --chart-editor-handle-scale: 1.7;
        /* Chunky, reliable touch targets (round 3 #3, the top touch
           priority): iPad touch is flaky against small hit areas, so
           coarse/touch pointers get a much larger invisible hit zone on
           top of the already-bigger visible dot. */
        --chart-editor-hit-scale: 1.8;
    }
}

.chart-editor__transform-box,
.chart-editor__pivot-group {
    pointer-events: none;
}

.chart-editor__handle,
.chart-editor__pivot,
.chart-editor__rotation-pivot {
    pointer-events: none;
    fill: #fff;
    stroke: #111827;
    stroke-width: 0.08;
    cursor: pointer;
    r: calc(0.28 * var(--chart-editor-handle-scale));
}

/* Round 3 #1/#3: every handle is now TWO circles -- the visible dot above
   (decorative, pointer-events: none so it never competes with its own hit
   zone for the topmost-element-wins SVG hit test) and this larger,
   invisible one, which is the actual pointerdown/hover/title target.
   `fill: transparent` + `pointer-events: all` still receives events (SVG's
   default pointer-events value, visiblePainted, would NOT -- transparent
   fill doesn't count as "painted" -- see chart_editor.js's header comment).
   Always noticeably bigger than its sibling dot ("well beyond the visible
   dot" per docs/EDITOR.md), bigger still under (pointer: coarse). */
.chart-editor__handle-hit {
    pointer-events: all;
    fill: transparent;
    r: calc(0.55 * var(--chart-editor-hit-scale));
}

/* Round 3 #4: hover cursors live on the HIT circle (it's the element that
   actually receives pointer/hover events -- see the comment above). Corner
   resize cursors are set INLINE instead (chart_editor.js's cornerCursor()),
   since which of nwse/nesw/ns/ew is "correct" depends on the section's
   current rotation; `.chart-editor__handle-hit--resize` here is just the
   pre-hydration/no-JS fallback. */
.chart-editor__handle-hit--resize {
    cursor: nwse-resize;
}

.chart-editor__handle-hit--offset {
    cursor: ew-resize;
}

.chart-editor__handle-hit--rotate {
    cursor: grab;
}

.chart-editor__handle-hit--pivot {
    cursor: move;
}

.chart-editor__handle-hit--rotation-pivot {
    cursor: crosshair;
}

.chart-editor__handle--resize {
    r: calc(0.32 * var(--chart-editor-handle-scale));
}

.chart-editor__handle--offset {
    r: calc(0.28 * var(--chart-editor-handle-scale));
    fill: #d97706;
}

.chart-editor__handle--rotate {
    r: calc(0.3 * var(--chart-editor-handle-scale));
    fill: #7c3aed;
}

.chart-editor__pivot {
    pointer-events: none;
    r: calc(0.26 * var(--chart-editor-handle-scale));
    fill: #e11d48;
}

.chart-editor__rotation-pivot {
    pointer-events: none;
    r: calc(0.26 * var(--chart-editor-handle-scale));
    fill: #0891b2;
}

/* Round 4 (docs/EDITOR.md #3): small inline-SVG glyphs painted ON TOP of
   each handle's existing colored dot, conveying its function (rotate =
   circular arrow, corners = diagonal resize arrows, offset = a horizontal
   shift arrow, move-section = a 4-way arrow cross, pivot = a crosshair/
   target) -- see chart_editor.html for the actual paths. Purely decorative
   (pointer-events: none, same as the dot underneath it): the invisible
   `.chart-editor__handle-hit` circle from round 3 is completely unchanged
   and still does all the actual pointerdown/hover/tooltip work, so touch
   grabbing isn't affected by this new layer at all.

   Each icon is TWO nested <g>s in the template: an outer one carrying the
   dynamic per-instance `transform` ATTRIBUTE (translate to the handle's
   position, rotate to match a corner's outward direction or the block's
   tilt), and this inner one carrying the responsive-scale CSS `transform`.
   That split is required, not just tidy -- an SVG element's CSS `transform`
   property REPLACES its presentation `transform` attribute outright when
   both are present on the SAME element (rather than composing), so putting
   the scale here on a plain child element lets the outer element's
   attribute-based translate/rotate keep working. `transform-box: fill-box`
   + `transform-origin: center` makes the CSS scale grow from the glyph's
   own middle (its paths are already centered on local (0, 0), so plain
   `center` reads the same either way) instead of the SVG viewport's
   origin. */
.chart-editor__handle-icon {
    pointer-events: none;
    fill: none;
    stroke-width: 0.045;
    stroke-linecap: round;
    stroke-linejoin: round;
    transform-box: fill-box;
    transform-origin: center;
    transform: scale(var(--chart-editor-handle-scale));
}

/* Resize handles sit on a WHITE dot (.chart-editor__handle--resize inherits
   the shared #fff/#111827 fill/stroke above) -- a dark icon stroke reads
   clearly against it. Every other icon below sits on a COLORED dot, so its
   icon is white instead for the same contrast reason. */
.chart-editor__handle-icon--resize {
    stroke: #111827;
}

.chart-editor__handle-icon--offset {
    stroke: #fff;
}

.chart-editor__handle-icon--rotate {
    stroke: #fff;
    fill: #fff;
}

.chart-editor__handle-icon--move {
    stroke: #fff;
}

.chart-editor__handle-icon--pivot {
    stroke: #fff;
}

.chart-editor__handle-line {
    stroke: #111827;
    stroke-width: 0.04;
    stroke-dasharray: 0.15 0.1;
    opacity: 0.6;
}

.chart-editor__handle-line--offset {
    stroke: #d97706;
}

.chart-editor__handle-line--rotate {
    stroke: #7c3aed;
}

.chart-editor__pivot-cross {
    stroke: #e11d48;
    stroke-width: 0.05;
}

.chart-editor__pivot-connector {
    stroke: #e11d48;
    stroke-width: 0.03;
    stroke-dasharray: 0.06 0.06;
    opacity: 0.7;
}

.chart-editor__pivot-point {
    fill: #e11d48;
    pointer-events: none;
}

/* Rotation-pivot marker (Round 2 #2) -- same connector/dot treatment as the
   origin marker above, teal instead of red so the two are visually
   distinct even when they sit close together (e.g. pivot_mode "origin"). */
.chart-editor__rotation-pivot-connector {
    stroke: #0891b2;
    stroke-width: 0.03;
    stroke-dasharray: 0.06 0.06;
    opacity: 0.7;
}

.chart-editor__rotation-pivot-point {
    fill: #0891b2;
    pointer-events: none;
}

/* -- live editor: background scale grid (docs/EDITOR.md Round 2 #4) ------- */

.chart-editor__grid-bg {
    pointer-events: none;
}

/* Round 6 ("the grid behind them is basically invisible"): the old lines
   were 0.015/0.025 SVG USER units in a near-white --border-color (#e5e7eb),
   which at a typical fit zoom render as a sub-pixel, washed-out ghost. Both
   are now a much stronger slate color at a visibly heavier user-unit width
   (still comfortably thinner than a seat: SEAT_RADIUS is 0.35), so the grid
   reads clearly at fit and holds up zoomed in/out. Kept in user units (not
   vector-effect: non-scaling-stroke) on purpose -- inside an SVG <pattern>
   older iPad WebKit ignores non-scaling-stroke, which would fall back to a
   1-unit-wide stroke that floods each 1-unit tile into a solid block. */
.chart-editor__grid-line--minor {
    stroke: #94a3b8;
    stroke-width: 0.04;
    opacity: 0.55;
}

.chart-editor__grid-line--major {
    stroke: #475569;
    stroke-width: 0.07;
    opacity: 0.7;
}

/* -- live editor: per-seat popover ----------------------------------------- */

.chart-editor__popover {
    display: none;
    position: fixed;
    z-index: 20;
    transform: translate(0.75rem, -0.5rem);
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18);
    padding: 0.6rem 0.75rem;
    min-width: 10rem;
    font-size: 0.85rem;
}

.chart-editor__popover-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.chart-editor__popover-close {
    border: none;
    background: none;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    color: var(--muted-color);
}

.chart-editor__popover-toggle {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
    cursor: pointer;
}

.chart-editor__popover-delete {
    width: 100%;
}

/* -- live editor: semantic sidebar controls -------------------------------- */

.chart-editor__control {
    margin-bottom: 0.85rem;
}

.chart-editor__control label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.chart-editor__control-value {
    font-variant-numeric: tabular-nums;
    color: var(--muted-color);
    font-weight: 400;
}

.chart-editor__slider {
    width: 100%;
    margin-top: 0.25rem;
}

.chart-editor__slider--centered {
    /* A visual center-zero marker under the track. */
    background: linear-gradient(to right, transparent 49.5%, var(--muted-color) 49.5%, var(--muted-color) 50.5%, transparent 50.5%);
}

/* Round-2 refinement #1: every slider gets a paired number input showing/
   accepting the exact value. Both inputs x-model the SAME underlying
   property (see chart_editor.html), so Alpine keeps them in sync with no
   extra JS -- this is purely a layout row for the pair. */
.chart-editor__slider-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.chart-editor__slider-row .chart-editor__slider {
    margin-top: 0;
    flex: 1 1 auto;
}

.chart-editor__number {
    width: 4.25rem;
    flex: 0 0 auto;
    padding: 0.2rem 0.35rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-variant-numeric: tabular-nums;
}

.chart-editor__unit {
    color: var(--muted-color);
    font-size: 0.85rem;
}

.chart-editor__toggle {
    display: flex;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    overflow: hidden;
    margin-top: 0.25rem;
}

.chart-editor__toggle button {
    flex: 1;
    padding: 0.35rem 0.5rem;
    border: none;
    background: #fff;
    cursor: pointer;
    font-size: 0.85rem;
}

.chart-editor__toggle button.is-active {
    background: var(--accent-color);
    color: #fff;
}

.chart-editor__toggle button:disabled,
.chart-editor__stepper button:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

/* Round 3 #11: snap-to-grid toolbar toggle, OFF by default (chart_editor.js's
   snapEnabled). */
.chart-editor__snap-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.85rem;
    color: var(--muted-color);
    cursor: pointer;
}

.chart-editor__stepper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.chart-editor__stepper button {
    width: 1.75rem;
    height: 1.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    background: #fff;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
}

.chart-editor__stepper span {
    min-width: 1.75rem;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.chart-editor__legend-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.3rem 0.4rem;
    border: 1px solid transparent;
    border-radius: 0.375rem;
    background: none;
    cursor: pointer;
    text-align: left;
    font-size: 0.875rem;
}

/* Reorder up/down arrows (Round 2 feedback on #7) share the row with the
   select button -- override its width:100% so the arrows have room. */
.chart-editor__legend-row .chart-editor__legend-btn {
    width: auto;
    flex: 1 1 auto;
    min-width: 0;
}

.chart-editor__legend-reorder {
    display: flex;
    flex: 0 0 auto;
    gap: 0.15rem;
}

.chart-editor__legend-reorder-btn {
    width: 1.4rem;
    height: 1.4rem;
    line-height: 1;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    background: #fff;
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--muted-color);
}

.chart-editor__legend-reorder-btn:hover:not(:disabled) {
    background: #f3f4f6;
    color: inherit;
}

.chart-editor__legend-reorder-btn:disabled {
    opacity: 0.35;
    cursor: default;
}

.chart-editor__legend-btn:hover {
    background: #f3f4f6;
}

.chart-editor__legend-btn.is-selected {
    border-color: var(--accent-color);
    background: #f3f4f6;
}

/* -- live editor: inline "New section" (docs/EDITOR.md Round 2 #7) -------- */

.chart-editor__new-section {
    margin-top: 0.6rem;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    background: #f9fafb;
}

.chart-editor__new-section .field {
    margin-bottom: 0.6rem;
}

@media (max-width: 900px) {
    .chart-editor__svg {
        height: 60vh;
    }
}

/* -- pricing-zone visual editor (Phase C, docs/SEATING.md) ---------------- */

.zone-editor__svg-wrap {
    user-select: none;
}

.zone-editor__svg {
    cursor: crosshair;
}

.zone-editor-seat {
    cursor: pointer;
    stroke: #fff;
    stroke-width: 0.05;
}

.zone-editor-seat.editor-seat--selected {
    stroke: #111827;
    stroke-width: 0.14;
}

/* Marquee rubber-band overlay -- positioned in screen (client) coordinates,
   sized in zone_editor.js's marqueeStyle getter; this element itself has no
   default position/size (both are set inline) and is invisible until a drag
   is in progress. */
.zone-editor__marquee {
    display: none;
    border: 1.5px dashed var(--accent-color);
    background: rgba(37, 99, 235, 0.12);
    pointer-events: none;
    z-index: 5;
}

.zone-editor__legend {
    list-style: none;
    margin: 0 0 1.5rem;
    padding: 0;
    font-size: 0.875rem;
}

.zone-editor__legend-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.zone-editor__legend-name {
    font-weight: 600;
    margin-right: 0.25rem;
}

.zone-editor__legend-actions {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
}

.zone-editor__panel {
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 0.85rem 1rem;
    margin-bottom: 1.25rem;
}

.zone-editor__panel .field {
    margin-bottom: 0.6rem;
}

.zone-editor__panel input[type="color"] {
    width: 3rem;
    height: 2rem;
    padding: 0.1rem;
}

.search-form {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.search-form input {
    flex: 1;
    max-width: 24rem;
    padding: 0.5rem 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
}

/* -- scanner --------------------------------------------------------------- */
/* App-like door scanner: a compact bar (nav behind a burger), one square
   camera stage with overlaid status/verdict, and manual entry pinned right
   below it. Kept narrow and centered so it reads like a handheld app. */

.scan {
    max-width: 30rem;
    margin: 0 auto;
}

.scan-bar {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.scan-bar__title {
    flex: 1;
    margin: 0;
    font-size: 1.25rem;
    color: var(--primary-color);
}

.scan-bar__burger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    cursor: pointer;
}

.scan-bar__burger span {
    display: block;
    width: 1.25rem;
    height: 2px;
    margin: 0 auto;
    background: var(--text-color);
}

.scan-bar__sound {
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    font-size: 1.1rem;
    line-height: 1;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    cursor: pointer;
}

/* Burger dropdown: reuse the dashboard section nav, stacked vertically. */
.scan-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    z-index: 20;
    min-width: 12rem;
    padding: 0.5rem;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14);
}

.scan-menu .dash-nav {
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
    margin: 0;
    padding: 0;
    border: 0;
}

.scan-menu .dash-nav a,
.scan-menu .dash-nav__logout button {
    display: block;
    width: 100%;
    padding: 0.5rem 0.6rem;
    border-radius: 0.375rem;
    text-align: left;
}

.scan-menu .dash-nav a:hover {
    text-decoration: none;
    background: var(--border-color);
}

.scan-menu .dash-nav__whoami {
    margin: 0.25rem 0 0;
    padding: 0.5rem 0.6rem 0;
    border-top: 1px solid var(--border-color);
    font-size: 0.85rem;
}

.scan-stage {
    position: relative;
    aspect-ratio: 1 / 1;
    width: 100%;
    overflow: hidden;
    background: #000;
    border-radius: 1rem;
}

.scan-stage__video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Corner-bracket aiming reticle, centered in the square. */
.scan-stage__reticle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 62%;
    height: 62%;
    transform: translate(-50%, -50%);
    border-radius: 0.75rem;
    background:
        linear-gradient(#fff, #fff) top left, linear-gradient(#fff, #fff) top left,
        linear-gradient(#fff, #fff) top right, linear-gradient(#fff, #fff) top right,
        linear-gradient(#fff, #fff) bottom left, linear-gradient(#fff, #fff) bottom left,
        linear-gradient(#fff, #fff) bottom right, linear-gradient(#fff, #fff) bottom right;
    background-repeat: no-repeat;
    background-size: 1.75rem 3px, 3px 1.75rem;
    opacity: 0.85;
    pointer-events: none;
}

/* "Multiple codes" hint over the live camera: sits below the reticle so it
   doesn't cover the frame the staffer is aiming. */
.scan-stage__hint {
    position: absolute;
    left: 50%;
    bottom: 8%;
    transform: translateX(-50%);
    max-width: 80%;
    padding: 0.4rem 0.8rem;
    border-radius: 999px;
    background: rgba(239, 68, 68, 0.92);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    pointer-events: none;
}

.scan-stage__status {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    text-align: center;
    color: #fff;
}

.scan-stage__status p {
    margin: 0;
}

/* Camera off / unavailable: a neutral diagonal-hatch placeholder rather than a
   maroon alarm -- no camera isn't a scan failure, just a fall-back-to-manual
   state, so it shouldn't wear the reject colour. */
.scan-stage__status--error {
    background: repeating-linear-gradient(
        -45deg,
        #eceef1,
        #eceef1 12px,
        #d8dce1 12px,
        #d8dce1 24px
    );
}

.scan-stage__status--error p {
    color: #374151;
}

.scan-tally {
    position: absolute;
    top: 0.6rem;
    right: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
}

.scan-tally__pass { color: #86efac; }
.scan-tally__fail { color: #fca5a5; }
.scan-tally__sep { opacity: 0.6; }

/* Verdict card below the manual entry -- a normal block in the flow, not an
   overlay, so the live camera above stays unobstructed. Stays until the next
   scan replaces it or staff tap it to dismiss (no auto-hide). */
.scan-verdict {
    margin-top: 0.75rem;
    padding: 0.9rem 1.1rem;
    text-align: center;
    color: #fff;
    background: #111;
    border-radius: 0.75rem;
    cursor: pointer;
}

.scan-verdict--pass { background: #166534; }
/* Vivid amber matching the full-screen flash; dark text since amber this bright
   doesn't carry white legibly. */
.scan-verdict--used { background: #f59e0b; color: #451a03; }
.scan-verdict--fail { background: #991b1b; }

.scan-verdict__headline {
    margin: 0;
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: 0.05em;
}

.scan-verdict__msg {
    margin: 0.15rem 0 0;
    font-size: 0.9rem;
    opacity: 0.95;
}

.scan-verdict__meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.25rem 1rem;
    margin: 0.5rem 0 0;
    font-size: 0.85rem;
}

.scan-verdict__meta div {
    display: flex;
    gap: 0.35rem;
}

.scan-verdict__meta dt {
    opacity: 0.7;
}

.scan-verdict__meta dd {
    margin: 0;
    font-weight: 600;
}

.scan-verdict__dismiss {
    margin: 0.5rem 0 0;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.7;
}

/* Manual entry, pinned directly below the square. */
.scan-manual {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.scan-manual__input {
    flex: 1;
    min-width: 0;
    padding: 0.65rem 0.75rem;
    /* 16px keeps iOS Safari from zooming the field on focus. */
    font-size: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    /* Codes are case-insensitive (the view upper()s on submit), so let staff
       type either case but render it as the uniform all-caps the codes print
       in. Placeholder stays normal case so the hint doesn't read as shouting. */
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.scan-manual__input::placeholder {
    text-transform: none;
    letter-spacing: normal;
}

.scan-manual__submit {
    flex: none;
}

.scan-manual__error {
    margin-top: 0.75rem;
}

.scan-note {
    margin-top: 0.75rem;
}

.scan-result {
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    padding: 1rem 1.25rem;
    margin: 1rem 0;
}

.scan-result__headline {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0 0 0.25rem;
    letter-spacing: 0.05em;
}

.scan-result--pass {
    border-color: #86efac;
    background: #f0fdf4;
    color: #166534;
}

/* "Scanned fine, but this ticket was already redeemed" -- amber, distinct from
   a hard reject so door staff can tell a re-entry attempt from a fake code. */
.scan-result--used {
    border-color: #fcd34d;
    background: #fffbeb;
    color: #92400e;
}

.scan-result--fail {
    border-color: #fca5a5;
    background: #fef2f2;
    color: #991b1b;
}

/* Prominent variant for the live camera scanner -- big and centered so the
   verdict reads at a glance on a phone held at the door. */
.scan-result--big {
    text-align: center;
    padding: 1.5rem 1.25rem;
}

.scan-result--big .scan-result__headline {
    font-size: 2.25rem;
    line-height: 1.1;
}

/* Full-screen color wash fired on every scan (scanner.js feedback()). Fixed +
   pointer-events:none so it never blocks the next scan; the fade is a one-shot
   keyframe whose ~1.2s matches the flash timer that clears the element. */
.scan-flash {
    position: fixed;
    inset: 0;
    z-index: 90;
    pointer-events: none;
    opacity: 0;
    animation: scan-flash-fade 1.2s ease-out forwards;
}

.scan-flash--pass { background: #22c55e; }
.scan-flash--used { background: #f59e0b; }
.scan-flash--fail { background: #ef4444; }

@keyframes scan-flash-fade {
    0% { opacity: 0.8; }
    100% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    /* Still show the color, just don't animate the fade. */
    .scan-flash { animation-duration: 0.01s; }
}

