/**
 * Tolheim PWA stylesheet.
 *
 * Touch-first, mobile-first. Designed primarily for portrait-orientation
 * phones and tablets. Big tap targets (min 48px), high contrast, polished
 * to feel like an installed app rather than a web page.
 *
 * Theme system (1.10.0):
 *
 * The PWA uses a token-based theme system. Mountain-default palette is
 * light, with a hand-tuned dark variant. Three tokens are brandable per
 * deployment (primary, secondary, surface) — those override values are
 * emitted inline by the PHP template after reading component config.
 *
 * Status colors (success/warning/danger) and structural tokens (radius,
 * spacing, shadow, motion) are NOT brandable — kept consistent for
 * accessibility and visual coherence.
 *
 * Light theme default: warm earthy "mountain lodge" feel.
 * Dark theme: pine forest at dusk — same palette but inverted lightness.
 */

:root {
    /* Brandable tokens — overridable from component config */
    --th-primary: #2d5d3f;            /* deep pine green */
    --th-primary-hover: #234a32;
    --th-primary-fg: #ffffff;
    --th-secondary: #4a6b7c;          /* mountain stone blue-gray */
    --th-secondary-hover: #3b5765;
    --th-secondary-fg: #ffffff;

    /* Surface tokens — structural, but brand-influenced */
    --th-bg: #faf7f2;                 /* warm off-white, aged paper */
    --th-surface: #ffffff;            /* cards, modals */
    --th-surface-2: #f3ede2;          /* slight tint for hover/active */
    --th-surface-3: #e8dfcf;          /* deeper tint for pressed */

    /* Text */
    --th-text: #1f2520;               /* charcoal, slight green */
    --th-text-strong: #0f1410;
    --th-muted: #7a6b58;              /* driftwood */
    --th-muted-2: #a89880;             /* lighter muted */

    /* Borders + shadows */
    --th-border: #d4c5a9;             /* sandstone */
    --th-border-strong: #b8a585;
    --th-shadow-sm: 0 1px 2px rgba(31, 37, 32, 0.06), 0 1px 1px rgba(31, 37, 32, 0.04);
    --th-shadow: 0 2px 6px rgba(31, 37, 32, 0.08), 0 1px 2px rgba(31, 37, 32, 0.05);
    --th-shadow-lg: 0 8px 24px rgba(31, 37, 32, 0.12), 0 2px 8px rgba(31, 37, 32, 0.06);
    --th-focus-ring: 0 0 0 3px rgba(45, 93, 63, 0.25);

    /* Status — not brandable */
    --th-success: #16794d;
    --th-success-bg: #e6f4ec;
    --th-warning: #b88416;
    --th-warning-bg: #fbf1d9;
    --th-danger: #b03a2e;
    --th-danger-bg: #fbeae7;
    --th-info: #4a6b7c;
    --th-info-bg: #ecf1f4;

    /* Structure */
    --th-radius-sm: 6px;
    --th-radius: 10px;
    --th-radius-lg: 14px;
    --th-radius-xl: 18px;

    /* Motion */
    --th-transition: 160ms ease-out;
    --th-transition-slow: 280ms ease-out;

    /* Typography */
    --th-font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --th-font-display: 'Manrope', var(--th-font-body);
    --th-font-mono: ui-monospace, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace;
}

/* Dark theme — pine forest at dusk. Activated by data-th-theme="dark" on
 * the root element. Status and brand tokens shift to dark-friendly values;
 * surfaces invert. The brandable primary/secondary stay as set; we
 * adjust their hover and contrast variants to work on dark surfaces. */
[data-th-theme="dark"] {
    --th-bg: #14181a;                 /* near-black, slight cool */
    --th-surface: #1c2125;            /* cards, modals */
    --th-surface-2: #262d31;          /* hover */
    --th-surface-3: #313940;          /* pressed */

    --th-text: #e8e4dc;               /* warm off-white */
    --th-text-strong: #f5f1e8;
    --th-muted: #9a9082;
    --th-muted-2: #6e6759;

    --th-border: #353d42;
    --th-border-strong: #4a5358;
    --th-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --th-shadow: 0 2px 8px rgba(0, 0, 0, 0.45), 0 1px 2px rgba(0, 0, 0, 0.3);
    --th-shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.55), 0 2px 8px rgba(0, 0, 0, 0.35);
    --th-focus-ring: 0 0 0 3px rgba(143, 187, 152, 0.35);

    --th-success: #4ea876;
    --th-success-bg: #1a2e22;
    --th-warning: #d6a44a;
    --th-warning-bg: #2e2615;
    --th-danger: #d96050;
    --th-danger-bg: #2e1815;
    --th-info: #7a9bab;
    --th-info-bg: #1a2429;
}

/* Make the app fill the viewport — but ONLY when the PWA root is present.
 * This prevents the styles from leaking into other Joomla pages if pwa.css
 * is ever loaded outside the PWA view. */
body:has(.th-pwa-root) {
    margin: 0;
    padding: 0;
    background: var(--th-bg);
    color: var(--th-text);
    font-family: var(--th-font-body);
    font-size: 16px;
    line-height: 1.4;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Disable iOS double-tap-to-zoom and pull-to-refresh */
    touch-action: manipulation;
    overscroll-behavior-y: contain;
    /* Lock to viewport height even when keyboard appears */
    min-height: 100vh;
    min-height: 100dvh;
}

.th-pwa-root {
    box-sizing: border-box;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--th-bg);
    color: var(--th-text);
}
.th-pwa-root *, .th-pwa-root *::before, .th-pwa-root *::after {
    box-sizing: border-box;
}

/* ---- Loading state ---- */
.th-pwa-loading {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    gap: 1rem;
}
.th-pwa-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--th-surface-2);
    border-top-color: var(--th-primary);
    border-radius: 50%;
    animation: th-pwa-spin 0.8s linear infinite;
}
@keyframes th-pwa-spin {
    to { transform: rotate(360deg); }
}
.th-pwa-loading-msg {
    color: var(--th-muted);
    font-size: 0.95em;
}

/* ---- Generic screen container ---- */
.th-pwa-screen {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    padding: 1.25rem;
    /* iOS safe-area insets so home indicator etc. don't overlap */
    padding-top: max(1.25rem, env(safe-area-inset-top));
    padding-bottom: max(1.25rem, env(safe-area-inset-bottom));
    padding-left:   max(1.25rem, env(safe-area-inset-left));
    padding-right:  max(1.25rem, env(safe-area-inset-right));
}
.th-pwa-screen-centred {
    justify-content: center;
    align-items: stretch;
    max-width: 480px;
    margin: 0 auto;
    width: 100%;
}

/* ---- Desktop / tablet centering ----
 * On wider viewports the PWA content stays centered with a tablet-portrait
 * max-width instead of stretching edge to edge. The fixed-positioned root
 * still fills the viewport (so the brand surface colour goes edge to edge),
 * but the actual screen content is constrained to a comfortable width. */
@media (min-width: 768px) {
    .th-pwa-screen,
    .th-pwa-screen-pin,
    .th-pwa-screen-home {
        max-width: 560px;
        margin-inline: auto;
        width: 100%;
    }
    /* Centred screens (location, staff pickers, error states) stay narrower
     * because they're vertical stacks that look better tighter. */
    .th-pwa-screen-centred {
        max-width: 480px;
    }
}

.th-pwa-h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 1rem;
    text-align: center;
}

.th-pwa-stack {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

/* ---- Big touch button ---- */
.th-pwa-big-btn {
    appearance: none;
    -webkit-appearance: none;
    background: var(--th-surface);
    color: var(--th-text);
    border: 2px solid var(--th-surface-2);
    border-radius: var(--th-radius);
    padding: 1.1rem 1rem;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    min-height: 60px;
    transition: background 0.15s, border-color 0.15s;
    font-family: inherit;
}
.th-pwa-big-btn:hover {
    background: var(--th-surface-2);
    border-color: var(--th-surface-3);
}
.th-pwa-big-btn:active {
    transform: scale(0.98);
    background: var(--th-surface-2);
}
.th-pwa-big-btn:disabled {
    opacity: 0.5;
    cursor: wait;
}
/* Location picker buttons act as radios — is-selected shows the chosen one. */
.th-pwa-loc-btn.is-selected {
    background: var(--th-brand-primary, #2d5d3f);
    color: #fff;
    border-color: var(--th-brand-primary, #2d5d3f);
}
.th-pwa-loc-btn.is-selected:hover {
    background: var(--th-brand-primary, #2d5d3f);
    border-color: var(--th-brand-primary, #2d5d3f);
}
.th-pwa-loc-btn:disabled {
    opacity: 1;  /* the "current location" disabled button stays clearly readable */
    cursor: default;
}
/* "Switch" link inline next to the home-screen location name. */
.th-pwa-home-loc-switch {
    margin-left: 0.5rem;
    font-size: 0.85em;
    padding: 0.1rem 0.4rem;
    vertical-align: baseline;
}

/* ---- Link-style button (less prominent) ---- */
.th-pwa-link-btn {
    appearance: none;
    background: none;
    border: 0;
    color: var(--th-primary);
    padding: 0.5rem;
    font-size: 0.95rem;
    cursor: pointer;
    font-family: inherit;
    text-align: center;
}
.th-pwa-link-btn:hover { color: var(--th-primary-hover); }

/* ---- Location tag ---- */
.th-pwa-location-tag {
    color: var(--th-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: center;
    margin-bottom: 0.5rem;
}

/* ---- Banners (for messages on screens) ---- */
.th-pwa-banner {
    padding: 0.75rem 1rem;
    border-radius: var(--th-radius);
    margin-bottom: 1rem;
    font-size: 0.95rem;
}
.th-pwa-banner-warning {
    background: rgba(245, 158, 11, 0.15);
    border: 1px solid var(--th-warning);
    color: #fbbf24;
}
.th-pwa-banner-danger {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid var(--th-danger);
    color: #fca5a5;
}
.th-pwa-banner-success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid var(--th-success);
    color: #6ee7b7;
}

/* ---- PIN screen ---- */
.th-pwa-screen-pin {
    padding: 0;
    /* PIN screen is 100% height, divided into header/body/keypad */
    display: flex;
    flex-direction: column;
    flex: 1 1 100%;
}
.th-pwa-pin-header {
    padding: 1rem 1.25rem 0.5rem;
    padding-top: max(1rem, env(safe-area-inset-top));
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
}
.th-pwa-pin-body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    gap: 1rem;
}
.th-pwa-pin-staff {
    font-size: 1.25rem;
    font-weight: 600;
}
.th-pwa-pin-prompt {
    color: var(--th-muted);
}
.th-pwa-pin-dots {
    display: flex;
    gap: 0.6rem;
    margin: 0.5rem 0;
}
.th-pwa-pin-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--th-surface-2);
    border: 1px solid var(--th-surface-3);
    transition: background 0.1s;
}
.th-pwa-pin-dot-filled {
    background: var(--th-text);
    border-color: var(--th-text);
}
.th-pwa-pin-error {
    color: var(--th-danger);
    font-size: 0.95em;
    text-align: center;
    margin-top: 0.5rem;
}
.th-pwa-keypad {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.4rem;
    padding-bottom: max(0.4rem, env(safe-area-inset-bottom));
    background: var(--th-bg);
}
.th-pwa-keypad-row {
    display: flex;
    gap: 0.4rem;
}
.th-pwa-key {
    appearance: none;
    flex: 1 1 0;
    background: var(--th-surface);
    color: var(--th-text);
    border: 0;
    border-radius: var(--th-radius);
    padding: 1rem 0;
    font-size: 1.6rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    min-height: 64px;
    transition: background 0.1s;
}
.th-pwa-key:active {
    background: var(--th-surface-2);
    transform: scale(0.97);
}
.th-pwa-key:disabled { opacity: 0.5; }
.th-pwa-key-secondary {
    background: var(--th-surface);
    color: var(--th-muted);
    font-size: 1.3rem;
}
.th-pwa-key-primary {
    background: var(--th-primary);
    color: white;
    font-size: 1.3rem;
}
.th-pwa-key-primary:active {
    background: var(--th-primary-hover);
}

/* ---- Home screen ---- */
.th-pwa-screen-home {
    padding: 0;
}
.th-pwa-home-header {
    padding: 1rem 1.25rem;
    padding-top: max(1rem, env(safe-area-inset-top));
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--th-surface);
    border-bottom: 1px solid var(--th-surface-2);
}
.th-pwa-home-staff-name {
    font-size: 1.05rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.th-pwa-home-location {
    color: var(--th-muted);
    font-size: 0.85em;
    margin-top: 0.2rem;
}
.th-pwa-badge {
    display: inline-block;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    font-size: 0.7em;
    font-weight: 500;
    background: var(--th-surface-3);
}
.th-pwa-badge-supervisor {
    background: var(--th-primary);
    color: white;
}

.th-pwa-tiles {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    padding: 1rem;
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
    flex: 1 1 auto;
    align-content: start;
}
.th-pwa-tile {
    appearance: none;
    background: var(--th-surface);
    color: var(--th-text);
    border: 1px solid var(--th-surface-2);
    border-radius: var(--th-radius);
    padding: 1.5rem 0.75rem;
    cursor: pointer;
    font-family: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    aspect-ratio: 1;
    transition: background 0.15s, transform 0.1s;
}
.th-pwa-tile:hover  { background: var(--th-surface-2); }
.th-pwa-tile:active { transform: scale(0.97); }
.th-pwa-tile-icon  { font-size: 2.2rem; line-height: 1; }
.th-pwa-tile-label { font-size: 1.05rem; font-weight: 600; }
.th-pwa-tile-sub   { font-size: 0.8rem; color: var(--th-muted); }

/* On wider screens, expand to 3 columns */
@media (min-width: 600px) {
    .th-pwa-tiles { grid-template-columns: repeat(3, 1fr); }
}

/* ---- Toast (bottom-aligned to dodge OS top status bar) ---- */
.th-pwa-toast {
    position: fixed;
    left: 50%;
    bottom: max(1rem, env(safe-area-inset-bottom));
    transform: translate(-50%, 1rem);
    background: var(--th-surface-2);
    color: var(--th-text);
    padding: 0.75rem 1.25rem;
    border-radius: var(--th-radius);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
    /* Above modal overlays (z-index 10000) so Copy toasts and
       other feedback show even when triggered from inside a modal. */
    z-index: 11000;
    max-width: calc(100vw - 2rem);
    text-align: center;
    font-size: 0.95em;
    pointer-events: auto;
}
.th-pwa-toast.th-pwa-toast-shown {
    opacity: 1;
    transform: translate(-50%, 0);
}
.th-pwa-toast-success { background: var(--th-success); }
.th-pwa-toast-error   { background: var(--th-danger); }
.th-pwa-toast-warning { background: var(--th-warning); color: #1f2937; }

/* ============================================================
 * Reservations list / detail / fulfillment screens (2c)
 * ============================================================ */

/* Sub-header used on list/detail/create/fulfill screens */
.th-pwa-sublist-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    padding-top: max(0.5rem, env(safe-area-inset-top));
    background: var(--th-surface);
    border-bottom: 1px solid var(--th-surface-2);
    gap: 0.5rem;
}
.th-pwa-sublist-header .th-pwa-location-tag {
    margin: 0;
    flex: 1 1 auto;
    text-align: center;
}
.th-pwa-icon-btn {
    appearance: none;
    background: var(--th-primary);
    color: white;
    border: 0;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    font-family: inherit;
}
.th-pwa-icon-btn:active { background: var(--th-primary-hover); }
.th-pwa-spacer {
    width: 40px;  /* match icon-btn so the centred header text actually centres */
    flex: 0 0 auto;
}

/* Search bar */
.th-pwa-search-bar {
    padding: 0.75rem 1rem 0.5rem;
}
.th-pwa-search-input {
    width: 100%;
    padding: 0.7rem 0.9rem;
    background: var(--th-surface);
    color: var(--th-text);
    border: 1px solid var(--th-surface-2);
    border-radius: var(--th-radius);
    font-size: 1rem;
    font-family: inherit;
}
.th-pwa-search-input:focus {
    outline: none;
    border-color: var(--th-primary);
}

/* List controls (date picker, filter toggles) */
.th-pwa-list-controls {
    padding: 0 1rem 0.5rem;
}
.th-pwa-list-control-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.th-pwa-date-input {
    background: var(--th-surface);
    color: var(--th-text);
    border: 1px solid var(--th-surface-2);
    border-radius: var(--th-radius);
    padding: 0.5rem 0.7rem;
    font-size: 0.95rem;
    font-family: inherit;
    /* 2.5.9: color-scheme must follow the active theme — hardcoded
       'dark' makes the browser pick a dark calendar icon that's
       invisible on the light-mode input background. Default to light
       and let [data-th-theme="dark"] override below. */
    color-scheme: light;
}
[data-th-theme="dark"] .th-pwa-date-input {
    color-scheme: dark;
}
/* 2.5.9: ensure the calendar picker indicator is always visible.
   WebKit/Blink (iOS Safari, Android Chrome) hide or theme this
   inconsistently. An explicit filter and opacity force visibility
   in both light and dark modes. */
.th-pwa-date-input::-webkit-calendar-picker-indicator {
    opacity: 1;
    cursor: pointer;
    margin-left: 0.25rem;
}
[data-th-theme="dark"] .th-pwa-date-input::-webkit-calendar-picker-indicator {
    filter: invert(1);
}
.th-pwa-toggle {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--th-muted);
    font-size: 0.9rem;
    cursor: pointer;
}
.th-pwa-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--th-primary);
}
/* 2.5.9: range-mode chips + supporting layout */
.th-pwa-list-control-chips {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    padding: 0.4rem 0 0;
}
.th-pwa-chip {
    background: var(--th-surface);
    color: var(--th-text);
    border: 1px solid var(--th-surface-2);
    border-radius: 999px;
    padding: 0.35rem 0.85rem;
    font-size: 0.85rem;
    font-family: inherit;
    cursor: pointer;
    line-height: 1;
    transition: background 0.15s, border-color 0.15s;
}
.th-pwa-chip:hover {
    border-color: var(--th-primary);
}
.th-pwa-chip-active {
    background: var(--th-primary);
    color: var(--th-on-primary, #fff);
    border-color: var(--th-primary);
}
.th-pwa-chip-active:hover {
    border-color: var(--th-primary);
}
.th-pwa-status-filter {
    border-top: 1px solid var(--th-surface-2);
    margin-top: 0.4rem;
    padding-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.th-pwa-status-filter-label {
    font-size: 0.85rem;
    color: var(--th-muted);
    flex: 0 0 auto;
}
.th-pwa-select {
    flex: 1 1 auto;
    background: var(--th-surface);
    color: var(--th-text);
    border: 1px solid var(--th-surface-2);
    border-radius: var(--th-radius);
    padding: 0.5rem 0.7rem;
    font-size: 0.95rem;
    font-family: inherit;
    cursor: pointer;
    color-scheme: light;
}
[data-th-theme="dark"] .th-pwa-select {
    color-scheme: dark;
}
.th-pwa-list-control-sep {
    color: var(--th-muted);
    font-size: 0.9rem;
}
.th-pwa-list-control-toggles {
    padding-top: 0.4rem;
}
.th-pwa-list-control-banner {
    margin-top: 0.5rem;
    padding: 0.4rem 0.6rem;
    background: var(--th-surface-2);
    color: var(--th-muted);
    border-radius: var(--th-radius);
    font-size: 0.8rem;
    line-height: 1.3;
}

/* List body */
.th-pwa-list-body {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 0 1rem 1rem;
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
}
.th-pwa-empty {
    text-align: center;
    color: var(--th-muted);
    padding: 3rem 1rem;
}
.th-pwa-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.th-pwa-list-row {
    appearance: none;
    background: var(--th-surface);
    color: var(--th-text);
    border: 1px solid var(--th-surface-2);
    border-radius: var(--th-radius);
    padding: 0.85rem 1rem;
    cursor: pointer;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: inherit;
    transition: background 0.15s;
}
.th-pwa-list-row:active { background: var(--th-surface-2); transform: scale(0.99); }
.th-pwa-list-row-main { flex: 1 1 auto; min-width: 0; }
.th-pwa-list-row-name {
    font-size: 1.05rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.th-pwa-list-row-meta {
    color: var(--th-muted);
    font-size: 0.85rem;
    margin-top: 0.15rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.th-pwa-list-row-status-col {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.2rem;
}
.th-pwa-list-row-status {
    flex: 0 0 auto;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: capitalize;
    background: var(--th-surface-2);
    color: var(--th-muted);
}
.th-pwa-list-row-payment {
    font-size: 0.72rem;
    color: var(--th-muted);
    white-space: nowrap;
}
.th-pwa-status-pending   { background: rgba(245, 158, 11, 0.2); color: #fbbf24; }
.th-pwa-status-confirmed { background: rgba(59, 130, 246, 0.2); color: #93c5fd; }
.th-pwa-status-fulfilled { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; }
.th-pwa-status-overdue   { background: rgba(239, 68, 68, 0.22); color: #fca5a5; }
.th-pwa-status-returned  { background: rgba(148, 163, 184, 0.2); color: #cbd5e1; }
.th-pwa-suggested-charge {
    margin: 0.5rem 0;
    padding: 0.75rem 1rem;
    background: var(--th-surface-2);
    border-radius: var(--th-radius);
}
.th-pwa-suggested-charge-head {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--th-muted);
}
.th-pwa-suggested-charge-amount {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0.15rem 0 0.25rem;
}
.th-pwa-status-cancelled { background: var(--th-surface-3); color: var(--th-muted); }
.th-pwa-status-noshow    { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }

.th-pwa-other-loc-tag {
    display: inline-block;
    padding: 0.05rem 0.4rem;
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border-radius: 999px;
    font-size: 0.75rem;
}

/* 2.5.0: Source badge — small chip next to customer name on rows and
 * detail card. Indicates the reservation came from an integration
 * (WaiverForever, Checkfront, etc.) rather than walk-up/admin. When
 * source_url is set, clicking opens the source system in a new tab. */
.th-pwa-source-badge {
    display: inline-block;
    margin-left: 0.5rem;
    padding: 0.1rem 0.5rem;
    background: var(--th-accent, #2d5d3f);
    color: #fff;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    vertical-align: middle;
    line-height: 1.4;
    text-transform: uppercase;
}
.th-pwa-source-badge[data-source-url] {
    cursor: pointer;
}
.th-pwa-source-badge[data-source-url]:hover {
    opacity: 0.85;
    text-decoration: underline;
}
/* Per-source colour tweaks; defaults to brand accent */
.th-pwa-source-badge[data-source="waiver"] {
    background: #0b6dbf;  /* WaiverForever blue */
}
.th-pwa-source-badge[data-source="checkfront"] {
    background: #18a558;
}

/* Detail screen */
.th-pwa-detail-screen {
    padding: 0;
}
.th-pwa-detail-card {
    margin: 1rem;
    padding: 1rem;
    background: var(--th-surface);
    border-radius: var(--th-radius);
    border: 1px solid var(--th-surface-2);
}
.th-pwa-detail-name {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.3rem;
}
.th-pwa-detail-meta {
    color: var(--th-muted);
    font-size: 0.9rem;
    margin-top: 0.6rem;
}
.th-pwa-detail-status {
    display: inline-block;
    margin-top: 0.6rem;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: capitalize;
}

.th-pwa-slots {
    padding: 0 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.th-pwa-slot {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    background: var(--th-surface);
    border: 1px solid var(--th-surface-2);
    border-radius: var(--th-radius);
    border-left-width: 3px;
}
.th-pwa-slot-fulfilled { border-left-color: var(--th-success); }
.th-pwa-slot-pending   { border-left-color: var(--th-warning); }
.th-pwa-slot-icon {
    flex: 0 0 auto;
    width: 1.5rem;
    text-align: center;
    font-size: 1.2rem;
    color: var(--th-muted);
}
.th-pwa-slot-fulfilled .th-pwa-slot-icon { color: var(--th-success); font-weight: 700; }
.th-pwa-slot-text { flex: 1 1 auto; min-width: 0; }
.th-pwa-slot-state {
    color: var(--th-muted);
    font-size: 0.85rem;
}
.th-pwa-slot-action {
    appearance: none;
    background: var(--th-success);
    color: white;
    border: 0;
    border-radius: var(--th-radius);
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}
.th-pwa-slot-action:active { transform: scale(0.97); }

.th-pwa-detail-actions {
    padding: 1rem;
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.th-pwa-secondary-btn {
    appearance: none;
    background: transparent;
    color: var(--th-text);
    border: 1px solid var(--th-surface-3);
    border-radius: var(--th-radius);
    padding: 0.8rem 1rem;
    font-size: 1rem;
    cursor: pointer;
    font-family: inherit;
}
.th-pwa-secondary-btn-warn {
    border-color: var(--th-warning);
    color: var(--th-warning);
}
.th-pwa-secondary-btn:active { transform: scale(0.98); }

/* Fulfill screen */
.th-pwa-fulfill-customer {
    margin: 1rem;
    padding: 0.75rem 1rem;
    background: var(--th-surface);
    border-radius: var(--th-radius);
}
.th-pwa-fulfill-customer-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}
.th-pwa-fulfill-search {
    padding: 0 1rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.th-pwa-fulfill-search label {
    color: var(--th-muted);
    font-size: 0.85rem;
}
.th-pwa-input {
    background: var(--th-surface);
    color: var(--th-text);
    border: 1px solid var(--th-surface-2);
    border-radius: var(--th-radius);
    padding: 0.7rem 0.9rem;
    font-size: 1rem;
    font-family: inherit;
    width: 100%;
}
.th-pwa-input:focus {
    outline: none;
    border-color: var(--th-primary);
}

.th-pwa-typeahead {
    background: var(--th-surface);
    border-radius: var(--th-radius);
    margin-top: 0.4rem;
    overflow: hidden;
    /* Hidden by default; show by adding .th-pwa-typeahead-shown */
    display: none;
}
.th-pwa-typeahead.th-pwa-typeahead-shown {
    display: flex;
    flex-direction: column;
}
.th-pwa-typeahead-item {
    appearance: none;
    display: block;
    width: 100%;
    text-align: left;
    background: transparent;
    color: var(--th-text);
    border: 0;
    border-bottom: 1px solid var(--th-surface-2);
    padding: 0.7rem 0.9rem;
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.4;
}
.th-pwa-typeahead-main {
    display: block;
}
.th-pwa-typeahead-item:last-child { border-bottom: 0; }
.th-pwa-typeahead-item:active { background: var(--th-surface-2); }
.th-pwa-typeahead-empty {
    padding: 0.75rem 0.9rem;
    color: var(--th-muted);
    font-size: 0.9rem;
}

.th-pwa-fulfill-confirm {
    padding: 0 1rem 1rem;
}
.th-pwa-fulfill-summary {
    padding: 0.75rem;
    background: var(--th-surface);
    border-radius: var(--th-radius);
    margin-bottom: 0.75rem;
}
.th-pwa-big-btn-primary {
    background: var(--th-primary);
    color: white;
    border-color: var(--th-primary);
}
.th-pwa-big-btn-primary:hover { background: var(--th-primary-hover); }

/* Walk-up create form */
.th-pwa-form {
    padding: 1rem;
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.th-pwa-form label {
    color: var(--th-muted);
    font-size: 0.85rem;
    margin-top: 0.4rem;
}
.th-pwa-required {
    color: var(--th-danger);
}
.th-pwa-form button[type="submit"] {
    margin-top: 1rem;
}

/* Helpers */
.th-pwa-mono { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace; }
.th-pwa-text-sm { font-size: 0.85rem; }
.th-pwa-text-muted { color: var(--th-muted); }
.th-pwa-text-warning { color: var(--th-warning); }
.th-pwa-stack {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Reset list-screen padding so sub-header sits flush */
.th-pwa-list-screen, .th-pwa-fulfill-screen, .th-pwa-create-screen {
    padding: 0;
    display: flex;
    flex-direction: column;
}

/* ============================================================
 * Scanner screen + scan CTA buttons (2d)
 * ============================================================ */

/* Scan-CTA: a prominent "tap to open camera" button that appears on screens
   that benefit from camera input (reservations list, fulfill, returns). */
.th-pwa-scan-cta {
    padding: 0.75rem 1rem 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.th-pwa-scan-cta .th-pwa-big-btn {
    width: 100%;
    min-height: 56px;
}
.th-pwa-scan-btn {
    appearance: none;
    width: 100%;
    background: var(--th-primary);
    color: white;
    border: 0;
    border-radius: var(--th-radius);
    padding: 0.95rem 1rem;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 56px;
    transition: background 0.15s;
}
.th-pwa-scan-btn:hover  { background: var(--th-primary-hover); }
.th-pwa-scan-btn:active { transform: scale(0.98); }
.th-pwa-scan-btn-icon {
    font-size: 1.4rem;
    line-height: 1;
}

/* Full-screen scanner */
.th-pwa-scanner-screen {
    padding: 0;
    background: #000;
}
.th-pwa-scanner-header {
    position: relative;
    z-index: 2;
    padding: 0.5rem 1rem;
    padding-top: max(0.5rem, env(safe-area-inset-top));
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(0, 0, 0, 0.6);
    color: var(--th-text);
}
.th-pwa-scanner-header .th-pwa-link-btn { color: white; }
.th-pwa-scanner-title {
    flex: 1 1 auto;
    text-align: center;
    font-weight: 600;
}
.th-pwa-scanner-viewport {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #000;
    position: relative;
}
/* html5-qrcode injects video + canvas into the mount; make video fill */
.th-pwa-scanner-viewport video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
}
/* The library also injects its own border/frame elements — hide if present */
.th-pwa-scanner-viewport > div[style*="border"]:not([id]) {
    border: 0 !important;
}
.th-pwa-scanner-hint {
    padding: 0.75rem 1rem;
    padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
    background: rgba(0, 0, 0, 0.7);
    color: var(--th-text);
    text-align: center;
    font-size: 0.9rem;
}
.th-pwa-scanner-error {
    padding: 0 1rem 0.75rem;
    background: rgba(0, 0, 0, 0.7);
}
.th-pwa-scanner-error:empty { padding: 0; }

/* ============================================================
 * Returns flow + scanner enhancements (1.5.0)
 * ============================================================ */

/* Returns intro */
.th-pwa-returns-intro {
    padding: 1rem;
}
.th-pwa-returns-intro h2 {
    margin: 0 0 0.5rem;
    font-size: 1.25rem;
}
.th-pwa-returns-intro p {
    margin: 0;
    color: var(--th-muted);
    font-size: 0.95rem;
}

/* Condition picker grid */
.th-pwa-returns-conditions {
    padding: 0 1rem 1rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.6rem;
}
.th-pwa-cond-btn {
    appearance: none;
    background: var(--th-surface);
    color: var(--th-text);
    border: 2px solid var(--th-surface-2);
    border-radius: var(--th-radius);
    padding: 1rem 1.25rem;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    text-align: left;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-height: 60px;
    transition: border-color 0.15s, background 0.15s;
}
.th-pwa-cond-btn:active { transform: scale(0.99); }
.th-pwa-cond-btn.th-pwa-cond-good {
    border-color: rgba(16, 185, 129, 0.5);
}
.th-pwa-cond-btn.th-pwa-cond-good:hover {
    border-color: var(--th-success);
    background: rgba(16, 185, 129, 0.08);
}
.th-pwa-cond-btn.th-pwa-cond-flag {
    border-color: rgba(245, 158, 11, 0.5);
}
.th-pwa-cond-btn.th-pwa-cond-flag:hover {
    border-color: var(--th-warning);
    background: rgba(245, 158, 11, 0.08);
}
.th-pwa-cond-btn.th-pwa-cond-current {
    background: var(--th-surface-2);
}
.th-pwa-cond-label {
    flex: 1 1 auto;
}
.th-pwa-cond-note-badge {
    flex: 0 0 auto;
    padding: 0.15rem 0.5rem;
    background: var(--th-surface-2);
    color: var(--th-muted);
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* Condition pill in returns scan header (also tappable to switch) */
.th-pwa-cond-pill {
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    background: var(--th-surface-2);
    color: var(--th-text);
    cursor: pointer;
    user-select: none;
}
.th-pwa-cond-pill.th-pwa-cond-good {
    background: rgba(16, 185, 129, 0.2);
    color: #6ee7b7;
}
.th-pwa-cond-pill.th-pwa-cond-flag {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}
.th-pwa-cond-pill-arrow {
    font-size: 0.7rem;
    opacity: 0.6;
}

/* Returns scan screen */
.th-pwa-returns-screen {
    padding: 0;
    display: flex;
    flex-direction: column;
}
.th-pwa-typed-row {
    display: flex;
    gap: 0.4rem;
}
.th-pwa-typed-row .th-pwa-input { flex: 1 1 auto; }
.th-pwa-icon-btn-sm {
    width: 44px;
    height: 44px;
    font-size: 1.2rem;
}

/* Recent returns list */
.th-pwa-returns-recent {
    padding: 0 1rem 1rem;
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
    overflow-y: auto;
    flex: 1 1 auto;
}
.th-pwa-recent-header {
    color: var(--th-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 1rem 0 0.5rem;
}
.th-pwa-empty-sm {
    text-align: center;
    color: var(--th-muted);
    padding: 1.5rem 1rem;
    font-size: 0.95rem;
}
.th-pwa-recent-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--th-surface);
    border: 1px solid var(--th-surface-2);
    border-radius: var(--th-radius);
    margin-bottom: 0.4rem;
}
.th-pwa-recent-main { flex: 1 1 auto; min-width: 0; }
.th-pwa-recent-undone {
    color: var(--th-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: var(--th-surface-2);
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
}

/* Modal overlay used by note prompt + condition switcher + item info */
.th-pwa-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
}
.th-pwa-modal {
    background: var(--th-surface);
    border-radius: 12px 12px 0 0;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    padding-bottom: env(safe-area-inset-bottom);
}
@media (min-width: 600px) {
    .th-pwa-modal-overlay { align-items: center; }
    .th-pwa-modal { border-radius: 12px; }
}
.th-pwa-modal-header {
    padding: 1rem;
    font-weight: 600;
    border-bottom: 1px solid var(--th-surface-2);
}
.th-pwa-modal-body {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.th-pwa-modal-actions {
    padding: 1rem;
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
    border-top: 1px solid var(--th-surface-2);
}
.th-pwa-modal-row {
    font-size: 0.95rem;
}
.th-pwa-input-error { border-color: var(--th-danger) !important; }

/* Scanner UI additions: auto toggle + capture button + preview line */
.th-pwa-scanner-auto {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    color: white;
    font-size: 0.85rem;
    cursor: pointer;
    user-select: none;
    padding: 0.25rem 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 999px;
}
.th-pwa-scanner-auto input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--th-primary);
}
.th-pwa-scanner-actions {
    padding: 0.75rem 1rem;
    background: rgba(0, 0, 0, 0.7);
}
.th-pwa-capture-btn {
    width: 100%;
}
.th-pwa-capture-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.th-pwa-scanner-preview {
    padding: 0.4rem 1rem;
    background: rgba(0, 0, 0, 0.6);
    color: var(--th-text);
    text-align: center;
    font-size: 0.85rem;
    font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
    min-height: 1.2rem;
    transition: background 0.15s;
}
.th-pwa-scanner-preview-active {
    background: rgba(16, 185, 129, 0.25);
    color: #ade1c4;
}

/* Typed-input preview card (returns) */
.th-pwa-typed-preview {
    margin-top: 0.5rem;
}
.th-pwa-typed-preview-loading {
    padding: 0.5rem;
    color: var(--th-muted);
    font-size: 0.9rem;
    font-style: italic;
}
.th-pwa-typed-preview-card {
    padding: 0.85rem 1rem;
    background: var(--th-surface);
    border-radius: var(--th-radius);
    border: 1px solid var(--th-surface-2);
    border-left-width: 3px;
    border-left-color: var(--th-success);
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.th-pwa-typed-preview-card.th-pwa-typed-preview-warn {
    border-left-color: var(--th-warning);
}
.th-pwa-typed-preview-card .th-pwa-big-btn {
    margin-top: 0.4rem;
}

/* ============================================================
 * Events screen (1.6.0)
 * ============================================================ */

.th-pwa-event-time {
    flex: 0 0 auto;
    font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
    font-size: 0.85rem;
    color: var(--th-muted);
    padding: 0.3rem 0.5rem;
    background: var(--th-surface-2);
    border-radius: 999px;
}

.th-pwa-event-flag-badge {
    display: inline-block;
    padding: 0.1rem 0.45rem;
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    line-height: 1.4;
    vertical-align: middle;
}

.th-pwa-event-details {
    padding: 0 1rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.th-pwa-event-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    padding: 0.4rem 0.7rem;
    background: var(--th-surface);
    border-radius: var(--th-radius);
    font-size: 0.9rem;
}
.th-pwa-event-detail-key {
    color: var(--th-muted);
    text-transform: capitalize;
    flex: 0 0 auto;
}
.th-pwa-event-detail-val {
    flex: 1 1 auto;
    text-align: right;
    word-break: break-word;
}

.th-pwa-event-flags {
    margin: 0 1rem 1rem;
    padding: 1rem;
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: var(--th-radius);
}
.th-pwa-event-flags-header {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #fbbf24;
}
.th-pwa-event-flag-row {
    padding: 0.5rem 0;
    border-top: 1px solid rgba(245, 158, 11, 0.2);
}
.th-pwa-event-flag-row:first-of-type { border-top: 0; padding-top: 0; }

.th-pwa-flag-resolved {
    color: var(--th-success);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
}
.th-pwa-flag-pending {
    color: var(--th-warning);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
}

/* ============================================================
 * Lookup screens (1.7.0)
 * ============================================================ */

/* Status banner — colored block under the item header */
.th-pwa-lookup-status {
    margin: 0 1rem 0.75rem;
    padding: 0.85rem 1rem;
    border-radius: var(--th-radius);
    border: 1px solid var(--th-surface-2);
    background: var(--th-surface);
}
.th-pwa-lookup-status.th-pwa-status-good {
    background: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.4);
}
.th-pwa-lookup-status.th-pwa-status-bad {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.4);
}
.th-pwa-lookup-status-label {
    font-weight: 600;
    text-transform: capitalize;
}
.th-pwa-lookup-status-reason {
    margin-top: 0.25rem;
    font-size: 0.95rem;
}

/* Open checkout block */
.th-pwa-lookup-checkout {
    margin: 0 1rem 0.75rem;
    padding: 0.85rem 1rem;
    background: var(--th-surface);
    border-left: 3px solid var(--th-warning);
    border-radius: var(--th-radius);
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.th-pwa-lookup-section-header {
    font-weight: 600;
    color: var(--th-muted);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    margin-bottom: 0.25rem;
}

.th-pwa-lookup-row {
    font-size: 0.95rem;
}

/* Action buttons — stacked block under detail */
.th-pwa-lookup-actions {
    margin: 0 1rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* History list */
.th-pwa-lookup-history {
    margin: 0 1rem 1rem;
}
.th-pwa-history-row {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.5rem 0.7rem;
    background: var(--th-surface);
    border-radius: var(--th-radius);
    margin-bottom: 0.4rem;
}
.th-pwa-history-time {
    flex: 0 0 auto;
    font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
    font-size: 0.8rem;
    color: var(--th-muted);
    white-space: nowrap;
}
.th-pwa-history-main {
    flex: 1 1 auto;
    min-width: 0;
}
.th-pwa-history-title {
    font-size: 0.95rem;
}

/* ============================================================
 * Event detail polish (1.7.0)
 * ============================================================ */

.th-pwa-event-detail-val .th-pwa-link-btn {
    /* Reservation links inside event details are right-aligned */
    padding: 0.1rem 0.3rem;
    color: var(--th-primary);
    background: transparent;
    border: 0;
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
    text-decoration: underline;
}
.th-pwa-event-detail-val .th-pwa-link-btn:hover {
    background: rgba(59, 130, 246, 0.1);
    border-radius: 4px;
}

/* Supervisor-only raw data expander */
.th-pwa-event-raw {
    margin: 1rem;
    background: var(--th-surface);
    border: 1px dashed var(--th-surface-2);
    border-radius: var(--th-radius);
    padding: 0.5rem 0.75rem;
}
.th-pwa-event-raw summary {
    cursor: pointer;
    font-size: 0.8rem;
    color: var(--th-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    user-select: none;
    list-style: revert;
}
.th-pwa-event-raw[open] summary {
    margin-bottom: 0.5rem;
}
.th-pwa-event-raw-pre {
    font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
    font-size: 0.8rem;
    background: var(--th-bg);
    padding: 0.75rem;
    border-radius: 6px;
    overflow-x: auto;
    margin: 0;
    color: var(--th-text);
    white-space: pre-wrap;
    word-break: break-all;
}

/* ============================================================
 * Transfer screens (1.9.0)
 *
 * Uses the same returns-batch CSS shape but with a destination
 * picker on the landing page. Most of the running-list styling
 * comes from existing returns CSS.
 * ============================================================ */

.th-pwa-loc-pick-intro {
    padding: 1rem 1rem 0.5rem;
}

.th-pwa-loc-pick-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0 1rem 1rem;
}

.th-pwa-loc-pick-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.1rem;
    background: var(--th-surface);
    border: 1px solid var(--th-surface-2);
    border-radius: var(--th-radius);
    cursor: pointer;
    color: var(--th-text);
    font-family: inherit;
    font-size: 1rem;
    text-align: left;
}
.th-pwa-loc-pick-row:hover {
    border-color: var(--th-primary);
}
.th-pwa-loc-pick-row:active {
    background: var(--th-bg);
}
.th-pwa-loc-pick-name {
    font-weight: 500;
}
.th-pwa-loc-pick-arrow {
    color: var(--th-muted);
    font-size: 1.2rem;
}

/* ============================================================
 * Signature modal (1.9.0)
 * ============================================================ */

.th-pwa-signature-modal .th-pwa-modal {
    /* Wider on tablet/desktop than the default modal */
    max-width: 640px;
}

.th-pwa-signature-pad-wrap {
    position: relative;
    margin: 0.75rem 0;
    background: #fff;
    border: 1px solid var(--th-surface-2);
    border-radius: var(--th-radius);
    overflow: hidden;
    /* Keep the canvas a reasonable height on phones too */
    aspect-ratio: 16 / 7;
    width: 100%;
}

.th-pwa-signature-pad {
    width: 100%;
    height: 100%;
    display: block;
    cursor: crosshair;
    touch-action: none; /* prevent scroll while drawing */
}

.th-pwa-signature-line {
    position: absolute;
    left: 8%;
    right: 8%;
    bottom: 18%;
    border-bottom: 1px solid #cbd5e1;
    pointer-events: none;
}

.th-pwa-signature-hint {
    position: absolute;
    bottom: 4%;
    left: 0;
    right: 0;
    text-align: center;
    color: #94a3b8;
    font-size: 0.85rem;
    font-style: italic;
    pointer-events: none;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.th-pwa-signature-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.4rem;
}

/* Signature thumbnail in PWA event detail (1.9.3) */
.th-pwa-signature-thumb-link {
    display: inline-block;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    padding: 4px;
    cursor: zoom-in;
}
.th-pwa-signature-thumb-img {
    display: block;
    max-width: 220px;
    max-height: 80px;
    height: auto;
    width: auto;
}

/* ============================================================
 * 1.10.0 Modern polish pass
 * ============================================================ */

/* --- Display font for headings, tile labels, buttons --- */
.th-pwa-home-staff-name,
.th-pwa-home-location,
.th-pwa-tile-label,
.th-pwa-detail-name,
.th-pwa-modal-header,
.th-pwa-section-header,
.th-pwa-event-flags-header,
.th-pwa-lookup-section-header {
    font-family: var(--th-font-display);
    letter-spacing: -0.01em;
}

/* --- Smoother button transitions everywhere --- */
.th-pwa-tile,
.th-pwa-big-btn,
.th-pwa-secondary-btn,
.th-pwa-icon-btn,
.th-pwa-link-btn,
.th-pwa-scan-btn,
.th-pwa-loc-pick-row,
.th-pwa-cond-btn {
    transition: background var(--th-transition),
                color var(--th-transition),
                border-color var(--th-transition),
                transform var(--th-transition),
                box-shadow var(--th-transition);
}

/* --- Focus-visible everywhere — WCAG-friendly keyboard nav --- */
.th-pwa-root :focus-visible {
    outline: none;
    box-shadow: var(--th-focus-ring);
}

/* --- Polished primary button with subtle shadow --- */
.th-pwa-big-btn-primary {
    background: var(--th-primary);
    color: var(--th-primary-fg);
    box-shadow: var(--th-shadow-sm);
    border-radius: var(--th-radius);
    border: 0;
    font-family: var(--th-font-display);
    font-weight: 600;
    letter-spacing: -0.005em;
}
.th-pwa-big-btn-primary:hover:not(:disabled) {
    background: var(--th-primary-hover);
    box-shadow: var(--th-shadow);
    transform: translateY(-1px);
}
.th-pwa-big-btn-primary:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: var(--th-shadow-sm);
}
.th-pwa-big-btn-primary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* --- Polished tiles with depth on hover --- */
.th-pwa-tile {
    background: var(--th-surface);
    border: 1px solid var(--th-border);
    border-radius: var(--th-radius-lg);
    box-shadow: var(--th-shadow-sm);
}
.th-pwa-tile:hover {
    box-shadow: var(--th-shadow);
    transform: translateY(-2px);
    border-color: var(--th-primary);
}
.th-pwa-tile:active {
    transform: translateY(0);
    box-shadow: var(--th-shadow-sm);
}
.th-pwa-tile-icon {
    /* Lucide icons — color via stroke, sized via width/height */
    color: var(--th-primary);
    width: 36px;
    height: 36px;
}
.th-pwa-tile-icon svg {
    width: 100%;
    height: 100%;
    stroke-width: 1.75;
}

/* --- Modals get a stronger shadow + larger radius --- */
.th-pwa-modal {
    border-radius: var(--th-radius-lg);
    box-shadow: var(--th-shadow-lg);
    border: 1px solid var(--th-border);
    background: var(--th-surface);
}
.th-pwa-modal-overlay {
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    animation: th-pwa-fade-in 160ms ease-out;
}
@keyframes th-pwa-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}
@keyframes th-pwa-slide-up {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
.th-pwa-modal {
    animation: th-pwa-slide-up 220ms cubic-bezier(0.2, 0, 0.1, 1);
}

/* --- Inputs --- */
.th-pwa-input {
    background: var(--th-surface);
    color: var(--th-text);
    border: 1px solid var(--th-border);
    border-radius: var(--th-radius);
    padding: 0.7rem 0.85rem;
    font-family: var(--th-font-body);
    font-size: 1rem;
    transition: border-color var(--th-transition), box-shadow var(--th-transition);
}
.th-pwa-input:focus {
    outline: none;
    border-color: var(--th-primary);
    box-shadow: var(--th-focus-ring);
}
.th-pwa-input::placeholder {
    color: var(--th-muted-2);
}

/* --- Lucide icon helpers --- */
.th-pwa-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1em;
    height: 1em;
    flex: 0 0 auto;
    line-height: 1;
}
.th-pwa-icon svg {
    width: 100%;
    height: 100%;
    stroke-width: 1.75;
    fill: none;
    stroke: currentColor;
}
.th-pwa-icon-btn .th-pwa-icon,
.th-pwa-link-btn .th-pwa-icon,
.th-pwa-big-btn .th-pwa-icon {
    width: 1.15em;
    height: 1.15em;
}

/* --- Theme toggle button (top-right of home header) --- */
.th-pwa-theme-toggle {
    background: transparent;
    border: 1px solid var(--th-border);
    color: var(--th-muted);
    padding: 0.4rem;
    border-radius: var(--th-radius);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    transition: background var(--th-transition),
                border-color var(--th-transition),
                color var(--th-transition);
}
.th-pwa-theme-toggle:hover {
    background: var(--th-surface-2);
    color: var(--th-text);
    border-color: var(--th-border-strong);
}
.th-pwa-theme-toggle svg {
    width: 18px;
    height: 18px;
}

/* --- Screen transitions —
 * applied via JS adding/removing .th-pwa-screen-enter on root mount.
 * Quick (220ms) horizontal slide + fade for forward/back navigation,
 * fade-only for "neutral" transitions (e.g., from PIN to home). */
@keyframes th-pwa-screen-fade-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.th-pwa-screen-enter {
    animation: th-pwa-screen-fade-in 220ms cubic-bezier(0.2, 0, 0.1, 1);
}
@media (prefers-reduced-motion: reduce) {
    .th-pwa-screen-enter,
    .th-pwa-modal,
    .th-pwa-modal-overlay {
        animation: none !important;
    }
    .th-pwa-tile:hover,
    .th-pwa-big-btn-primary:hover {
        transform: none;
    }
}

/* --- Dark theme adjustments for tiles, modals, etc that need extra love --- */
[data-th-theme="dark"] .th-pwa-tile {
    background: var(--th-surface);
    border-color: var(--th-border);
}
[data-th-theme="dark"] .th-pwa-modal-overlay {
    background: rgba(0, 0, 0, 0.6);
}

/* Home header actions row (theme toggle + logout) */
.th-pwa-home-actions {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

/* Brand logo / wordmark on login flow */
.th-pwa-brand-logo,
.th-pwa-brand-wordmark {
    margin: 0 auto 1.5rem;
    text-align: center;
}
.th-pwa-brand-logo img {
    /* Definite width + height:auto. SVGs without intrinsic sizing render
     * at 0x0 in some browsers when only max-* is supplied. The viewBox
     * gives the browser the aspect ratio so height computes correctly. */
    width: 240px;
    height: auto;
    max-width: 100%;
    max-height: 80px;
    display: inline-block;
}
.th-pwa-brand-wordmark {
    font-family: var(--th-font-display);
    font-weight: 700;
    font-size: 1.75rem;
    color: var(--th-primary);
    letter-spacing: -0.02em;
}

/* ============================================================
 * PWA capture sections (2.2.0).
 * Mirrors the supervisor capture panel UX with mobile-first
 * tap targets, full-width panels, and PWA color tokens.
 * ============================================================ */

.th-pwa-capture-host {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 1rem 0;
}
.th-pwa-capture-panel {
    border: 1px solid var(--th-pwa-border, #d0d7de);
    border-radius: 8px;
    padding: 0.75rem;
    background: var(--th-pwa-card-bg, #fff);
}
.th-pwa-capture-panel-payment {
    border-left: 4px solid var(--th-pwa-primary, #0d6efd);
}
.th-pwa-capture-panel-waiver {
    border-left: 4px solid var(--th-pwa-info, #0dcaf0);
}
.th-pwa-capture-empty-highlight {
    background: #fff8db;
    border-color: #f5d96d;
}
.th-pwa-capture-empty-mandatory {
    background: #ffeaea;
    border-color: #f1a8a8;
}

.th-pwa-capture-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.th-pwa-capture-title {
    font-weight: 600;
    font-size: 1rem;
}
.th-pwa-capture-status {
    font-size: 0.875rem;
    color: var(--th-pwa-text-muted, #6c757d);
}

.th-pwa-capture-latest {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    background: var(--th-pwa-card-bg, #fff);
    padding: 0.5rem;
    border-radius: 6px;
    border: 1px solid var(--th-pwa-border, #d0d7de);
}
.th-pwa-capture-is-correction {
    background: #fff5e6;
    border-color: #f5c97a;
}
.th-pwa-capture-qr-wrap {
    flex: 0 0 auto;
}
.th-pwa-capture-qr {
    display: block;
    width: 120px;
    height: 120px;
    background: #fff;
}
.th-pwa-capture-meta {
    flex: 1 1 auto;
    min-width: 0;
}
.th-pwa-capture-ref {
    word-break: break-all;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
}
.th-pwa-capture-notes {
    font-size: 0.875rem;
    margin-top: 0.25rem;
    padding-top: 0.25rem;
    border-top: 1px dashed var(--th-pwa-border, #d0d7de);
}

.th-pwa-capture-empty {
    background: var(--th-pwa-card-bg, #fff);
    border: 1px dashed var(--th-pwa-border, #d0d7de);
    border-radius: 6px;
    padding: 0.75rem;
    color: var(--th-pwa-text-muted, #6c757d);
    font-size: 0.875rem;
    text-align: center;
}
.th-pwa-capture-empty-mandatory .th-pwa-capture-empty {
    color: #8a3a3a;
    border-color: #f1a8a8;
}

.th-pwa-capture-actions {
    margin-top: 0.5rem;
}
.th-pwa-capture-actions > .th-pwa-big-btn,
.th-pwa-capture-actions > .th-pwa-secondary-btn {
    width: 100%;
}

/* History reveal */
.th-pwa-capture-history {
    margin-top: 0.5rem;
}
.th-pwa-capture-history > summary {
    cursor: pointer;
    color: var(--th-pwa-text-muted, #6c757d);
    padding: 0.25rem 0;
    font-size: 0.875rem;
    user-select: none;
}
.th-pwa-capture-history-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding-left: 0.5rem;
    border-left: 2px solid var(--th-pwa-border, #d0d7de);
}
.th-pwa-capture-history-row {
    background: var(--th-pwa-card-bg, #fff);
    border: 1px solid var(--th-pwa-border, #d0d7de);
    border-radius: 6px;
    padding: 0.5rem;
    font-size: 0.875rem;
}
.th-pwa-capture-history-row.th-pwa-capture-is-correction {
    background: #fff5e6;
    border-color: #f5c97a;
}
.th-pwa-capture-annotations {
    margin-top: 0.5rem;
    padding-left: 0.5rem;
    border-left: 2px dotted var(--th-pwa-border, #d0d7de);
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

/* Form bits used inside capture modals */
.th-pwa-form-label {
    display: block;
    margin-top: 0.5rem;
    margin-bottom: 0.25rem;
    font-size: 0.875rem;
    font-weight: 600;
}
.th-pwa-form-input {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--th-pwa-border, #d0d7de);
    border-radius: 6px;
    font-size: 1rem;
    background: #fff;
    box-sizing: border-box;
}
.th-pwa-form-input:focus {
    outline: 2px solid var(--th-pwa-primary, #0d6efd);
    outline-offset: -1px;
}

/* Warning variant for big buttons (capture-vs-release choice modal) */
.th-pwa-big-btn-warning {
    background: var(--th-warning, #ffc107);
    color: #212529;
}
.th-pwa-big-btn-warning:hover,
.th-pwa-big-btn-warning:active {
    background: #e0a800;
}

/* ============================================================
 * 2.3.1 — record modal field row + locked input + QR features
 * ============================================================ */

/* Text field with an action button alongside (used for the
   "Reference value" + "Scan" pairing in the record modal) */
.th-pwa-form-row-with-action {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}
.th-pwa-form-row-with-action > .th-pwa-form-input {
    flex: 1 1 auto;
    min-width: 0;
}
.th-pwa-form-row-with-action > .th-pwa-secondary-btn {
    flex: 0 0 auto;
}

/* Read-only display of a locked field value (e.g., locked intent
   in the preauth-follow-up flow). Looks like the form input but
   not editable. */
.th-pwa-form-input-locked {
    display: block;
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--th-pwa-border, #d0d7de);
    border-radius: 6px;
    font-size: 1rem;
    background: var(--th-surface-2, #f7f7f7);
    color: var(--th-text-muted, #6c757d);
    box-sizing: border-box;
    cursor: not-allowed;
}

/* "Tap for larger" hint under the inline QR canvas */
.th-pwa-capture-qr-hint {
    text-align: center;
    font-size: 0.75rem;
    color: var(--th-pwa-text-muted, #6c757d);
    margin-top: 0.25rem;
}

/* Empty-ref state in the QR area (shown when capture has no ref_value) */
.th-pwa-capture-qr-placeholder {
    width: 120px;
    height: 120px;
    border: 1px dashed var(--th-pwa-border, #d0d7de);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    color: var(--th-pwa-text-muted, #6c757d);
    text-align: center;
    padding: 0.5rem;
    box-sizing: border-box;
}

/* Tap target hint on the inline QR canvas */
.th-pwa-capture-qr {
    cursor: zoom-in;
}

/* Fullscreen QR modal — distinct from the regular record modal because
   the QR needs maximum visual prominence (a POS scanner across a counter
   is reading it) and the layout must center on screen rather than the
   bottom-sheet pattern used by the form modals. */
.th-pwa-qr-overlay {
    align-items: center !important;
    padding: 1rem;
}
.th-pwa-qr-modal {
    background: #fff;
    color: #1f2937;
    border-radius: 12px;
    padding: 1.5rem 1rem 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    max-width: 95vw;
    max-height: 95vh;
    overflow-y: auto;
}
.th-pwa-qr-modal-canvas-wrap {
    background: #fff;
    padding: 1rem;
    border-radius: 8px;
}
.th-pwa-qr-modal-canvas {
    display: block;
    background: #fff;
    max-width: 100%;
    height: auto;
}
.th-pwa-qr-modal-ref {
    word-break: break-all;
    text-align: center;
    font-size: 0.875rem;
    padding: 0.5rem;
    background: var(--th-surface-2, #f7f7f7);
    border-radius: 6px;
    width: 100%;
    box-sizing: border-box;
    color: #1f2937;
}
.th-pwa-qr-modal .th-pwa-modal-actions {
    display: flex;
    gap: 0.5rem;
    width: 100%;
    padding: 0;
    margin: 0;
}
.th-pwa-qr-modal .th-pwa-modal-actions > button {
    flex: 1 1 0;
}

/* ============================================================
 * 2.4.0 — Notifications (PWA flag tile, list, broadcast composer)
 * ============================================================ */

/* Tile badge — count overlay on the home screen Notifications tile */
.th-pwa-tile {
    /* tile is already position:relative in existing styles, but ensure */
    position: relative;
}
.th-pwa-tile-badge {
    position: absolute;
    top: 0.4rem;
    right: 0.4rem;
    background: var(--th-danger, #dc3545);
    color: #fff;
    border-radius: 999px;
    min-width: 1.5rem;
    height: 1.5rem;
    padding: 0 0.4rem;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

/* Notifications list screen */
.th-pwa-screen-notifs {
    display: flex;
    flex-direction: column;
    gap: 0;
    min-height: 100%;
}
.th-pwa-screen-title {
    flex: 1 1 auto;
    text-align: center;
    font-weight: 600;
    font-size: 1rem;
}
.th-pwa-notifs-body {
    flex: 1 1 auto;
    padding: 0.5rem;
}
.th-pwa-notifs-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.th-pwa-notif-row {
    background: var(--th-pwa-card-bg, #fff);
    border: 1px solid var(--th-pwa-border, #d0d7de);
    border-radius: 8px;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.th-pwa-notif-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
    font-size: 0.875rem;
}
.th-pwa-notif-type {
    font-weight: 600;
    color: var(--th-text, #1f2937);
}
.th-pwa-notif-when {
    margin-left: auto;
}
.th-pwa-notif-tag {
    display: inline-block;
    padding: 0.1rem 0.45rem;
    font-size: 0.7rem;
    font-weight: 600;
    background: var(--th-surface-2, #f7f7f7);
    color: var(--th-text-muted, #6c757d);
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.th-pwa-notif-tag-auto {
    background: var(--th-warning, #ffc107);
    color: #1f2937;
}
.th-pwa-notif-tag-broadcast {
    background: var(--th-info, #0dcaf0);
    color: #fff;
}
.th-pwa-notif-vis {
    font-size: 0.7rem;
    color: var(--th-pwa-text-muted, #6c757d);
    font-style: italic;
}

.th-pwa-notif-target {
    background: var(--th-surface-2, #f7f7f7);
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
}
.th-pwa-notif-target:active {
    opacity: 0.7;
}
.th-pwa-notif-target-arrow {
    margin-left: auto;
    color: var(--th-pwa-text-muted, #6c757d);
    font-size: 1.2rem;
}

.th-pwa-notif-note {
    font-size: 0.95rem;
    line-height: 1.4;
    word-wrap: break-word;
}
.th-pwa-notif-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--th-pwa-border, #d0d7de);
    padding-top: 0.5rem;
}

/* Empty state when there are no notifications */
.th-pwa-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    color: var(--th-pwa-text-muted, #6c757d);
}
.th-pwa-empty-state-icon {
    opacity: 0.3;
    margin-bottom: 1rem;
}
.th-pwa-empty-state-msg {
    font-size: 1rem;
    text-align: center;
}

/* ============================================================
 * 2.4.1 — Item expiry chip + slot action variant
 * ============================================================ */

/* Three-tier expiry chip rendered in fulfillment search result rows
 * and the picked-item summary. Mirrors the supervisor module's color
 * scheme so staff and supervisors see the same visual semantics. */
.th-pwa-expiry-chip {
    display: inline-block;
    margin-top: 0.35rem;
    padding: 0.15rem 0.55rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 999px;
    line-height: 1.3;
}
.th-pwa-expiry-chip-ok {
    background: var(--th-success-bg, #d1e7dd);
    color: var(--th-success-fg, #0f5132);
}
.th-pwa-expiry-chip-warning {
    background: var(--th-warning-bg, #fff3cd);
    color: var(--th-warning-fg, #856404);
}
.th-pwa-expiry-chip-expired {
    background: var(--th-danger-bg, #f8d7da);
    color: var(--th-danger-fg, #842029);
}

/* "Remove" button on fulfilled-slot rows (2.4.1 void). Visually
 * subdued vs the primary fulfill action; appears as a quiet warning
 * action so it's clear this is a corrective, not routine, action. */
.th-pwa-slot-action-warn {
    background: transparent;
    color: var(--th-warning-fg, #856404);
    border: 1px solid var(--th-warning-fg, #856404);
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 4px;
    margin-left: auto;
    cursor: pointer;
}
.th-pwa-slot-action-warn:hover,
.th-pwa-slot-action-warn:active {
    background: var(--th-warning-bg, #fff3cd);
}
