/* ============================================================
   Dourak — Customer PWA (app.css)
   Uses ONLY tokens from variables.css + the §8–§22 components.
   RTL-first, mobile-first. Cairo. Bootstrap Icons.
   ============================================================ */

/* ============================================================
   MEDICAL LIGHT THEME - token layer
   ------------------------------------------------------------
   Medical identity matching variables.css (Dourak Deep Blue
   #123a7a + accent #2f80ed on #f6f8fc). Each sheet loads
   variables.css FIRST; the tokens below mirror those values and
   define the component-scoped extras the PWA layer reads
   (--color-surface, --color-surface-alt, --color-bg-subtle,
   --color-muted, --color-nav, overlays). No layout, spacing,
   radius, font or breakpoint is changed here.
   ============================================================ */
:root {
    /* ---- Medical identity (mirrors variables.css) ---- */
    --color-primary: #123a7a;
    --color-primary-hover: #0f2f63;
    --color-primary-light: #edf4ff;
    --color-primary-soft: #edf4ff;
    --color-primary-tint-text: #123a7a;

    /* ---- Accent: medical blue (links, focus, selected icons, ring) ---- */
    --color-accent: #2f80ed;
    --color-accent-light: rgba(47, 128, 237, 0.16);

    /* ---- Surfaces: light medical tones ---- */
    --color-bg: #f6f8fc;
    --color-card: #ffffff;
    --color-surface: #ffffff;
    --color-surface-alt: #eef3fb;
    --color-bg-subtle: #eef3fb;
    --color-muted: #e9eef6;
    --color-input-bg: #ffffff;
    --color-nav: #ffffff;
    --color-border: #e5eaf2;
    --color-border-strong: #d4dce8;

    /* ---- Text: medical navy family ---- */
    --color-text: #17325c;
    --color-text-secondary: #6b7280;
    --color-text-muted: #98a4b8;
    --color-text-inverse: #ffffff;

    /* ---- App bar / drawer shell: medical navy ---- */
    --color-sidebar: #0c1f42;
    --color-sidebar-2: #0a1833;
    --color-sidebar-text: rgba(255, 255, 255, 0.78);
    --color-sidebar-muted: rgba(255, 255, 255, 0.45);
    --color-sidebar-hover: rgba(255, 255, 255, 0.08);
    --color-sidebar-active: rgba(47, 128, 237, 0.22);

    /* ---- Status: functional semantics preserved (light tints) ---- */
    --color-success: #20b15a;
    --color-success-light: #e9f9f0;
    --color-success-text: #15803d;
    --color-success-solid: #20b15a;
    --color-warning: #f59e0b;
    --color-warning-light: #fff7e8;
    --color-warning-soft: #fff7e8;
    --color-warning-text: #b45309;
    --color-danger: #ef4444;
    --color-danger-light: #fdeeee;
    --color-danger-soft: #fdeeee;
    --color-danger-subtle: #fdeeee;
    --color-danger-text: #b91c1c;
    --color-danger-solid: #ef4444;

    /* ---- Shadows: soft medical blue glow ---- */
    --shadow-card: 0 15px 40px rgba(0, 0, 0, 0.05);
    --shadow-sm: 0 4px 14px rgba(18, 58, 122, 0.06);
    --shadow-md: 0 10px 28px rgba(18, 58, 122, 0.10);
    --shadow-lg: 0 24px 60px rgba(18, 58, 122, 0.16);
    --shadow-primary: 0 12px 26px rgba(18, 58, 122, 0.30);
    --shadow-accent: 0 12px 26px rgba(47, 128, 237, 0.32);
    --shadow-danger: 0 10px 22px rgba(239, 68, 68, 0.30);
    --shadow-success: 0 10px 22px rgba(32, 177, 90, 0.30);

    /* ---- Focus: medical blue ring, visible on light surfaces ---- */
    --focus-ring: 0 0 0 4px rgba(47, 128, 237, 0.28);
    /* ---- Light overlays (for white/translucent layers on brand gradients) ---- */
    --color-overlay-faint: rgba(255, 255, 255, 0.10);
    --color-overlay-soft: rgba(255, 255, 255, 0.14);
    --color-overlay: rgba(255, 255, 255, 0.18);
    --color-overlay-mid: rgba(255, 255, 255, 0.22);
    --color-overlay-strong: rgba(255, 255, 255, 0.28);
}



*,
*::before,
*::after {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

.pwa-body {
    margin: 0;
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-family);
    -webkit-tap-highlight-color: transparent;
}

button,
input,
select,
textarea {
    font-family: inherit;
}

a {
    color: inherit;
    text-decoration: none;
}

:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

/* ---- Safe-area insets (notched / home-indicator devices) ----
   viewport-fit=cover lets env() resolve to the real notches. Fallbacks keep
   desktops/browsers unchanged. */
:root {
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-right: env(safe-area-inset-right, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-left: env(safe-area-inset-left, 0px);
}

/* ---- Accessibility: skip link + screen-reader-only ---- */
.c-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.c-skip-link {
    position: fixed;
    top: var(--safe-top);
    inset-inline-start: var(--space-3);
    z-index: calc(var(--z-drawer) + 20);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-pill);
    background: var(--color-primary);
    color: var(--color-text-inverse);
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    transform: translateY(-200%);
    transition: transform var(--transition-fast);
}

.c-skip-link:focus-visible {
    transform: none;
}

/* ---- App bar (unified navy — identical on every PWA screen).
   The gradient starts at the sidebar navy and ends exactly at
   --color-primary so the home view's .c-hero continues it with
   zero visible seam. ---- */
.pwa-appbar {
    position: sticky;
    top: 0;
    z-index: var(--z-header);
    padding-top: var(--safe-top);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, rgba(0, 0, 0, 0) 42%, rgba(0, 0, 0, 0.22) 100%),
        linear-gradient(180deg, var(--color-sidebar) 0%, var(--color-primary) 100%);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    border-bottom: none;
    box-shadow: var(--shadow-primary);
}

.pwa-appbar-inner {
    max-width: 440px;
    margin-inline: auto;
    min-height: 64px;
    padding-block: var(--space-3);
    padding-inline: var(--space-4);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-2);
}

.pwa-brand {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    order: 2;
    color: var(--color-text-inverse);
    text-align: center;
}

/* Brand wrapper: the mark+name row above the tagline. */
.pwa-brand-title {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    min-width: 0;
}

.pwa-brand-tagline {
    display: block;
    font-size: var(--fs-xs);
    font-weight: var(--fw-medium);
    opacity: 0.85;
    white-space: nowrap;
}

.pwa-brand-mark {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.38);
    color: var(--color-text-inverse);
    font-size: 1rem;
    box-shadow: none;
    overflow: hidden;
}

/* Admin-managed header logo (branding.js paints it over the shop icon).
   Fills the mark without distortion; the icon stays when no logo is set. */
.pwa-brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

.pwa-brand-name {
    font-size: var(--fs-lg);
    font-weight: var(--fw-extrabold);
    color: #ffffff;}

/* Actions group (install · profile · back) sits at the inline-end, ordered
   around the centered brand: bell (start) · brand (center) · actions (end). */
.pwa-appbar-actions {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    order: 3;
}

#notif-btn {
    order: 1;
}

#install-appbar-btn {
    order: 3;
}

.pwa-appbar-actions .pwa-icon-btn {
    order: 4;
}

.pwa-icon-btn {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border: none;
    border-radius: var(--radius-pill);
    background: var(--color-overlay);
    color: var(--color-text-inverse);
    font-size: 1.25rem;
    cursor: pointer;
    transition: transform var(--transition-fast), background var(--transition-fast);
}

.pwa-icon-btn:hover {
    background: var(--color-overlay-strong);
}

.pwa-icon-btn:active {
    transform: scale(0.94);
}

/* High-contrast keyboard focus on the dark oxblood app bar (the global
   focus ring is too subtle against this surface). */
.pwa-appbar :focus-visible {
    outline: 2px solid var(--color-text-inverse);
    outline-offset: 2px;
    box-shadow: none;
}

.pwa-back-btn {
    order: 5;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding-inline: var(--space-3);
    border-radius: var(--radius-pill);
    background: var(--color-overlay);
    color: var(--color-text-inverse);
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
    transition: transform var(--transition-fast), background var(--transition-fast);
}

.pwa-back-btn:hover {
    background: var(--color-overlay-strong);
}

.pwa-back-btn:active {
    transform: scale(0.94);
}

.pwa-back-btn i {
    font-size: 1rem;
}

/* ---- Business switcher (presentation layer only).
   A one-tap "switch activity" strip under the app bar. It points at the
   exact same ?business= deep links / /customer/go/{id} pages the favorites
   list opens, and only appears once there is more than one context to
   switch between. ---- */
.pwa-switcher {
    max-width: 440px;
    margin-inline: auto;
}

.pwa-switcher[hidden] {
    display: none;
}

.pwa-switcher-strip {
    display: flex;
    gap: var(--space-2);
    align-items: center;
    overflow-x: auto;
    padding: var(--space-2) var(--space-4) 0;
    scrollbar-width: none;
}

.pwa-switcher-strip::-webkit-scrollbar {
    display: none;
}

.pwa-switcher-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    flex: 0 0 auto;
    max-width: 190px;
    min-height: 36px;
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-pill);
    border: 1px solid var(--color-border);
    background: var(--color-card);
    box-shadow: var(--shadow-sm);
    color: var(--color-text);
    font-size: var(--fs-xs);
    font-weight: var(--fw-semibold);
    cursor: pointer;
    transition: transform var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast);
}

.pwa-switcher-chip:hover {
    border-color: var(--color-accent);
    background: var(--color-primary-light);
}

.pwa-switcher-chip:active {
    transform: scale(0.96);
}

.pwa-switcher-chip.is-current {
    border-color: var(--color-accent);
    background: var(--color-primary-light);
    color: var(--color-primary);
    font-weight: var(--fw-bold);
}

.pwa-switcher-chip.is-current {
    cursor: default;
}

.pwa-switcher-chip .bi {
    font-size: var(--fs-sm);
    color: var(--color-accent);
}

.pwa-switcher-chip.is-current .bi {
    color: var(--color-primary-tint-text);
}

.pwa-switcher-chip-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---- Hero (home view): greeting + search on the same gradient.
   Full-bleed against .pwa-main padding, rounded bottom, and it starts
   at --color-primary — the exact color the appbar gradient ends at. ---- */
.c-hero {
    margin: calc(-1 * var(--space-4)) calc(-1 * var(--space-4)) 0;
    padding: var(--space-4) var(--space-4) var(--space-5);
    background: linear-gradient(180deg, var(--color-primary) 0%, var(--color-accent) 130%);
    border-radius: 0 0 26px 26px;
    color: var(--color-text-inverse);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.c-hero-title {
    margin: 0;
    font-size: var(--fs-xl);
    font-weight: var(--fw-extrabold);
    text-align: center;
}

.c-hero-sub {
    margin: 0 0 var(--space-2);
    font-size: var(--fs-sm);
    opacity: 0.88;
    text-align: center;
}

.c-hero .c-search-bar {
    border-color: transparent;
    box-shadow: var(--shadow-md);
}

/* ---- Main / screens ---- */
.pwa-main {
    max-width: 440px;
    margin-inline: auto;
    padding: var(--space-4);
    padding-bottom: calc(var(--space-7) + 96px + var(--safe-bottom));
}

.c-screen {
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
    animation: c-fade-up 300ms cubic-bezier(0.25, 0.6, 0.3, 1);
}

@keyframes c-fade-up {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.c-greeting {
    font-size: var(--fs-base);
    color: var(--color-text-secondary);
    margin: 0;
}

.c-greeting strong {
    color: var(--color-text);
}

.c-screen-title {
    font-size: var(--fs-xl);
    font-weight: var(--fw-extrabold);
    margin: 0;
}

.c-section-title {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-3);
    font-size: var(--fs-lg);
    font-weight: var(--fw-extrabold);
    margin: 0 0 var(--space-3);
}

.c-section-title .c-section-link {
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    color: var(--color-accent);
}

/* Title row with no heading text: keeps the single link at the
   inline-end where it sat next to the removed heading. */
.c-section-title-end {
    justify-content: flex-end;
}

.c-stack {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

/* ---- Pills / badges ---- */
.c-pill {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    border-radius: var(--radius-pill);
    padding: var(--space-2) var(--space-4);
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    line-height: 1.3;
    white-space: nowrap;
}

.c-pill .bi {
    font-size: 0.8rem;
}

.c-pill-success {
    background: var(--color-success-light);
    color: var(--color-success);
}

.c-pill-warning {
    background: var(--color-warning-light);
    color: var(--color-warning-text);
}

.c-pill-danger {
    background: var(--color-danger-light);
    color: var(--color-danger-text);
}

.c-pill-accent {
    background: var(--color-primary-light);
    color: var(--color-primary);
}

.c-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius-pill);
    background: currentColor;
    display: inline-block;
}

.c-pill-live .c-dot {
    animation: c-pulse 1.6s ease-in-out infinite;
}

@keyframes c-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

/* ---- Store hero card ---- */
.c-shopcard {
    position: relative;
    overflow: hidden;
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 24px;
    box-shadow: var(--shadow-card);
    padding: var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.c-shopcard-head {
    display: flex;
    align-items: flex-start;
    gap: var(--space-4);
}

/* Discover follow row: follower count + follow toggle under
   the business card head. Flex-wrap keeps RTL narrow screens free of
   horizontal overflow; an empty section (Discover off) takes no space. */
.c-follow {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.c-follow:empty {
    display: none;
}

.c-shopcard-cover {
    margin: calc(var(--space-5) * -1) calc(var(--space-5) * -1) 0;
    width: calc(100% + (var(--space-5) * 2));
    height: 150px;
    overflow: hidden;
    border-radius: 24px 24px 0 0;
    background: var(--color-muted);
}

.c-shopcard-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.c-shopcard-mark {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    border-radius: 20px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
    color: var(--color-text-inverse);
    font-size: 1.75rem;
    box-shadow: var(--shadow-primary);
}

.c-shopcard-meta {
    flex: 1;
    min-width: 0;
}

.c-shopcard-name {
    font-size: var(--fs-lg);
    font-weight: var(--fw-extrabold);
    margin: 0 0 var(--space-1);
}

.c-shopcard-sub {
    font-size: var(--fs-sm);
    color: var(--color-text-secondary);
    margin: 0 0 var(--space-3);
}

.c-shopcard-chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.c-shopcard-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-2);
    padding-top: var(--space-4);
    border-top: 1px solid var(--color-border);
}

.c-stat {
    text-align: center;
    padding: var(--space-2);
}

.c-stat b {
    display: block;
    font-size: var(--fs-md);
    font-weight: var(--fw-extrabold);
    color: var(--color-text);
}

.c-stat span {
    font-size: var(--fs-xs);
    color: var(--color-text-muted);
}

.c-stat-urgent b {
    color: var(--color-danger-text);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ---- Live queue card ---- */
.c-livecard {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
    border-radius: 24px;
    box-shadow: var(--shadow-primary);
    color: var(--color-text-inverse);
    padding: var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.c-livecard-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
}

.c-livecard-title {
    font-size: var(--fs-base);
    font-weight: var(--fw-semibold);
    margin: 0;
}

.c-livecard-live {
    background: var(--color-overlay-mid);
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    border-radius: var(--radius-pill);
    padding: var(--space-1) var(--space-3);
    font-size: var(--fs-xs);
    font-weight: var(--fw-semibold);
}

.c-livecard .c-shopcard-stats {
    border-top: 1px solid rgba(255, 255, 255, 0.25);
}

.c-livecard .c-stat b {
    color: #ffffff;
}

.c-livecard .c-stat span {
    color: rgba(255, 255, 255, 0.82);
}

.c-livecard-num {
    font-size: clamp(3rem, 16vw, 4.5rem);
    font-weight: var(--fw-extrabold);
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin: 0;
}

.c-livecard-caption {
    font-size: var(--fs-sm);
    opacity: 0.85;
    margin: 0;
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    height: var(--btn-height);
    padding: 0 var(--space-5);
    border-radius: var(--radius-md);
    border: none;
    font-size: var(--fs-base);
    font-weight: var(--fw-semibold);
    cursor: pointer;
    text-align: center;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), opacity var(--transition-fast);
}

.btn:active {
    transform: scale(0.98);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-block {
    width: 100%;
}

.btn-primary {
    background: var(--color-primary);
    color: var(--color-text-inverse);
    box-shadow: var(--shadow-primary);
}

.btn-primary:hover:not(:disabled) {
    background: var(--color-primary-hover);
}

.btn-secondary {
    background: var(--color-surface);
    color: var(--color-text);
}

.btn-outline {
    background: transparent;
    color: var(--color-primary-tint-text);
    border: 1px solid var(--color-border-strong);
}

.btn-ghost {
    background: transparent;
    color: var(--color-text-secondary);
    border: none;
}

.btn-danger {
    background: var(--color-danger-solid);
    color: var(--color-text-inverse);
    box-shadow: var(--shadow-danger);
}

/* Cancel-booking actions: danger-text treatment only. Keeps the existing
   background, size, position, icon and label untouched; scope is limited to
   the two real cancel buttons (home booking card + bookings list row). */
.c-bookingcard .btn-danger,
.c-bookingrow-actions .btn-danger {
    color: var(--color-danger-soft);
}

.btn-lg {
    height: 64px;
    font-size: var(--fs-md);
}

.btn-sm {
    height: 44px;
    padding: 0 var(--space-4);
    font-size: var(--fs-sm);
}

/* Appointment slot chips: the queue-row `.btn-sm` redefinition further down
   this sheet resets border-color to transparent, which erases the outlined
   chip and lets adjacent times read as one run of text. Re-assert the
   outline for THIS grid only. The box is border-box and the border already
   existed (transparent), so sizes, order and spacing do not change. */
.c-slot-grid .btn-outline {
    border-color: var(--color-border-strong);
}

/* ---- Quick actions ---- */
.c-quick {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
}

.c-quick-item {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: var(--space-4);
    cursor: pointer;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.c-quick-item:hover {
    box-shadow: var(--shadow-md);
}

.c-quick-item:active {
    transform: scale(0.97);
}

.c-quick-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: var(--radius-md);
    background: var(--color-primary-light);
    color: var(--color-accent);
    font-size: 1.25rem;
}

.c-quick-label {
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    line-height: 1.4;
}

/* ---- Service cards ---- */
.c-service {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: var(--space-4);
    cursor: pointer;
    text-align: start;
    transition: border-color var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
}

.c-service:hover {
    box-shadow: var(--shadow-md);
}

.c-service:active {
    transform: scale(0.98);
}

.c-service.is-selected {
    border-color: var(--color-accent);
    box-shadow: var(--focus-ring);
}

.c-service-icon {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    border-radius: var(--radius-md);
    background: var(--color-primary-light);
    color: var(--color-accent);
    font-size: 1.4rem;
}

.c-service-body {
    flex: 1;
    min-width: 0;
}

.c-service-name {
    font-size: var(--fs-base);
    font-weight: var(--fw-semibold);
    margin: 0 0 var(--space-1);
}

.c-service-desc {
    display: block;
    font-size: var(--fs-sm);
    color: var(--color-text-secondary);
    line-height: 1.5;
    margin: 0 0 var(--space-1);
}

.c-service-clinics {
    display: block;
    font-size: var(--fs-sm);
    font-weight: var(--fw-medium);
    color: var(--color-primary-tint-text);
    margin: 0 0 var(--space-1);
}

.c-service-meta {
    font-size: var(--fs-sm);
    color: var(--color-text-secondary);
    margin: 0;
    display: flex;
    gap: var(--space-3);
}

.c-service-price {
    font-weight: var(--fw-bold);
    color: var(--color-text);
}

.c-service-eta {
    color: var(--color-success);
    font-weight: var(--fw-semibold);
}

/* ---- Doctor cards + details sheet ---- */
.c-doctor .c-service-desc:empty {
    display: none;
}

.c-doctor-avatar {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-pill);
    overflow: hidden;
    background: var(--color-primary-light);
    color: var(--color-primary-tint-text);
    display: grid;
    place-items: center;
    font-size: 1.2rem;
}

.c-doctor-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.c-doctor-avatar.is-lg {
    width: 64px;
    height: 64px;
    font-size: 1.6rem;
}

.c-service-icon.is-lg {
    width: 64px;
    height: 64px;
    font-size: 1.6rem;
}

.c-doctor-sheet {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.c-doctor-sheet-head {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.c-doctor-sheet-id {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    align-items: flex-start;
    min-width: 0;
}

.c-doctor-sheet-name {
    margin: 0;
    font-size: var(--fs-lg);
    font-weight: var(--fw-bold);
    color: var(--color-text);
}

.c-doctor-sheet-list {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: var(--space-2) var(--space-4);
    margin: 0;
    padding: var(--space-4);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
}

.c-doctor-sheet-list dt {
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    color: var(--color-text-secondary);
    white-space: nowrap;
}

.c-doctor-sheet-list dd {
    margin: 0;
    font-size: var(--fs-base);
    color: var(--color-text);
    overflow-wrap: anywhere;
}

.c-doctor-sheet-label {
    margin: 0 0 var(--space-2);
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    color: var(--color-text-secondary);
}

.c-doctor-sheet-bio p {
    margin: 0;
    font-size: var(--fs-base);
    line-height: 1.7;
    color: var(--color-text);
}

/* ---- Single doctor's "بيانات الطبيب" button -------------------------------
   A HIGHLIGHTED action that deliberately sits one step BELOW the booking CTA.
   The booking button is the solid .btn-primary: a --color-primary fill, white
   text and --shadow-primary. This one reuses the treatment the app already
   applies to informational accents (.c-empty-icon, .c-service-icon) — a
   --color-primary-light surface with --color-primary text — and adds an
   --color-accent border so the control has a real edge instead of reading as
   plain text. It therefore catches the eye while staying unmistakably lighter
   than "احجز دورك", which keeps the booking CTA the primary action.

   Size, radius and the focus ring are inherited (.btn-lg + .btn + the global
   :focus-visible), so this is a colour/weight adjustment only — the button
   stays a normal Dourak button. Tokens only: no new colour, no gradient, no
   animation, no pulse. Hover deepens the existing border and lifts the
   existing --shadow-sm to --shadow-md, both already in the system. */
.c-doctor-info-btn {
    background: var(--color-primary-light);
    color: var(--color-primary-tint-text);
    border: 1px solid var(--color-accent);
    font-weight: var(--fw-bold);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast),
                opacity var(--transition-fast), background var(--transition-fast),
                border-color var(--transition-fast);
}

/* Hover/active only re-use tokens already on the page: the border moves to the
   solid primary and the shadow steps up one level, then settles back on press
   so the tap still feels physical (the shared .btn:active scale is kept). */
.c-doctor-info-btn:hover:not(:disabled) {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-md);
}

.c-doctor-info-btn:active:not(:disabled) {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-sm);
}

/* The badge icon is already the feature's doctor glyph; it only needs to match
   the larger label beside it. */
.c-doctor-info-btn .bi {
    font-size: 1.2rem;
}

/* Doctor hint row on a search result card */
.c-shopcard-doctor {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-top: var(--space-3);
    padding-top: var(--space-3);
    border-top: 1px solid var(--color-border);
}

.c-shopcard-doctor-meta {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
}

.c-shopcard-doctor-name {
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    color: var(--color-text);
    overflow-wrap: anywhere;
}

.c-shopcard-doctor-sub {
    font-size: var(--fs-sm);
    color: var(--color-text-secondary);
}

/* ---- Reviews ---- */
.c-review {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.c-review-head {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.c-review-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-pill);
    background: var(--color-accent-light);
    color: var(--color-accent);
    display: grid;
    place-items: center;
    font-weight: var(--fw-extrabold);
    font-size: var(--fs-base);
}

.c-review-name {
    font-size: var(--fs-base);
    font-weight: var(--fw-semibold);
    margin: 0;
}

.c-review-stars {
    color: var(--color-warning);
    font-size: 0.9rem;
    letter-spacing: 2px;
}

.c-review-text {
    font-size: var(--fs-sm);
    color: var(--color-text-secondary);
    line-height: var(--line-height);
    margin: 0;
}

/* ---- Bottom tab bar: one floating rounded bar (surface drawn by the
   ::before pseudo-element) with a raised circular QR scan FAB ---- */
.c-tabbar {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: var(--z-header);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: var(--space-1);
    max-width: 480px;
    margin-inline: auto;
    padding: 0 calc(var(--safe-left) + var(--space-2)) calc(var(--safe-bottom) + var(--space-2)) calc(var(--safe-right) + var(--space-2));
    pointer-events: none;
}

/* The visible bar surface: spans behind the tabs but excludes the
   safe-area strip so the home-indicator zone stays transparent. */
.c-tabbar::before {
    content: "";
    position: absolute;
    top: 0;
    inset-inline: 0;
    bottom: calc(var(--safe-bottom) + var(--space-2));
    background: var(--color-nav);
    border: 1px solid var(--color-border);
    border-radius: 22px;
    box-shadow: var(--shadow-lg);
    pointer-events: none;
}

.c-tabbar .c-tab {
    pointer-events: auto;
}

.c-tabbar-inner,
.c-tabbar {
    display: flex;
}

.c-tab {
    position: relative;
    z-index: 1;
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    height: 62px;
    border-radius: 18px;
    background: transparent;
    color: var(--color-text-muted);
    font-size: var(--fs-xs);
    font-weight: var(--fw-semibold);
    box-shadow: none;
    border: none;
    transition: color var(--transition-fast), background var(--transition-fast), transform var(--transition-fast);
}

.c-tab .bi {
    font-size: 1.35rem;
}

.c-tab.is-active {
    background: var(--color-primary-light);
    color: var(--color-primary);
}

.c-tab:hover {
    transform: translateY(-2px);
}

/* ---- Bottom sheet ---- */
.sheet-root {
    position: fixed;
    inset: 0;
    z-index: var(--z-drawer);
}

.sheet-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.70);
    opacity: 0;
    transition: opacity var(--transition);
}

.sheet {
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    margin-inline: auto;
    max-width: 440px;
    max-height: 88dvh;
    background: var(--color-card);
    border-radius: 24px 24px 0 0;
    box-shadow: var(--shadow-lg);
    transform: translateY(100%);
    transition: transform 300ms cubic-bezier(0.25, 0.6, 0.3, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sheet.is-open {
    transform: none;
}

.sheet.is-open ~ .sheet-backdrop {
    opacity: 1;
}

.sheet-handle {
    width: 32px;
    height: 4px;
    border-radius: var(--radius-pill);
    background: var(--color-border-strong);
    margin: var(--space-3) auto var(--space-1);
    flex-shrink: 0;
}

.sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-2) var(--space-5);
}

.sheet-title {
    font-size: var(--fs-lg);
    font-weight: var(--fw-extrabold);
    margin: 0;
}

.sheet-close {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border: none;
    border-radius: var(--radius-pill);
    background: var(--color-bg);
    color: var(--color-text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
}

.sheet-body {
    padding: var(--space-4) var(--space-5) calc(var(--space-5) + var(--safe-bottom));
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

/* Sheet steps */
.c-steps {
    display: flex;
    gap: var(--space-2);
    margin-bottom: var(--space-1);
}

.c-step {
    flex: 1;
    height: 4px;
    border-radius: var(--radius-pill);
    background: var(--color-border);
}

.c-step.is-active {
    background: var(--color-primary);
}

.c-step.is-done {
    background: var(--color-success);
}

/* ---- Forms ---- */
.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.form-label {
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    color: var(--color-text);
}

.form-input {
    width: 100%;
    height: var(--input-height);
    background: var(--color-input-bg);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-md);
    padding: 0 var(--space-4);
    font-size: var(--fs-base);
    color: var(--color-text);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input::placeholder {
    color: var(--color-text-muted);
}

.form-input:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: var(--focus-ring);
}

.form-input.is-invalid {
    border-color: var(--color-danger-text);
    box-shadow: var(--shadow-danger);
}

.form-error {
    font-size: var(--fs-xs);
    color: var(--color-danger-text);
    margin: 0;
}

.form-select {
    width: 100%;
    height: var(--input-height);
    background: var(--color-input-bg);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-md);
    padding: 0 var(--space-4);
    font-size: var(--fs-sm);
    color: var(--color-text);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16'%3E%3Cpath fill='%2398a4b8' d='M4.5 6l3.5 4 3.5-4z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left var(--space-3) center;
    padding-left: var(--space-8);
}

.form-select:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: var(--focus-ring);
}

.c-search-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.c-search-form .form-input {
    width: 100%;
}

.c-search-form .btn {
    width: 100%;
}

.c-search-filters {
    display: flex;
    gap: var(--space-2);
}

.c-filter-select {
    flex: 1;
    min-width: 0;
}

.form-hint {
    font-size: var(--fs-xs);
    color: var(--color-text-muted);
    margin: 0;
}

/* ---- Summary card ---- */
.c-summary {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.c-summary-row {
    display: flex;
    justify-content: space-between;
    gap: var(--space-3);
    font-size: var(--fs-sm);
}

.c-summary-row span {
    color: var(--color-text-secondary);
}

.c-summary-row b {
    color: var(--color-text);
    font-weight: var(--fw-semibold);
    text-align: end;
}

.c-summary-divider {
    border: none;
    border-top: 1px dashed var(--color-border-strong);
    margin: var(--space-1) 0;
}

/* ---- Booking / queue ticket card ---- */
.c-ticket {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 24px;
    box-shadow: var(--shadow-card);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.c-ticket-hero {
    position: relative;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
    color: var(--color-text-inverse);
    padding: var(--space-5);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
    text-align: center;
}

.c-ticket-label {
    font-size: var(--fs-base);
    font-weight: var(--fw-semibold);
    opacity: 0.9;
    margin: 0;
}

.c-ticket-num {
    font-size: clamp(3.5rem, 20vw, 5.5rem);
    font-weight: var(--fw-extrabold);
    line-height: 1.05;
    letter-spacing: -0.02em;
    margin: 0;
}

/* Customer full name in the ticket hero.
   .c-ticket inherits `word-break: break-word` from the mobile media query,
   which lets a browser fragment Arabic names character-by-character into a
   vertical column. These rules opt this element out: the name stays on one
   horizontal line and only ellipsizes when it is genuinely too long. */
.c-ticket-customer {
    font-size: clamp(1.05rem, 4.4vw, 1.4rem);
    font-weight: var(--fw-bold);
    line-height: 1.3;
    margin: 0;
    max-width: 100%;
    min-width: 0;
    white-space: nowrap;
    word-break: normal;
    overflow-wrap: normal;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Same opt-out for the name value inside the .c-summary block, so the name
   never fragments there either. */
.c-summary-value-name {
    min-width: 0;
    white-space: nowrap;
    word-break: normal;
    overflow-wrap: normal;
    overflow: hidden;
    text-overflow: ellipsis;
}

.c-ticket-status {
    background: var(--color-overlay-mid);
    color: #ffffff;
    border-radius: var(--radius-pill);
    padding: var(--space-2) var(--space-4);
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
}

.c-ticket-body {
    padding: var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.c-ticket-qr {
    align-self: center;
    width: 168px;
    height: 168px;
    padding: var(--space-3);
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.c-ticket-qr canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.c-ticket-progress {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-2);
    padding: var(--space-4);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
}

.c-ticket-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
}

.c-ticket-actions .btn-sm {
    width: 100%;
}

.c-ticket-cancel {
    border-top: 1px solid var(--color-border);
    padding: var(--space-4);
}

/* ---- Customer Turn Card (queue screen hero) ----
   The server-issued turn number is the primary element; the
   business identity (logo/name/open status) is secondary meta. */
.c-turn-card {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 24px;
    box-shadow: var(--shadow-card);
    padding: var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.c-turn-head {
    display: flex;
    align-items: flex-start;
    gap: var(--space-4);
}

.c-turn-meta {
    flex: 1;
    min-width: 0;
}

.c-turn-shop {
    font-size: var(--fs-base);
    font-weight: var(--fw-semibold);
    color: var(--color-text-secondary);
    margin: 0 0 var(--space-1);
}

.c-turn-tagline {
    font-size: var(--fs-sm);
    color: var(--color-text-muted);
    margin: 0 0 var(--space-2);
}

.c-turn-chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.c-turn-hero {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
    color: var(--color-text-inverse);
    border-radius: var(--radius-lg);
    padding: var(--space-5);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
    text-align: center;
}

.c-turn-label {
    font-size: var(--fs-base);
    font-weight: var(--fw-semibold);
    opacity: 0.9;
    margin: 0;
}

.c-turn-num {
    font-size: clamp(3.5rem, 20vw, 5.5rem);
    font-weight: var(--fw-extrabold);
    line-height: 1.05;
    letter-spacing: -0.02em;
    margin: 0;
}

.c-turn-hero .c-pill {
    background: var(--color-overlay-mid);
    color: #ffffff;
    border: 0;
}

.c-turn-ahead {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    margin: 0;
    font-size: var(--fs-base);
    font-weight: var(--fw-bold);
    color: var(--color-text);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-3) var(--space-4);
    text-align: center;
}

.c-turn-ahead.is-now {
    color: var(--color-success);
    background: var(--color-success-light);
    border-color: var(--color-success);
    font-size: var(--fs-lg);
}

.c-turn-proceed {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    margin: -0.25rem 0 0;
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    color: var(--color-success);
}

/* ---- Progress ring ---- */
.c-ring-card {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 24px;
    box-shadow: var(--shadow-card);
    padding: var(--space-5);
    display: flex;
    justify-content: center;
}

.c-ring-wrap {
    position: relative;
    width: 240px;
    height: 240px;
    margin-inline: auto;
}

.c-ring {
    width: 100%;
    height: 100%;
    display: block;
}

.c-ring-bg {
    fill: none;
    stroke: var(--color-border);
    stroke-width: 12;
}

.c-ring-fg {
    fill: none;
    stroke: var(--color-accent);
    stroke-width: 12;
    stroke-linecap: round;
    transform: rotate(-90deg);
    transform-origin: center;
    transition: stroke-dashoffset 300ms cubic-bezier(0.25, 0.6, 0.3, 1);
}

.c-ring-center {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-1);
    text-align: center;
}

.c-ring-center b {
    font-size: var(--fs-2xl);
    font-weight: var(--fw-extrabold);
    color: var(--color-text);
}

.c-ring-center span {
    font-size: var(--fs-sm);
    color: var(--color-text-secondary);
}

.c-ring-center .c-ring-note {
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    color: var(--color-success);
    background: var(--color-success-light);
    border-radius: var(--radius-pill);
    padding: var(--space-1) var(--space-3);
}

/* ---- Timeline ---- */
.c-timeline {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.c-timeline-item {
    position: relative;
    display: flex;
    gap: var(--space-4);
    padding-bottom: var(--space-5);
}

.c-timeline-item:last-child {
    padding-bottom: 0;
}

.c-timeline-item::before {
    content: "";
    position: absolute;
    inset-block-start: 34px;
    inset-inline-start: 19px;
    width: 2px;
    bottom: -4px;
    background: var(--color-border);
}

.c-timeline-item:last-child::before {
    display: none;
}

.c-timeline-icon {
    position: relative;
    z-index: 1;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: var(--radius-pill);
    background: var(--color-border);
    color: var(--color-text-muted);
    font-size: 1.1rem;
}

.c-timeline-item.is-done .c-timeline-icon {
    background: var(--color-success-light);
    color: var(--color-success);
}

.c-timeline-item.is-current .c-timeline-icon {
    background: var(--color-accent);
    color: var(--color-text-inverse);
    box-shadow: var(--shadow-accent);
}

.c-timeline-item.is-pending .c-timeline-icon {
    background: var(--color-bg);
}

.c-timeline-item.is-done::before {
    background: var(--color-success);
}

.c-timeline-body {
    padding-top: var(--space-1);
}

.c-timeline-title {
    font-size: var(--fs-base);
    font-weight: var(--fw-semibold);
    margin: 0;
}

.c-timeline-item.is-pending .c-timeline-title {
    color: var(--color-text-muted);
}

.c-timeline-time {
    font-size: var(--fs-xs);
    color: var(--color-text-muted);
    margin: var(--space-1) 0 0;
}

/* ---- Queue screen: status banner, ring state, hints ---- */
.c-status-banner {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4);
    border-radius: var(--radius-lg);
    background: var(--color-primary);
    color: var(--color-text-inverse);
    font-size: var(--fs-base);
    font-weight: var(--fw-bold);
    line-height: var(--line-height);
    box-shadow: var(--shadow-accent);
}

.c-status-banner i {
    font-size: 1.4rem;
    flex-shrink: 0;
}

.c-status-banner.is-serving {
    background: var(--color-success);
    box-shadow: var(--shadow-success);
}

.c-ring-card.is-serving .c-ring-fg {
    stroke: var(--color-success);
}

.c-inperson-ahead {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    text-align: center;
    font-size: 1.15rem;
    font-weight: var(--fw-extrabold);
    line-height: 1.4;
    color: var(--color-danger-text);
    background: var(--color-danger-light);
    border-radius: var(--radius-pill);
    padding: var(--space-3) var(--space-4);
    margin: 0;
}

.c-sync-hint {
    align-self: center;
    font-size: var(--fs-xs);
    font-weight: var(--fw-semibold);
    color: var(--color-warning-text);
    background: var(--color-warning-light);
    border-radius: var(--radius-pill);
    padding: var(--space-1) var(--space-3);
    margin: 0;
}

.c-ticket-progress .c-stat b {
    font-size: var(--fs-lg);
}

/* ---- Notification cards ---- */
.c-notice {
    display: flex;
    gap: var(--space-4);
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: var(--space-4);
}

.c-notice-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: var(--radius-md);
    font-size: 1.2rem;
}

.c-notice-icon-success { background: var(--color-success-light); color: var(--color-success); }
.c-notice-icon-warning { background: var(--color-warning-light); color: var(--color-warning); }
.c-notice-icon-accent { background: var(--color-primary-light); color: var(--color-accent); }
.c-notice-icon-danger { background: var(--color-danger-light); color: var(--color-danger-text); }

.c-notice-body {
    flex: 1;
    min-width: 0;
}

.c-notice-title {
    font-size: var(--fs-base);
    font-weight: var(--fw-semibold);
    margin: 0 0 var(--space-1);
}

.c-notice-text {
    font-size: var(--fs-sm);
    color: var(--color-text-secondary);
    line-height: var(--line-height);
    margin: 0 0 var(--space-2);
}

.c-notice-time {
    font-size: var(--fs-xs);
    color: var(--color-text-muted);
    margin: 0;
}

/* ---- Profile ---- */
.c-profile-head {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
    text-align: center;
    padding: var(--space-5) var(--space-4);
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 24px;
    box-shadow: var(--shadow-card);
}

.c-profile-avatar {
    width: 84px;
    height: 84px;
    border-radius: var(--radius-pill);
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
    color: var(--color-text-inverse);
    display: grid;
    place-items: center;
    font-size: 2.25rem;
    box-shadow: var(--shadow-primary);
}

.c-profile-name {
    font-size: var(--fs-lg);
    font-weight: var(--fw-extrabold);
    margin: 0;
}

.c-profile-sub {
    font-size: var(--fs-sm);
    color: var(--color-text-muted);
    margin: 0;
}

.c-profile-list {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.c-profile-row {
    display: flex;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-4);
    background: none;
    border: none;
    border-bottom: 1px solid var(--color-border);
    font-size: var(--fs-base);
    color: var(--color-text);
    text-align: start;
    width: 100%;
    cursor: pointer;
}

.c-profile-row:last-child {
    border-bottom: none;
}

.c-profile-row .bi-chevron-left {
    margin-inline-start: auto;
    color: var(--color-text-muted);
}

.c-profile-row-icon {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: var(--radius-md);
    background: var(--color-primary-light);
    color: var(--color-accent);
    font-size: 1.2rem;
}

/* ---- Toggle switch ---- */
.c-switch {
    position: relative;
    width: 52px;
    height: 32px;
    flex-shrink: 0;
}

.c-switch input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
}

.c-switch-track {
    position: absolute;
    inset: 0;
    border-radius: var(--radius-pill);
    background: var(--color-border-strong);
    transition: background var(--transition-fast);
}

.c-switch-track::after {
    content: "";
    position: absolute;
    top: 4px;
    inset-inline-start: 4px;
    width: 24px;
    height: 24px;
    border-radius: var(--radius-pill);
    background: #ffffff;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-fast);
}

.c-switch input:checked + .c-switch-track {
    background: var(--color-success);
}

.c-switch input:checked + .c-switch-track::after {
    transform: translateX(-20px);
}

/* ---- Snackbar ---- */
.snackbar-root {
    position: fixed;
    inset-inline: 0;
    bottom: calc(var(--safe-bottom) + var(--space-5) + 96px);
    z-index: var(--z-drawer);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    pointer-events: none;
    padding-inline: var(--space-4);
}

.snackbar {
    max-width: 440px;
    width: 100%;
    display: flex;
    align-items: center;
    gap: var(--space-3);
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
    padding: var(--space-3) var(--space-4);
    font-size: var(--fs-sm);
    color: var(--color-text);
    pointer-events: auto;
    animation: c-snack-in 300ms cubic-bezier(0.25, 0.6, 0.3, 1);
}

.snackbar .bi {
    font-size: 1.25rem;
}

.snackbar-success .bi { color: var(--color-success); }
.snackbar-danger .bi { color: var(--color-danger-text); }
.snackbar-warning .bi { color: var(--color-warning); }

@keyframes c-snack-in {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: none; }
}

/* ---- Dialog ---- */
.dialog-root {
    position: fixed;
    inset: 0;
    z-index: calc(var(--z-drawer) + 10);
    display: grid;
    place-items: center;
    padding: var(--space-5);
}

.dialog-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.70);
}

.dialog {
    position: relative;
    width: 100%;
    max-width: 380px;
    background: var(--color-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    animation: c-fade-up 300ms cubic-bezier(0.25, 0.6, 0.3, 1);
}

.dialog-title {
    font-size: var(--fs-lg);
    font-weight: var(--fw-extrabold);
    margin: 0;
}

.dialog-text {
    font-size: var(--fs-base);
    color: var(--color-text-secondary);
    line-height: var(--line-height);
    margin: 0;
}

.dialog-actions {
    display: flex;
    gap: var(--space-3);
}

.dialog-actions .btn {
    flex: 1;
}

/* ---- Empty states ---- */
.c-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
    text-align: center;
    padding: var(--space-6) var(--space-4);
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 24px;
    box-shadow: var(--shadow-card);
}

.c-empty-icon {
    width: 72px;
    height: 72px;
    display: grid;
    place-items: center;
    border-radius: var(--radius-pill);
    background: var(--color-primary-light);
    color: var(--color-accent);
    font-size: 2rem;
}

.c-shopcard-avatar {
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    border-radius: var(--radius-pill);
    overflow: hidden;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
    box-shadow: var(--shadow-sm);
}

.c-shopcard-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.c-empty-title {
    font-size: var(--fs-lg);
    font-weight: var(--fw-extrabold);
    margin: 0;
}

.c-empty-text {
    font-size: var(--fs-sm);
    color: var(--color-text-secondary);
    line-height: var(--line-height);
    margin: 0;
}

/* ---- Install banner ---- */
.c-install-banner {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: var(--space-3);
}

.c-install-banner .bi-x {
    margin-inline-start: auto;
    cursor: pointer;
    color: var(--color-text-muted);
    font-size: 1.25rem;
}

/* ---- Home quick actions (scan QR + favorites) ---- */
.c-home-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-3);
}

.c-home-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    height: 52px;
    border: none;
    border-radius: var(--radius-md);
    background: var(--color-card);
    color: var(--color-primary-tint-text);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    font-size: var(--fs-base);
    font-weight: var(--fw-semibold);
    cursor: pointer;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.c-home-action:hover {
    box-shadow: var(--shadow-md);
}

.c-home-action:active {
    transform: scale(0.97);
}

/* ---- Header notification badge (appbar) ---- */
.pwa-notif-btn {
    position: relative;
}

.c-badge {
    position: absolute;
    top: 4px;
    inset-inline-end: 4px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    display: grid;
    place-items: center;
    border-radius: var(--radius-pill);
    background: var(--color-danger-solid);
    color: var(--color-text-inverse);
    font-size: 0.7rem;
    font-weight: var(--fw-bold);
    line-height: 1;
}

/* ---- Home search bar ---- */
.c-search-bar {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    width: 100%;
    height: 52px;
    padding: 0 var(--space-4);
    border: 1px solid var(--color-border-strong);
    border-radius: var(--radius-pill);
    background: var(--color-input-bg);
    color: var(--color-text-muted);
    font-size: var(--fs-base);
    text-align: start;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.c-search-bar:hover {
    border-color: var(--color-accent);
}

.c-search-bar .bi {
    color: var(--color-accent);
    font-size: 1.2rem;
    flex-shrink: 0;
}

.c-search-bar-text {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---- Home active booking card ---- */
.c-bookingcard {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 24px;
    box-shadow: var(--shadow-card);
    padding: var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.c-bookingcard-flag {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
}

.c-bookingcard-title {
    margin: 0;
    font-size: var(--fs-md);
    font-weight: var(--fw-extrabold);
}

.c-bookingcard-main {
    display: flex;
    align-items: stretch;
    justify-content: space-between;
    gap: var(--space-4);
}

.c-bookingcard-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-1);
}

.c-bookingcard-shop {
    margin: 0;
    font-size: var(--fs-lg);
    font-weight: var(--fw-extrabold);
}

.c-bookingcard-sub {
    margin: 0;
    font-size: var(--fs-sm);
    color: var(--color-text-secondary);
}

.c-bookingcard-number {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-width: 108px;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-lg);
    background: var(--color-primary-light);
    text-align: center;
}

.c-bookingcard-number-label {
    font-size: var(--fs-xs);
    font-weight: var(--fw-semibold);
    color: var(--color-text-secondary);
    white-space: nowrap;
}

.c-bookingcard-number-value {
    font-size: var(--fs-2xl);
    font-weight: var(--fw-extrabold);
    color: var(--color-primary-tint-text);
    line-height: 1.1;
}

.c-bookingcard-number-ahead {
    font-size: var(--fs-xs);
    font-weight: var(--fw-semibold);
    color: var(--color-text-secondary);
    white-space: nowrap;
}

.c-bookingcard-chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.c-eta-chip {
    flex: 1;
    min-width: 140px;
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    background: var(--color-success-light);
    color: var(--color-success);
}

.c-eta-chip-icon {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: var(--radius-pill);
    background: var(--color-success-light);
    font-size: 1rem;
}

.c-eta-chip-body {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
    min-width: 0;
}

.c-eta-chip-body span {
    font-size: var(--fs-xs);
}

.c-eta-chip-body b {
    font-size: var(--fs-sm);
    font-weight: var(--fw-bold);
    white-space: nowrap;
}

/* ---- Home favorites (visited shops) ---- */
.c-favhome-row {
    display: flex;
    align-items: stretch;
    gap: var(--space-2);
}

.c-favhome {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: var(--space-3);
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: var(--space-3) var(--space-4);
    text-align: start;
    cursor: pointer;
    transition: box-shadow var(--transition-fast), transform var(--transition-fast);
}

.c-favhome:hover {
    box-shadow: var(--shadow-md);
}

.c-favhome:active {
    transform: scale(0.98);
}

.c-favhome:disabled {
    opacity: 0.7;
    cursor: default;
}

.c-favhome-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.c-favhome-body b {
    font-size: var(--fs-base);
    font-weight: var(--fw-semibold);
    color: var(--color-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.c-favhome-body span {
    font-size: var(--fs-xs);
    color: var(--color-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.c-favhome .c-pill {
    flex-shrink: 0;
}

/* ---- Reserved ad area (hidden until an ad source fills it) ---- */
.c-ad-area {
    min-height: 120px;
    border: 1px dashed var(--color-border-strong);
    border-radius: var(--radius-lg);
    background: var(--color-card);
}

/* ---- Home: favorite places section ---- */
.c-favsection .c-section-title {
    align-items: center;
}

.c-placecard {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
    padding: var(--space-4);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.c-placecard-head {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.c-placecard-mark {
    flex-shrink: 0;
    width: 54px;
    height: 54px;
    border-radius: var(--radius-pill);
    overflow: hidden;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
    color: var(--color-text-inverse);
    font-size: 1.4rem;
    box-shadow: var(--shadow-sm);
}

.c-placecard-mark img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.c-placecard-meta {
    flex: 1;
    min-width: 0;
}

.c-placecard-name {
    margin: 0 0 2px;
    font-size: var(--fs-base);
    font-weight: var(--fw-bold);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.c-placecard-sub {
    margin: 0;
    font-size: var(--fs-xs);
    color: var(--color-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.c-placecard-sub .bi {
    color: var(--color-accent);
}

.c-placecard-chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.c-placecard-chips .c-pill {
    padding: var(--space-1) var(--space-3);
    font-size: var(--fs-xs);
}

.c-placecard-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding-top: var(--space-3);
    border-top: 1px solid var(--color-border);
}

.c-placecard-queue {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    min-width: 0;
    font-size: var(--fs-xs);
    font-weight: var(--fw-semibold);
    color: var(--color-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.c-placecard-queue .bi {
    color: var(--color-accent);
    flex-shrink: 0;
}

.c-heart-btn-sm {
    width: 44px;
    height: 44px;
    font-size: 1.05rem;
}

/* ---- Home: quick booking banner (removed — ad area placeholder now) ---- */

/* ---- Schedule view (medical clinic) ---- */
.c-sched-nav {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.c-sched-back {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border: none;
    border-radius: var(--radius-pill);
    background: var(--color-primary-light);
    color: var(--color-primary);
    font-size: 1.25rem;
    cursor: pointer;
    transition: transform var(--transition-fast), background var(--transition-fast);
}

.c-sched-back:hover {
    background: var(--color-accent-light);
}

.c-sched-back:active {
    transform: scale(0.94);
}

.c-sched-card {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
    padding: var(--space-4) var(--space-4) var(--space-2);
}

.c-sched-title {
    margin: 0 0 var(--space-3);
    font-size: var(--fs-md);
    font-weight: var(--fw-extrabold);
}

.c-sched-head {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding-bottom: var(--space-3);
}

.c-sched-mark {
    flex-shrink: 0;
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border-radius: var(--radius-pill);
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
    color: var(--color-text-inverse);
    font-size: 1.4rem;
    box-shadow: var(--shadow-sm);
}

.c-sched-head-meta {
    flex: 1;
    min-width: 0;
}

.c-sched-clinic {
    margin: 0 0 2px;
    font-size: var(--fs-base);
    font-weight: var(--fw-bold);
}

.c-sched-sub {
    margin: 0;
    font-size: var(--fs-xs);
    color: var(--color-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.c-sched-sub .bi {
    color: var(--color-accent);
}

.c-sched-empty {
    margin: 0 0 var(--space-3);
    font-size: var(--fs-sm);
    color: var(--color-text-secondary);
}

.c-sched-days {
    display: flex;
    flex-direction: column;
}

.c-sched-day {
    display: flex;
    flex-direction: column;
    gap: var(--space-1);
    padding: var(--space-3) 0;
    border-top: 1px solid var(--color-border);
}

.c-sched-days .c-sched-day:first-child {
    border-top: none;
}

.c-sched-day.is-today {
    background: var(--color-primary-light);
    margin-inline: calc(-1 * var(--space-2));
    padding-inline: var(--space-2);
    border-radius: var(--radius-sm);
}

.c-sched-day-name {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--fs-sm);
    font-weight: var(--fw-bold);
    color: var(--color-text);
}

.c-sched-today {
    padding: 2px var(--space-2);
    font-size: var(--fs-xs);
}

.c-sched-session {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    padding-inline-start: var(--space-4);
    font-size: var(--fs-sm);
}

.c-sched-session b {
    color: var(--color-text);
    white-space: nowrap;
}

.c-sched-session-label {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    color: var(--color-text-secondary);
}

.c-sched-session-morning .bi {
    color: var(--color-warning);
}

.c-sched-session-evening .bi {
    color: var(--color-accent);
}

.c-sched-closed {
    color: var(--color-text-muted);
    font-size: var(--fs-sm);
}

.c-sched-reason {
    font-size: var(--fs-xs);
    color: var(--color-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---- Bottom nav: raised center scan FAB (circular chip around the
   icon; the label stays below it like the other tabs) ---- */
.c-tab-scan {
    background: transparent;
}

.c-tab-scan .bi {
    width: 54px;
    height: 54px;
    margin-top: -30px;
    display: grid;
    place-items: center;
    border-radius: var(--radius-pill);
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-accent) 100%);
    border: 4px solid var(--color-card);
    box-shadow: var(--shadow-primary);
    color: var(--color-text-inverse);
    font-size: 1.4rem;
    box-sizing: border-box;
}

/* ---- Heart (favorite toggle) ---- */
.c-heart-btn {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border: none;
    border-radius: var(--radius-pill);
    background: var(--color-primary-light);
    color: var(--color-text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    transition: color var(--transition-fast), transform var(--transition-fast);
}

.c-heart-btn:active {
    transform: scale(0.9);
}

.c-heart-btn.is-fav {
    color: var(--color-danger-text);
    background: var(--color-danger-light);
}

/* ---- Favorites screen ---- */
.c-favcard {
    position: relative;
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 24px;
    box-shadow: var(--shadow-card);
    padding: var(--space-5);
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.c-favcard-foot {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.c-shopcard-body {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.c-text-danger {
    color: var(--color-danger-text);
}

/* ---- In-app QR scanner overlay ---- */
.c-scanner {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    /* Explicit offsets (not the `inset` shorthand): some older mobile
       WebViews/browsers don't support `inset`, and without offsets a fixed
       element drops to its static position — a small card at the bottom of
       the page with the app still visible behind it. */
    z-index: var(--z-overlay);
    background: #0B0B0B; /* functional: camera surface stays dark for contrast */
    color: var(--color-text-inverse);
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
    padding: calc(var(--safe-top) + var(--space-4)) var(--space-4) calc(var(--safe-bottom) + var(--space-4));
}

/* Scanner mode: while the overlay is open the whole page behind it is
   hidden and inert — no visible content, no scroll, no clickable buttons. */
body.scanner-active {
    overflow: hidden;
    height: 100%;
}

body.scanner-active .pwa-appbar,
body.scanner-active .pwa-main,
body.scanner-active .c-appbar,
body.scanner-active .customer-main {
    visibility: hidden;
}

.c-scanner-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
}

.c-scanner-title {
    font-size: var(--fs-lg);
    font-weight: var(--fw-extrabold);
    margin: 0;
}

.c-scanner-view {
    position: relative;
    flex: 1;
    min-height: 0;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 24px;
    background: #000;
}

.c-scanner-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.c-scanner-frame {
    position: relative;
    width: min(64vw, 260px);
    aspect-ratio: 1;
    border-radius: 28px;
}

.c-scanner-status {
    min-height: 1.5em;
    margin: 0;
    text-align: center;
    font-size: var(--fs-sm);
    color: rgba(255, 255, 255, 0.82);
    line-height: var(--line-height);
}

.c-scanner-status.is-error {
    color: var(--color-warning);
    font-weight: var(--fw-semibold);
}

.c-scanner-fallback {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    background: var(--color-overlay-faint);
    border: 1px solid var(--color-overlay);
    border-radius: var(--radius-lg);
    padding: var(--space-4);
}

.c-scanner-fallback .form-input {
    background: var(--color-input-bg);
}

.c-scanner-hint {
    margin: 0;
    font-size: var(--fs-sm);
    color: rgba(255, 255, 255, 0.82);
    line-height: var(--line-height);
}

/* Close button sits in the header row ABOVE the camera and must stay
   clearly visible on the dark scanner surface (the base .sheet-close is
   styled for light sheets). */
.c-scanner .sheet-close {
    background: var(--color-overlay-soft);
    color: #ffffff;
}

/* ---- Queue screen: in-page tab navigation ---- */
.c-tabs-nav {
    display: flex;
    gap: var(--space-2);
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: var(--space-1);
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.c-tabs-nav::-webkit-scrollbar {
    display: none;
}

.c-tab-btn {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-3);
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--color-text-secondary);
    font-family: inherit;
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    line-height: 1.3;
    text-align: center;
    white-space: nowrap;
    border: none;
    cursor: pointer;
    transition: color var(--transition-fast), background var(--transition-fast), box-shadow var(--transition-fast);
}

.c-tab-btn .bi {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.c-tab-btn:hover {
    background: var(--color-primary-light);
    color: var(--color-primary);
}

.c-tab-btn.is-active {
    background: var(--color-primary);
    color: var(--color-text-inverse);
    box-shadow: var(--shadow-primary);
}

.c-tab-btn.is-active:hover {
    background: var(--color-primary-hover);
}

.c-tabs-panel {
    display: none;
    flex-direction: column;
    gap: var(--space-5);
}

.c-tabs-panel.is-active {
    display: flex;
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================================
   § Multi-booking hint (home)
   ============================================================ */
.c-bookingmulti-hint {
    background: var(--color-surface-alt);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg, 12px);
    padding: var(--space-md, 12px) var(--space-lg, 16px);
    text-align: center;
}
.c-bookingmulti-hint p {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    margin-bottom: var(--space-sm, 8px);
}

/* ============================================================
   § Booking row (bookings list)
   ============================================================ */
.c-bookingrow {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg, 12px);
    padding: var(--space-md, 12px) var(--space-lg, 16px);
    cursor: pointer;
    transition: box-shadow 0.15s ease;
}
.c-bookingrow:hover,
.c-bookingrow:focus-visible {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    outline: none;
}
.c-bookingrow-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-sm, 8px);
    margin-bottom: var(--space-sm, 8px);
}
.c-bookingrow-info {
    flex: 1;
    min-width: 0;
}
.c-bookingrow-shop {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    margin: 0;
}
.c-bookingrow-number {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
}
.c-bookingrow-ahead {
    text-align: center;
    min-width: 3rem;
}
.c-bookingrow-ahead b {
    display: block;
    font-size: 1.2rem;
}
.c-bookingrow-ahead span {
    font-size: 0.75rem;
    color: var(--color-text-secondary);
}
.c-bookingrow-chips {
    display: flex;
    gap: var(--space-sm, 8px);
    margin-bottom: var(--space-sm, 8px);
    flex-wrap: wrap;
}
.c-bookingrow-actions {
    display: flex;
    gap: var(--space-sm, 8px);
}

/* ---- In-app login (PWA) ---- */
.c-login-card {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg, 12px);
    padding: var(--space-5, 20px);
    display: flex;
    flex-direction: column;
    gap: var(--space-3, 12px);
}
.c-login-title {
    margin: 0;
    text-align: center;
    font-size: var(--fs-lg, 1.2rem);
    font-weight: var(--fw-bold, 700);
}
.c-login-error {
    margin: 0;
    padding: var(--space-2, 8px) var(--space-3, 12px);
    border-radius: var(--radius-sm, 6px);
    background: var(--color-danger-light);
    color: var(--color-danger-text);
    font-size: var(--fs-sm, 0.85rem);
    text-align: center;
}
.c-login-field {
    display: flex;
    flex-direction: column;
    gap: var(--space-1, 4px);
}
.c-login-label {
    font-size: var(--fs-sm, 0.85rem);
    font-weight: var(--fw-medium, 500);
    color: var(--color-text-secondary);
}
.c-login-input {
    width: 100%;
    padding: var(--space-3, 12px);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm, 6px);
    font-size: var(--fs-base, 1rem);
    background: var(--color-card);
    color: var(--color-text);
    box-sizing: border-box;
}
.c-login-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px var(--color-primary-light);
}

/* ============================================================
   § Business Dashboard (c-biz)
   ============================================================ */
.c-biz { padding: var(--space-md, 16px); }

.c-biz-head { margin-bottom: var(--space-md, 16px); }

.c-biz-profile {
    display: flex;
    align-items: center;
    gap: var(--space-sm, 8px);
    margin-bottom: var(--space-sm, 8px);
}
.c-biz-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--color-primary);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    flex-shrink: 0;
}
.c-biz-name {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0;
}
.c-biz-type {
    font-size: 0.8rem;
    color: var(--color-text-secondary);
    margin: 2px 0 0;
}

.c-biz-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm, 8px);
    margin-bottom: var(--space-md, 16px);
}
.c-stat-card {
    background: var(--color-card);
    border-radius: var(--radius-md, 10px);
    padding: var(--space-sm, 8px) var(--space-md, 16px);
    text-align: center;
}
.c-stat-card--accent {
    background: var(--color-primary-light);
}
.c-stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
}
.c-stat-label {
    display: block;
    font-size: 0.75rem;
    color: var(--color-text-secondary);
}

.c-biz-section-title {
    font-size: 0.95rem;
    font-weight: 700;
    margin: var(--space-md, 16px) 0 var(--space-sm, 8px);
}

.c-biz-queue-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm, 8px);
}

.c-qrow {
    background: var(--color-card);
    border-radius: var(--radius-md, 10px);
    padding: var(--space-sm, 8px) var(--space-md, 16px);
    display: flex;
    align-items: center;
    gap: var(--space-sm, 8px);
}
.c-qrow--serving {
    border-inline-start: 3px solid var(--color-success);
}
.c-qrow-num {
    font-weight: 700;
    font-size: 1.1rem;
    min-width: 36px;
    text-align: center;
    color: var(--color-primary-tint-text);
}
.c-qrow-name {
    flex: 1;
    font-size: 0.95rem;
}
.c-qrow-status {
    font-size: 0.75rem;
    color: var(--color-text-secondary);
}
.c-qrow-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.btn-sm {
    font-size: 0.72rem;
    padding: 4px 8px;
    border-radius: var(--radius-sm, 6px);
    border: 1px solid transparent;
    cursor: pointer;
    white-space: nowrap;
}
.btn-success {
    background: var(--color-success-solid);
    color: #ffffff;
}
.btn-warning {
    background: var(--color-warning);
    color: #000;
}
.btn-danger-outline {
    background: transparent;
    border-color: var(--color-danger-text);
    color: var(--color-danger-text);
}
.btn-ghost {
    background: transparent;
    color: var(--color-text-secondary);
}

/* Subscription badge */
.c-biz-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    margin-top: 2px;
}
.c-biz-badge--trial {
    background: var(--color-warning-light);
    color: var(--color-warning-text);
}
.c-biz-badge--active {
    background: var(--color-success-light);
    color: var(--color-success-text);
}
.c-biz-badge--expired {
    background: var(--color-danger-light);
    color: var(--color-danger-text);
}

/* Queue action bar */
.c-biz-controls {
    margin-bottom: var(--space-md, 16px);
}
.c-biz-actions {
    display: flex;
    gap: var(--space-sm, 8px);
}
.c-biz-actions .btn {
    flex: 1;
}

/* Bold, always-visible sign-out footer for the operator dashboards */
.c-biz-logout {
    padding-top: var(--space-md, 16px);
    margin-top: var(--space-md, 16px);
    border-top: 1px solid var(--color-border);
}
.c-biz-logout .btn {
    color: var(--color-danger-text);
    background: var(--color-danger-light);
    box-shadow: none;
}

/* Collapsible sections */
.c-collapsible {
    margin-bottom: var(--space-md, 16px);
}
.c-collapsible-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: var(--space-sm, 8px);
   /* background: var(--color-card);*/
    border: none;
    border-radius: var(--radius-md, 10px);
    padding: var(--space-sm, 8px) var(--space-md, 16px);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-align: start;
}
.c-collapsible-toggle span {
    flex: 1;
}
.c-collapsible-body {
    padding: var(--space-sm, 8px) 0;
}

/* Doctors dropdown toggle inside the schedule card: the card already
   provides the outer padding, so the toggle drops its own padding and
   matches the c-sched-title look. */
.c-sched-card .c-sched-doctors-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    background: none;
    border: none;
    padding: 0 0 var(--space-3);
    font-size: var(--fs-md);
    font-weight: var(--fw-extrabold);
    color: var(--color-text);
    cursor: pointer;
    text-align: start;
}
.c-sched-card .c-sched-doctors-toggle span {
    flex: 1;
}
.c-sched-card .c-collapsible-body {
    padding: 0 0 var(--space-2);
}

/* In-person form */
.c-biz-inperson-form {
    padding: 0 var(--space-sm, 8px);
}
.c-biz-inperson-fields {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm, 8px);
    margin-bottom: var(--space-sm, 8px);
}

/* QR panel */
.c-biz-qr-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm, 8px);
    padding: var(--space-sm, 8px);
}
.c-biz-qr-img {
    max-width: 200px;
    border-radius: var(--radius-md, 10px);
    border: 1px solid var(--color-border);
}

.c-biz-error {
    text-align: center;
    color: var(--color-danger-text);
    padding: var(--space-md, 16px);
}

.c-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm, 8px);
    padding: var(--space-xl, 32px) 0;
    color: var(--color-text-secondary);
}
.c-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================================
   Global Turn Alert (ahead 3 → 2 → 1 → 0 + called)
   Fixed, top-layer surface mounted OUTSIDE #app-root so the banners
   are visible from every screen without any navigation. Every banner
   is role="alert" (assertive) and auto-dismisses after 30s; manual
   dismiss never cancels the stage cycle (state decides the stages).
   ============================================================ */

.c-turnalert-root {
    --turnalert-orange: #175bee;
    --turnalert-orange-light: rgba(240, 145, 58, 0.16);
    position: fixed;
    top: calc(var(--appbar-min-h, 64px) + var(--space-2));
    inset-inline: var(--space-3);
    z-index: calc(var(--z-drawer) + 10);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    pointer-events: none;      /* the surface never blocks the page */
}

/* Stage colors — one tint per stage, critical = red. */
.c-turnalert {
    --turnalert-color: var(--color-accent);
    --turnalert-bg: var(--color-accent-light);
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    border-radius: var(--radius-lg);
    background: var(--turnalert-bg);
    color: var(--turnalert-color);
    box-shadow: var(--shadow-md);
    border: 1px solid transparent;
    transition: transform var(--transition-fast), opacity var(--transition-fast);
    opacity: 0;
    transform: translateY(-10px);
}

.c-turnalert.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.c-turnalert.is-hiding {
    opacity: 0;
    transform: translateY(-10px);
}

/* 3 — entered the queue (informative, calm) */
.c-turnalert--s3 {
    --turnalert-color: var(--color-danger-text);
    --turnalert-bg: var(--color-success-light);
}

/* 2 — almost your turn (warning) */
.c-turnalert--s2 {
    --turnalert-color: var(--color-danger-text);
    --turnalert-bg: var(--color-warning-light);
}

/* 1 — one person left (strong orange) */
.c-turnalert--s1 {
    --turnalert-color: var(--turnalert-orange);
    --turnalert-bg: var(--color-warning-light);
}

/* 0 / called — your turn now (critical) */
.c-turnalert--s0 {
    --turnalert-color: var(--color-danger-text);
    --turnalert-bg: var(--color-danger-light);
    border-color: rgba(229, 72, 77, 0.40);
}

.c-turnalert-dot {
    flex-shrink: 0;
    width: 12px;
    height: 12px;
    border-radius: var(--radius-pill);
    background: currentColor;
}

.c-turnalert--s0 .c-turnalert-dot {
    animation: turnAlertDotPulse 1.6s ease-in-out infinite;
}

.c-turnalert-body {
    flex: 1;
    min-width: 0;
}

.c-turnalert-title {
    display: block;
    font-size: var(--fs-sm);
    font-weight: var(--fw-bold);
    line-height: 1.35;
}

.c-turnalert-text {
    margin: var(--space-1) 0 0;
    font-size: var(--fs-xs);
    line-height: 1.5;
    opacity: 0.92;
}

.c-turnalert-meta {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    margin: var(--space-1) 0 0;
    font-size: var(--fs-xs);
    font-weight: var(--fw-semibold);
    opacity: 0.9;
}

.c-turnalert-dismiss {
    flex-shrink: 0;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: var(--radius-pill);
    background: transparent;
    color: currentColor;
    opacity: 0.7;
    cursor: pointer;
    font-size: 1rem;
}

.c-turnalert-dismiss:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.10);
}

@keyframes turnAlertDotPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(229, 72, 77, 0.45); }
    50% { box-shadow: 0 0 0 6px rgba(229, 72, 77, 0); }
}

@media (prefers-reduced-motion: reduce) {
    .c-turnalert,
    .c-turnalert--s0 .c-turnalert-dot {
        animation: none;
        transition: none;
    }
}

/* ============================================================
   Entry Screen
   ============================================================ */
.c-entry {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: var(--space-xl, 32px);
    text-align: center;
    gap: var(--space-lg, 24px);
}
.c-entry-icon {
    font-size: 3rem;
    color: var(--color-primary-tint-text);
    opacity: 0.9;
}
.c-entry-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
    margin: 0;
}
.c-entry-sub {
    font-size: 0.95rem;
    color: var(--color-text-secondary);
    margin: 0;
}
.c-entry .btn {
    min-width: 260px;
}

/* Very narrow screens: keep «عودة» tappable without crowding the logo. */
@media (max-width: 374px) {
    .pwa-back-btn {
        min-height: 38px;
        padding-inline: var(--space-2);
        font-size: var(--fs-xs);
    }
    .pwa-back-btn i {
        font-size: 0.9rem;
    }
}

/* ============================================================
   Offline screen — full-screen overlay shown only on real
   connectivity loss. Built purely from existing tokens/fonts/icons
   (no images, no external deps), so it renders fine offline.
   ============================================================ */
.c-offline {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: calc(var(--z-overlay) + 10);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-5);
    background: var(--color-bg);
}

.c-offline[hidden] {
    display: none;
}

.c-offline-card {
    width: 100%;
    max-width: 380px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-4);
    padding: var(--space-6) var(--space-5);
    border-radius: 24px;
    border: 1px solid var(--color-border);
    background: var(--color-card);
    box-shadow: var(--shadow-card);
    text-align: center;
}

.c-offline-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-2);
}

.c-offline-logo .pwa-brand-mark {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    font-size: 1.2rem;
    background: var(--color-primary);
}

.c-offline-logo .pwa-brand-name {
    font-size: var(--fs-xl);
    font-weight: var(--fw-extrabold);
    color: var(--color-primary-tint-text);
}

.c-offline-icon {
    position: relative;
    width: 84px;
    height: 84px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--color-danger-light);
    color: var(--color-danger-text);
    margin-bottom: var(--space-2);
}

.c-offline-icon i {
    font-size: 2.4rem;
}

.c-offline-slash {
    position: absolute;
    width: 58%;
    height: 3px;
    border-radius: 3px;
    background: var(--color-danger);
    transform: rotate(-45deg);
}

.c-offline-title {
    margin: 0;
    font-size: var(--fs-xl);
    font-weight: var(--fw-bold);
    color: var(--color-text);
}

.c-offline-text {
    margin: 0;
    font-size: var(--fs-base);
    line-height: 1.8;
    color: var(--color-text-secondary);
}

.c-offline-card .btn {
    margin-top: var(--space-2);
}

/* ---- Discover (Phase 4 customer view) — mirrored from the unified
   PWA stylesheet so the client shell renders the identical feature. ---- */
.c-discover-entry {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    width: 100%;
    padding: var(--space-3) var(--space-4);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    background: var(--color-card);
    box-shadow: var(--shadow-sm);
    color: var(--color-text);
    text-align: start;
    cursor: pointer;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.c-discover-entry:hover {
    box-shadow: var(--shadow-md);
}

.c-discover-entry:active {
    transform: scale(0.99);
}

.c-discover-entry-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: var(--radius-pill);
    background: var(--color-primary-light);
    color: var(--color-accent);
    font-size: 1.3rem;
}

.c-discover-entry-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.c-discover-entry-body b {
    font-size: var(--fs-md);
    font-weight: var(--fw-bold);
    color: var(--color-text);
}

.c-discover-entry-body span {
    font-size: var(--fs-sm);
    color: var(--color-text-secondary);
}

.c-discover-entry > i:last-child {
    color: var(--color-text-secondary);
    font-size: 0.95rem;
}

/* ---- Discover screen nav ---- */
.c-discover-nav {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
}

.c-discover-back {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border: none;
    border-radius: var(--radius-pill);
    background: var(--color-primary-light);
    color: var(--color-primary);
    font-size: 1.25rem;
    cursor: pointer;
    transition: background var(--transition-fast), transform var(--transition-fast);
}

.c-discover-back:hover {
    background: var(--color-accent-light);
}

.c-discover-back:active {
    transform: scale(0.94);
}

/* ---- Discover cards ---- */
.c-discover-card {
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.c-discover-media {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

/* Still images render uncropped: an <img> keeps its own aspect with
   object-fit: contain and a natural height, so heads/edges near the
   frame are never cut. The 16/9 crop above stays for embeds, and the
   video.c-discover-media rules below are untouched. A 70vh ceiling
   keeps very tall photos from swallowing the screen; the subtle
   surface shows only in the letterbox area. */
img.c-discover-media {
    aspect-ratio: auto;
    object-fit: contain;
    height: auto;
    max-height: 70vh;
    margin-inline: auto;
    background: var(--color-bg-subtle);
}

/* Short-video rows render a <video class="c-discover-media"> (only
   short_video produces a video element, so the override can never
   touch image cards). The video becomes a vertical Reels/Shorts
   frame; object-fit: cover crops non-vertical sources instead of
   distorting them. */
video.c-discover-media {
    width: 100%;
    height: auto;
    aspect-ratio: 9 / 16;
    object-fit: cover;
    max-width: 440px;
    margin-inline: auto;
}

/* ---- Short-video Reels-style scrollbar hiding (visual only) ----
   The 9:16 videos are tall, so while a short_video is on the Discover
   screen the page — which is the container that actually scrolls the
   videos — shows its browser scrollbar right beside the frame. We hide
   that scrollbar's VISUAL ONLY when a short-video surface is present;
   scroll/gesture are untouched, and every other route keeps its
   scrollbar (they never contain a video.c-discover-media element). */

/* 1. The video surface itself must never render its own scrollbar
   (mirrors the .pwa-switcher-strip theme, all three browser families). */
video.c-discover-media {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

video.c-discover-media::-webkit-scrollbar {
    display: none;
}

/* 2. Reels look: the page scrollbar disappears only while a short
   video (feed or detail) is on the Discover screen — html:has() is the
   pure-CSS scoping (Chrome 105+, Firefox 121+, Safari 15.4+; engines
   without :has simply keep the scrollbar — no breakage). */
@supports selector(:has(*)) {
    html:has(video.c-discover-media) {
        scrollbar-width: none;
        -ms-overflow-style: none;
    }

    html:has(video.c-discover-media)::-webkit-scrollbar {
        display: none;
    }
}

.c-discover-body {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
}

.c-discover-meta {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-wrap: wrap;
}

.c-discover-type {
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    color: var(--color-text-secondary);
}

.c-discover-sponsor {
    font-size: var(--fs-xs);
    padding: var(--space-1) var(--space-3);
}

.c-discover-sponsor .bi {
    font-size: 0.8rem;
}

/* Business promotion pill: same treatment as the sponsored
   pill, distinct class so the two meanings never share styling. */
.c-discover-promoted {
    font-size: var(--fs-xs);
    padding: var(--space-1) var(--space-3);
}

.c-discover-promoted .bi {
    font-size: 0.8rem;
}

.c-discover-title {
    margin: 0;
    font-size: var(--fs-lg);
    font-weight: var(--fw-extrabold);
    color: var(--color-text);
    line-height: 1.4;
}

.c-discover-text {
    margin: 0;
    font-size: var(--fs-base);
    color: var(--color-text-secondary);
    line-height: 1.75;
}

/* Feed cards clamp the text to a fixed box (3 lines); the dynamic
   "More" chip appears only when it actually overflows this height.
   The detail view shares bodyContent WITHOUT the clamp, so the full
   text always renders on the detail page. */
.c-discover-text-clamp {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
}

.c-discover-actions {
    margin-top: var(--space-1);
}

/* ---- Business identity strip + channel header (Phase 14B) ----
   One tappable row per owned card (feed + detail share the markup,
   so it never duplicates). The button is unstyled chrome: avatar +
   ellipsis name, RTL follows flex direction. Reuses the
   .c-shopcard-avatar mark from businessAvatar(); sizes stay compact
   for 320px screens. */
.c-discover-identity {
    padding: var(--space-3) var(--space-4) 0;
}

.c-discover-identity-btn {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    max-width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    cursor: pointer;
    text-align: start;
}

.c-discover-identity-btn .c-shopcard-avatar,
.c-discover-identity-btn .c-shopcard-mark {
    flex: none;
}

.c-discover-identity-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    color: var(--color-text-secondary);
}

.c-discover-channel-id {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    min-width: 0;
}

.c-discover-channel-id .c-screen-title {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---- Like row (Phase 14C) ----
   Persistent footer row OUTSIDE .c-discover-open (which the overflow
   logic may hide): the count is always visible, the toggle only for
   owned rows. Compact like the "More" chip; pressed state tints the
   heart without moving layout (no width change between states). */
.c-discover-like-row {
    padding: 0 var(--space-4) var(--space-3);
}

.c-discover-like {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-1);
    min-height: 40px;
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border-strong);
    background: transparent;
    color: var(--color-primary-tint-text);
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    cursor: pointer;
    text-align: center;
}

.c-discover-like:active {
    transform: scale(0.98);
}

.c-discover-like .bi {
    font-size: 0.95rem;
}

.c-discover-like[aria-pressed="true"] {
    border-color: var(--color-danger);
    color: var(--color-danger-text);
}

.c-discover-like:disabled {
    opacity: 0.6;
    cursor: wait;
}

.c-discover-like-count {
    font-variant-numeric: tabular-nums;
}

/* ---- Unified card footer (share + like, all content types) ----
   Independent row OUTSIDE .c-discover-open and outside the clamped
   text: share chip + like toggle side by side, RTL follows flex
   direction automatically. Wraps on 320px screens instead of
   clipping; never overlaps media, text or the bottom nav (in-flow
   block, same card padding as the old footers). */
.c-discover-foot {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    flex-wrap: wrap;
    padding: 0 var(--space-4) var(--space-3);
}

.c-discover-share {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-1);
    min-height: 40px;
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border-strong);
    background: transparent;
    color: var(--color-primary-tint-text);
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    cursor: pointer;
    text-align: center;
}

.c-discover-share:active {
    transform: scale(0.98);
}

.c-discover-share .bi {
    font-size: 0.95rem;
}

/* ---- Share sheet list (Phase 14C) ----
   Vertical stack inside the standard bottom sheet; every option is a
   full-width button reusing .btn-secondary, so 320px, RTL and touch
   targets behave exactly like the booking sheet rows. */
.c-discover-share-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.c-discover-open {
    padding: 0 var(--space-4) var(--space-3);
}

/* Discover detail affordance: one compact "More" chip for every
   content type (tip / did_you_know / info / offer / sponsored /
   short_video), replacing the old full-width outline button. It hugs
   its label — auto width, never stretching across the card — and
   mirrors the discover outline treatment (transparent fill, primary
   text). Generated by discover.js for every card. */
.c-discover-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-1);
    min-height: 40px;
    padding: var(--space-1) var(--space-4);
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border-strong);
    background: transparent;
    color: var(--color-primary-tint-text);
    font-size: var(--fs-sm);
    font-weight: var(--fw-semibold);
    cursor: pointer;
    text-align: center;
    transition: transform var(--transition-fast), opacity var(--transition-fast);
}

.c-discover-more:active {
    transform: scale(0.98);
}

.c-discover-more .bi {
    font-size: 0.8rem;
}

/* ============================================================
   BASE TEXT COLOUR
   ------------------------------------------------------------
   variables.css set no body colour, so every element that did
   not declare its own inherited BLACK onto a near-black surface.
   This is the safety net for that whole class of bug.
   ============================================================ */
html,
body {
    color: var(--color-text);
}

::selection {
    background: var(--color-primary);
    color: var(--color-text-inverse);
}

/* ============================================================
   BUTTON SYSTEM - one source of truth for every variant/state.

   Two bugs this fixes, both found by measuring computed colours
   in a real browser rather than by reading the source:

   1. Only .btn-primary had a hover background. The other six
      variants fell back to .btn:active's scale() alone, so they
      gave the user no pressable feedback at all.
   2. Hover must never move the FOREGROUND away from the surface.
      Hover only shifts the background; text stays cream.

   Disabled is a neutral surface rather than a faded oxblood:
   an oxblood button at 0.6 opacity still reads as the primary
   action, which is exactly the "looks active" defect.
   ============================================================ */
.btn-secondary:hover:not(:disabled) {
    background: var(--color-surface-alt);
    border-color: var(--color-border-strong);
}
.btn-secondary:active:not(:disabled) {
    background: var(--color-bg-subtle);
}

.btn-outline:hover:not(:disabled) {
    background: var(--color-primary-light);
    border-color: var(--color-accent);
}
.btn-outline:active:not(:disabled) {
    background: var(--color-primary-soft);
}

.btn-ghost:hover:not(:disabled) {
    background: var(--color-overlay-soft);
    color: var(--color-text);
}
.btn-ghost:active:not(:disabled) {
    background: var(--color-overlay);
}

.btn-danger:hover:not(:disabled) {
    background: #B32B31;
}
.btn-danger:active:not(:disabled) {
    background: #8E1B21;
}
.btn-danger-outline:hover:not(:disabled) {
    background: var(--color-danger-light);
}
.btn-success:hover:not(:disabled) {
    background: #1D8553;
}
.btn-success:active:not(:disabled) {
    background: #12593A;
}
.btn-warning:hover:not(:disabled) {
    background: #F0B75C;
}
.btn-warning:active:not(:disabled) {
    background: #D18F2C;
}

/* --- disabled: inert surface, readable text, no elevation --- */
.btn:disabled,
.btn[disabled] {
    opacity: 1;
    background: var(--color-muted);
    color: var(--color-text-muted);
    border-color: var(--color-border);
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}
.btn:disabled .bi,
.btn[disabled] .bi {
    color: inherit;
}

/* ============================================================
   LONG-TEXT GUARDS
   ------------------------------------------------------------
   Every selector below already sets `white-space: nowrap` AND
   sits inside a flex/grid row, AND can receive a string the
   business actually typed (a doctor specialty, a place name, a
   status sentence).

   nowrap removes the only thing that would have broken the line,
   and without `min-width: 0` a flex item refuses to shrink below
   its content, so a single long word pushed the row past the
   right edge of a 320px phone. `min-width: 0` lets it shrink,
   ellipsis degrades instead of clipping mid-glyph.
   ============================================================ */
.pwa-brand-tagline {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}
.c-bookingcard-number-label {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}
.c-doctor-sheet-list dt {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}