/*
   Tenant-controlled customer visual layer.
   IMPORTANT: this file must never change the customer app structure.
   The original PlaceOrder/Menu/Basket responsive layout remains the source of truth.
   Themes only alter colour, contrast, backgrounds, borders and decorative ambience.
*/

/*
   Paint the browser/root canvas as well as <body>. Mobile browsers can briefly
   expose the root canvas during momentum/rubber-band scrolling; leaving the
   template's black <html> background visible produces a black band at the
   bottom of the menu. _Layout.cshtml mirrors the theme variables onto <html>.
*/
html {
    background-color: var(--q-bg, #050914);
}

body[class*="q-customer-theme-"] {
    min-height: 100vh;
    min-height: 100dvh;
    margin-bottom: 0;
    background-color: var(--q-bg) !important;
    background-image: var(--q-page-bg), var(--q-venue-bg-image) !important;
    background-size: cover !important;
    background-position: center !important;
    background-attachment: fixed !important;
    color: var(--q-text) !important;
}

/*
   Fixed page backgrounds plus sticky/fixed glass surfaces can create compositor
   gaps on iOS/Android while the page is moving. On touch-sized viewports the
   normal scrolling background is visually equivalent here and avoids those
   transient black/blank strips.
*/
@media (max-width: 820px), (hover: none) and (pointer: coarse) {
    body[class*="q-customer-theme-"] {
        background-attachment: scroll !important;
    }
}

body[class*="q-customer-theme-"] * {
    color-scheme: var(--q-color-scheme);
}

body[class*="q-customer-theme-"] ::selection {
    background: var(--q-selection-bg);
    color: var(--q-selection-text);
}

/* High-level surfaces: colour only, no sizing/grid/spacing changes. */
body[class*="q-customer-theme-"] .menu-header,
body[class*="q-customer-theme-"] .categories,
body[class*="q-customer-theme-"] .menu-filter-panel,
body[class*="q-customer-theme-"] .basket-bar,
body[class*="q-customer-theme-"] .card,
body[class*="q-customer-theme-"] .summary,
body[class*="q-customer-theme-"] .basket-page,
body[class*="q-customer-theme-"] .basket-header,
body[class*="q-customer-theme-"] .basket-item,
body[class*="q-customer-theme-"] .basket-summary,
body[class*="q-customer-theme-"] .swal2-popup.swal-light-gradient {
    background: var(--q-bg-elevated) !important;
    border-color: var(--q-line) !important;
    color: var(--q-text) !important;
}

body[class*="q-customer-theme-"].q-customer-card-solid .menu-header,
body[class*="q-customer-theme-"].q-customer-card-solid .categories,
body[class*="q-customer-theme-"].q-customer-card-solid .menu-filter-panel,
body[class*="q-customer-theme-"].q-customer-card-solid .basket-bar,
body[class*="q-customer-theme-"].q-customer-card-solid .card,
body[class*="q-customer-theme-"].q-customer-card-solid .summary,
body[class*="q-customer-theme-"].q-customer-card-solid .basket-page,
body[class*="q-customer-theme-"].q-customer-card-solid .basket-header,
body[class*="q-customer-theme-"].q-customer-card-solid .basket-item,
body[class*="q-customer-theme-"].q-customer-card-solid .basket-summary {
    background: var(--q-bg-elevated-strong) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

body[class*="q-customer-theme-"].q-customer-card-outline .menu-header,
body[class*="q-customer-theme-"].q-customer-card-outline .categories,
body[class*="q-customer-theme-"].q-customer-card-outline .menu-filter-panel,
body[class*="q-customer-theme-"].q-customer-card-outline .basket-bar,
body[class*="q-customer-theme-"].q-customer-card-outline .card,
body[class*="q-customer-theme-"].q-customer-card-outline .summary,
body[class*="q-customer-theme-"].q-customer-card-outline .basket-page,
body[class*="q-customer-theme-"].q-customer-card-outline .basket-header,
body[class*="q-customer-theme-"].q-customer-card-outline .basket-item,
body[class*="q-customer-theme-"].q-customer-card-outline .basket-summary {
    background: color-mix(in srgb, var(--q-bg-elevated) 56%, transparent) !important;
    border-color: color-mix(in srgb, var(--q-brand) 34%, var(--q-line)) !important;
}

body[class*="q-customer-theme-"] .menu-header strong,
body[class*="q-customer-theme-"] .menu-header span,
body[class*="q-customer-theme-"] .menus-caption,
body[class*="q-customer-theme-"] .menu-title,
body[class*="q-customer-theme-"] .cat-name,
body[class*="q-customer-theme-"] .menu-info h4,
body[class*="q-customer-theme-"] .basket-header h1,
body[class*="q-customer-theme-"] .basket-item-title,
body[class*="q-customer-theme-"] .basket-price,
body[class*="q-customer-theme-"] .summary h4,
body[class*="q-customer-theme-"] .summary-total,
body[class*="q-customer-theme-"] .price,
body[class*="q-customer-theme-"] label {
    color: var(--q-text) !important;
}

body[class*="q-customer-theme-"] .menu-info p,
body[class*="q-customer-theme-"] .menu-filter-label,
body[class*="q-customer-theme-"] .summary span,
body[class*="q-customer-theme-"] .basket-item-desc,
body[class*="q-customer-theme-"] .location-text,
body[class*="q-customer-theme-"] .summary-row,
body[class*="q-customer-theme-"] .empty-basket,
body[class*="q-customer-theme-"] .footer {
    color: var(--q-text-soft) !important;
}

/* Theme layout presets are intentionally visual-only. No grid/template/image size overrides. */
body[class*="q-customer-theme-"].q-customer-layout-hero .menu-header {
    background: linear-gradient(160deg, color-mix(in srgb, var(--q-brand) 20%, transparent), color-mix(in srgb, var(--q-bg-elevated-strong) 92%, transparent)), var(--q-venue-bg-image) !important;
    background-size: cover !important;
    background-position: center !important;
}

body[class*="q-customer-theme-"].q-customer-layout-compact .menu-header,
body[class*="q-customer-theme-"].q-customer-layout-compact .categories,
body[class*="q-customer-theme-"].q-customer-layout-compact .menu-filter-panel,
body[class*="q-customer-theme-"].q-customer-layout-compact .menu-item,
body[class*="q-customer-theme-"].q-customer-layout-compact .basket-item {
    box-shadow: 0 10px 24px rgba(0,0,0,.16) !important;
}

body[class*="q-customer-theme-"] .categories a,
body[class*="q-customer-theme-"] .basket-btn,
body[class*="q-customer-theme-"] .menu-header .btn-light,
body[class*="q-customer-theme-"] .secondary,
body[class*="q-customer-theme-"] .back-link,
body[class*="q-customer-theme-"] .wine-btn,
body[class*="q-customer-theme-"] .wine-size-btn {
    background: color-mix(in srgb, var(--q-brand) 16%, transparent) !important;
    border-color: color-mix(in srgb, var(--q-brand) 34%, var(--q-line)) !important;
    color: var(--q-text) !important;
}

body[class*="q-customer-theme-"] .categories a:hover,
body[class*="q-customer-theme-"] .basket-btn:hover,
body[class*="q-customer-theme-"] .menu-header .btn-light:hover,
body[class*="q-customer-theme-"] .secondary:hover,
body[class*="q-customer-theme-"] .back-link:hover,
body[class*="q-customer-theme-"] .wine-btn:hover,
body[class*="q-customer-theme-"] .wine-size-btn:hover {
    background: color-mix(in srgb, var(--q-brand) 24%, transparent) !important;
    color: var(--q-text) !important;
}

body[class*="q-customer-theme-"] .categories a.bg-dark.text-light,
body[class*="q-customer-theme-"] .add-btn,
body[class*="q-customer-theme-"] .basket-bar a,
body[class*="q-customer-theme-"] .primary,
body[class*="q-customer-theme-"] .checkout-btn,
body[class*="q-customer-theme-"] .swal2-confirm,
body[class*="q-customer-theme-"] .menu-scroll-top {
    background: linear-gradient(135deg, var(--q-brand), var(--q-brand-2)) !important;
    border-color: transparent !important;
    color: var(--q-on-brand) !important;
    box-shadow: 0 14px 32px color-mix(in srgb, var(--q-brand) 24%, transparent) !important;
}

body[class*="q-customer-theme-"] .add-btn *,
body[class*="q-customer-theme-"] .basket-bar a *,
body[class*="q-customer-theme-"] .primary *,
body[class*="q-customer-theme-"] .checkout-btn *,
body[class*="q-customer-theme-"] .swal2-confirm *,
body[class*="q-customer-theme-"] .menu-scroll-top * {
    color: var(--q-on-brand) !important;
}

body[class*="q-customer-theme-"] select,
body[class*="q-customer-theme-"] textarea,
body[class*="q-customer-theme-"] input,
body[class*="q-customer-theme-"] .form-control,
body[class*="q-customer-theme-"] .form-select {
    background: var(--q-bg-input) !important;
    border-color: var(--q-line) !important;
    color: var(--q-text) !important;
}

body[class*="q-customer-theme-"] .form-select option,
body[class*="q-customer-theme-"] select option,
body[class*="q-customer-theme-"] .form-select optgroup,
body[class*="q-customer-theme-"] select optgroup {
    background-color: var(--q-option-bg) !important;
    color: var(--q-option-text) !important;
}

body[class*="q-customer-theme-"] .form-control::placeholder,
body[class*="q-customer-theme-"] textarea::placeholder,
body[class*="q-customer-theme-"] input::placeholder {
    color: color-mix(in srgb, var(--q-muted) 84%, transparent) !important;
    opacity: 1 !important;
}

body[class*="q-customer-theme-"] .badge,
body[class*="q-customer-theme-"] .pill,
body[class*="q-customer-theme-"] .tag,
body[class*="q-customer-theme-"] .basket-count,
body[class*="q-customer-theme-"] .qty-control {
    background: color-mix(in srgb, var(--q-brand) 18%, transparent) !important;
    color: var(--q-text) !important;
    border-color: color-mix(in srgb, var(--q-brand) 34%, var(--q-line)) !important;
}

body[class*="q-customer-theme-"] .qty-btn,
body[class*="q-customer-theme-"] .remove-btn {
    color: var(--q-text) !important;
}

body[class*="q-customer-theme-"] a:not(.primary):not(.checkout-btn):not(.add-btn):not(.basket-bar a) {
    color: color-mix(in srgb, var(--q-brand) 72%, var(--q-text)) !important;
}

body.q-customer-graphics-none::before,
body.q-customer-graphics-none::after {
    display: none !important;
}

body.q-customer-graphics-aurora::before,
body.q-customer-graphics-orbs::before,
body.q-customer-graphics-stripes::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
}

body.q-customer-graphics-aurora::before {
    background: radial-gradient(circle at 12% 16%, color-mix(in srgb, var(--q-brand) 24%, transparent), transparent 34%), radial-gradient(circle at 86% 12%, color-mix(in srgb, var(--q-brand-2) 18%, transparent), transparent 34%);
}

body.q-customer-graphics-orbs::before {
    background: radial-gradient(circle at 18% 20%, color-mix(in srgb, var(--q-brand) 30%, transparent), transparent 18%), radial-gradient(circle at 82% 72%, color-mix(in srgb, var(--q-brand-2) 22%, transparent), transparent 20%);
    filter: blur(6px);
}

body.q-customer-graphics-stripes::before {
    background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--q-brand) 10%, transparent) 0 1px, transparent 1px 16px);
}


/* =========================================================
   CONTRAST HARDENING LAYER
   This section deliberately uses higher specificity + !important because
   several customer pages contain inline/page-level colours and Bootstrap
   utility classes such as .text-dark/.text-muted. Tenant themes must never
   make customer text unreadable.
   ========================================================= */
body[class*="q-customer-theme-"] .text-dark,
body[class*="q-customer-theme-"] .text-black,
body[class*="q-customer-theme-"] .text-body,
body[class*="q-customer-theme-"] .text-muted,
body[class*="q-customer-theme-"] .swal2-title,
body[class*="q-customer-theme-"] .swal2-html-container,
body[class*="q-customer-theme-"] .swal2-content,
body[class*="q-customer-theme-"] .swal2-popup.swal-light-gradient .swal2-title,
body[class*="q-customer-theme-"] .swal2-popup.swal-light-gradient .swal2-html-container,
body[class*="q-customer-theme-"] .swal2-popup.swal-light-gradient .text-dark,
body[class*="q-customer-theme-"] .swal2-popup.swal-light-gradient .text-muted {
    color: var(--q-text) !important;
}

body[class*="q-customer-theme-"] .swal2-popup,
body[class*="q-customer-theme-"] .swal2-popup.swal-light-gradient {
    background: var(--q-bg-elevated-strong) !important;
    color: var(--q-text) !important;
    border: 1px solid var(--q-line) !important;
}

body[class*="q-customer-theme-"] .swal2-popup *,
body[class*="q-customer-theme-"] .menu-item *,
body[class*="q-customer-theme-"] .menu-header *,
body[class*="q-customer-theme-"] .categories *,
body[class*="q-customer-theme-"] .menu-filter-panel *,
body[class*="q-customer-theme-"] .basket-bar *,
body[class*="q-customer-theme-"] .basket-page *,
body[class*="q-customer-theme-"] .basket-item *,
body[class*="q-customer-theme-"] .basket-summary *,
body[class*="q-customer-theme-"] .summary * {
    text-shadow: none;
}

body[class*="q-customer-theme-"] .swal2-popup h1,
body[class*="q-customer-theme-"] .swal2-popup h2,
body[class*="q-customer-theme-"] .swal2-popup h3,
body[class*="q-customer-theme-"] .swal2-popup h4,
body[class*="q-customer-theme-"] .swal2-popup h5,
body[class*="q-customer-theme-"] .swal2-popup h6,
body[class*="q-customer-theme-"] .swal2-popup p,
body[class*="q-customer-theme-"] .swal2-popup span,
body[class*="q-customer-theme-"] .swal2-popup div:not(.badge),
body[class*="q-customer-theme-"] .swal2-popup label:not(.modifier-choice) {
    color: var(--q-text) !important;
}

body[class*="q-customer-theme-"] .modifier-choice {
    color: var(--q-text) !important;
    border-color: color-mix(in srgb, var(--q-brand) 34%, var(--q-line)) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.10), 0 10px 22px rgba(0,0,0,.12) !important;
}

body[class*="q-customer-theme-"] .modifier-choice .badge,
body[class*="q-customer-theme-"] .wine-size-btn .badge {
    background: var(--q-bg-3) !important;
    color: var(--q-text) !important;
    border: 1px solid var(--q-line) !important;
}

body[class*="q-customer-theme-"] .btn-secondary,
body[class*="q-customer-theme-"] .swal2-cancel {
    background: var(--q-bg-input) !important;
    border-color: var(--q-line) !important;
    color: var(--q-text) !important;
}

body[class*="q-customer-theme-"] .btn-close,
body[class*="q-customer-theme-"] .btn-close-white {
    filter: none !important;
}

body[class*="q-customer-theme-"] .menu-item {
    color: var(--q-text) !important;
}

body[class*="q-customer-theme-"] .cat-name span,
body[class*="q-customer-theme-"] .menu-title,
body[class*="q-customer-theme-"] .toast-style,
body[class*="q-customer-theme-"] .toast-style * {
    color: var(--q-text) !important;
}

/* =========================================================
   FINAL READABILITY GUARDRAILS
   Customer pages and SweetAlert dialogs must remain readable with every
   venue palette. These rules do not change layout; they only take ownership
   of colour on legacy/Bootstrap text utilities and common customer surfaces.
   ========================================================= */
body[class*="q-customer-theme-"] {
    --bs-body-color: var(--q-text) !important;
    --bs-secondary-color: var(--q-text-soft) !important;
    --bs-tertiary-color: var(--q-muted) !important;
    --bs-emphasis-color: var(--q-text) !important;
    --bs-heading-color: var(--q-text) !important;
    --bs-link-color: color-mix(in srgb, var(--q-brand) 72%, var(--q-text)) !important;
    --bs-link-hover-color: color-mix(in srgb, var(--q-brand-2) 74%, var(--q-text)) !important;
}

body[class*="q-customer-theme-"] .menu-item,
body[class*="q-customer-theme-"] .menu-card,
body[class*="q-customer-theme-"] .item-card,
body[class*="q-customer-theme-"] .category-card,
body[class*="q-customer-theme-"] .modifier-card,
body[class*="q-customer-theme-"] .modifier-choice,
body[class*="q-customer-theme-"] .wine-size-btn,
body[class*="q-customer-theme-"] .wine-btn,
body[class*="q-customer-theme-"] .basket-card,
body[class*="q-customer-theme-"] .basket-item,
body[class*="q-customer-theme-"] .basket-summary,
body[class*="q-customer-theme-"] .summary,
body[class*="q-customer-theme-"] .swal2-popup,
body[class*="q-customer-theme-"] [class*="card"],
body[class*="q-customer-theme-"] [class*="panel"],
body[class*="q-customer-theme-"] [style*="background: rgba(0, 0, 0"],
body[class*="q-customer-theme-"] [style*="background:rgba(0, 0, 0"],
body[class*="q-customer-theme-"] [style*="background-color: rgba(0, 0, 0"],
body[class*="q-customer-theme-"] [style*="background-color:rgba(0, 0, 0"],
body[class*="q-customer-theme-"] [style*="background: rgba(255, 255, 255"],
body[class*="q-customer-theme-"] [style*="background:rgba(255, 255, 255"],
body[class*="q-customer-theme-"] [style*="background-color: rgba(255, 255, 255"],
body[class*="q-customer-theme-"] [style*="background-color:rgba(255, 255, 255"] {
    background: var(--q-bg-elevated) !important;
    border-color: var(--q-line) !important;
    color: var(--q-text) !important;
}

body[class*="q-customer-theme-"] .text-light,
body[class*="q-customer-theme-"] .text-white,
body[class*="q-customer-theme-"] .text-dark,
body[class*="q-customer-theme-"] .text-black,
body[class*="q-customer-theme-"] .text-body,
body[class*="q-customer-theme-"] .text-secondary,
body[class*="q-customer-theme-"] .text-muted,
body[class*="q-customer-theme-"] .lead,
body[class*="q-customer-theme-"] p,
body[class*="q-customer-theme-"] span,
body[class*="q-customer-theme-"] label,
body[class*="q-customer-theme-"] small,
body[class*="q-customer-theme-"] li,
body[class*="q-customer-theme-"] td,
body[class*="q-customer-theme-"] th,
body[class*="q-customer-theme-"] .swal2-title,
body[class*="q-customer-theme-"] .swal2-html-container,
body[class*="q-customer-theme-"] .swal2-content {
    color: var(--q-text) !important;
}

body[class*="q-customer-theme-"] .text-warning { color: #f59e0b !important; }
body[class*="q-customer-theme-"] .text-info { color: #06b6d4 !important; }
body[class*="q-customer-theme-"] .text-danger { color: #ef4444 !important; }
body[class*="q-customer-theme-"] .text-success { color: #22c55e !important; }

body[class*="q-customer-theme-"] .btn,
body[class*="q-customer-theme-"] button,
body[class*="q-customer-theme-"] a.btn {
    color: var(--q-text) !important;
}

body[class*="q-customer-theme-"] .btn-primary,
body[class*="q-customer-theme-"] .btn-success,
body[class*="q-customer-theme-"] .btn-info,
body[class*="q-customer-theme-"] .btn-warning,
body[class*="q-customer-theme-"] .btn-danger,
body[class*="q-customer-theme-"] .add-btn,
body[class*="q-customer-theme-"] .basket-bar a,
body[class*="q-customer-theme-"] .primary,
body[class*="q-customer-theme-"] .checkout-btn,
body[class*="q-customer-theme-"] .swal2-confirm,
body[class*="q-customer-theme-"] .menu-scroll-top {
    color: var(--q-on-brand) !important;
}

body[class*="q-customer-theme-"] .btn-primary *,
body[class*="q-customer-theme-"] .btn-success *,
body[class*="q-customer-theme-"] .btn-info *,
body[class*="q-customer-theme-"] .btn-warning *,
body[class*="q-customer-theme-"] .btn-danger *,
body[class*="q-customer-theme-"] .add-btn *,
body[class*="q-customer-theme-"] .basket-bar a *,
body[class*="q-customer-theme-"] .primary *,
body[class*="q-customer-theme-"] .checkout-btn *,
body[class*="q-customer-theme-"] .swal2-confirm *,
body[class*="q-customer-theme-"] .menu-scroll-top * {
    color: inherit !important;
}

/* CSS fallback before the runtime contrast audit runs. The customer app can be
   themed light or dark, so utility classes and hand-written menu text must not
   assume one fixed foreground colour. */
body.q-customer-scheme-light {
    --q-readable-page-text: #111827;
    --q-readable-page-soft: #334155;
    --q-readable-page-muted: #64748b;
}

body.q-customer-scheme-dark {
    --q-readable-page-text: #f8fafc;
    --q-readable-page-soft: #dbeafe;
    --q-readable-page-muted: #aab8cf;
}

body[class*="q-customer-theme-"] main,
body[class*="q-customer-theme-"] main h1,
body[class*="q-customer-theme-"] main h2,
body[class*="q-customer-theme-"] main h3,
body[class*="q-customer-theme-"] main h4,
body[class*="q-customer-theme-"] main h5,
body[class*="q-customer-theme-"] main h6,
body[class*="q-customer-theme-"] main p,
body[class*="q-customer-theme-"] main label,
body[class*="q-customer-theme-"] main small,
body[class*="q-customer-theme-"] main span,
body[class*="q-customer-theme-"] main li,
body[class*="q-customer-theme-"] main td,
body[class*="q-customer-theme-"] main th,
body[class*="q-customer-theme-"] .swal2-popup,
body[class*="q-customer-theme-"] .swal2-popup * {
    color: var(--q-readable-page-text, var(--q-text)) !important;
}

body[class*="q-customer-theme-"] main .text-muted,
body[class*="q-customer-theme-"] main .text-secondary,
body[class*="q-customer-theme-"] main .form-text,
body[class*="q-customer-theme-"] main .description,
body[class*="q-customer-theme-"] main .muted,
body[class*="q-customer-theme-"] .swal2-html-container,
body[class*="q-customer-theme-"] .swal2-footer {
    color: var(--q-readable-page-soft, var(--q-text-soft)) !important;
}

body[class*="q-customer-theme-"] .btn-primary,
body[class*="q-customer-theme-"] .add-button,
body[class*="q-customer-theme-"] .basket-button,
body[class*="q-customer-theme-"] button[type="submit"] {
    color: var(--q-on-brand) !important;
}

/* =========================================================
   ABSOLUTE MODIFIER READABILITY / COLOUR PRESERVATION
   Modifier colours are operational data, not tenant-theme chrome. The theme
   must never wash them out. Each modifier button carries calculated CSS
   variables from swal_helper.js; these rules deliberately sit last.
   ========================================================= */
body[class*="q-customer-theme-"] .swal2-popup .modifier-choice,
body[class*="q-customer-theme-"] .swal2-popup .modifier-choice:not(.active) {
    background: var(--modifier-bg, rgba(85,153,85,.30)) !important;
    color: var(--modifier-fg, #020617) !important;
    border: 1px solid var(--modifier-border, #559955) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.28), 0 14px 28px rgba(0,0,0,.12) !important;
}

body[class*="q-customer-theme-"] .swal2-popup .modifier-choice.active {
    background: var(--modifier-bg, #559955) !important;
    color: var(--modifier-fg, #ffffff) !important;
    border-color: var(--modifier-border, #559955) !important;
    box-shadow: 0 18px 38px rgba(0,0,0,.20), 0 0 0 3px color-mix(in srgb, var(--modifier-border, #559955) 32%, transparent) !important;
}

body[class*="q-customer-theme-"] .swal2-popup .modifier-choice,
body[class*="q-customer-theme-"] .swal2-popup .modifier-choice *,
body[class*="q-customer-theme-"] .swal2-popup .modifier-choice .modifier-label,
body[class*="q-customer-theme-"] .swal2-popup .modifier-choice .modifier-label span:not(.badge) {
    color: var(--modifier-fg, currentColor) !important;
    text-shadow: none !important;
}

body[class*="q-customer-theme-"] .swal2-popup .modifier-choice .modifier-price-badge,
body[class*="q-customer-theme-"] .swal2-popup .modifier-choice .badge {
    background: var(--modifier-badge-bg, rgba(2,6,23,.92)) !important;
    color: var(--modifier-badge-fg, #ffffff) !important;
    border: 1px solid var(--modifier-badge-border, var(--modifier-border, #559955)) !important;
}

/* =========================================================
   ABSOLUTE CUSTOMER READABILITY PATCH
   Customer theme starts only after a venue has been resolved. Once active,
   every visible text surface uses theme-safe foregrounds, while operational
   modifier colours remain protected by their own calculated variables.
   ========================================================= */
body:not([class*="q-customer-theme-"]) {
    color-scheme: dark;
}

body[class*="q-customer-theme-"] :where(h1,h2,h3,h4,h5,h6,p,span,small,label,strong,li,td,th,button,a):not([data-q-contrast-ignore]):not([data-q-contrast-ignore] *) {
    text-shadow: none !important;
}

body[class*="q-customer-theme-"] .swal2-popup {
    background: var(--q-bg-elevated-strong) !important;
    color: var(--q-text) !important;
}

body[class*="q-customer-theme-"] .swal2-popup :where(h1,h2,h3,h4,h5,h6,p,span,small,label,strong,div):not(.modifier-choice):not(.modifier-choice *) {
    color: var(--q-text) !important;
}

body[class*="q-customer-theme-"] .modifier-choice,
body[class*="q-customer-theme-"] .modifier-choice * {
    color: var(--modifier-fg, currentColor) !important;
}

body[class*="q-customer-theme-"] .modifier-choice .badge,
body[class*="q-customer-theme-"] .modifier-choice .modifier-price-badge {
    color: var(--modifier-badge-fg, #ffffff) !important;
    background: var(--modifier-badge-bg, rgba(2,6,23,.92)) !important;
    border-color: var(--modifier-badge-border, var(--modifier-border, #559955)) !important;
}


/* =========================================================
   CUSTOMER FORM CONTROL READABILITY LOCKDOWN
   Protect floating labels, file controls and buttons from tenant palettes on
   account/profile pages and any customer form screen.
   ========================================================= */
body[class*="q-customer-theme-"] .form-floating > label,
body[class*="q-customer-theme-"] .form-floating > .form-control:focus ~ label,
body[class*="q-customer-theme-"] .form-floating > .form-control:not(:placeholder-shown) ~ label,
body[class*="q-customer-theme-"] .form-floating > .form-select ~ label {
    color: var(--q-text) !important;
    background: color-mix(in srgb, var(--q-bg-elevated-strong) 92%, transparent) !important;
    border-radius: .45rem !important;
    padding-inline: .45rem !important;
    opacity: 1 !important;
    text-shadow: none !important;
}

body[class*="q-customer-theme-"] .form-floating > .form-control,
body[class*="q-customer-theme-"] .form-floating > .form-select,
body[class*="q-customer-theme-"] .profile-card input,
body[class*="q-customer-theme-"] .profile-card select,
body[class*="q-customer-theme-"] .profile-card textarea {
    background: var(--q-bg-input) !important;
    border: 1px solid var(--q-line) !important;
    color: var(--q-text) !important;
}

body[class*="q-customer-theme-"] input[type="file"],
body[class*="q-customer-theme-"] .form-control[type="file"] {
    background: var(--q-bg-input) !important;
    border: 1px solid var(--q-line) !important;
    color: var(--q-text) !important;
}

body[class*="q-customer-theme-"] input[type="file"]::file-selector-button,
body[class*="q-customer-theme-"] .form-control[type="file"]::file-selector-button {
    background: color-mix(in srgb, var(--q-text) 12%, var(--q-bg-elevated-strong)) !important;
    border: 0 !important;
    border-right: 1px solid var(--q-line) !important;
    color: var(--q-text) !important;
    font-weight: 700 !important;
}

body[class*="q-customer-theme-"] input[type="file"]::-webkit-file-upload-button,
body[class*="q-customer-theme-"] .form-control[type="file"]::-webkit-file-upload-button {
    background: color-mix(in srgb, var(--q-text) 12%, var(--q-bg-elevated-strong)) !important;
    border: 0 !important;
    border-right: 1px solid var(--q-line) !important;
    color: var(--q-text) !important;
    font-weight: 700 !important;
}

body[class*="q-customer-theme-"] .btn,
body[class*="q-customer-theme-"] button,
body[class*="q-customer-theme-"] a.btn {
    text-shadow: none !important;
}

body[class*="q-customer-theme-"] .btn-dark,
body[class*="q-customer-theme-"] a.btn-dark,
body[class*="q-customer-theme-"] button.btn-dark {
    background: #111827 !important;
    border-color: #111827 !important;
    color: #f8fafc !important;
}

body[class*="q-customer-theme-"] .btn-dark *,
body[class*="q-customer-theme-"] a.btn-dark *,
body[class*="q-customer-theme-"] button.btn-dark * {
    color: #f8fafc !important;
}

body[class*="q-customer-theme-"] .btn-secondary,
body[class*="q-customer-theme-"] a.btn-secondary,
body[class*="q-customer-theme-"] button.btn-secondary,
body[class*="q-customer-theme-"] .secondary {
    background: var(--q-bg-input) !important;
    border: 1px solid var(--q-line) !important;
    color: var(--q-text) !important;
}

body[class*="q-customer-theme-"] .btn-secondary *,
body[class*="q-customer-theme-"] a.btn-secondary *,
body[class*="q-customer-theme-"] button.btn-secondary *,
body[class*="q-customer-theme-"] .secondary * {
    color: var(--q-text) !important;
}

/* Menu/category filter shell: keep the rows visually premium without relying
   on page-level legacy .categories backgrounds. */
body[class*="q-customer-theme-"] .menu-filter-panel {
    background: linear-gradient(180deg, color-mix(in srgb, var(--q-bg-elevated-strong) 94%, transparent), color-mix(in srgb, var(--q-bg-elevated) 90%, transparent)) !important;
    border-color: var(--q-line) !important;
    color: var(--q-text) !important;
}

body[class*="q-customer-theme-"] .menu-filter-panel .categories {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    color: var(--q-text) !important;
}

body[class*="q-customer-theme-"] .menu-filter-label,
body[class*="q-customer-theme-"] .menu-filter-label * {
    color: var(--q-text-soft) !important;
}

/* =========================================================
   ABSOLUTE CUSTOMER ACTION BUTTON READABILITY
   Venue owners can choose any two accent colours for customer gradients.
   These rules keep primary actions, menu/category pills, basket actions and
   SweetAlert action buttons readable even when the chosen gradient crosses
   very light, very dark or clashing colours. Runtime JS sets the --q-action-*
   variables per element; the C# theme builder provides safe no-JS fallbacks.
   ========================================================= */
body[class*="q-customer-theme-"] .categories a,
body[class*="q-customer-theme-"] .basket-btn,
body[class*="q-customer-theme-"] .basket-btn .badge,
body[class*="q-customer-theme-"] .menu-header .btn-light,
body[class*="q-customer-theme-"] .secondary,
body[class*="q-customer-theme-"] .back-link,
body[class*="q-customer-theme-"] .wine-btn,
body[class*="q-customer-theme-"] .wine-size-btn {
    background: linear-gradient(var(--q-action-overlay, transparent), var(--q-action-overlay, transparent)), color-mix(in srgb, var(--q-brand) 18%, var(--q-bg-elevated-strong)) !important;
    border-color: color-mix(in srgb, var(--q-brand) 36%, var(--q-line)) !important;
    color: var(--q-action-fg, var(--q-text)) !important;
    text-shadow: var(--q-action-text-shadow, none) !important;
}

body[class*="q-customer-theme-"] .categories a.bg-dark.text-light,
body[class*="q-customer-theme-"] .add-btn,
body[class*="q-customer-theme-"] .basket-bar a,
body[class*="q-customer-theme-"] .primary,
body[class*="q-customer-theme-"] .checkout-btn,
body[class*="q-customer-theme-"] .btn-primary,
body[class*="q-customer-theme-"] button[type="submit"],
body[class*="q-customer-theme-"] .swal2-confirm,
body[class*="q-customer-theme-"] .menu-scroll-top {
    background: linear-gradient(var(--q-action-overlay, var(--q-brand-readable-overlay, transparent)), var(--q-action-overlay, var(--q-brand-readable-overlay, transparent))), linear-gradient(135deg, var(--q-brand), var(--q-brand-2)) !important;
    border-color: transparent !important;
    color: var(--q-action-fg, var(--q-on-brand-gradient, var(--q-on-brand))) !important;
    text-shadow: var(--q-action-text-shadow, none) !important;
}

body[class*="q-customer-theme-"] .swal2-cancel,
body[class*="q-customer-theme-"] .swal2-deny {
    color: var(--q-action-fg, #ffffff) !important;
    text-shadow: var(--q-action-text-shadow, none) !important;
}

body[class*="q-customer-theme-"] .menu-item[href] {
    color: var(--q-action-fg, #ffffff) !important;
    text-shadow: var(--q-action-text-shadow, none) !important;
}

body[class*="q-customer-theme-"] .menu-item[href]::after {
    background: var(--q-action-overlay, rgba(0,0,0,.42)) !important;
}

body[class*="q-customer-theme-"] .categories a *,
body[class*="q-customer-theme-"] .basket-btn *,
body[class*="q-customer-theme-"] .basket-btn .badge,
body[class*="q-customer-theme-"] .menu-header .btn-light *,
body[class*="q-customer-theme-"] .secondary *,
body[class*="q-customer-theme-"] .back-link *,
body[class*="q-customer-theme-"] .wine-btn *,
body[class*="q-customer-theme-"] .wine-size-btn *,
body[class*="q-customer-theme-"] .add-btn *,
body[class*="q-customer-theme-"] .basket-bar a *,
body[class*="q-customer-theme-"] .primary *,
body[class*="q-customer-theme-"] .checkout-btn *,
body[class*="q-customer-theme-"] .btn-primary *,
body[class*="q-customer-theme-"] button[type="submit"] *,
body[class*="q-customer-theme-"] .swal2-confirm *,
body[class*="q-customer-theme-"] .menu-scroll-top *,
body[class*="q-customer-theme-"] .swal2-cancel *,
body[class*="q-customer-theme-"] .swal2-deny *,
body[class*="q-customer-theme-"] .menu-item[href] .menu-title,
body[class*="q-customer-theme-"] .menu-item[href] .price,
body[class*="q-customer-theme-"] .menu-item[href] .menu-meta,
body[class*="q-customer-theme-"] .menu-item[href] .menu-meta *,
body[class*="q-customer-theme-"] .menu-item[href] .menu-info,
body[class*="q-customer-theme-"] .menu-item[href] .menu-info * {
    color: inherit !important;
    text-shadow: inherit !important;
}

/* =========================================================
   GUEST THEME SELECTOR
   A per-device customer override for the same 14 presets exposed in the
   admin portal. It changes palette tokens only; venue layout, graphics,
   accents, card style and background imagery remain under owner control.
   ========================================================= */
.qrelia-theme-switcher[hidden],
.qrelia-theme-panel[hidden],
.qrelia-theme-backdrop[hidden] {
    display: none !important;
}

body.qrelia-theme-panel-open {
    overflow: hidden !important;
}

.qrelia-theme-trigger {
    position: fixed;
    left: max(14px, env(safe-area-inset-left));
    bottom: calc(82px + env(safe-area-inset-bottom));
    z-index: 2147480500;
    min-height: 50px;
    max-width: min(220px, calc(100vw - 28px));
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 7px 13px 7px 8px;
    border: 1px solid color-mix(in srgb, var(--q-brand) 30%, var(--q-line));
    border-radius: 999px;
    color: var(--q-text);
    background: color-mix(in srgb, var(--q-bg-elevated-strong) 92%, transparent);
    box-shadow: 0 16px 38px rgba(0, 0, 0, .25), inset 0 1px 0 rgba(255, 255, 255, .08);
    backdrop-filter: blur(18px) saturate(1.15);
    -webkit-backdrop-filter: blur(18px) saturate(1.15);
    cursor: pointer;
    isolation: isolate;
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.qrelia-theme-trigger::before {
    content: "";
    position: absolute;
    inset: -1px;
    z-index: -1;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, color-mix(in srgb, var(--q-brand) 64%, transparent), color-mix(in srgb, var(--q-brand-2) 54%, transparent), transparent 72%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: .75;
}

.qrelia-theme-trigger:hover,
.qrelia-theme-trigger:focus-visible {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--q-brand) 58%, var(--q-line));
    background: color-mix(in srgb, var(--q-bg-elevated-strong) 97%, transparent);
    box-shadow: 0 20px 46px rgba(0, 0, 0, .3), 0 0 0 4px var(--q-focus-ring);
    outline: none;
}

.qrelia-theme-trigger__icon {
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--q-on-brand-gradient);
    background: linear-gradient(135deg, var(--q-brand), var(--q-brand-2));
    box-shadow: 0 8px 22px color-mix(in srgb, var(--q-brand) 30%, transparent);
}

.qrelia-theme-trigger__icon svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.qrelia-theme-trigger__copy {
    min-width: 0;
    display: grid;
    gap: 1px;
    text-align: left;
    line-height: 1.15;
}

.qrelia-theme-trigger__copy > span {
    color: var(--q-muted);
    font-size: .62rem;
    font-weight: 850;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.qrelia-theme-trigger__copy strong {
    max-width: 145px;
    overflow: hidden;
    color: var(--q-text);
    font-size: .77rem;
    font-weight: 850;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.qrelia-theme-backdrop {
    position: fixed;
    inset: 0;
    z-index: 2147482400;
    background: rgba(2, 6, 23, .56);
    opacity: 0;
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
    transition: opacity .22s ease;
}

.qrelia-theme-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 2147482500;
    width: min(540px, 100vw);
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--q-line);
    color: var(--q-text);
    background:
        radial-gradient(circle at 12% 0%, color-mix(in srgb, var(--q-brand) 19%, transparent), transparent 32%),
        radial-gradient(circle at 94% 8%, color-mix(in srgb, var(--q-brand-2) 15%, transparent), transparent 34%),
        var(--q-bg-elevated-strong);
    box-shadow: -36px 0 90px rgba(0, 0, 0, .38);
    transform: translateX(104%);
    transition: transform .28s cubic-bezier(.2, .78, .2, 1);
    overflow: hidden;
}

.qrelia-theme-switcher.is-open .qrelia-theme-backdrop {
    opacity: 1;
}

.qrelia-theme-switcher.is-open .qrelia-theme-panel {
    transform: translateX(0);
}

.qrelia-theme-panel__handle {
    display: none;
}

.qrelia-theme-panel__header {
    flex: 0 0 auto;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 28px 28px 20px;
    border-bottom: 1px solid var(--q-line);
    background: color-mix(in srgb, var(--q-bg-elevated-strong) 78%, transparent);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.qrelia-theme-panel__eyebrow {
    display: block;
    margin-bottom: 6px;
    color: color-mix(in srgb, var(--q-brand) 72%, var(--q-text));
    font-size: .68rem;
    font-weight: 900;
    letter-spacing: .15em;
    text-transform: uppercase;
}

.qrelia-theme-panel__header h2 {
    margin: 0;
    color: var(--q-text);
    font-size: clamp(1.35rem, 3.5vw, 1.8rem);
    font-weight: 900;
    letter-spacing: -.035em;
}

.qrelia-theme-panel__header p {
    max-width: 390px;
    margin: 8px 0 0;
    color: var(--q-text-soft);
    font-size: .82rem;
    line-height: 1.55;
}

.qrelia-theme-close {
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--q-line);
    border-radius: 50%;
    color: var(--q-text);
    background: var(--q-bg-input);
    cursor: pointer;
    transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
}

.qrelia-theme-close:hover,
.qrelia-theme-close:focus-visible {
    transform: rotate(4deg) scale(1.04);
    background: color-mix(in srgb, var(--q-brand) 18%, var(--q-bg-input));
    box-shadow: 0 0 0 4px var(--q-focus-ring);
    outline: none;
}

.qrelia-theme-close svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

.qrelia-theme-grid {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: start;
    gap: 12px;
    padding: 20px 22px 28px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--q-brand) 42%, transparent) transparent;
}

.qrelia-theme-option {
    position: relative;
    min-width: 0;
    display: grid;
    grid-template-rows: 92px auto;
    gap: 10px;
    padding: 9px 9px 12px;
    border: 1px solid var(--q-line);
    border-radius: 20px;
    color: var(--q-text);
    background: color-mix(in srgb, var(--q-bg-elevated) 76%, transparent);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .055), 0 12px 26px rgba(0, 0, 0, .1);
    text-align: left;
    cursor: pointer;
    overflow: hidden;
    transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.qrelia-theme-option:hover,
.qrelia-theme-option:focus-visible {
    transform: translateY(-2px);
    border-color: color-mix(in srgb, var(--q-brand) 54%, var(--q-line));
    background: color-mix(in srgb, var(--q-brand) 8%, var(--q-bg-elevated));
    box-shadow: 0 16px 34px rgba(0, 0, 0, .16), 0 0 0 3px var(--q-focus-ring);
    outline: none;
}

.qrelia-theme-option.is-selected {
    border-color: color-mix(in srgb, var(--q-brand) 78%, var(--q-line));
    background: color-mix(in srgb, var(--q-brand) 12%, var(--q-bg-elevated));
    box-shadow: 0 18px 38px rgba(0, 0, 0, .17), 0 0 0 2px color-mix(in srgb, var(--q-brand) 32%, transparent);
}

.qrelia-theme-option__preview {
    --preview-bg: #07111f;
    --preview-bg-2: #0b1628;
    --preview-card: rgba(10, 18, 34, .88);
    --preview-line: rgba(255, 255, 255, .11);
    --preview-accent: #4fd8ff;
    position: relative;
    display: grid;
    grid-template-columns: 1.35fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 7px;
    padding: 12px;
    border: 1px solid var(--preview-line);
    border-radius: 14px;
    background: linear-gradient(145deg, var(--preview-bg), var(--preview-bg-2));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
    overflow: hidden;
}

.qrelia-theme-option__glow {
    position: absolute;
    top: -28px;
    right: -20px;
    width: 82px;
    height: 82px;
    border-radius: 50%;
    background: var(--preview-accent);
    filter: blur(21px);
    opacity: .36;
}

.qrelia-theme-option__surface {
    position: relative;
    z-index: 1;
    min-width: 0;
    border: 1px solid var(--preview-line);
    border-radius: 8px;
    background: var(--preview-card);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}

.qrelia-theme-option__surface::before,
.qrelia-theme-option__surface::after {
    content: "";
    position: absolute;
    left: 7px;
    right: 7px;
    height: 3px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--preview-accent) 64%, transparent);
}

.qrelia-theme-option__surface::before {
    top: 8px;
}

.qrelia-theme-option__surface::after {
    top: 15px;
    right: 34%;
    opacity: .42;
}

.qrelia-theme-option__surface--wide {
    grid-row: 1 / span 2;
}

.qrelia-theme-option__copy {
    min-width: 0;
    display: grid;
    gap: 3px;
    padding: 0 3px;
}

.qrelia-theme-option__copy strong {
    overflow: hidden;
    color: var(--q-text);
    font-size: .78rem;
    font-weight: 900;
    line-height: 1.22;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.qrelia-theme-option__copy small {
    min-height: 2.55em;
    display: -webkit-box;
    overflow: hidden;
    color: var(--q-muted);
    font-size: .64rem;
    line-height: 1.3;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.qrelia-theme-option__check {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 3;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, .4);
    border-radius: 50%;
    color: var(--q-on-brand-gradient);
    background: linear-gradient(135deg, var(--q-brand), var(--q-brand-2));
    box-shadow: 0 8px 18px rgba(0, 0, 0, .24);
    opacity: 0;
    transform: scale(.65) rotate(-8deg);
    transition: opacity .18s ease, transform .18s ease;
}

.qrelia-theme-option.is-selected .qrelia-theme-option__check {
    opacity: 1;
    transform: scale(1) rotate(0);
}

.qrelia-theme-option__check svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.qrelia-theme-option__preview[data-preview-theme="midnight"] {
    --preview-bg: #050914;
    --preview-bg-2: #08101e;
    --preview-card: rgba(10, 18, 34, .9);
    --preview-line: rgba(255, 255, 255, .11);
    --preview-accent: #4fd8ff;
}

.qrelia-theme-option__preview[data-preview-theme="champagne"] {
    --preview-bg: #f7efe5;
    --preview-bg-2: #efe1cf;
    --preview-card: rgba(255, 248, 239, .93);
    --preview-line: rgba(61, 43, 30, .18);
    --preview-accent: #bd8747;
}

.qrelia-theme-option__preview[data-preview-theme="forest"] {
    --preview-bg: #07120e;
    --preview-bg-2: #0d2119;
    --preview-card: rgba(8, 31, 23, .9);
    --preview-line: rgba(200, 255, 220, .14);
    --preview-accent: #37d78d;
}

.qrelia-theme-option__preview[data-preview-theme="ruby"] {
    --preview-bg: #17070b;
    --preview-bg-2: #2a0d16;
    --preview-card: rgba(59, 18, 32, .9);
    --preview-line: rgba(255, 210, 220, .14);
    --preview-accent: #fb7185;
}

.qrelia-theme-option__preview[data-preview-theme="minimal"] {
    --preview-bg: #f6f8fb;
    --preview-bg-2: #eef2f7;
    --preview-card: rgba(255, 255, 255, .96);
    --preview-line: rgba(17, 24, 39, .14);
    --preview-accent: #4f7cff;
}

.qrelia-theme-option__preview[data-preview-theme="ocean"] {
    --preview-bg: #031923;
    --preview-bg-2: #073244;
    --preview-card: rgba(6, 45, 62, .92);
    --preview-line: rgba(190, 245, 255, .15);
    --preview-accent: #38bdf8;
}

.qrelia-theme-option__preview[data-preview-theme="lavender"] {
    --preview-bg: #f7f3ff;
    --preview-bg-2: #ece5ff;
    --preview-card: rgba(255, 255, 255, .96);
    --preview-line: rgba(60, 35, 100, .16);
    --preview-accent: #9b87f5;
}

.qrelia-theme-option__preview[data-preview-theme="sunset"] {
    --preview-bg: #1e0b09;
    --preview-bg-2: #3a1710;
    --preview-card: rgba(58, 23, 16, .92);
    --preview-line: rgba(255, 216, 190, .16);
    --preview-accent: #fb923c;
}

.qrelia-theme-option__preview[data-preview-theme="slate"] {
    --preview-bg: #0f172a;
    --preview-bg-2: #172033;
    --preview-card: rgba(31, 41, 55, .94);
    --preview-line: rgba(226, 232, 240, .14);
    --preview-accent: #94a3b8;
}

.qrelia-theme-option__preview[data-preview-theme="copper"] {
    --preview-bg: #160d08;
    --preview-bg-2: #2b1a0f;
    --preview-card: rgba(65, 38, 21, .92);
    --preview-line: rgba(255, 224, 190, .16);
    --preview-accent: #c77b38;
}

.qrelia-theme-option__preview[data-preview-theme="neon"] {
    --preview-bg: #07060f;
    --preview-bg-2: #111025;
    --preview-card: rgba(25, 20, 58, .94);
    --preview-line: rgba(220, 210, 255, .16);
    --preview-accent: #c084fc;
}

.qrelia-theme-option__preview[data-preview-theme="porcelain"] {
    --preview-bg: #f8fbff;
    --preview-bg-2: #edf4fb;
    --preview-card: rgba(255, 255, 255, .97);
    --preview-line: rgba(15, 45, 75, .14);
    --preview-accent: #60a5fa;
}

.qrelia-theme-option__preview[data-preview-theme="tropical"] {
    --preview-bg: #041512;
    --preview-bg-2: #082a22;
    --preview-card: rgba(13, 63, 51, .92);
    --preview-line: rgba(190, 255, 235, .15);
    --preview-accent: #22c55e;
}

.qrelia-theme-option__preview[data-preview-theme="monochrome"] {
    --preview-bg: #060606;
    --preview-bg-2: #141414;
    --preview-card: rgba(36, 36, 36, .96);
    --preview-line: rgba(255, 255, 255, .15);
    --preview-accent: #f5f5f5;
}

.qrelia-theme-panel__footer {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 22px calc(16px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--q-line);
    background: color-mix(in srgb, var(--q-bg-elevated-strong) 88%, transparent);
    box-shadow: 0 -14px 34px rgba(0, 0, 0, .12);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.qrelia-theme-reset,
.qrelia-theme-done {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 999px;
    font: inherit;
    font-size: .76rem;
    font-weight: 900;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.qrelia-theme-reset {
    padding: 10px 15px;
    border: 1px solid var(--q-line);
    color: var(--q-text);
    background: var(--q-bg-input);
}

.qrelia-theme-reset svg {
    width: 17px;
    height: 17px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.qrelia-theme-done {
    min-width: 112px;
    padding: 10px 22px;
    border: 0;
    color: var(--q-on-brand-gradient);
    background:
        linear-gradient(var(--q-brand-readable-overlay), var(--q-brand-readable-overlay)),
        linear-gradient(135deg, var(--q-brand), var(--q-brand-2));
    box-shadow: 0 12px 28px color-mix(in srgb, var(--q-brand) 25%, transparent);
}

.qrelia-theme-reset:hover,
.qrelia-theme-reset:focus-visible,
.qrelia-theme-done:hover,
.qrelia-theme-done:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 0 0 4px var(--q-focus-ring);
    outline: none;
}

@media (max-width: 700px) {
    .qrelia-theme-trigger {
        left: max(10px, env(safe-area-inset-left));
        bottom: calc(84px + env(safe-area-inset-bottom));
        min-height: 46px;
        padding: 6px 11px 6px 6px;
    }

    .qrelia-theme-trigger__icon {
        flex-basis: 34px;
        width: 34px;
        height: 34px;
    }

    .qrelia-theme-trigger__copy strong {
        max-width: 108px;
        font-size: .7rem;
    }

    .qrelia-theme-panel {
        top: auto;
        left: 0;
        width: 100%;
        max-height: min(88dvh, 820px);
        border: 1px solid var(--q-line);
        border-bottom: 0;
        border-radius: 28px 28px 0 0;
        box-shadow: 0 -34px 90px rgba(0, 0, 0, .42);
        transform: translateY(104%);
    }

    .qrelia-theme-switcher.is-open .qrelia-theme-panel {
        transform: translateY(0);
    }

    .qrelia-theme-panel__handle {
        flex: 0 0 auto;
        width: 46px;
        height: 5px;
        display: block;
        margin: 9px auto 0;
        border-radius: 999px;
        background: color-mix(in srgb, var(--q-muted) 48%, transparent);
    }

    .qrelia-theme-panel__header {
        padding: 13px 18px 16px;
    }

    .qrelia-theme-panel__header p {
        font-size: .75rem;
    }

    .qrelia-theme-close {
        flex-basis: 38px;
        width: 38px;
        height: 38px;
    }

    .qrelia-theme-grid {
        gap: 9px;
        padding: 14px 13px 20px;
    }

    .qrelia-theme-option {
        grid-template-rows: 78px auto;
        gap: 8px;
        padding: 7px 7px 10px;
        border-radius: 17px;
    }

    .qrelia-theme-option__preview {
        padding: 9px;
        gap: 5px;
        border-radius: 12px;
    }

    .qrelia-theme-option__copy strong {
        font-size: .7rem;
    }

    .qrelia-theme-option__copy small {
        min-height: 2.5em;
        font-size: .58rem;
    }

    .qrelia-theme-option__check {
        top: 11px;
        right: 11px;
        width: 22px;
        height: 22px;
    }

    .qrelia-theme-panel__footer {
        padding: 12px 13px calc(12px + env(safe-area-inset-bottom));
    }

    .qrelia-theme-reset,
    .qrelia-theme-done {
        min-height: 42px;
        font-size: .7rem;
    }

    .qrelia-theme-done {
        min-width: 92px;
    }
}

@media (max-width: 390px) {
    .qrelia-theme-trigger__copy strong {
        max-width: 86px;
    }

    .qrelia-theme-panel__header h2 {
        font-size: 1.23rem;
    }

    .qrelia-theme-panel__header p {
        max-width: 250px;
    }

    .qrelia-theme-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .qrelia-theme-option__copy small {
        display: none;
        min-height: 0;
    }

    .qrelia-theme-reset {
        padding-inline: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .qrelia-theme-trigger,
    .qrelia-theme-backdrop,
    .qrelia-theme-panel,
    .qrelia-theme-option,
    .qrelia-theme-option__check,
    .qrelia-theme-close,
    .qrelia-theme-reset,
    .qrelia-theme-done {
        transition: none !important;
    }
}
