/* Mobile app shell — bottom tab bar, safe areas, touch-friendly UI */

:root {
    --safe-area-top: env(safe-area-inset-top, 0px);
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
    --safe-area-left: env(safe-area-inset-left, 0px);
    --safe-area-right: env(safe-area-inset-right, 0px);
    --mobile-tab-bar-height: calc(58px + var(--safe-area-bottom));
    --mobile-topbar-content-height: 52px;
    --mobile-header-height: calc(var(--mobile-topbar-content-height) + var(--safe-area-top));
}

html {
    -webkit-tap-highlight-color: transparent;
}

@media (max-width: 767px) {
    html {
        overscroll-behavior: none;
    }

    body {
        overscroll-behavior-y: none;
        overscroll-behavior-x: none;
    }

    body.has-mobile-tab-bar {
        padding-bottom: var(--mobile-tab-bar-height);
    }

    .main-content {
        min-height: calc(100dvh - var(--mobile-header-height) - var(--mobile-tab-bar-height));
    }

    /* Compact app-style header — safe area for notch / status bar (PWA + mobile Safari) */
    .topbar {
        padding-top: var(--safe-area-top);
        padding-left: var(--safe-area-left);
        padding-right: var(--safe-area-right);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        z-index: 200;
    }

    .topbar-inner {
        min-height: var(--mobile-topbar-content-height);
        padding: 8px var(--space-page);
        flex-wrap: nowrap;
        position: relative;
        z-index: 202;
        gap: 8px;
    }

    .topbar-logout {
        flex-shrink: 0;
        margin-left: auto;
        padding: 6px 10px;
        border: 1px solid var(--border);
        border-radius: 8px;
        background: var(--bg3);
        color: var(--text);
        font-family: inherit;
        font-size: 0.72rem;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        cursor: pointer;
        touch-action: manipulation;
        white-space: nowrap;
    }

    .topbar-logout:hover {
        border-color: var(--gold);
        color: var(--gold);
    }

    .logo-wrap {
        position: relative;
        z-index: 1;
        flex-shrink: 1;
        min-width: 0;
        max-width: calc(100% - 56px);
    }

    .logo {
        height: 32px;
        width: auto;
        max-width: 100%;
        object-fit: contain;
        object-position: left center;
    }

    .site-name {
        font-size: 0.95rem;
        max-width: 42vw;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .burger {
        display: flex;
        position: relative;
        z-index: 203;
        width: 44px;
        height: 44px;
        flex-shrink: 0;
        margin-left: 0;
        align-items: center;
        justify-content: center;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }

    .nav-backdrop {
        position: fixed;
        inset: 0;
        z-index: 300;
        margin: 0;
        padding: 0;
        border: none;
        background: rgba(0, 0, 0, 0.45);
        cursor: pointer;
        touch-action: manipulation;
    }

    /* Portal hosts fixed backdrop + sheet; keep wrapper out of flow */
    .mobile-nav-portal {
        position: fixed;
        inset: 0;
        z-index: 300;
        pointer-events: none;
    }

    .mobile-nav-portal .nav-backdrop,
    .mobile-nav-portal .nav--mobile.open {
        pointer-events: auto;
    }

    /* Sheet styles: portal path (React) + body-level .nav--mobile fallback */
    .mobile-nav-portal .nav--mobile,
    body > .nav.nav--mobile,
    .nav.nav--mobile {
        display: none;
        pointer-events: none;
        visibility: hidden;
        position: fixed;
        z-index: 310;
        left: var(--space-page);
        right: var(--space-page);
        top: auto;
        bottom: calc(var(--mobile-tab-bar-height) + 8px);
        max-height: min(72vh, 520px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 18px 18px 14px 14px;
        border: 1px solid var(--border);
        box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
        margin: 0;
        background: var(--bg2);
    }

    .mobile-nav-portal .nav--mobile.open,
    body > .nav.nav--mobile.open,
    .nav.nav--mobile.open {
        display: flex;
        pointer-events: auto;
        visibility: visible;
        gap: 6px;
        padding: 12px;
        flex-direction: column;
    }

    .mobile-nav-portal .nav--mobile.open .nav-link--logout,
    .nav.nav--mobile.open .nav-link--logout {
        margin-top: auto;
        padding-top: 14px;
        border-top: 1px solid var(--border);
        color: #ef4444;
        font-weight: 600;
    }

    .mobile-nav-portal .nav--mobile.open .nav-link,
    .mobile-nav-portal .nav--mobile.open .lang-btn,
    .mobile-nav-portal .nav--mobile.open .theme-btn,
    .mobile-nav-portal .nav--mobile.open button.nav-link,
    .nav.nav--mobile.open .nav-link,
    .nav.nav--mobile.open .lang-btn,
    .nav.nav--mobile.open .theme-btn,
    .nav.nav--mobile.open button.nav-link {
        min-height: 48px;
        border-radius: 12px;
        background: var(--bg3);
        width: 100%;
        text-align: center;
    }

    .mobile-nav-portal .nav--mobile.open .nav-link--panel,
    .nav.nav--mobile.open .nav-link--panel {
        background: rgba(201, 162, 39, 0.15);
        color: var(--gold);
    }

    body.nav-open {
        overflow: hidden;
    }

    /* Bottom tab bar */
    .mobile-tab-bar {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 120;
        display: flex;
        align-items: flex-end;
        justify-content: space-around;
        gap: 2px;
        min-height: var(--mobile-tab-bar-height);
        padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
        background: var(--topbar-bg);
        border-top: 1px solid var(--border);
        box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.35);
        overflow: visible;
    }

    .mobile-tab-bar__item {
        flex: 1 1 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2px;
        min-height: 48px;
        padding: 4px 6px;
        border-radius: 12px;
        text-decoration: none;
        color: var(--muted);
        font-size: 0.58rem;
        letter-spacing: 0.03em;
        text-transform: uppercase;
        transition: color 0.15s ease, background 0.15s ease;
        touch-action: manipulation;
    }

    button.mobile-tab-bar__item {
        border: none;
        background: transparent;
        cursor: pointer;
        font-family: inherit;
        appearance: none;
        -webkit-appearance: none;
    }

    button.mobile-tab-bar__item--primary {
        background: linear-gradient(180deg, var(--gold) 0%, #a88420 100%);
        color: var(--on-gold, #1a1208);
        -webkit-text-fill-color: var(--on-gold, #1a1208);
    }

    button.mobile-tab-bar__item--primary.mobile-tab-bar__item--active {
        background: linear-gradient(180deg, #e0c04a 0%, var(--gold) 100%);
        color: var(--on-gold, #1a1208);
        -webkit-text-fill-color: var(--on-gold, #1a1208);
    }

    .mobile-tab-bar__item--active {
        color: var(--gold);
        background: rgba(201, 162, 39, 0.1);
    }

    .mobile-tab-bar__item--disabled {
        opacity: 0.55;
        cursor: not-allowed;
        pointer-events: none;
    }

    .mobile-tab-bar__item--primary.mobile-tab-bar__item--disabled {
        box-shadow: none;
    }

    .mobile-tab-bar__icon {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 24px;
        height: 24px;
        line-height: 1;
        color: inherit;
    }

    .mobile-tab-bar__icon svg,
    .mobile-tab-bar__svg {
        width: 22px;
        height: 22px;
        display: block;
        flex-shrink: 0;
    }

    .mobile-tab-bar__label {
        line-height: 1.1;
        text-align: center;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mobile-tab-bar__item--primary {
        position: relative;
        top: auto;
        /* Float above the bar without stretching its flex line / lifting baseline */
        transform: translateY(-10px);
        align-self: flex-end;
        flex: 1.15 1 0;
        min-height: 48px;
        padding: 8px 8px 6px;
        border-radius: 16px;
        background: linear-gradient(180deg, var(--gold) 0%, #a88420 100%);
        color: var(--on-gold, #1a1208);
        box-shadow:
            0 4px 0 rgba(0, 0, 0, 0.25),
            0 8px 20px rgba(201, 162, 39, 0.35);
    }

    .mobile-tab-bar__item--primary.mobile-tab-bar__item--active {
        color: var(--on-gold, #1a1208);
        background: linear-gradient(180deg, #e0c04a 0%, var(--gold) 100%);
    }

    .mobile-tab-bar__item--primary .mobile-tab-bar__icon svg,
    .mobile-tab-bar__item--primary .mobile-tab-bar__svg {
        width: 24px;
        height: 24px;
    }

    .mobile-tab-bar__item--primary .mobile-tab-bar__label {
        font-weight: 600;
    }

    /* Hide floating FAB — booking is in tab bar */
    .book-online-fab,
    .book-online-fab-stack {
        display: none !important;
    }

    /* Footer clears tab bar */
    .footer {
        padding-bottom: calc(16px + var(--mobile-tab-bar-height));
    }

    /* Touch-friendly controls */
    .btn-gold,
    .btn-outline,
    .btn-muted,
    .admin-btn {
        min-height: 48px;
        padding-top: 12px;
        padding-bottom: 12px;
    }

    .booking-widget .booking-choice:not(.booking-master-row__select) {
        min-height: 52px;
    }

    .booking-master-row {
        padding: 14px 8px 14px 14px;
    }

    .booking-master-row__photo {
        flex-basis: 56px;
        width: 56px;
        height: 56px;
    }

    .booking-master-info {
        flex-basis: 32px;
        width: 32px !important;
        min-width: 32px;
        max-width: 32px;
        height: 32px;
        min-height: 32px;
    }

    .booking-widget button:not(.month-calendar__nav):not(.month-calendar__day):not(.booking-date-btn):not(.booking-time-btn):not(.month-calendar__nav):not(.booking-master-info):not(.booking-master-row__select) {
        min-height: 44px;
    }

    .ui-input,
    .ui-field select,
    .ui-field input,
    .ui-field textarea {
        min-height: 48px;
        font-size: 16px;
    }

    /* App-like page sections */
    .page-content,
    .services-section,
    .team-section,
    .home-gallery-section {
        padding-top: 24px;
        padding-bottom: 24px;
        max-width: 100%;
        overflow-x: clip;
        box-sizing: border-box;
    }

    .main-content {
        max-width: 100vw;
    }

    .panel-page {
        padding: 16px var(--space-page) 20px;
    }

    .panel-header {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .panel-header h1 {
        font-size: 1.35rem;
        line-height: 1.25;
    }

    .panel-header__actions {
        display: flex;
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }

    .panel-header__actions .btn-gold,
    .panel-header__actions .btn-outline {
        width: 100%;
        text-align: center;
    }

    .schedule-dashboard .panel-header__actions .btn-gold,
    .schedule-dashboard .panel-header__actions .btn-outline {
        width: auto;
    }

    .schedule-dashboard .schedule-toolbar__btn {
        min-height: 34px;
    }

    .booking-widget {
        padding: 16px var(--space-page);
        border-radius: 0;
        max-width: 100%;
    }

    .booking-page-heading {
        align-items: center;
        gap: 0.25rem 0.55rem;
        margin-bottom: 0.85rem;
    }

    .booking-page-branch {
        font-size: 0.85rem;
    }

    .manage-card {
        border-radius: 16px;
    }

    body.has-mobile-tab-bar .style-guide-result__actions,
    body.has-mobile-tab-bar .style-guide-step__nav,
    body.has-mobile-tab-bar .gallery-quick-result .style-guide-result__actions {
        position: sticky;
        bottom: calc(var(--mobile-tab-bar-height) + 8px);
        z-index: 5;
        margin: 0 calc(-1 * var(--space-page));
        padding: 12px var(--space-page);
        background: linear-gradient(180deg, transparent 0%, var(--bg) 24%);
    }

    /* Sticky Continue base styles live in peaky.css (all viewports).
       Lift the bar above the mobile tab bar when present. */
    body.has-mobile-tab-bar .booking-continue-bar {
        bottom: var(--mobile-tab-bar-height);
        padding-bottom: 12px;
    }

    .style-guide-step__nav .btn-gold,
    .style-guide-step__nav .btn-muted,
    .style-guide-result__actions .btn-gold,
    .style-guide-result__actions .btn-outline {
        width: 100%;
    }

    /* Modals: full-screen on smartphone */
    .modal-overlay,
    .modal-overlay--nested {
        align-items: stretch;
        justify-content: flex-start;
        padding: 0;
        overflow: hidden;
        overscroll-behavior: contain;
        height: 100%;
        max-height: 100%;
    }

    .modal,
    .modal-wide,
    .modal-scroll,
    .modal-sm,
    .appointment-detail,
    .visit-history-modal,
    .add-product-modal,
    .appt-sheet,
    .catalog-picker,
    .create-appointment-modal {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        height: 100% !important;
        max-height: 100% !important;
        min-height: 0 !important;
        margin: 0 !important;
        box-sizing: border-box;
        border-radius: 18px 18px 0 0 !important;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        touch-action: pan-y;
        padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    }

    .appointment-detail,
    .add-product-modal,
    .appt-sheet,
    .catalog-picker {
        overflow: hidden;
        display: flex;
        flex-direction: column;
        padding-bottom: 0;
    }

    .appointment-detail__scroll,
    .add-product-modal__scroll,
    .appt-sheet__scroll,
    .catalog-picker__scroll,
    .appt-detail-view,
    #detailMount {
        flex: 1 1 auto;
        min-height: 0;
    }

    #detailModal.modal-overlay {
        align-items: stretch !important;
        justify-content: flex-start !important;
        padding: 0 !important;
        height: 100% !important;
        max-height: 100% !important;
        /* Safari / iOS: fill visual viewport consistently */
        min-height: 100vh;
        min-height: 100dvh;
        min-height: -webkit-fill-available;
    }

    #detailModalCard.appt-sheet,
    #detailModalCard.appointment-detail {
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
        height: 100% !important;
        max-height: 100% !important;
        min-height: 0 !important;
    }

    #detailModalCard #detailMount,
    #detailModalCard .appointment-detail__scroll {
        display: flex !important;
        flex-direction: column !important;
        flex: 1 1 auto !important;
        min-height: 0 !important;
        overflow: hidden !important;
        padding: 0 !important;
        height: auto !important;
        max-height: none !important;
    }

    #detailModalCard .appt-detail-view {
        display: -webkit-flex !important;
        display: flex !important;
        -webkit-flex-direction: column !important;
        flex-direction: column !important;
        -webkit-flex: 1 1 0% !important;
        flex: 1 1 0% !important;
        min-height: 0 !important;
        height: 100% !important;
        max-height: 100% !important;
        overflow: hidden !important;
    }

    #detailModalCard .adv-header {
        display: -webkit-grid !important;
        display: grid !important;
        grid-template-columns: 40px minmax(0, 1fr) auto !important;
        -webkit-flex: 0 0 auto !important;
        flex: 0 0 auto !important;
        -webkit-flex-shrink: 0 !important;
        flex-shrink: 0 !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: relative !important;
        z-index: 8 !important;
        min-height: 48px !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding: 8px 12px !important;
        padding-top: calc(8px + env(safe-area-inset-top, 0px)) !important;
        background: var(--appt-sheet-bg, var(--bg2, #121212)) !important;
        color: var(--appt-sheet-ink, var(--text, #f2f2f2)) !important;
        border-bottom: 1px solid rgba(128, 128, 128, 0.25) !important;
    }

    #detailModalCard .adv-header__date {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        min-width: 0 !important;
        color: var(--appt-sheet-ink, var(--text, #f2f2f2)) !important;
        font-size: clamp(0.78rem, 0.6rem + 0.9vw, 0.86rem) !important;
        font-weight: 600 !important;
        line-height: 1.2 !important;
        text-align: center !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    #detailModalCard .appt-detail-view {
        font-size: clamp(0.78rem, 0.6rem + 0.9vw, 0.86rem);
    }

    #detailModalCard .adv-client__name {
        font-size: clamp(1.06rem, 0.82rem + 1.35vw, 1.22rem);
    }

    #detailModalCard .adv-block__title,
    #detailModalCard .adv-actions__title {
        font-size: clamp(0.84rem, 0.66rem + 0.95vw, 0.94rem);
    }

    #detailModalCard .adv-add-btn,
    #detailModalCard .adv-client-pick-btn,
    #detailModalCard .adv-line,
    #detailModalCard .adv-pay-trigger {
        font-size: clamp(0.78rem, 0.6rem + 0.9vw, 0.86rem);
    }

    #detailModalCard .adv-status__chip,
    #detailModalCard .adv-line__sub,
    #detailModalCard .adv-line__desc {
        font-size: clamp(0.66rem, 0.52rem + 0.7vw, 0.72rem);
    }

    .appointment-detail h3,
    .create-appointment-modal h3,
    .product-picker-overlay .modal h3,
    .visit-history-modal h3,
    .modal-heading h3 {
        font-size: clamp(0.92rem, 0.72rem + 1vw, 1.02rem);
    }

    #detailModalCard .adv-header__center {
        display: -webkit-flex !important;
        display: flex !important;
        -webkit-align-items: center !important;
        align-items: center !important;
        -webkit-justify-content: center !important;
        justify-content: center !important;
        gap: 4px !important;
        min-width: 0 !important;
        max-width: 100% !important;
    }

    #detailModalCard .adv-icon-btn--close,
    #detailModalCard .adv-icon-btn {
        display: -webkit-inline-flex !important;
        display: inline-flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        color: var(--appt-sheet-ink, var(--text, #f2f2f2)) !important;
    }

    #detailModalCard .adv-icon-btn__glyph {
        display: block !important;
        color: inherit !important;
    }

    #detailModalCard .adv-scroll {
        -webkit-flex: 1 1 0% !important;
        flex: 1 1 0% !important;
        min-height: 0 !important;
        overflow-y: scroll !important;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 28px !important;
    }

    #detailModalCard .adv-block,
    #detailModalCard .adv-add-btn,
    #detailModalCard .adv-client-pick-btn {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: relative !important;
        z-index: 1 !important;
    }

    #detailModalCard .adv-add-btn,
    #detailModalCard .adv-client-pick-btn {
        display: -webkit-flex !important;
        display: flex !important;
        min-height: 44px !important;
    }

    #detailModalCard .adv-paybar,
    #detailModalCard .adv-paydock {
        -webkit-flex: 0 0 auto !important;
        flex: 0 0 auto !important;
        position: relative;
        z-index: 2;
    }

    /* Sheet docks only — do not touch schedule sticky headers. */
    .appt-sheet__footer,
    .catalog-picker__footer {
        padding-bottom: calc(16px + var(--appt-sheet-safe-bottom, env(safe-area-inset-bottom, 0px)));
    }

    #detailMount > .appt-sheet__form {
        flex: 0 0 auto;
    }

    #detailMount > .appt-sheet__scroll {
        padding-bottom: 28px;
    }

    .appointment-detail__scroll,
    .add-product-modal__scroll {
        padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    }

    #detailModalCard .appointment-detail__scroll {
        padding-bottom: 0 !important;
    }

    .modal .modal-actions,
    .modal-wide .modal-actions,
    .modal-scroll .modal-actions,
    .modal-sm .modal-actions,
    .appointment-detail .modal-actions,
    .visit-history-modal .modal-actions {
        flex-direction: column;
        flex-wrap: nowrap;
        align-items: stretch;
        gap: 10px;
        margin-top: 16px;
        padding-top: 12px;
        border-top: 1px solid var(--border);
    }

    .modal .modal-actions button,
    .modal-wide .modal-actions button,
    .modal-scroll .modal-actions button,
    .modal-sm .modal-actions button,
    .appointment-detail .modal-actions button,
    .appointment-detail .modal-actions a,
    .visit-history-modal .modal-actions button {
        flex: 0 0 auto;
        width: 100%;
        min-width: 0;
        min-height: 44px;
        white-space: normal;
        writing-mode: horizontal-tb;
        text-orientation: mixed;
    }

    .appointment-detail h3,
    .create-appointment-modal h3,
    .product-picker-overlay .modal h3,
    .visit-history-modal h3,
    .modal-heading h3 {
        line-height: 1.3;
        word-break: break-word;
        margin-top: 0;
    }

    .appointment-detail .modal-heading,
    .create-appointment-modal .modal-heading,
    .product-picker-overlay .modal-heading,
    .visit-history-modal .modal-heading {
        position: sticky;
        top: 0;
        z-index: 3;
        background: var(--bg2);
        padding-top: 4px;
    }

    .modal-close-btn {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
        font-size: 1.65rem;
        flex: 0 0 auto;
    }

    .appointment-detail .modal-subtitle,
    .visit-history-modal .modal-subtitle {
        word-break: break-word;
    }

    .visit-history-list {
        list-style: none;
        margin: 12px 0 0;
        padding: 0;
        display: flex;
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    .visit-history-card {
        padding: 12px 14px;
        background: var(--bg3);
        border: 1px solid var(--border);
        border-radius: 12px;
        box-sizing: border-box;
    }

    .visit-history-card__head {
        display: flex;
        align-items: baseline;
        justify-content: space-between;
        gap: 10px;
        margin-bottom: 6px;
    }

    .visit-history-card__date {
        font-weight: 600;
        font-size: 0.9rem;
        color: var(--text);
    }

    .visit-history-card__price {
        font-weight: 700;
        color: var(--gold);
        font-size: 0.9rem;
        flex-shrink: 0;
    }

    .visit-history-card__line {
        margin: 0 0 4px;
        font-size: 0.88rem;
        line-height: 1.35;
        word-break: break-word;
    }

    .visit-history-card__meta {
        margin: 0;
        font-size: 0.8rem;
        color: var(--muted);
        word-break: break-word;
    }

    .appointment-detail .status-buttons--top {
        margin-bottom: 12px;
    }

    .appointment-detail .admin-form,
    .appointment-detail .service-lines,
    .appointment-detail .product-lines {
        max-width: 100%;
        overflow-x: hidden;
    }

    .client-cabinet .cabinet-cards--mobile {
        gap: 12px;
    }

    /* ——— Home mobile: first viewport + scannable sections ——— */
    .hero-slider::after {
        content: "";
        display: block;
        height: 28px;
        margin-top: -28px;
        position: relative;
        z-index: 2;
        pointer-events: none;
        background: linear-gradient(180deg, transparent 0%, var(--bg) 100%);
    }

    .home-seo {
        padding: 8px var(--space-page) 4px;
    }

    .home-seo__inner {
        display: flex;
        flex-direction: column;
        padding: 16px 14px 18px;
        border-radius: 14px;
        box-shadow: 0 8px 22px rgba(0, 0, 0, 0.28);
    }

    .home-seo__inner::before {
        width: 2px;
    }

    .home-seo__eyebrow-row {
        order: 1;
        gap: 8px 10px;
        margin: 0 0 8px;
    }

    .home-seo__eyebrow {
        font-size: 0.65rem;
        letter-spacing: 0.14em;
    }

    .home-seo__eyebrow-row .open-status {
        padding: 6px 10px 6px 8px;
        font-size: 0.72rem;
        min-height: 32px;
    }

    .home-seo__eyebrow-row .open-status__hint {
        display: none;
    }

    .home-seo__title {
        order: 2;
        font-size: clamp(1.2rem, 5.6vw, 1.45rem);
        line-height: 1.22;
        margin: 0 0 12px;
        letter-spacing: 0.015em;
    }

    .home-seo__cta {
        order: 3;
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        margin: 0 0 14px;
    }

    .home-seo__cta-primary {
        width: 100%;
        min-height: 48px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 1rem;
        letter-spacing: 0.06em;
        border-radius: 10px;
        box-shadow: 0 6px 18px rgba(201, 162, 39, 0.28);
    }

    .home-seo__cta-secondary {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .home-seo__cta-secondary .btn-outline {
        width: 100%;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 10px 12px;
        font-size: 0.82rem;
        border-radius: 10px;
    }

    .home-seo__cta-secondary .home-seo__phone {
        grid-column: 1 / -1;
        margin: 2px 0 0;
        min-height: 44px;
        justify-content: center;
        font-size: 0.92rem;
        border: 1px solid color-mix(in srgb, var(--gold) 35%, var(--border));
        border-radius: 10px;
        background: rgba(201, 162, 39, 0.06);
    }

    .home-seo__lead {
        order: 4;
        margin: 0 0 14px;
        font-size: 0.95rem;
        line-height: 1.55;
        overflow: visible;
    }

    .home-seo__stats {
        order: 5;
        display: flex;
        gap: 8px;
        margin: 0 0 16px;
        padding-bottom: 2px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
        scroll-snap-type: x proximity;
        scrollbar-width: none;
    }

    .home-seo__stats::-webkit-scrollbar {
        display: none;
    }

    .home-seo__stat {
        flex: 0 0 auto;
        width: min(72vw, 220px);
        scroll-snap-align: start;
        padding: 10px 12px;
        border-radius: 10px;
    }

    .home-seo__stat-value {
        font-size: 0.82rem;
    }

    .home-seo__stat-label {
        font-size: 0.72rem;
    }

    .home-seo__grid {
        order: 6;
        gap: 10px;
    }

    .home-seo__card {
        padding: 14px 14px 14px;
        border-radius: 12px;
    }

    .home-seo__card:hover {
        transform: none;
        box-shadow: none;
    }

    .home-seo__card-mark {
        width: 36px;
        height: 36px;
        margin-bottom: 8px;
        border-radius: 8px;
    }

    .home-seo__card-mark svg {
        width: 22px;
        height: 22px;
    }

    .home-seo__card h2 {
        font-size: 0.98rem;
        margin-bottom: 6px;
    }

    .home-seo__card p {
        font-size: 0.86rem;
        line-height: 1.45;
        margin-bottom: 12px;
    }

    .home-seo__card-actions {
        gap: 10px;
    }

    .home-seo__card-cta {
        min-height: 44px;
        padding: 10px 14px;
        border-radius: 10px;
        font-size: 0.82rem;
    }

    .home-seo__card-link {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        font-size: 0.84rem;
    }

    .home-training,
    .promotions-section--home,
    .services-section,
    .home-gallery-section,
    .team-section {
        padding-top: 22px;
        padding-bottom: 22px;
    }

    .home-training {
        padding-left: var(--space-page);
        padding-right: var(--space-page);
    }

    .home-training__header,
    .promotions-section__header,
    .section-header {
        margin-bottom: 10px;
        gap: 10px;
    }

    .home-training__header .section-title,
    .promotions-section__header .section-title,
    .services-section .section-title,
    .home-gallery-section .section-title,
    .team-section .section-title {
        margin-bottom: 0;
        font-size: clamp(1.2rem, 5vw, 1.45rem);
        letter-spacing: 0.05em;
    }

    .home-training__lead {
        margin: 0 0 14px;
        font-size: 0.9rem;
        line-height: 1.45;
    }

    .home-training__all-link,
    .promotions-section__all-link {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 10px 14px;
        border-radius: 10px;
    }

    .home-training__cta {
        min-height: 48px;
        padding: 12px 16px;
        border-radius: 10px;
    }

    .home-training__body {
        padding: 14px 14px 16px;
    }

    .home-training__media {
        min-height: 96px;
        padding: 20px 16px 16px;
    }

    .promotions-section--home {
        padding-left: var(--space-page);
        padding-right: var(--space-page);
    }

    .promotions-home-slider {
        margin: 0;
        padding-bottom: 22px;
    }

    .promotion-card {
        padding: 16px;
        border-radius: 12px;
    }

    .promotion-card__cta {
        min-height: 48px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        border-radius: 10px;
    }

    #prices-services .price-category-block {
        margin-bottom: 14px;
        border-radius: 12px;
    }

    #prices-services .price-category-header {
        padding: 14px 14px 12px 18px;
    }

    #prices-services .price-category-header h3 {
        font-size: 1.05rem;
        margin: 0;
    }

    #prices-services .price-table th,
    #prices-services .price-table td {
        padding: 10px 10px;
        font-size: 0.82rem;
    }

    #prices-services .price-cell {
        font-size: 0.9rem;
    }

    .style-guide-promo {
        padding-top: 4px;
        padding-bottom: 8px;
    }

    .style-guide-promo__card {
        gap: 12px;
        padding: 16px;
        border-radius: 14px;
    }

    .style-guide-promo__btn {
        width: 100%;
        min-height: 48px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 10px;
    }

    .home-gallery-section {
        padding-left: var(--space-page);
        padding-right: var(--space-page);
    }

    .gallery-grid-uniform--home {
        gap: 8px;
        margin-top: 12px;
    }

    .home-gallery-section .gallery-more-btn {
        width: 100%;
        max-width: 280px;
        min-height: 48px;
        margin-top: 18px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        border-radius: 12px;
        box-sizing: border-box;
    }

    .gallery-tile__want-same {
        min-height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.7rem;
        padding: 8px 10px;
    }

    .team-branches {
        gap: 8px;
        margin-bottom: 14px;
    }

    .team-branch-btn {
        min-height: 48px;
        padding: 10px 12px;
        border-radius: 12px;
        touch-action: manipulation;
    }

    .team-grid--masters .team-action-btn {
        min-height: 40px;
        padding: 8px 10px;
        font-size: 0.65rem;
        border-radius: 8px;
        touch-action: manipulation;
    }

    .team-grid--masters .team-card-actions {
        gap: 6px;
        padding: 6px 8px 0;
    }

    .footer-map {
        padding: 0 var(--space-page) 20px;
    }

    .footer-map__title {
        font-size: 0.98rem;
        margin-bottom: 10px;
    }

    .footer-map__frame {
        height: 200px;
        border-radius: 12px;
    }

    .footer-map__actions {
        gap: 8px;
        margin-top: 10px;
    }

    .footer-map__route {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 10px 12px;
        border-radius: 10px;
        box-sizing: border-box;
    }

    /* Avoid double bottom inset: body already reserves tab bar */
    body.has-mobile-tab-bar .footer {
        padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    }

    body.has-mobile-tab-bar .book-online-fab,
    body.has-mobile-tab-bar .book-online-fab-stack {
        display: none !important;
    }

    body.has-mobile-tab-bar .a2hs-tip {
        bottom: calc(var(--mobile-tab-bar-height) + 12px);
    }
}

@media (min-width: 768px) {
    .mobile-tab-bar {
        display: none;
    }
}

@media (min-width: 360px) and (max-width: 429px) {
    #detailModalCard .adv-header__date {
        font-size: 0.82rem !important;
    }

    #detailModalCard .appt-detail-view {
        font-size: 0.82rem;
    }

    #detailModalCard .adv-client__name {
        font-size: 1.12rem;
    }
}

@media (min-width: 430px) and (max-width: 600px) {
    #detailModalCard .adv-header__date {
        font-size: 0.86rem !important;
    }

    #detailModalCard .appt-detail-view {
        font-size: 0.86rem;
    }

    #detailModalCard .adv-client__name {
        font-size: 1.18rem;
    }
}

@media (min-width: 601px) and (max-width: 767px) {
    #detailModalCard .adv-header__date {
        font-size: 0.88rem !important;
    }

    #detailModalCard .appt-detail-view {
        font-size: 0.88rem;
    }

    #detailModalCard .adv-client__name {
        font-size: 1.22rem;
    }
}

/* Soft “Add to Home Screen” tip (mobile public clients) */
.a2hs-tip {
    position: fixed;
    left: max(12px, env(safe-area-inset-left, 0px));
    right: max(12px, env(safe-area-inset-right, 0px));
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    z-index: 220;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px 14px;
    align-items: start;
    padding: 16px 40px 16px 14px;
    max-height: min(78vh, 560px);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 16px;
    background: linear-gradient(165deg, var(--bg2) 0%, var(--bg3, #1a1a1a) 100%);
    border: 1px solid rgba(201, 162, 39, 0.35);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
    animation: a2hs-tip-in 0.35s ease-out;
}

body.has-mobile-tab-bar .a2hs-tip {
    bottom: calc(var(--mobile-tab-bar-height, 58px) + 10px);
}

.a2hs-tip--expanded {
    grid-template-columns: 1fr;
}

.a2hs-tip--expanded .a2hs-tip__icon {
    display: none;
}

.a2hs-tip__icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: rgba(201, 162, 39, 0.16);
    border: 1px solid rgba(201, 162, 39, 0.45);
    color: var(--gold);
    font-size: 1.25rem;
    line-height: 1;
}

.a2hs-tip__body {
    min-width: 0;
}

.a2hs-tip__title {
    margin: 0 0 6px;
    font-family: "Cinzel", serif;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: var(--gold-light, var(--gold));
}

.a2hs-tip__text,
.a2hs-tip__steps,
.a2hs-tip__note,
.a2hs-tip__platform {
    margin: 0 0 8px;
    font-family: "Source Sans 3", "Lato", sans-serif;
    font-size: 0.9rem;
    line-height: 1.45;
    color: var(--text);
}

.a2hs-tip__steps,
.a2hs-tip__note,
.a2hs-tip__platform {
    color: var(--muted);
}

.a2hs-tip__note {
    margin-bottom: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(201, 162, 39, 0.08);
    border: 1px solid rgba(201, 162, 39, 0.22);
    color: var(--gold-light, var(--gold));
    font-size: 0.82rem;
}

.a2hs-tip__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.a2hs-tip__actions .btn-gold,
.a2hs-tip__actions .btn-outline,
.a2hs-tip__actions .btn-muted {
    min-height: 40px;
    padding: 8px 14px;
    font-size: 0.85rem;
    border-radius: 10px;
    cursor: pointer;
}

.a2hs-tip__panel {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

.a2hs-tip__tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
}

.a2hs-tip__tab {
    flex: 1 1 0;
    min-height: 36px;
    padding: 6px 8px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--bg3, #1a1a1a);
    color: var(--muted);
    font-family: "Source Sans 3", "Lato", sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}

.a2hs-tip__tab.is-active,
.a2hs-tip__tab[aria-selected="true"] {
    border-color: rgba(201, 162, 39, 0.65);
    background: rgba(201, 162, 39, 0.16);
    color: var(--gold-light, var(--gold));
}

.a2hs-tip__steps-list {
    margin: 0 0 10px;
    padding-left: 1.2em;
    font-family: "Source Sans 3", "Lato", sans-serif;
    font-size: 0.88rem;
    line-height: 1.5;
    color: var(--text);
}

.a2hs-tip__steps-list li + li {
    margin-top: 6px;
}

.a2hs-tip__platform {
    margin-bottom: 10px;
    font-size: 0.78rem;
}

.a2hs-tip__never {
    display: block;
    width: 100%;
    margin: 0;
    padding: 8px;
    border: 0;
    background: transparent;
    color: var(--muted);
    font-family: "Source Sans 3", "Lato", sans-serif;
    font-size: 0.8rem;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}

.a2hs-tip__never:hover,
.a2hs-tip__never:focus-visible {
    color: var(--text);
}

.a2hs-tip__close {
    position: absolute;
    top: 8px;
    right: 10px;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
}

.a2hs-tip__close:hover,
.a2hs-tip__close:focus-visible {
    color: var(--text);
    background: var(--bg3);
}

@keyframes a2hs-tip-in {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (min-width: 901px) {
    .a2hs-tip {
        display: none !important;
    }
}

/* ═══ YCLIENTS — yellow app chrome (mobile tab bar) ═══ */
body.theme-yclients .mobile-tab-bar {
    background: #ffffff !important;
    border-top: 1px solid var(--border-color, #e6e6e6) !important;
    box-shadow: none !important;
}

body.theme-yclients.mode-night .mobile-tab-bar {
    background: var(--bg-secondary, #1a1e26) !important;
}

body.theme-yclients .mobile-tab-bar__item--active {
    color: var(--text-primary, #111) !important;
    background: color-mix(in srgb, var(--accent-color, #ffcc00) 16%, transparent) !important;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent-color, #ffcc00) 32%, transparent) !important;
    border-radius: 12px;
}

body.theme-yclients .mobile-tab-bar__item--active .mobile-tab-bar__label {
    font-weight: 700;
}

body.theme-yclients .mobile-tab-bar__item--active .mobile-tab-bar__icon,
body.theme-yclients .mobile-tab-bar__item--active .mobile-tab-bar__svg {
    color: var(--accent-color, #ffcc00) !important;
}

body.theme-yclients button.mobile-tab-bar__item--primary,
body.theme-yclients .mobile-tab-bar__item--primary,
body.theme-yclients .mobile-tab-bar__item--primary.mobile-tab-bar__item--active {
    background: var(--accent-color, #ffcc00) !important;
    color: var(--on-accent, #111) !important;
    -webkit-text-fill-color: var(--on-accent, #111) !important;
    box-shadow: 0 4px 14px rgba(255, 204, 0, 0.35) !important;
}

body.theme-yclients .btn-gold,
body.theme-yclients .panel-header__actions .btn-gold,
body.theme-yclients .schedule-dashboard .panel-header__actions .btn-gold,
body.theme-yclients .style-guide-step__nav .btn-gold,
body.theme-yclients .style-guide-result__actions .btn-gold,
body.theme-yclients .a2hs-tip__actions .btn-gold {
    background: var(--accent-color) !important;
    color: var(--on-accent) !important;
    -webkit-text-fill-color: var(--on-accent) !important;
    border: none !important;
    box-shadow: none !important;
    font-family: var(--font-nav, "Inter", system-ui, sans-serif) !important;
}

body.theme-yclients .a2hs-tip__title,
body.theme-yclients .mobile-tab-bar__label {
    font-family: var(--font-body, "Inter", system-ui, sans-serif) !important;
}

/* ═══ BIRMINGHAM — charcoal + gold mobile chrome ═══ */
body.theme-birmingham .mobile-tab-bar {
    background: var(--bg-primary, #0d0d0d) !important;
    border-top: 1px solid color-mix(in srgb, var(--accent-color, #c5a059) 40%, transparent) !important;
    box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.45) !important;
}

body.theme-birmingham .mobile-tab-bar__item {
    color: var(--text-secondary, #8c8578) !important;
    border-radius: 10px;
}

body.theme-birmingham .mobile-tab-bar__item--active {
    color: var(--text-primary, #e5e0d8) !important;
    background: color-mix(in srgb, var(--accent-color, #c5a059) 12%, transparent) !important;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent-color, #c5a059) 55%, transparent) !important;
}

body.theme-birmingham .mobile-tab-bar__item--active .mobile-tab-bar__label {
    font-weight: 600;
    color: var(--text-primary, #e5e0d8) !important;
}

body.theme-birmingham .mobile-tab-bar__item--active .mobile-tab-bar__icon,
body.theme-birmingham .mobile-tab-bar__item--active .mobile-tab-bar__svg {
    color: var(--accent-color, #c5a059) !important;
}

body.theme-birmingham button.mobile-tab-bar__item--primary,
body.theme-birmingham .mobile-tab-bar__item--primary,
body.theme-birmingham .mobile-tab-bar__item--primary.mobile-tab-bar__item--active {
    background: linear-gradient(180deg, var(--accent-alt, #d4b06e), var(--accent-color, #c5a059)) !important;
    color: var(--on-accent, #0d0d0d) !important;
    -webkit-text-fill-color: var(--on-accent, #0d0d0d) !important;
    box-shadow: 0 4px 14px color-mix(in srgb, var(--accent-color, #c5a059) 35%, transparent) !important;
    border: 1px solid color-mix(in srgb, var(--accent-color, #c5a059) 70%, #000) !important;
}

body.theme-birmingham .mobile-tab-bar__label {
    font-family: var(--font-body, "Montserrat", system-ui, sans-serif) !important;
}

/* Client account: 6 tabs — keep labels readable */
@media (max-width: 767px) {
    .mobile-tab-bar:has(> :nth-child(6)) {
        gap: 2px;
        padding-left: 4px;
        padding-right: 4px;
    }

    .mobile-tab-bar:has(> :nth-child(6)) .mobile-tab-bar__item {
        min-width: 0;
        padding: 4px 2px;
        gap: 2px;
    }

    .mobile-tab-bar:has(> :nth-child(6)) .mobile-tab-bar__label {
        font-size: 0.58rem;
        letter-spacing: 0;
    }

    .mobile-tab-bar:has(> :nth-child(6)) .mobile-tab-bar__icon svg,
    .mobile-tab-bar:has(> :nth-child(6)) .mobile-tab-bar__svg {
        width: 20px;
        height: 20px;
    }

    .mobile-tab-bar:has(> :nth-child(6)) .mobile-tab-bar__item--primary {
        transform: translateY(-8px);
        min-width: 48px;
        padding: 6px 4px;
    }
}

body.theme-birmingham .btn-gold,
body.theme-birmingham .panel-header__actions .btn-gold,
body.theme-birmingham .schedule-dashboard .panel-header__actions .btn-gold {
    background: transparent !important;
    color: var(--accent-color, #c5a059) !important;
    -webkit-text-fill-color: var(--accent-color, #c5a059) !important;
    border: 1px solid var(--accent-color, #c5a059) !important;
    box-shadow: none !important;
    font-family: var(--font-nav, "Montserrat", system-ui, sans-serif) !important;
}

/* iOS PWA / standalone: avoid stretched empty layout and respect safe areas */
@media (display-mode: standalone), (display-mode: fullscreen) {
    html {
        height: var(--app-height, 100%);
        min-height: var(--app-height, 100%);
    }

    body {
        min-height: var(--app-height, 100%);
        padding-top: env(safe-area-inset-top, 0px);
        padding-bottom: env(safe-area-inset-bottom, 0px);
        box-sizing: border-box;
    }

    #detailModal.modal-overlay,
    #createModal.modal-overlay {
        height: var(--app-height, 100%) !important;
        max-height: var(--app-height, 100%) !important;
        top: 0;
        bottom: auto;
    }

    #detailModalCard.appt-sheet,
    #detailModalCard .appt-detail-view {
        height: 100% !important;
        max-height: 100% !important;
    }

    #detailModalCard .adv-scroll {
        -webkit-flex: 1 1 0% !important;
        flex: 1 1 0% !important;
        overflow-y: scroll !important;
    }
}
