@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;700;800&family=Fraunces:wght@600;700&display=swap');

:root,
:root[data-theme="light"] {
    color-scheme: light;
    --bg: #f5f6fa;
    --bg-soft: #eef3ff;
    --surface: #fff;
    --surface-soft: #f8fbff;
    --border: #e4e7ee;
    --text: #171c2e;
    --text-muted: #6b7280;
    --muted: var(--text-muted);
    --line: var(--border);
    --btn-bg: #f0eefc;
    --icon-color: #4f46e5;
    --input-bg: #fff;
    --surface-muted: #f8fafc;
    --surface-accent: #f8faff;
    --control-text: #344054;
    --primary: #2563ff;
    --primary-2: #8a1cf3;
    --success: #17b26a;
    --warning: #f59e0b;
    --danger: #f04438;
    --shadow: 0 24px 50px rgba(26, 38, 62, 0.10);
    --shadow-soft: 0 12px 30px rgba(26, 38, 62, 0.08);
    --radius-xl: 28px;
    --radius-lg: 22px;
    --radius-md: 16px;
    --radius-sm: 12px;
    --gradient: linear-gradient(90deg, #2563ff 0%, #8a1cf3 100%);
    --transition: 0.3s ease;
    --theme-transition: var(--transition);
}

/* Shared priority indicators for operational lists. */
.priority-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    max-width: 100%;
    margin-top: 0.35rem;
    padding: 0.2rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1.25;
    white-space: normal;
}

.priority-badge--high {
    border-color: rgba(239, 68, 68, 0.35);
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.priority-badge--medium {
    border-color: rgba(245, 158, 11, 0.35);
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

.priority-item--high {
    position: relative;
}

tr.priority-item--high > td:first-child,
.staff-order-card.priority-item--high,
.payment-review-card.priority-item--high,
.notification-history-item.priority-item--high,
.support-thread.priority-item--high {
    border-left: 3px solid #ef4444;
}

.priority-stack {
    display: inline-flex;
    align-items: flex-end;
    flex-direction: column;
    gap: 0.35rem;
}

@media (max-width: 640px) {
    .priority-badge {
        margin-top: 0.3rem;
        padding: 0.18rem 0.45rem;
        font-size: 0.68rem;
    }

    .priority-stack {
        align-items: flex-start;
    }
}

/* Administrator user actions, matched to mobile-user-actions.html. */
.user-action-label {
    display: none;
}

.user-management-table .user-actions-row {
    flex-wrap: nowrap;
    gap: 12px;
}

.user-management-table .user-actions-row .user-action-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    min-width: 0;
    margin: 0;
}

.user-management-table .user-actions-row .btn-icon {
    width: 42px !important;
    min-width: 42px !important;
    max-width: 42px;
    height: 42px;
    min-height: 42px;
    padding: 0;
    border: 1px solid #e3e7ef !important;
    border-radius: 50%;
    background: #fff !important;
    box-shadow: none !important;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.user-management-table .user-actions-row .btn-icon:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 14px rgba(32, 38, 58, 0.1) !important;
}

.user-management-table .user-actions-row .btn-icon:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

.user-management-table .user-actions-row .btn-icon svg {
    width: 19px;
    height: 19px;
    stroke: currentColor;
}

.user-management-table .user-actions-row .btn-edit-icon {
    color: #5b5cf6 !important;
}

.user-management-table .user-actions-row .user-action-item--status .btn-icon {
    color: #f59e0b !important;
}

.user-management-table .user-actions-row .btn-delete-icon {
    color: #ef4444 !important;
}

@media (max-width: 640px) {
    .user-management-table td:last-child {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .user-management-table td:last-child::before {
        color: #5b5cf6;
        font-size: 12px;
        font-weight: 700;
        line-height: 1;
        letter-spacing: 0.08em;
        text-transform: uppercase;
    }

    .user-management-table .user-actions-row {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        align-items: start;
        justify-items: center;
        gap: 12px;
        width: 100%;
        padding: 0.1rem 0 0;
    }

    .user-management-table .user-actions-row .user-action-item {
        display: grid;
        grid-template-columns: 1fr;
        justify-items: center;
        align-items: start;
        gap: 7px;
        width: 100%;
        min-width: 0;
        margin: 0;
    }

    .user-management-table .user-actions-row .user-action-label {
        display: block;
        width: 100%;
        color: var(--text);
        font-size: 12px;
        font-weight: 400;
        line-height: 1.2;
        text-align: center;
        white-space: nowrap;
    }

    .user-management-table .user-actions-row .btn-icon {
        width: 42px !important;
        min-width: 42px !important;
        max-width: 42px;
        height: 42px;
        min-height: 42px;
        padding: 0;
        border-radius: 50%;
        background: var(--surface) !important;
        box-shadow: none !important;
    }

    .user-management-table .user-actions-row .btn-icon svg {
        width: 19px;
        height: 19px;
    }

    .user-management-table .user-actions-row .btn-edit-icon {
        color: #5b5cf6 !important;
        border-color: #e3e7ef !important;
    }

    .user-management-table .user-actions-row .user-action-item--status .btn-icon {
        color: #f59e0b !important;
        border-color: #e3e7ef !important;
    }

    .user-management-table .user-actions-row .btn-delete-icon {
        color: #ef4444 !important;
        border-color: #e3e7ef !important;
    }

    .user-management-table .user-actions-row .btn-edit-icon:hover,
    .user-management-table .user-actions-row .btn-edit-icon:focus-visible {
        color: #5b5cf6 !important;
        background: #fff !important;
        border-color: #e3e7ef !important;
    }

    .user-management-table .user-actions-row .user-action-item--status .btn-icon:hover,
    .user-management-table .user-actions-row .user-action-item--status .btn-icon:focus-visible {
        color: #f59e0b !important;
        background: #fff !important;
        border-color: #e3e7ef !important;
    }

    .user-management-table .user-actions-row .btn-delete-icon:hover,
    .user-management-table .user-actions-row .btn-delete-icon:focus-visible {
        color: #ef4444 !important;
        background: #fff !important;
        border-color: #e3e7ef !important;
    }
}

@media (max-width: 360px) {
    .user-management-table .user-actions-row {
        gap: 8px;
    }

    .user-management-table .user-actions-row .btn-icon {
        width: 40px !important;
        min-width: 40px !important;
        max-width: 40px;
        height: 40px;
        min-height: 40px;
    }

    .user-management-table .user-actions-row .user-action-label {
        font-size: 11px;
    }
}

/* New shared icon-only theme control based on theme-toggle-simple.html. */
.system-theme-toggle {
    width: 44px;
    min-width: 44px;
    max-width: 44px;
    height: 44px;
    min-height: 44px;
    max-height: 44px;
    flex: 0 0 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--btn-bg);
    color: var(--icon-color);
    box-shadow: none;
    cursor: pointer;
    line-height: 1;
    transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.system-theme-toggle:hover {
    border-color: var(--icon-color);
}

.system-theme-toggle:focus-visible {
    outline: 2px solid var(--icon-color);
    outline-offset: 2px;
}

.system-theme-toggle svg {
    display: block;
    width: 20px;
    height: 20px;
}

.system-theme-toggle .icon-sun { display: block; }
.system-theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .system-theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .system-theme-toggle .icon-moon { display: block; }

.system-theme-slot {
    display: inline-block;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
}

.system-theme-toggle--standalone {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 60;
    visibility: hidden;
}

.system-theme-toggle--standalone.is-ready {
    visibility: visible;
}

.system-theme-toggle--standalone.system-theme-toggle--beside-home {
    right: 4.5rem;
}

.customer-topbar__user > .system-theme-toggle,
.ops-topbar__right > .system-theme-toggle,
.topbar__account-actions > .system-theme-toggle {
    align-self: center;
    margin: 0;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: "DM Sans", "Segoe UI", sans-serif;
    color: var(--text);
    background: var(--bg);
    transition: background var(--theme-transition), color var(--theme-transition);
}

body,
.topbar,
.topbar--public,
.customer-topbar,
.ops-topbar,
.sidebar,
.auth-card,
.summary-card,
.form-card,
.info-card,
.receipt-card,
.empty-state,
.metric-card,
.metric-box,
.page-panel,
.product-card,
.cart-item,
.data-table,
.data-table th,
.data-table td,
.notification-panel,
.notification-panel__item,
.notification-detail-modal__card,
.product-detail-dialog,
.support-thread,
.support-message,
input,
textarea,
select,
button {
    transition:
        background var(--theme-transition),
        background-color var(--theme-transition),
        border-color var(--theme-transition),
        color var(--theme-transition),
        box-shadow var(--theme-transition);
}

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

img {
    max-width: 100%;
    display: block;
}

img[hidden] {
    display: none !important;
}

h1,
h2,
h3,
h4 {
    margin: 0 0 0.65rem;
    line-height: 1.12;
}

h1,
h2 {
    font-weight: 800;
}

h3,
h4 {
    font-weight: 700;
}

p {
    margin: 0 0 1rem;
    color: var(--muted);
    line-height: 1.6;
}

small {
    color: var(--muted);
}

.guest-body,
.customer-body {
    min-height: 100vh;
}

.landing-portal-body {
    background:
        radial-gradient(circle at 10% 12%, rgba(103, 153, 255, 0.42), transparent 20%),
        radial-gradient(circle at 84% 10%, rgba(180, 61, 255, 0.30), transparent 18%),
        radial-gradient(circle at 55% 60%, rgba(146, 68, 255, 0.16), transparent 32%),
        linear-gradient(100deg, #2a6ff3 0%, #5336f6 48%, #b514f0 100%);
    color: #fff;
}

.auth-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 2rem 1rem;
    background: var(--bg);
}

.auth-page__inner {
    width: min(100%, 470px);
}

.auth-page__logo {
    width: 128px;
    height: 128px;
    margin: 0 auto 1.5rem;
    border-radius: 18px;
    background: linear-gradient(180deg, var(--surface), var(--surface-muted));
    box-shadow: var(--shadow);
    display: grid;
    place-items: center;
    text-align: center;
    color: #7b3b0c;
    font-family: "Fraunces", Georgia, serif;
    font-size: 1.7rem;
    overflow: hidden;
}

.auth-page__logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.auth-card {
    background: var(--surface);
    border: 1px solid rgba(228, 232, 241, 0.8);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    padding: 2rem;
}

.auth-card h1 {
    font-size: clamp(2rem, 4vw, 3rem);
}

.auth-card__subhead {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.auth-card__row,
.auth-links,
.topbar__actions,
.product-card__meta,
.product-card__footer,
.section__actions,
.card-head,
.cart-summary,
.receipt-card__header,
.receipt-meta,
.portal-choice-card__actions,
.portal-choice-grid,
.customer-topbar,
.customer-topbar__nav,
.customer-topbar__user,
.ops-topbar,
.ops-topbar__left,
.ops-topbar__right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.auth-divider {
    position: relative;
    text-align: center;
    color: var(--muted);
    margin: 0.5rem 0;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    position: absolute;
    top: 50%;
    width: calc(50% - 60px);
    height: 1px;
    background: var(--line);
}

.auth-divider::before { left: 0; }
.auth-divider::after { right: 0; }

.auth-footer {
    text-align: center;
    margin-top: 1.75rem;
    color: var(--muted);
}

.check-row {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.auth-link {
    font-weight: 700;
    color: #7c34ff;
}

.auth-back {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    color: var(--muted);
    font-weight: 600;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.74rem;
    font-weight: 700;
    color: #7c34ff;
}

.btn {
    border: 0;
    border-radius: 14px;
    padding: 0.95rem 1.3rem;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(37, 99, 255, 0.16);
}

.btn-primary,
.portal-link-button {
    background: var(--gradient);
    color: #fff;
}

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--line);
}

.btn-ghost {
    background: transparent;
    color: var(--muted);
    border: 1px solid var(--line);
}

.btn-danger {
    background: rgba(240, 68, 56, 0.1);
    color: var(--danger);
    border: 1px solid rgba(240, 68, 56, 0.18);
}

.btn-sm {
    padding: 0.62rem 0.95rem;
    font-size: 0.86rem;
}

form {
    display: grid;
    gap: 1rem;
}

label {
    display: grid;
    gap: 0.45rem;
    font-weight: 600;
    color: var(--text-muted);
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 0.95rem 1rem;
    background: var(--input-bg);
    color: var(--text);
    font: inherit;
}

input[type="checkbox"],
input[type="radio"] {
    width: auto;
    padding: 0;
    margin-right: 0.45rem;
}

input:focus,
textarea:focus,
select:focus {
    outline: 3px solid rgba(111, 84, 255, 0.12);
    border-color: rgba(111, 84, 255, 0.5);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.form-grid__full {
    grid-column: 1 / -1;
}

.flash-stack {
    display: grid;
    gap: 0.75rem;
    width: min(100%, 1100px);
    margin: 0 auto 1rem;
}

.alert {
    padding: 0.95rem 1rem;
    border-radius: 14px;
    font-weight: 600;
}

.alert-success { background: rgba(23, 178, 106, 0.10); color: var(--success); }
.alert-warning { background: rgba(245, 158, 11, 0.12); color: #9a6708; }
.alert-danger { background: rgba(240, 68, 56, 0.10); color: var(--danger); }
.alert-info { background: rgba(37, 99, 255, 0.10); color: var(--primary); }

.topbar {
    padding: 1rem 1.5rem;
}

.topbar--public {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem;
}

.topbar__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.6rem;
    flex-wrap: nowrap;
    margin-left: auto;
}

.topbar__nav-controls,
.topbar__account-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
}

.topbar__nav-controls {
    flex: 0 0 auto;
}

.topbar__account-actions {
    flex: 0 0 auto;
    justify-content: flex-end;
    flex-wrap: nowrap;
}

.topbar__account-actions .btn {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    border-radius: 999px;
    padding-inline: 1.25rem;
}

.topbar-cart-link,
.customer-topbar__cart-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    line-height: 1;
}

.topbar-cart-link {
    min-height: 44px;
    padding-inline: 0.85rem;
}

.topbar-cart-link .customer-topbar__badge,
.customer-topbar__cart-link .customer-topbar__badge {
    margin-left: 0;
}

.topbar-home-link {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    font-weight: 800;
}

.customer-topbar__home {
    flex: 0 0 auto;
}

.auth-home-button {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 20;
    box-shadow: 0 12px 28px rgba(16, 24, 40, 0.1);
}

.brand-link {
    display: flex;
    flex-direction: column;
}

.brand-link__eyebrow {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #8a1cf3;
}

.customer-topbar,
.ops-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 8px 20px rgba(16, 24, 40, 0.03);
    padding: 0.8rem 1.5rem;
    justify-content: space-between;
}

.customer-topbar__brand,
.ops-topbar__user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.customer-topbar__logo,
.sidebar__logo,
.ops-topbar__avatar,
.customer-topbar__avatar {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: var(--gradient);
    color: #fff;
    font-weight: 800;
}

.customer-topbar__nav a {
    padding: 0.75rem 1rem;
    border-radius: 12px;
    color: #465063;
    font-weight: 700;
}

.customer-topbar__nav a.is-active {
    background: var(--gradient);
    color: #fff;
}

.customer-topbar__badge {
    margin-left: 0.35rem;
    background: #ff4d4f;
    color: #fff;
    padding: 0.06rem 0.38rem;
    border-radius: 999px;
    font-size: 0.72rem;
}

.topbar-cart-link__badge {
    min-width: 21px;
    height: 21px;
    padding: 0 0.42rem;
    display: inline-grid;
    place-items: center;
}

.guest-cart {
    position: relative;
    flex: 0 0 auto;
    z-index: 30;
}

.guest-cart__toggle {
    position: relative;
    width: 44px;
    min-width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    color: var(--control-text);
    box-shadow: 0 12px 28px rgba(16, 24, 40, 0.1);
}

.guest-cart__badge {
    position: absolute;
    top: -7px;
    right: -7px;
    margin-left: 0;
    min-width: 22px;
    height: 22px;
    border: 2px solid #fff;
    font-size: 0.72rem;
    line-height: 1;
}

.guest-cart__panel {
    position: absolute;
    top: calc(100% + 0.75rem);
    left: 0;
    width: min(420px, calc(100vw - 2rem));
    max-height: min(76vh, 680px);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: var(--surface);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
}

.guest-cart__panel[hidden],
.guest-cart__scrim[hidden] {
    display: none !important;
}

.guest-cart__header,
.guest-cart__summary,
.guest-cart__actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.guest-cart__header {
    margin-bottom: 0.9rem;
}

.guest-cart__header h2,
.guest-cart__empty h3,
.guest-cart__item h3 {
    margin: 0;
}

.guest-cart__close {
    width: 44px;
    min-width: 44px;
    height: 44px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    color: var(--control-text);
    font-size: 1.5rem;
    line-height: 1;
}

.guest-cart__form,
.guest-cart__items,
.guest-cart__empty {
    display: grid;
    gap: 0.9rem;
}

.guest-cart__empty {
    color: var(--text-muted);
}

.guest-cart__item {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr) auto;
    gap: 0.85rem;
    align-items: center;
    padding: 0.8rem;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface-muted);
}

.guest-cart__item-media {
    width: 72px;
    height: 72px;
    border-radius: 16px;
    background: var(--surface-muted) center/cover no-repeat;
}

.guest-cart__item-main {
    min-width: 0;
}

.guest-cart__item-main h3 {
    font-size: 1rem;
    line-height: 1.25;
}

.guest-cart__item-main small {
    display: block;
    margin-top: 0.15rem;
    color: #667085;
}

.guest-cart__qty {
    display: inline-grid;
    grid-template-columns: 44px minmax(58px, 72px) 44px;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.55rem;
}

.guest-cart__qty button {
    width: 44px;
    min-width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 14px;
    font-size: 1.15rem;
    font-weight: 800;
}

.guest-cart__qty .qty-input {
    max-width: none;
    width: 100%;
}

.guest-cart__item-summary {
    display: grid;
    justify-items: end;
    gap: 0.45rem;
    text-align: right;
}

.guest-cart__item-summary strong {
    color: #101828;
    white-space: nowrap;
}

.guest-cart__summary {
    padding-top: 0.85rem;
    border-top: 1px solid var(--border);
    font-weight: 800;
}

.guest-cart__summary strong {
    color: #101828;
    font-size: 1.25rem;
}

.guest-cart__actions {
    flex-wrap: wrap;
}

@keyframes mobile-drawer-in {
    from {
        opacity: 0.85;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.customer-topbar__user,
.ops-topbar__user {
    margin-left: auto;
}

.customer-topbar__user div,
.ops-topbar__user div {
    display: grid;
    gap: 0.1rem;
    text-align: right;
}

.customer-topbar__user span,
.ops-topbar__user span {
    font-size: 0.82rem;
    color: var(--muted);
}

.customer-topbar__logout {
    color: #ef4444;
    font-weight: 700;
}

.logout-form {
    margin: 0;
    display: inline-flex;
}

.ops-search input {
    width: 320px;
    background: var(--input-bg);
}

.ops-topbar__icon {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--surface);
}

.menu-toggle {
    --menu-bar-color: var(--control-text);
    --menu-bar-width: 22px;
    --menu-bar-height: 3px;
    --menu-bar-gap: 7px;
    --menu-bars-height: 17px;
    position: relative;
    display: none;
    place-items: center;
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    padding: 0;
    appearance: none;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: var(--surface);
    color: var(--control-text);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
    cursor: pointer;
    z-index: 60;
    align-self: center;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.menu-toggle::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: var(--menu-bar-width);
    height: var(--menu-bar-height);
    border-radius: 999px;
    background: var(--menu-bar-color);
    box-shadow:
        0 calc(0px - var(--menu-bar-gap)) 0 var(--menu-bar-color),
        0 var(--menu-bar-gap) 0 var(--menu-bar-color);
    opacity: 1;
    visibility: visible;
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 2;
    display: none;
}

.menu-toggle:hover {
    transform: translateY(-1px);
    border-color: #d8e0ea;
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.11), 0 2px 4px rgba(15, 23, 42, 0.05);
}

.menu-toggle:focus-visible {
    outline: 3px solid rgba(37, 99, 255, 0.18);
    outline-offset: 3px;
}

.menu-toggle__bars {
    position: relative;
    width: var(--menu-bar-width);
    height: var(--menu-bars-height);
    display: block;
    flex: 0 0 auto;
    pointer-events: none;
    color: var(--menu-bar-color);
    z-index: 3;
}

.menu-toggle .menu-toggle__bar {
    position: absolute;
    display: block;
    left: 0;
    top: 50%;
    width: var(--menu-bar-width);
    height: var(--menu-bar-height);
    border-radius: 999px;
    background-color: var(--menu-bar-color);
    opacity: 1;
    visibility: visible;
    transform-origin: center;
    z-index: 3;
    transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.18s ease, background-color 0.18s ease;
    will-change: transform, opacity;
}

.menu-toggle .menu-toggle__bar:nth-child(1) {
    transform: translateY(calc(-50% - var(--menu-bar-gap)));
}

.menu-toggle .menu-toggle__bar:nth-child(2) {
    transform: translateY(-50%);
}

.menu-toggle .menu-toggle__bar:nth-child(3) {
    transform: translateY(calc(-50% + var(--menu-bar-gap)));
}

.menu-toggle.is-open {
    border-color: var(--border);
    background: var(--surface);
    color: var(--control-text);
}

.menu-toggle.is-open .menu-toggle__bar:nth-child(1) {
    transform: translateY(-50%) rotate(45deg);
}

.menu-toggle.is-open .menu-toggle__bar:nth-child(2) {
    opacity: 0;
    transform: translateY(-50%) scaleX(0.25);
}

.menu-toggle.is-open .menu-toggle__bar:nth-child(3) {
    transform: translateY(-50%) rotate(-45deg);
}

.menu-toggle__badge {
    position: absolute;
    top: -7px;
    right: -7px;
    z-index: 6;
    display: inline-grid;
    place-items: center;
    min-width: 20px;
    height: 20px;
    padding: 0 0.38rem;
    border: 2px solid #ffffff;
    border-radius: 999px;
    background: #ef4444;
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(239, 68, 68, 0.28);
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
    pointer-events: none;
}

.menu-toggle__badge[hidden] {
    display: none !important;
}

@keyframes notification-pulse {
    0% {
        opacity: 0.7;
        transform: scale(0.96);
    }

    70% {
        opacity: 0;
        transform: scale(1.12);
    }

    100% {
        opacity: 0;
        transform: scale(1.12);
    }
}

.app-shell {
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr);
    min-height: calc(100vh - 75px);
}

.sidebar {
    background: var(--surface);
    border-right: 1px solid var(--line);
    padding: 1.25rem;
    position: sticky;
    top: 75px;
    height: calc(100vh - 75px);
    max-height: calc(100vh - 75px);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.sidebar__header {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding-bottom: 1.2rem;
    border-bottom: 1px solid var(--line);
    margin-bottom: 1rem;
}

.sidebar__eyebrow {
    display: block;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.7rem;
    margin-bottom: 0.2rem;
}

.sidebar__nav {
    display: grid;
    gap: 0.35rem;
}

.sidebar__link {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.85rem 0.95rem;
    border-radius: 14px;
    color: #4b5567;
    font-weight: 700;
}

.sidebar__link-label {
    min-width: 0;
    flex: 1 1 auto;
}

.sidebar__link.is-active {
    background: var(--gradient);
    color: #fff;
}

.sidebar__dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: currentColor;
    opacity: 0.6;
}

.sidebar__profile {
    display: inline-flex;
    margin-top: 1.2rem;
    padding: 0.85rem 0.95rem;
    border-radius: 14px;
    background: var(--surface-accent);
    color: var(--primary);
    font-weight: 700;
}

.app-main,
.customer-shell,
.landing,
.portal-home {
    padding: 1.5rem;
}

.section {
    max-width: 1240px;
    margin: 0 auto 1.5rem;
}

.section__heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.section__heading h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: 0.3rem;
}

.section__heading p {
    margin-bottom: 0;
}

.summary-grid,
.content-grid,
.catalog-grid,
.portal-choice-grid {
    display: grid;
    gap: 1rem;
}

.summary-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.content-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.catalog-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.summary-card,
.form-card,
.info-card,
.receipt-card,
.portal-choice-card,
.empty-state,
.metric-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-soft);
    padding: 1.35rem;
}

.summary-card strong {
    display: block;
    font-size: 2rem;
    margin-top: 0.55rem;
}

.summary-card span {
    color: var(--muted);
}

.toolbar {
    display: flex;
    gap: 0.85rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.toolbar input,
.toolbar select {
    min-width: 200px;
}

.table-responsive {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 640px;
}

.data-table th,
.data-table td {
    padding: 1rem 0.85rem;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}

.data-table th {
    color: var(--muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.activity-list,
.summary-list,
.portal-choice-card__list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.9rem;
}

.activity-list li,
.summary-list li {
    padding: 0.95rem 1rem;
    border-radius: 14px;
    background: var(--surface-accent);
}

.summary-total,
.cart-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
}

.product-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

.product-card__media {
    min-height: 190px;
    background: var(--surface-accent);
    background-size: cover;
    background-position: center;
}

.product-card__body {
    padding: 1rem;
}

.product-card__body h3 {
    font-size: 1.1rem;
}

.product-card__body strong {
    font-size: 1.8rem;
}

.chip,
.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: max-content;
    max-width: none;
    flex: 0 0 auto;
    border-radius: 999px;
    padding: 0.28rem 0.65rem;
    font-size: 0.74rem;
    font-weight: 700;
    line-height: 1.2;
    vertical-align: middle;
    white-space: nowrap;
    word-break: normal;
    overflow-wrap: normal;
    hyphens: none;
}

.chip {
    background: #eaf1ff;
    color: #4b68d9;
}

.badge-success { background: rgba(23, 178, 106, 0.12); color: var(--success); }
.badge-warning { background: rgba(245, 158, 11, 0.12); color: #9a6708; }
.badge-danger { background: rgba(240, 68, 56, 0.12); color: var(--danger); }
.badge-info { background: rgba(37, 99, 255, 0.10); color: var(--primary); }
.badge-muted { background: rgba(109, 118, 136, 0.12); color: var(--muted); }
.badge-accent { background: rgba(138, 28, 243, 0.12); color: var(--primary-2); }

.order-payment-summary {
    display: grid;
    gap: 0.38rem;
    min-width: 0;
}

.order-payment-summary__line,
.order-payment-summary__detail {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.order-payment-summary__line strong {
    color: inherit;
}

.order-payment-summary__detail {
    color: var(--muted);
    font-size: 0.78rem;
}

.order-payment-summary__detail strong {
    color: inherit;
    overflow-wrap: anywhere;
}

.staff-orders-page {
    --staff-order-card: var(--surface);
    --staff-order-line: var(--line);
    --staff-order-label: #3159a8;
    --staff-order-text: var(--text);
    --staff-order-muted: var(--muted);
    --staff-order-field: var(--surface-soft);
    --staff-order-field-border: var(--line);
    --staff-order-focus: var(--primary);
    --staff-order-update: var(--surface-soft);
    --staff-order-update-padding: 0.95rem;
    --staff-order-purple: #8b5cf6;
    --staff-order-purple-dark: #6d45e8;
    --staff-badge-success-bg: #dcfce7;
    --staff-badge-success-text: #087443;
    --staff-badge-info-bg: #e4ecff;
    --staff-badge-info-text: #3156b8;
    --staff-badge-warning-bg: #fff2cc;
    --staff-badge-warning-text: #8a5700;
    --staff-badge-danger-bg: #ffe1e6;
    --staff-badge-danger-text: #b4233c;
    --staff-badge-muted-bg: #edf1f6;
    --staff-badge-muted-text: #536174;
    --staff-badge-accent-bg: #eee8ff;
    --staff-badge-accent-text: #6842c2;
}

:root[data-theme="dark"] .staff-orders-page {
    --staff-order-card: #151a2c;
    --staff-order-line: #262d42;
    --staff-order-label: #8ba4e8;
    --staff-order-text: #ffffff;
    --staff-order-muted: #9ca7c7;
    --staff-order-field: #0f1425;
    --staff-order-field-border: #293149;
    --staff-order-focus: #4e5f95;
    --staff-order-update: transparent;
    --staff-order-update-padding: 0.95rem 0 0;
    --staff-badge-success-bg: #064d4b;
    --staff-badge-success-text: #24e5a4;
    --staff-badge-info-bg: #232b67;
    --staff-badge-info-text: #7f9cff;
    --staff-badge-warning-bg: #49391e;
    --staff-badge-warning-text: #ffc04d;
    --staff-badge-danger-bg: #4f1f2a;
    --staff-badge-danger-text: #ff768c;
    --staff-badge-muted-bg: #273044;
    --staff-badge-muted-text: #aab4cc;
    --staff-badge-accent-bg: #25215e;
    --staff-badge-accent-text: #a891ff;
}

.staff-orders-page .section {
    max-width: 960px;
}

.staff-order-list {
    display: grid;
    gap: 0.9rem;
    width: min(100%, 720px);
    margin-top: 1rem;
}

.staff-order-card {
    display: grid;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--staff-order-line);
    border-radius: 6px;
    background: var(--staff-order-card);
    color: var(--staff-order-text);
    box-shadow: none;
    transition: background-color var(--theme-transition), border-color var(--theme-transition), color var(--theme-transition);
}

.staff-order-card__header h2 {
    margin: 0 0 0.25rem;
    color: var(--staff-order-text);
    font-size: 0.98rem;
    font-weight: 800;
    letter-spacing: 0;
}

.staff-order-card__header p {
    margin: 0;
    color: var(--staff-order-muted);
    font-size: 0.9rem;
    line-height: 1.25;
}

.staff-order-card__status-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 1.3rem;
    row-gap: 0.95rem;
}

.staff-order-card__status,
.staff-order-card__update {
    display: grid;
    gap: 0.45rem;
    min-width: 0;
}

.staff-order-card__status > span:first-child,
.staff-order-card__update h3 {
    margin: 0;
    color: var(--staff-order-label);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    line-height: 1.15;
    text-transform: uppercase;
}

.staff-order-card .badge {
    width: max-content;
    min-height: 27px;
    padding: 0.36rem 0.78rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
}

.staff-order-card .badge-success {
    background: var(--staff-badge-success-bg);
    color: var(--staff-badge-success-text);
}

.staff-order-card .badge-info {
    background: var(--staff-badge-info-bg);
    color: var(--staff-badge-info-text);
}

.staff-order-card .badge-warning {
    background: var(--staff-badge-warning-bg);
    color: var(--staff-badge-warning-text);
}

.staff-order-card .badge-danger {
    background: var(--staff-badge-danger-bg);
    color: var(--staff-badge-danger-text);
}

.staff-order-card .badge-muted {
    background: var(--staff-badge-muted-bg);
    color: var(--staff-badge-muted-text);
}

.staff-order-card .badge-accent {
    background: var(--staff-badge-accent-bg);
    color: var(--staff-badge-accent-text);
}

.staff-order-card__updates {
    display: grid;
    gap: 0.95rem;
    padding: var(--staff-order-update-padding);
    border-top: 1px solid var(--staff-order-line);
    border-radius: 7px;
    background: var(--staff-order-update);
    transition: background-color var(--theme-transition), border-color var(--theme-transition);
}

.staff-order-card__form,
.staff-order-card__form-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(108px, 124px);
    align-items: stretch;
    gap: 0.75rem;
}

.staff-order-card__form--stacked {
    grid-template-columns: 1fr;
    align-items: stretch;
}

.staff-order-card__form--stacked .staff-order-card__form-row {
    width: 100%;
}

.staff-order-card select,
.staff-order-card input[type="text"],
.staff-order-card input[type="file"] {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    border: 1px solid var(--staff-order-field-border);
    border-radius: 9px;
    background-color: var(--staff-order-field);
    color: var(--staff-order-text);
    font-weight: 800;
}

.staff-order-card input[type="file"]::file-selector-button {
    margin-right: 0.6rem;
    border: 1px solid var(--staff-order-field-border);
    border-radius: 5px;
    background: var(--staff-order-card);
    color: var(--staff-order-text);
    font: inherit;
    cursor: pointer;
}

.staff-order-card select,
.staff-order-card input[type="text"] {
    padding: 0.55rem 0.75rem;
}

.staff-order-card input[type="file"] {
    padding: 0.45rem 0.55rem;
    color: var(--staff-order-muted);
}

.staff-order-card select option {
    background: var(--staff-order-field);
    color: var(--staff-order-text);
}

.staff-order-card select:focus,
.staff-order-card input:focus {
    border-color: var(--staff-order-focus);
    outline: 2px solid rgba(139, 92, 246, 0.22);
}

.staff-order-card .btn {
    display: inline-flex;
    width: 100%;
    min-width: 108px;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 1.15rem;
    border: 0;
    border-radius: 9px;
    background: linear-gradient(180deg, var(--staff-order-purple), var(--staff-order-purple-dark));
    color: #fff;
    font-size: 0.86rem;
    font-weight: 800;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    box-shadow: 0 5px 12px rgba(109, 69, 232, 0.2);
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.staff-order-card .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(109, 69, 232, 0.28);
    filter: brightness(1.04);
}

.staff-order-card .btn:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 3px 8px rgba(109, 69, 232, 0.22);
}

.staff-order-card .btn:focus-visible {
    outline: 3px solid rgba(139, 92, 246, 0.28);
    outline-offset: 2px;
}

.staff-order-card--empty h2 {
    margin: 0;
    color: var(--staff-order-text);
    font-size: 1rem;
}

.qty-input {
    max-width: 90px;
}

.stack-form {
    display: grid;
    gap: 0.5rem;
}

.receipt-card__header {
    justify-content: space-between;
}

.receipt-meta {
    padding: 1rem 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.empty-state {
    text-align: center;
}

.narrow-section {
    max-width: 760px;
}

.token-preview {
    padding: 1rem;
    background: #edf4ff;
    border-radius: 14px;
}

code {
    padding: 0.2rem 0.45rem;
    border-radius: 8px;
    background: #eef2ff;
}

.portal-home {
    position: relative;
    min-height: 100vh;
    min-height: 100svh;
    display: grid;
    place-items: center;
    overflow: hidden;
    padding: clamp(1rem, 3vw, 2rem);
}

.portal-home__wrap {
    position: relative;
    z-index: 2;
    width: min(100%, 760px);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.portal-brand {
    text-align: center;
    max-width: 560px;
    margin: 0 auto 2.5rem;
}

.portal-brand__logo {
    width: 104px;
    height: 104px;
    margin: 0 auto 1.6rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 18px 40px rgba(29, 7, 89, 0.26);
    display: grid;
    place-items: center;
    overflow: hidden;
}

.portal-brand__logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.portal-brand h1 {
    font-size: clamp(2.7rem, 5vw, 3.8rem);
    color: #fff;
    font-family: "DM Sans", "Segoe UI", sans-serif;
    font-weight: 800;
    margin-bottom: 0;
    line-height: 1.08;
    text-shadow: 0 10px 28px rgba(21, 11, 66, 0.22);
}

.portal-brand p {
    color: rgba(255, 255, 255, 0.82);
    font-size: 1.05rem;
}

.portal-choice-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.portal-choice-grid--two {
    width: min(100%, 620px);
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: center;
    max-width: 620px;
    margin: 0 auto;
    gap: 0.9rem;
}

.portal-choice-card {
    background: linear-gradient(180deg, rgba(255,255,255,0.14), rgba(255,255,255,0.08));
    border: 1px solid rgba(255,255,255,0.14);
    backdrop-filter: blur(18px);
    color: #fff;
    min-height: 296px;
    min-width: 0;
    padding: 1rem 1rem 1.1rem;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    border-radius: 18px;
    box-shadow: 0 20px 44px rgba(20, 8, 71, 0.14);
}

.portal-choice-card h2 {
    text-align: center;
    font-size: 0.98rem;
    margin-top: 0.2rem;
    margin-bottom: 0.45rem;
    line-height: 1.18;
}

.portal-choice-card p {
    text-align: center;
    color: rgba(255,255,255,0.85);
    min-height: 50px;
    max-width: 200px;
    margin: 0 auto 0.8rem;
    font-size: 0.8rem;
    line-height: 1.45;
}

.portal-choice-card__icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    margin: 0 auto 0.85rem;
    background:
        radial-gradient(circle at 32% 28%, rgba(120, 172, 255, 0.38), transparent 40%),
        linear-gradient(180deg, rgba(73, 127, 255, 0.92), rgba(161, 54, 255, 0.92));
    display: grid;
    place-items: center;
    box-shadow: 0 14px 24px rgba(30, 12, 84, 0.24);
    font-weight: 800;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.portal-choice-card__icon--bag span {
    position: relative;
    width: 18px;
    height: 15px;
    border: 2px solid rgba(255, 255, 255, 0.98);
    border-radius: 5px;
    display: block;
}

.portal-choice-card__icon--bag span::before {
    content: "";
    position: absolute;
    left: 50%;
    top: -8px;
    width: 9px;
    height: 6px;
    transform: translateX(-50%);
    border: 2px solid rgba(255, 255, 255, 0.98);
    border-bottom: 0;
    border-radius: 10px 10px 0 0;
}

.portal-choice-card__icon--grid {
    grid-template-columns: repeat(2, 8px);
    grid-template-rows: repeat(2, 8px);
    gap: 5px;
}

.portal-choice-card__icon--grid span {
    width: 8px;
    height: 8px;
    border: 2px solid rgba(255, 255, 255, 0.98);
    border-radius: 3px;
    display: block;
}

.portal-choice-card__list li {
    position: relative;
    padding-left: 1.4rem;
    color: rgba(255,255,255,0.88);
    font-size: 0.8rem;
    line-height: 1.45;
}

.portal-choice-card__list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    top: 0.02rem;
    width: 1.15rem;
    height: 1.15rem;
    border-radius: 50%;
    background: rgba(80, 255, 171, 0.16);
    border: 1px solid rgba(80, 255, 171, 0.42);
    color: #7bf8c2;
    display: grid;
    place-items: center;
    font-size: 0.72rem;
    font-weight: 800;
}

.portal-link-button {
    width: auto;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 0.4rem;
    padding: 0.65rem 0;
    border-radius: 0;
    font-weight: 800;
    background: transparent;
}

.portal-choice-card__list li::before {
    content: "\2713";
}

.portal-link-button {
    padding: 0.35rem 0;
    color: #fff;
    font-size: 1rem;
}

.portal-link-button span {
    font-size: 1.18rem;
    line-height: 1;
}

.portal-choice-card__actions {
    justify-content: center;
    margin-top: auto;
    padding-top: 0.65rem;
}

.portal-home__ambient,
.portal-home__ring,
.portal-home__line {
    position: absolute;
    pointer-events: none;
}

.portal-home__ambient {
    width: 20rem;
    height: 20rem;
    border-radius: 50%;
    filter: blur(42px);
    opacity: 0.28;
}

.portal-home__ambient--left {
    top: 8%;
    left: -4%;
    background: #70a4ff;
}

.portal-home__ambient--right {
    right: -6%;
    bottom: 6%;
    background: #da5fff;
}

.portal-home__ring {
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.12);
}

.portal-home__ring--one {
    width: 78px;
    height: 78px;
    left: 14%;
    top: 22%;
}

.portal-home__ring--two {
    width: 32px;
    height: 32px;
    right: 34%;
    top: 17%;
}

.portal-home__line {
    width: 3px;
    background: linear-gradient(180deg, rgba(255,255,255,0), rgba(255,255,255,0.26), rgba(255,255,255,0));
    border-radius: 999px;
    opacity: 0.45;
}

.portal-home__line--one {
    height: 140px;
    right: 20%;
    top: 33%;
    transform: rotate(7deg);
}

.portal-home__line--two {
    height: 120px;
    left: 20%;
    bottom: 18%;
    transform: rotate(78deg);
}

.page-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: var(--shadow-soft);
    padding: 1.25rem;
}

.page-panel--spaced {
    margin-top: 1rem;
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.inline-form {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.inline-form .btn {
    white-space: nowrap;
}

.inline-form select {
    width: auto;
    min-width: 150px;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.metric-box {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: var(--shadow-soft);
    padding: 1.25rem;
}

.metric-box__icon {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 800;
    margin-bottom: 0.85rem;
}

.metric-box__icon.blue { background: #2f6dfc; }
.metric-box__icon.green { background: #17b26a; }
.metric-box__icon.purple { background: #8a1cf3; }
.metric-box__icon.orange { background: #f97316; }
.metric-box__icon.red { background: #f04438; }

.metric-box strong {
    display: block;
    font-size: 2rem;
}

/* Design alignment overrides */
.guest-body:not(.landing-portal-body),
.customer-body {
    background: var(--bg);
}

.auth-page {
    background: var(--bg);
}

.auth-page__inner {
    width: min(100%, 445px);
}

.auth-card {
    padding: 2.15rem 2rem 1.85rem;
    border-radius: 28px;
    box-shadow: 0 26px 60px rgba(20, 28, 45, 0.12);
}

.auth-card h1 {
    font-size: clamp(2.2rem, 4vw, 3rem);
    margin-bottom: 0.55rem;
}

.auth-card p {
    color: #667085;
    font-size: 1.02rem;
}

.auth-card form {
    gap: 1.1rem;
}

.auth-card__row {
    justify-content: space-between;
    width: 100%;
}

.auth-card--dashboard-login {
    text-align: center;
}

.auth-card--dashboard-login .auth-card__logo {
    width: 112px;
    height: 112px;
    margin: 0 auto 1.25rem;
    padding: 0.4rem;
    border-radius: 22px;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: 0 18px 42px rgba(26, 38, 62, 0.12);
}

.auth-card--dashboard-login .auth-card__logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.auth-card--dashboard-login h2 {
    max-width: 24ch;
    margin: 0 auto 0.65rem;
    color: var(--text);
    font-size: 1.55rem;
    line-height: 1.22;
}

.auth-card--dashboard-login > p {
    max-width: 34ch;
    margin: 0 auto 1.4rem;
}

.auth-card--dashboard-login form {
    text-align: left;
}

@media (max-width: 560px) {
    .auth-card--dashboard-login .auth-card__logo {
        width: 96px;
        height: 96px;
        margin-bottom: 1rem;
        border-radius: 20px;
    }

    .auth-card--dashboard-login h2 {
        max-width: 22ch;
        font-size: 1.42rem;
    }

    .auth-card--dashboard-login > p {
        max-width: 29ch;
        font-size: 0.95rem;
    }
}

.auth-divider {
    margin: 1.15rem 0 0.7rem;
}

input,
textarea,
select {
    border-radius: 15px;
    border-color: #d9e0ea;
    min-height: 54px;
    padding: 0.95rem 1rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

textarea {
    min-height: 120px;
}

.btn {
    border-radius: 14px;
}

.btn-primary {
    background: linear-gradient(90deg, #2563ff 0%, #8b1df5 100%);
    box-shadow: none;
}

.btn-secondary,
.btn-ghost {
    background: var(--surface);
}

.customer-topbar,
.ops-topbar {
    min-height: 74px;
    padding: 0.75rem 1.45rem;
    background: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.03);
    backdrop-filter: blur(16px);
}

.customer-topbar__brand,
.ops-topbar__left,
.ops-topbar__right,
.ops-topbar__user {
    gap: 0.9rem;
}

.customer-topbar__brand strong {
    font-size: 1.45rem;
}

.customer-topbar__logo,
.sidebar__logo,
.ops-topbar__avatar,
.customer-topbar__avatar {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 22px rgba(64, 63, 216, 0.16);
}

.customer-topbar__nav {
    gap: 0.6rem;
}

.customer-topbar__nav a {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: 0.7rem 1rem;
    border: 1px solid transparent;
}

.customer-topbar__nav a.is-active {
    box-shadow: 0 12px 24px rgba(99, 102, 241, 0.2);
}

.customer-topbar__user,
.ops-topbar__user {
    gap: 0.8rem;
}

.customer-topbar__logout,
.ops-topbar__logout {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    border: 1px solid #ffd9da;
    background: var(--surface);
    color: #ef4444;
    font-size: 1.1rem;
    cursor: pointer;
}

.ops-search input {
    width: 280px;
    min-height: 46px;
    border-radius: 14px;
    background: var(--input-bg);
}

.ops-topbar__icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    color: #344054;
}

.menu-toggle {
    display: inline-grid;
    place-items: center;
    color: #344054;
}

.app-shell {
    display: block;
    min-height: calc(100vh - 74px);
}

.sidebar {
    position: fixed;
    inset: 74px auto 0 0;
    width: min(82vw, 286px);
    height: calc(100vh - 74px);
    height: calc(100dvh - 74px);
    max-height: calc(100vh - 74px);
    max-height: calc(100dvh - 74px);
    padding: 1.3rem;
    border-right: 0;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.16);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    transform: translateX(-110%);
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.22s ease;
    z-index: 45;
}

.sidebar.is-open {
    transform: translateX(0);
}

body.sidebar-open {
    overflow-x: hidden;
}

.app-main,
.customer-shell {
    padding: 1.7rem 1.5rem 2rem;
}

.section {
    max-width: 1280px;
    margin: 0 auto 1.65rem;
}

.section__heading {
    margin-bottom: 1.3rem;
}

.section__heading h1 {
    font-size: clamp(2.15rem, 4vw, 3.2rem);
    margin-bottom: 0.35rem;
}

.section__heading p {
    color: #667085;
}

.page-panel,
.form-card,
.info-card,
.receipt-card,
.metric-box,
.empty-state {
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

.page-panel,
.receipt-card {
    padding: 1.5rem;
}

.form-card,
.info-card {
    padding: 1.35rem;
}

.metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
}

.metric-box {
    min-height: 132px;
    padding: 1.35rem 1.45rem;
}

.metric-box__icon {
    width: 58px;
    height: 58px;
    border-radius: 16px;
    margin-bottom: 0.9rem;
    font-size: 1.6rem;
}

.metric-box strong {
    font-size: 2.15rem;
    line-height: 1;
}

.metric-box span {
    display: block;
    margin-top: 0.4rem;
    color: #667085;
    font-size: 1rem;
}

.toolbar {
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.toolbar input,
.toolbar select {
    min-width: 220px;
}

.data-table th,
.data-table td {
    padding: 1rem 0.95rem;
}

.data-table tbody tr:hover {
    background: var(--surface-accent);
}

.activity-list li,
.summary-list li {
    background: var(--surface-accent);
    border: 1px solid var(--border);
}

.summary-total {
    font-size: 1.05rem;
}

.catalog-layout {
    grid-template-columns: 290px minmax(0, 1fr);
    align-items: start;
}

.catalog-filter-panel {
    margin-bottom: 1.15rem;
    padding: 1rem;
}

.catalog-filter {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    gap: 0.75rem;
    margin: 0;
}

.catalog-filter input,
.catalog-filter select,
.catalog-filter .btn {
    width: 100%;
    min-width: 0;
    min-height: 48px;
    border-radius: 12px;
    font-size: 0.95rem;
    line-height: 1.2;
}

.catalog-filter input,
.catalog-filter select {
    padding: 0.78rem 0.95rem;
    border-color: #d8deea;
    background-color: #fff;
}

.catalog-filter .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.78rem 1rem;
    white-space: nowrap;
}

.catalog-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.1rem;
}

.product-card {
    border-radius: 22px;
}

.product-card__media {
    min-height: 165px;
    background-color: var(--surface-accent);
}

.product-card__body {
    padding: 1.1rem;
}

.product-card__body h3 {
    margin-bottom: 0.35rem;
}

.product-card__body strong {
    font-size: 1.6rem;
}

.cart-stack,
.checkout-stack,
.payment-stack {
    display: grid;
    gap: 1rem;
}

.cart-items {
    display: grid;
    gap: 1rem;
}

.cart-item {
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr) auto;
    gap: 1.2rem;
    align-items: center;
    padding: 1rem 1.15rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 22px;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.05);
}

.cart-item__media {
    width: 92px;
    height: 92px;
    border-radius: 18px;
    background: var(--surface-accent) center/cover no-repeat;
}

.cart-item__details h3 {
    margin-bottom: 0.35rem;
    font-size: 1.7rem;
}

.cart-item__controls {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.9rem;
}

.cart-item__controls label {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    color: #667085;
}

.qty-input {
    max-width: 88px;
    min-height: 44px;
    text-align: center;
}

.cart-item__summary {
    text-align: right;
}

.cart-item__summary strong {
    display: block;
    font-size: 2rem;
    line-height: 1.1;
    color: #101828;
}

.cart-item__summary small {
    display: block;
    margin-bottom: 0.35rem;
    color: #667085;
}

.cart-summary-panel,
.checkout-summary,
.payment-summary {
    max-width: 860px;
}

.checkout-section,
.payment-section {
    display: grid;
    gap: 1rem;
}

.checkout-stack > .page-panel,
.payment-stack > .page-panel {
    max-width: 980px;
}

.payment-method-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.payment-method-tile {
    display: grid;
    place-items: center;
    min-height: 116px;
    border: 2px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
    text-align: center;
    gap: 0.45rem;
    font-weight: 800;
    color: var(--text);
}

.payment-method-tile strong {
    font-size: 1.9rem;
}

.payment-method-tile span {
    font-size: 0.95rem;
    color: #667085;
}

.section__actions {
    gap: 0.85rem;
}

.confirmation-hero {
    padding: 1.7rem 1.5rem;
    border-radius: 20px;
    background: linear-gradient(135deg, #16c45a 0%, #08a36d 100%);
    color: #fff;
    text-align: center;
    box-shadow: 0 18px 34px rgba(20, 150, 85, 0.22);
}

.confirmation-hero p,
.confirmation-hero strong {
    color: rgba(255, 255, 255, 0.92);
}

.receipt-card__header {
    margin: -1.5rem -1.5rem 1.4rem;
    padding: 1.45rem 1.5rem;
    background: linear-gradient(90deg, #2563ff 0%, #8b1df5 100%);
    color: #fff;
    border-radius: 24px 24px 0 0;
}

.receipt-card__header p,
.receipt-card__header strong {
    color: rgba(255, 255, 255, 0.95);
}

.receipt-card .content-grid {
    align-items: start;
}

.receipt-note {
    background: var(--surface-accent);
}

/* Landing page polish overrides */
.portal-home__wrap {
    width: min(100%, 780px);
    display: grid;
    gap: clamp(1.4rem, 2.5vw, 2.2rem);
    justify-items: center;
}

.portal-brand {
    margin: 0;
}

.portal-brand__logo {
    width: clamp(92px, 11vw, 104px);
    height: clamp(92px, 11vw, 104px);
    margin-bottom: 1.4rem;
}

.portal-brand h1 {
    font-size: clamp(2.2rem, 6vw, 3.8rem);
    text-wrap: balance;
}

.portal-choice-grid--two {
    width: min(100%, 680px);
    max-width: 680px;
    grid-template-columns: repeat(2, minmax(250px, 1fr));
    gap: clamp(0.9rem, 2vw, 1.1rem);
}

.portal-choice-card {
    min-height: 300px;
    padding: 1.15rem 1.05rem 1.15rem;
}

.portal-choice-card h2 {
    font-size: 1rem;
    text-wrap: balance;
}

.portal-choice-card p {
    min-height: 3.6em;
}

.portal-choice-card__list li::before {
    content: "\2713";
    width: 1rem;
    height: 1rem;
    font-size: 0.65rem;
}

.portal-link-button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 0.35rem;
    min-width: 138px;
    padding: 0.72rem 1rem;
    border-radius: 12px;
    color: #fff;
    font-size: 0.85rem;
    background: linear-gradient(90deg, #2a72f4 0%, #b31ff2 100%);
    box-shadow: 0 14px 30px rgba(41, 67, 232, 0.22);
}

.portal-link-button span {
    font-size: 1rem;
}

.portal-choice-card__actions {
    padding-top: 0.8rem;
}

.portal-home__ambient,
.portal-home__ring,
.portal-home__line {
    pointer-events: none;
}

@media (max-width: 1100px) {
    .portal-choice-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .portal-home__wrap {
        width: min(100%, 620px);
    }

    .portal-choice-grid--two {
        width: min(100%, 540px);
        grid-template-columns: repeat(2, minmax(220px, 1fr));
    }

    .portal-home__line--one {
        right: 12%;
    }

    .portal-home__line--two {
        left: 12%;
    }
}

@media (max-width: 980px) {
    .app-shell,
    .content-grid {
        grid-template-columns: 1fr;
    }

    .metric-grid,
    .catalog-layout {
        grid-template-columns: 1fr;
    }

    .catalog-filter {
        grid-template-columns: 1fr;
    }

    .menu-toggle {
        display: inline-grid;
        place-items: center;
    }

    .sidebar {
        position: fixed;
        inset: 74px auto 0 0;
        width: min(84vw, 280px);
        max-height: calc(100vh - 74px);
        max-height: calc(100dvh - 74px);
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        transform: translateX(-105%);
    }

    .sidebar.is-open {
        transform: translateX(0);
    }

    .ops-search input {
        width: 100%;
        min-width: 180px;
    }
}

@media (max-width: 760px) {
    .customer-topbar,
    .ops-topbar,
    .customer-shell,
    .portal-home,
    .app-main {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .customer-topbar {
        gap: 1rem;
    }

    .customer-topbar__nav {
        width: 100%;
        order: 3;
        justify-content: space-between;
    }

    .portal-choice-grid,
    .portal-choice-grid--two,
    .form-grid,
    .summary-grid {
        grid-template-columns: 1fr;
    }

    .auth-card {
        padding: 1.5rem;
    }

    .auth-home-button {
        top: 0.75rem;
        right: 0.75rem;
    }

    .portal-home {
        padding-top: 2rem;
        padding-bottom: 2rem;
    }

    .portal-brand {
        max-width: 320px;
    }

    .portal-brand__logo {
        width: 96px;
        height: 96px;
    }

    .portal-brand h1 {
        font-size: clamp(2rem, 10vw, 2.8rem);
    }

    .portal-choice-grid--two {
        width: min(100%, 360px);
        max-width: 360px;
    }

    .portal-choice-card {
        min-height: auto;
        padding: 1.3rem 1.15rem;
    }

    .portal-choice-card p {
        min-height: 0;
    }

    .portal-link-button {
        width: 100%;
    }

    .customer-topbar__nav,
    .payment-method-grid,
    .metric-grid {
        grid-template-columns: 1fr;
    }

    .cart-item {
        grid-template-columns: 1fr;
        text-align: left;
    }

    .cart-item__media {
        width: 100%;
        height: 150px;
    }

    .cart-item__summary {
        text-align: left;
    }

    .data-table {
        min-width: 560px;
    }
}

@media (max-width: 520px) {
    .portal-home__ambient {
        width: 14rem;
        height: 14rem;
        opacity: 0.2;
    }

    .portal-home__ring,
    .portal-home__line {
        display: none;
    }

    .portal-home__wrap {
        gap: 1.2rem;
    }

    .portal-brand__logo {
        width: 84px;
        height: 84px;
        margin-bottom: 1.1rem;
    }

    .portal-choice-grid--two {
        width: 100%;
        max-width: 100%;
    }

    .portal-choice-card {
        border-radius: 16px;
    }
}

/* Responsive compatibility pass */
html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

body,
.app-shell,
.app-main,
.customer-shell,
.section,
.page-panel,
.form-card,
.info-card,
.receipt-card,
.metric-box,
.product-card,
.cart-item {
    min-width: 0;
}

img,
video,
canvas,
iframe {
    max-width: 100%;
}

.btn,
.portal-link-button,
.customer-topbar__nav a,
.sidebar__link {
    min-width: 0;
    overflow-wrap: anywhere;
    white-space: normal;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    text-align: center;
}

.table-responsive {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-responsive .data-table {
    min-width: 720px;
}

.summary-list li {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.summary-list li span,
.summary-list li strong,
.activity-list li,
.empty-state p,
.portal-choice-card h2,
.portal-choice-card p,
.product-card__body p,
.cart-item__details,
.cart-item__summary,
.receipt-card,
.info-card,
.form-card {
    min-width: 0;
    overflow-wrap: anywhere;
}

.cart-summary-panel,
.checkout-summary,
.payment-summary,
.checkout-stack > .page-panel,
.payment-stack > .page-panel {
    width: 100%;
}

.product-card__footer {
    align-items: flex-end;
    justify-content: space-between;
}

.product-card__footer .inline-form {
    flex: 1 1 auto;
    justify-content: flex-end;
}

.cart-item__summary .btn,
.table-actions .btn,
.inline-form .btn {
    flex-shrink: 0;
}

@media (max-width: 1180px) {
    .customer-topbar {
        align-items: flex-start;
    }

    .customer-topbar__brand,
    .customer-topbar__user {
        flex: 1 1 auto;
    }

    .customer-topbar__user {
        justify-content: flex-end;
        margin-left: 0;
    }

    .customer-topbar__nav {
        order: 3;
        width: 100%;
        flex: 1 0 100%;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
        gap: 0.55rem;
    }

    .customer-topbar__nav a {
        justify-content: center;
        text-align: center;
    }

    .ops-topbar {
        align-items: flex-start;
    }

    .ops-topbar__left,
    .ops-topbar__right {
        min-width: 0;
    }

    .ops-search {
        flex: 1 1 220px;
        min-width: 0;
    }

    .ops-search input {
        width: 100%;
    }
}

@media (max-width: 900px) {
    .topbar--public {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .topbar__brand {
        width: 100%;
    }

    .topbar__actions {
        width: 100%;
        align-self: stretch;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        gap: 0.55rem;
        flex-wrap: wrap;
        overflow-x: visible;
    }

    .topbar__account-actions {
        flex: 0 0 auto;
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .topbar__account-actions .btn {
        width: auto;
    }

    .section__heading {
        flex-direction: column;
        align-items: stretch;
    }

    .section__heading > .btn,
    .section__heading > a.btn,
    .section__heading .auth-link {
        align-self: flex-start;
    }

    .toolbar {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
        align-items: stretch;
    }

    .catalog-filter {
        grid-template-columns: 1fr;
    }

    .toolbar input,
    .toolbar select,
    .toolbar .btn,
    .toolbar button,
    .toolbar a {
        width: 100%;
        min-width: 0;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .form-grid > * {
        grid-column: 1 / -1;
    }

    .cart-item {
        grid-template-columns: 96px minmax(0, 1fr);
        align-items: start;
    }

    .cart-item__summary {
        grid-column: 1 / -1;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        text-align: left;
    }
}

@media (max-width: 760px) {
    .customer-topbar__brand strong {
        font-size: 1.2rem;
    }

    .customer-topbar__user,
    .ops-topbar__user {
        gap: 0.55rem;
    }

    .customer-topbar__user div,
    .ops-topbar__user div {
        max-width: min(58vw, 260px);
        text-align: left;
    }

    .customer-topbar__user span,
    .ops-topbar__user span {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .section__actions,
    .receipt-card__header,
    .cart-summary,
    .summary-total {
        align-items: stretch;
    }

    .section__actions .btn,
    .section__actions form,
    .section__actions .inline-form {
        width: 100%;
    }

    .section__actions .btn,
    .section__actions button {
        min-height: 46px;
    }

    .payment-method-grid,
    .content-grid,
    .summary-grid,
    .metric-grid,
    .catalog-grid,
    .portal-choice-grid,
    .portal-choice-grid--two {
        grid-template-columns: 1fr;
    }

    .page-panel,
    .form-card,
    .info-card,
    .receipt-card,
    .metric-box,
    .empty-state {
        padding: 1rem;
    }

    .receipt-card__header {
        margin: -1rem -1rem 1rem;
        padding: 1rem;
    }

    .checkout-section,
    .payment-section {
        gap: 0.85rem;
    }

    .table-actions,
    .inline-form {
        align-items: stretch;
    }

    .table-actions .btn,
    .table-actions .inline-form,
    .inline-form select,
    .inline-form input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]) {
        width: 100%;
        min-width: 0;
    }

    .table-responsive .data-table {
        min-width: 620px;
    }
}

@media (max-width: 560px) {
    .customer-shell,
    .app-main,
    .portal-home {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .topbar--public {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .customer-topbar__nav {
        grid-template-columns: 1fr;
    }

    .topbar__actions {
        width: 100%;
        align-self: stretch;
        justify-content: flex-start;
        gap: 0.45rem;
        flex-wrap: wrap;
        overflow-x: visible;
    }

    .topbar__account-actions {
        width: auto;
        display: inline-flex;
        grid-template-columns: none;
        gap: 0.45rem;
        flex: 0 0 auto;
        flex-wrap: wrap;
    }

    .topbar__account-actions .btn {
        width: auto;
        min-width: 0;
        padding-inline: 0.72rem;
    }

    .portal-home__wrap,
    .portal-choice-grid--two {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .portal-brand {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .portal-choice-card {
        width: 100%;
    }

    .topbar__actions,
    .page-panel,
    .form-card,
    .info-card,
    .receipt-card,
    .empty-state,
    .product-card,
    .cart-item {
        width: calc(100vw - 2rem) !important;
        max-width: calc(100vw - 2rem) !important;
        margin-left: auto;
        margin-right: auto;
    }

    .portal-choice-card h2 {
        max-width: 22ch;
        margin-left: auto;
        margin-right: auto;
        font-size: 0.95rem;
    }

    .empty-state p {
        max-width: 30ch;
        margin-left: auto;
        margin-right: auto;
    }

    .btn,
    .portal-link-button {
        min-height: 44px;
    }

    .auth-page {
        padding: 1rem 0.85rem;
    }

    .auth-page__inner,
    .auth-card {
        width: calc(100vw - 2rem) !important;
        max-width: calc(100vw - 2rem) !important;
        margin-left: auto;
        margin-right: auto;
    }

    .auth-card {
        padding: 1.2rem;
        border-radius: 20px;
    }

    .auth-card__row,
    .auth-links {
        flex-direction: column;
        align-items: stretch;
    }

    .auth-card__row .auth-link,
    .auth-links a,
    .auth-footer {
        max-width: 100%;
        overflow-wrap: anywhere;
        text-align: center;
    }

    .auth-footer p {
        display: grid;
        justify-items: center;
        gap: 0.25rem;
    }

    .auth-back {
        justify-content: center;
    }

    .auth-card .btn {
        width: 100%;
    }

    .toolbar {
        grid-template-columns: 1fr;
    }

    .product-card__footer {
        flex-direction: column;
        align-items: stretch;
    }

    .product-card__footer > strong {
        width: 100%;
    }

    .product-card__footer .inline-form {
        width: 100%;
        display: grid;
        grid-template-columns: minmax(72px, 92px) minmax(0, 1fr);
    }

    .product-card__footer .qty-input {
        max-width: none;
        width: 100%;
    }

    .cart-item {
        gap: 0.85rem;
        padding: 0.85rem;
    }

    .cart-item__details h3 {
        font-size: 1.35rem;
    }

    .cart-item__controls,
    .cart-item__controls label,
    .cart-item__summary {
        width: 100%;
    }

    .cart-item__controls label,
    .cart-item__summary {
        display: grid;
        grid-template-columns: 1fr;
        justify-items: stretch;
    }

    .cart-item__summary strong {
        font-size: 1.6rem;
    }

    .summary-list li,
    .summary-total,
    .cart-summary {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.3rem;
    }
}

@media (max-width: 420px) {
    .customer-topbar,
    .ops-topbar,
    .topbar {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .customer-topbar__brand,
    .ops-topbar__left,
    .ops-topbar__right {
        width: 100%;
    }

    .customer-topbar__user,
    .ops-topbar__user {
        width: 100%;
        justify-content: space-between;
    }

    .customer-topbar__home {
        flex: 0 0 44px;
        width: 44px;
    }

    .customer-topbar__user div,
    .ops-topbar__user div {
        max-width: calc(100vw - 135px);
    }

    .section__heading h1 {
        font-size: clamp(1.65rem, 9vw, 2.15rem);
    }

    .product-card__media,
    .cart-item__media {
        min-height: 132px;
        height: 132px;
    }

    .payment-method-tile {
        min-height: 92px;
    }

    .payment-method-tile strong {
        font-size: 1.45rem;
    }
}

.product-card__detail-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.product-card__detail-link:hover h3,
.product-card__detail-link:focus-visible h3 {
    color: var(--primary);
}

.product-card__detail-link:focus-visible {
    outline: 3px solid rgba(111, 84, 255, 0.18);
    outline-offset: -4px;
    border-radius: 18px;
}

.product-card__media {
    min-height: 0;
    height: auto;
    aspect-ratio: 4 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    background: var(--surface-accent);
    background-image: none !important;
    overflow: hidden;
}

.product-card__media img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    border-radius: 14px;
}

.product-card__media.is-missing-image,
.portal-product-card__media.is-missing-image,
.product-detail-dialog__media.is-missing-image {
    position: relative;
}

.product-card__media.is-missing-image::after,
.portal-product-card__media.is-missing-image::after,
.product-detail-dialog__media.is-missing-image::after {
    content: "Image unavailable";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: min(100%, 14rem);
    min-height: 3rem;
    padding: 0.75rem 1rem;
    border: 1px dashed rgba(100, 116, 139, 0.34);
    border-radius: 14px;
    color: #64748b;
    background: rgba(255, 255, 255, 0.64);
    font-size: 0.86rem;
    font-weight: 800;
    text-align: center;
}

.product-card__footer {
    padding: 0 1.1rem 1.1rem;
}

.product-card__footer > strong {
    font-size: 1.45rem;
}

.product-detail-dialog {
    width: min(920px, calc(100vw - 2rem));
    padding: 0;
    border: 0;
    border-radius: 24px;
    background: transparent;
    color: var(--text);
}

.product-detail-dialog::backdrop {
    background: rgba(15, 23, 42, 0.58);
}

.product-detail-dialog__card {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
    gap: 1.25rem;
    padding: 1rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 24px;
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.24);
}

.product-detail-dialog__media {
    min-height: 340px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    border-radius: 20px;
    background: var(--surface-accent);
}

.product-detail-dialog__media img {
    width: 100%;
    height: 100%;
    max-height: 440px;
    object-fit: contain;
    display: block;
    border-radius: 16px;
}

.product-detail-dialog__content {
    display: grid;
    align-content: center;
    gap: 0.85rem;
    padding: 1.25rem 1rem 1.25rem 0;
}

.product-detail-dialog__content h2 {
    margin: 0;
    font-size: clamp(1.8rem, 4vw, 2.7rem);
}

.product-detail-dialog__content p {
    color: var(--muted);
    line-height: 1.7;
}

.product-detail-dialog__content strong {
    font-size: 1.8rem;
}

.product-detail-dialog__stock {
    font-weight: 700;
    color: var(--muted);
}

.product-detail-dialog__close {
    position: absolute;
    top: 0.85rem;
    right: 0.85rem;
    z-index: 2;
    width: 40px;
    height: 40px;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(16, 24, 40, 0.06);
}

.product-detail-dialog__close:hover,
.product-detail-dialog__close:focus-visible {
    border-color: #cbd5e1;
    box-shadow: 0 12px 24px rgba(17, 24, 39, 0.10);
}

@media (max-width: 720px) {
    .product-detail-dialog__card {
        grid-template-columns: 1fr;
        gap: 0.9rem;
    }

    .product-detail-dialog__media {
        min-height: 230px;
    }

    .product-detail-dialog__content {
        padding: 0.25rem;
    }
}

.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;
}

.inline-form--icon {
    width: auto;
    flex: 0 0 auto;
}

.btn-icon {
    width: 42px;
    height: 42px;
    min-width: 42px;
    min-height: 42px;
    flex: 0 0 42px;
    padding: 0;
    display: inline-grid;
    place-items: center;
    border-radius: 13px;
    line-height: 1;
}

.btn.topbar-nav-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    flex: 0 0 44px;
    border-radius: 15px;
    border-color: var(--border);
    background: var(--surface);
    color: #1e293b;
    box-shadow: 0 10px 24px rgba(16, 24, 40, 0.06);
}

.btn.topbar-nav-icon:hover {
    border-color: #cbd5e1;
    box-shadow: 0 14px 28px rgba(37, 99, 255, 0.13);
}

.btn.topbar-nav-icon:focus-visible {
    outline: 3px solid rgba(37, 99, 255, 0.18);
    outline-offset: 3px;
}

.nav-action-icon {
    width: 22px;
    height: 22px;
    display: block;
}

.cart-icon {
    width: 19px;
    height: 19px;
    flex: 0 0 19px;
    display: block;
}

.topbar-cart-link .cart-icon {
    width: 20px;
    height: 20px;
    flex-basis: 20px;
}

.nav-action-icon path,
.nav-action-icon rect,
.cart-icon path,
.cart-icon circle {
    vector-effect: non-scaling-stroke;
}

.btn-edit-icon,
.btn-activate-icon,
.btn-deactivate-icon,
.btn-delete-icon {
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    box-shadow: 0 8px 18px rgba(16, 24, 40, 0.04);
}

.btn-edit-icon:hover,
.btn-activate-icon:hover,
.btn-deactivate-icon:hover,
.btn-delete-icon:hover {
    background: var(--surface);
    color: var(--text);
    border-color: #cbd5e1;
    box-shadow: 0 12px 24px rgba(17, 24, 39, 0.10);
}

.btn-edit-icon:focus-visible,
.btn-activate-icon:focus-visible,
.btn-deactivate-icon:focus-visible,
.btn-delete-icon:focus-visible {
    outline: 3px solid rgba(17, 24, 39, 0.14);
    outline-offset: 3px;
}

.btn-archive-record,
.btn-recover-record {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.62rem 0.95rem;
    border-radius: 13px;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    box-shadow: 0 8px 18px rgba(16, 24, 40, 0.04);
    line-height: 1;
}

.btn-archive-record:hover,
.btn-recover-record:hover {
    background: var(--surface);
    color: var(--text);
    border-color: #cbd5e1;
    box-shadow: 0 12px 24px rgba(17, 24, 39, 0.10);
}

.btn-archive-record:focus-visible,
.btn-recover-record:focus-visible {
    outline: 3px solid rgba(17, 24, 39, 0.14);
    outline-offset: 3px;
}

.edit-icon,
.eye-icon,
.eye-slash-icon,
.archive-icon,
.recover-icon,
.trash-icon {
    width: 20px;
    height: 20px;
    display: block;
}

.edit-icon path,
.eye-icon path,
.eye-icon circle,
.eye-slash-icon path,
.archive-icon path,
.recover-icon path,
.trash-icon path {
    vector-effect: non-scaling-stroke;
}

.table-actions .inline-form--icon,
.table-actions .btn-edit-icon,
.table-actions .btn-activate-icon,
.table-actions .btn-deactivate-icon,
.table-actions .btn-delete-icon,
.inline-form--icon .btn-edit-icon,
.inline-form--icon .btn-activate-icon,
.inline-form--icon .btn-deactivate-icon,
.inline-form--icon .btn-delete-icon {
    width: 42px;
    min-width: 42px;
}

.notification-button {
    position: relative;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: var(--surface);
    color: #1e293b;
    box-shadow: 0 10px 24px rgba(16, 24, 40, 0.06);
    line-height: 1;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.notification-button:hover {
    transform: translateY(-1px);
    border-color: #cbd5e1;
    box-shadow: 0 14px 28px rgba(37, 99, 255, 0.13);
}

.notification-button:focus-visible {
    outline: 3px solid rgba(37, 99, 255, 0.18);
    outline-offset: 3px;
}

.notification-button__icon {
    width: 23px;
    height: 23px;
    display: block;
}

.notification-button__icon path {
    vector-effect: non-scaling-stroke;
}

.notification-button__badge,
.notification-nav-badge {
    display: inline-grid;
    place-items: center;
    min-width: 19px;
    height: 19px;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: #ff4d4f;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.notification-button__badge[hidden],
.notification-nav-badge[hidden] {
    display: none !important;
}

.notification-button__badge {
    position: absolute;
    top: -6px;
    right: -6px;
    border: 2px solid #fff;
    box-shadow: 0 8px 16px rgba(255, 77, 79, 0.22);
}

.notification-nav-badge {
    flex: 0 0 auto;
    margin-left: 0.35rem;
    vertical-align: middle;
}

.sidebar__notification-badge {
    margin-left: auto;
    border: 1px solid rgba(255, 255, 255, 0.75);
}

.sidebar__link.is-active .sidebar__notification-badge {
    border-color: rgba(255, 255, 255, 0.9);
}

.support-layout {
    display: grid;
    grid-template-columns: minmax(220px, 280px) minmax(0, 1fr) minmax(240px, 320px);
    gap: 1rem;
    align-items: start;
}

.support-layout--console {
    grid-template-columns: minmax(240px, 320px) minmax(0, 1fr) minmax(240px, 300px);
}

.support-sidebar,
.support-panel,
.support-new {
    min-width: 0;
}

.support-thread-list {
    display: grid;
    gap: 0.55rem;
    max-height: 68vh;
    overflow: auto;
}

.support-thread {
    display: grid;
    gap: 0.2rem;
    padding: 0.8rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    color: var(--text);
}

.support-thread.is-active {
    border-color: rgba(37, 99, 255, 0.35);
    background: #eff6ff;
}

.support-thread span,
.support-thread small {
    color: var(--muted);
    font-size: 0.82rem;
}

.support-thread small {
    color: #dc2626;
    font-weight: 800;
}

.support-panel__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--line);
    margin-bottom: 1rem;
}

.support-panel__header h2 {
    margin: 0 0 0.2rem;
    font-size: 1.35rem;
}

.support-panel__header p {
    margin: 0;
    color: var(--muted);
}

.support-context-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.65rem;
    margin-bottom: 1rem;
}

.support-context-grid article {
    display: grid;
    gap: 0.2rem;
    padding: 0.75rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-accent);
}

.support-context-grid span {
    color: var(--muted);
    font-size: 0.86rem;
}

.support-messages {
    display: grid;
    gap: 0.75rem;
    min-height: 360px;
    max-height: 62vh;
    overflow: auto;
    padding: 0.2rem 0.35rem 1rem 0;
}

.support-message {
    width: min(82%, 680px);
    padding: 0.85rem 0.95rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.05);
}

.support-message.is-own {
    justify-self: end;
    background: #eef6ff;
    border-color: #cfe3ff;
}

.support-message.is-automated {
    background: var(--surface-muted);
    border-style: dashed;
}

.support-message__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.35rem;
    color: var(--muted);
    font-size: 0.78rem;
}

.support-message__meta strong {
    color: var(--text);
}

.support-message p {
    margin: 0;
    white-space: pre-wrap;
}

.support-compose,
.support-filter,
.support-control-form,
.support-new form,
.support-test-form {
    display: grid;
    gap: 0.7rem;
}

.support-compose {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
}

.support-compose textarea {
    min-height: 54px;
    resize: vertical;
}

.support-notes {
    display: grid;
    gap: 0.65rem;
    margin-top: 1rem;
}

.support-notes article {
    padding: 0.75rem;
    border-radius: 12px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
}

.support-notes span {
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
}

.support-form-status {
    min-height: 1.2rem;
    margin: 0;
    color: var(--muted);
}

.support-form-status.is-error {
    color: #dc2626;
}

.checkbox-row {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.notification-button.has-unread::after {
    content: "";
    position: absolute;
    right: 8px;
    bottom: 8px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #17b26a;
    border: 2px solid #fff;
}

.notification-center {
    position: relative;
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
}

.notification-panel {
    position: absolute;
    top: calc(100% + 0.7rem);
    right: 0;
    z-index: 1200;
    width: min(440px, calc(100vw - 2rem));
    max-height: min(76vh, 680px);
    display: grid;
    grid-template-rows: auto minmax(120px, 1fr) auto;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.18);
}

.notification-panel[hidden] {
    display: none;
}

.notification-panel__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1rem 0.85rem;
    border-bottom: 1px solid var(--line);
}

.notification-panel__heading {
    display: grid;
    gap: 0.15rem;
    min-width: 0;
}

.notification-panel__heading span {
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 600;
}

.notification-panel__header-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    flex: 0 0 auto;
}

.notification-panel__close {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: inline-grid;
    place-items: center;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 11px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(16, 24, 40, 0.05);
}

.notification-panel__close span {
    display: block;
    transform: translateY(-1px);
}

.notification-panel__close:hover,
.notification-panel__close:focus-visible {
    border-color: #cbd5e1;
    box-shadow: 0 12px 24px rgba(17, 24, 39, 0.10);
}

.notification-panel__list {
    display: grid;
    align-content: start;
    gap: 0.55rem;
    max-height: 310px;
    padding: 0.85rem;
    overflow-y: auto;
}

.notification-panel__item {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.75rem;
    padding: 0.8rem;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    text-align: left;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(16, 24, 40, 0.04);
}

.notification-panel__item:hover,
.notification-panel__item:focus-visible {
    border-color: #cbd5e1;
    box-shadow: 0 12px 24px rgba(17, 24, 39, 0.08);
}

.notification-panel__item.is-unread {
    border-color: rgba(245, 158, 11, 0.38);
    background: #fffaf0;
}

.notification-panel__item.is-read {
    opacity: 0.78;
}

.notification-panel__item span:first-child {
    min-width: 0;
    display: grid;
    gap: 0.18rem;
}

.notification-panel__item strong,
.notification-panel__item small {
    min-width: 0;
    overflow-wrap: anywhere;
}

.notification-panel__item small {
    color: var(--muted);
    font-size: 0.78rem;
}

.notification-panel__empty {
    padding: 1rem;
    border-radius: 14px;
    background: var(--surface-accent);
    color: var(--muted);
    font-weight: 700;
    text-align: center;
}

.notification-panel__detail {
    display: grid;
    gap: 0.65rem;
    padding: 1rem;
    border-top: 1px solid var(--line);
    background: var(--surface-accent);
}

.notification-panel__detail h3 {
    margin: 0;
    font-size: 1.1rem;
}

.notification-panel__detail p {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

.notification-panel__detail dl {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
    margin: 0;
}

.notification-panel__detail div {
    display: grid;
    gap: 0.25rem;
}

.notification-panel__detail dt {
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
}

.notification-panel__detail dd {
    margin: 0;
    font-weight: 700;
}

.notification-page {
    display: grid;
    gap: 1rem;
}

.notification-page__panel {
    display: grid;
    gap: 1rem;
}

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

.notification-filter-tabs {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.notification-filter-tabs__item {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 0.85rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 800;
    text-decoration: none;
}

.notification-filter-tabs__item:hover,
.notification-filter-tabs__item:focus-visible,
.notification-filter-tabs__item.is-active {
    border-color: #2563ff;
    background: #edf3ff;
    color: #1d4ed8;
}

.notification-history-list {
    display: grid;
    gap: 0.7rem;
}

.notification-history-item {
    width: 100%;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.85rem;
    padding: 0.95rem;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    text-align: left;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(16, 24, 40, 0.04);
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.notification-history-item:hover,
.notification-history-item:focus-visible {
    transform: translateY(-1px);
    border-color: #cbd5e1;
    box-shadow: 0 14px 30px rgba(17, 24, 39, 0.08);
}

.notification-history-item.is-unread {
    border-color: rgba(37, 99, 255, 0.36);
    background: #f6f9ff;
}

.notification-history-item.is-read {
    opacity: 0.76;
    background: var(--surface-soft);
}

.gcash-qr-preview {
    display: grid;
    justify-items: start;
    gap: 0.7rem;
    padding: 0.9rem;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface-soft);
}

.gcash-qr-preview img {
    width: min(220px, 100%);
    aspect-ratio: 1;
    object-fit: contain;
    border-radius: 14px;
    background: #fff;
}

.gcash-qr-preview--checkout {
    justify-items: center;
    text-align: center;
}

.notification-history-item__icon {
    width: 44px;
    height: 44px;
    display: inline-grid;
    place-items: center;
    border-radius: 14px;
    background: #eaf1ff;
    color: #1d4ed8;
    font-weight: 900;
}

.notification-history-item--success .notification-history-item__icon {
    background: #eafaf1;
    color: #067647;
}

.notification-history-item--warning .notification-history-item__icon,
.notification-history-item--danger .notification-history-item__icon {
    background: #fff7e6;
    color: #b54708;
}

.notification-history-item__body {
    min-width: 0;
    display: grid;
    gap: 0.25rem;
}

.notification-history-item__title {
    min-width: 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.notification-history-item__title strong {
    min-width: 0;
    overflow-wrap: anywhere;
}

.notification-history-item__title em {
    min-height: 22px;
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.48rem;
    border-radius: 999px;
    background: #fffbeb;
    color: #92400e;
    font-size: 0.72rem;
    font-style: normal;
    font-weight: 900;
}

.notification-history-item__meta,
.notification-history-item small {
    min-width: 0;
    color: var(--muted);
    overflow-wrap: anywhere;
}

.notification-history-item small {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.45;
}

.notification-history-empty {
    margin: 0;
}

.notification-detail-modal {
    width: min(620px, calc(100vw - 2rem));
    padding: 0;
    border: 0;
    border-radius: 20px;
    background: transparent;
    color: var(--text);
}

.notification-detail-modal::backdrop {
    background: rgba(15, 23, 42, 0.42);
}

.notification-detail-modal__card {
    position: relative;
    display: grid;
    gap: 0.85rem;
    padding: 1.25rem;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--surface);
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.24);
}

.notification-detail-modal__close {
    position: absolute;
    top: 0.85rem;
    right: 0.85rem;
    width: 36px;
    height: 36px;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    color: var(--text);
    font-size: 1.35rem;
    line-height: 1;
    cursor: pointer;
}

.notification-detail-modal h2 {
    max-width: calc(100% - 3rem);
    margin: 0;
    color: var(--text);
    font-size: 1.35rem;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.notification-detail-modal p {
    margin: 0;
    color: var(--muted);
    line-height: 1.65;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.notification-detail-modal__meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin: 0;
}

.notification-detail-modal__meta div {
    display: grid;
    gap: 0.25rem;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface-accent);
}

.notification-detail-modal__meta dt {
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 900;
    text-transform: uppercase;
}

.notification-detail-modal__meta dd {
    min-width: 0;
    margin: 0;
    color: var(--text);
    font-weight: 800;
    overflow-wrap: anywhere;
}

@media (max-width: 640px) {
    .notification-panel {
        position: fixed;
        top: 5rem;
        right: 1rem;
        left: 1rem;
        width: auto;
        max-height: calc(100vh - 6rem);
    }

    .notification-panel__detail dl {
        grid-template-columns: 1fr;
    }

    .notification-page__toolbar,
    .notification-page__toolbar .inline-form,
    .notification-page__toolbar .btn {
        width: 100%;
        min-height: 44px;
    }

    .notification-filter-tabs {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .notification-history-item {
        grid-template-columns: 38px minmax(0, 1fr);
        align-items: start;
    }

    .notification-history-item > .badge {
        grid-column: 2;
        justify-self: start;
    }

    .notification-history-item__icon {
        width: 38px;
        height: 38px;
        border-radius: 12px;
    }

    .notification-detail-modal__meta {
        grid-template-columns: 1fr;
    }
}

/* Landing portal drawer overlay and interaction layer. */
.sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 999;
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: rgba(15, 23, 42, 0.62);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.24s ease, visibility 0s linear 0.24s;
}

.sidebar-backdrop.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s;
}

body.sidebar-open {
    overflow: hidden;
}

.sidebar__close {
    display: none;
}

@media (max-width: 1024px) {
    .sidebar--portal-drawer {
        position: fixed !important;
        inset: 0 auto 0 0 !important;
        z-index: 1000 !important;
        width: min(85vw, 320px) !important;
        height: 100vh !important;
        height: 100dvh !important;
        max-height: 100vh !important;
        max-height: 100dvh !important;
        padding: 1rem !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        border: 0 !important;
        border-radius: 0 20px 20px 0 !important;
        box-shadow: 18px 0 48px rgba(15, 23, 42, 0.28) !important;
        transform: translate3d(-105%, 0, 0) !important;
    }

    .sidebar--portal-drawer.is-open {
        transform: translate3d(0, 0, 0) !important;
    }

    .sidebar--portal-drawer .sidebar__header {
        display: grid;
        grid-template-columns: 48px minmax(0, 1fr) 44px;
        align-items: center;
        gap: 0.75rem;
        margin: 0 0 1rem;
        padding: 0 0 1rem;
    }

    .sidebar--portal-drawer .sidebar__logo {
        width: 48px;
        height: 48px;
        flex: 0 0 48px;
        overflow: hidden;
        padding: 0;
        background: var(--surface);
    }

    .sidebar--portal-drawer .sidebar__logo img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .sidebar--portal-drawer .sidebar__identity {
        min-width: 0;
    }

    .sidebar--portal-drawer .sidebar__eyebrow,
    .sidebar--portal-drawer .sidebar__header h2 {
        display: block;
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .sidebar--portal-drawer .sidebar__close {
        display: grid;
        place-items: center;
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
        padding: 0;
        border: 1px solid var(--line);
        border-radius: 12px;
        background: var(--bg-soft);
        color: var(--text);
        font-size: 1.7rem;
        line-height: 1;
        cursor: pointer;
    }

    .sidebar--portal-drawer .mobile-drawer__extras {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        align-items: stretch;
        gap: 0.7rem;
        margin: 0;
        padding: 0;
        border: 0;
    }

    .sidebar--portal-drawer .mobile-drawer__extras > a,
    .sidebar--portal-drawer .mobile-drawer__extras > form,
    .sidebar--portal-drawer .mobile-drawer__extras > form > button {
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
    }

    .sidebar--portal-drawer .mobile-drawer__extras > a,
    .sidebar--portal-drawer .mobile-drawer__extras > form > button {
        display: flex;
        min-height: 46px;
        align-items: center;
        justify-content: center;
        padding: 0.75rem 1rem;
        border-radius: 12px;
    }

    .sidebar--portal-drawer .mobile-drawer__extras > :empty,
    .sidebar--portal-drawer .sidebar__nav:empty,
    .sidebar--portal-drawer .sidebar__profile:empty {
        display: none !important;
    }
}

/* Landing page mobile drawer: compact layout without affecting desktop or app sidebars. */
@media (max-width: 1024px) {
    .sidebar--portal-drawer {
        inset: 0 auto 0 0 !important;
        width: min(85vw, 320px) !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        padding: 1rem !important;
        border: 0 !important;
        border-radius: 0 20px 20px 0 !important;
        background: var(--surface);
    }

    .sidebar--portal-drawer .sidebar__header {
        display: grid;
        grid-template-columns: 48px minmax(0, 1fr) 44px;
        align-items: center;
        gap: 0.75rem;
        padding: 0 0 1rem;
        margin: 0 0 1rem;
        border-bottom: 1px solid var(--line);
    }

    .sidebar--portal-drawer .sidebar__logo {
        width: 48px;
        height: 48px;
        border-radius: 12px;
        font-size: 1rem;
    }

    .sidebar--portal-drawer .sidebar__eyebrow {
        font-size: 0.66rem;
        line-height: 1;
    }

    .sidebar--portal-drawer .sidebar__header h2 {
        margin: 0.18rem 0 0;
        font-size: 0.98rem;
        line-height: 1.15;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .sidebar--portal-drawer .mobile-drawer__extras {
        display: grid;
        grid-template-columns: 1fr;
        align-items: stretch;
        gap: 0.7rem;
        margin: 0;
        padding: 0;
        border: 0;
    }

    .sidebar--portal-drawer .mobile-drawer__extras > a,
    .sidebar--portal-drawer .mobile-drawer__extras > form,
    .sidebar--portal-drawer .mobile-drawer__extras > form > button {
        width: 100%;
        min-width: 0;
        max-width: none;
        min-height: 42px;
        margin: 0;
        border-radius: 12px;
    }

    .sidebar--portal-drawer .mobile-drawer__extras > a,
    .sidebar--portal-drawer .mobile-drawer__extras > form > button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0.65rem 0.9rem;
        font-size: 0.86rem;
        line-height: 1;
        text-align: center;
    }

    .sidebar--portal-drawer .sidebar__nav:empty,
    .sidebar--portal-drawer .sidebar__profile:empty,
    .sidebar--portal-drawer .mobile-drawer__extras > :empty {
        display: none;
    }

    :root[data-theme="dark"] .sidebar--portal-drawer {
        background: var(--surface);
        border-color: var(--line);
    }
}

@media (max-width: 640px) {
    .portal-home__actions {
        top: 0.7rem !important;
        left: 0.75rem !important;
        right: 0.75rem !important;
        width: auto !important;
        max-width: none !important;
        min-height: 44px;
        flex-wrap: nowrap !important;
        align-items: center;
        justify-content: space-between !important;
        gap: 0.65rem;
    }

    .portal-home__actions .guest-cart {
        flex: 0 0 44px;
        margin: 0;
    }

    .portal-home__actions .guest-cart__toggle,
    .portal-home__actions > .topbar-drawer-toggle {
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
        flex: 0 0 44px;
        margin: 0;
    }

    .portal-home.portal-home--browse {
        padding-top: 4.9rem;
    }
}

.customer-topbar__user > .notification-center,
.ops-topbar__right > .notification-center {
    flex: 0 0 44px;
}

.customer-topbar__user > div,
.ops-topbar__user > div {
    min-width: 0;
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0b1120;
    --bg-soft: #111827;
    --surface: #111827;
    --surface-soft: #172033;
    --border: #263247;
    --text: #eef4ff;
    --text-muted: #a8b3c7;
    --muted: var(--text-muted);
    --line: var(--border);
    --btn-bg: #131728;
    --icon-color: #a78bfa;
    --input-bg: #0f172a;
    --surface-muted: #141f31;
    --surface-accent: #172033;
    --control-text: var(--text);
    --shadow: 0 24px 50px rgba(0, 0, 0, 0.36);
    --shadow-soft: 0 14px 34px rgba(0, 0, 0, 0.28);
}

:root[data-theme="dark"] body,
:root[data-theme="dark"] .guest-body:not(.landing-portal-body),
:root[data-theme="dark"] .customer-body,
:root[data-theme="dark"] .auth-page {
    color: var(--text);
    background: var(--bg);
}

:root[data-theme="dark"] p,
:root[data-theme="dark"] small,
:root[data-theme="dark"] label,
:root[data-theme="dark"] .section__heading p,
:root[data-theme="dark"] .metric-box span,
:root[data-theme="dark"] .customer-topbar__user span,
:root[data-theme="dark"] .ops-topbar__user span {
    color: var(--muted);
}

:root[data-theme="dark"] input,
:root[data-theme="dark"] textarea,
:root[data-theme="dark"] select {
    background: #0f172a;
    color: var(--text);
    border-color: #334155;
    box-shadow: none;
}

:root[data-theme="dark"] input::placeholder,
:root[data-theme="dark"] textarea::placeholder {
    color: #8190a8;
}

:root[data-theme="dark"] .topbar--public,
:root[data-theme="dark"] .customer-topbar,
:root[data-theme="dark"] .ops-topbar,
:root[data-theme="dark"] .sidebar {
    background: rgba(15, 23, 42, 0.97);
    border-color: var(--line);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04);
}

:root[data-theme="dark"] .auth-card,
:root[data-theme="dark"] .summary-card,
:root[data-theme="dark"] .form-card,
:root[data-theme="dark"] .info-card,
:root[data-theme="dark"] .receipt-card,
:root[data-theme="dark"] .empty-state,
:root[data-theme="dark"] .metric-card,
:root[data-theme="dark"] .metric-box,
:root[data-theme="dark"] .page-panel,
:root[data-theme="dark"] .product-card,
:root[data-theme="dark"] .cart-item {
    background: var(--surface);
    border-color: var(--line);
    box-shadow: var(--shadow-soft);
}

:root[data-theme="dark"] .btn-secondary,
:root[data-theme="dark"] .btn-ghost,
:root[data-theme="dark"] .ops-topbar__icon,
:root[data-theme="dark"] .guest-cart__toggle,
:root[data-theme="dark"] .guest-cart__close,
:root[data-theme="dark"] .customer-topbar__logout,
:root[data-theme="dark"] .ops-topbar__logout {
    background: #141f31;
    color: var(--text);
    border-color: var(--line);
}

:root[data-theme="dark"] .topbar-nav-icon {
    background: var(--btn-bg);
    border-color: var(--border);
    color: var(--icon-color);
    box-shadow: none;
}

:root[data-theme="dark"] .notification-button {
    background: linear-gradient(180deg, #172033 0%, #101827 100%);
    border-color: #334155;
    color: #f8fafc;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}

:root[data-theme="dark"] .menu-toggle {
    background: var(--btn-bg);
    border-color: var(--border);
    color: var(--control-text);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}

:root[data-theme="dark"] .menu-toggle__badge {
    border-color: #101827;
}

:root[data-theme="dark"] .guest-cart__badge {
    border-color: #101827;
}

:root[data-theme="dark"] .guest-cart__panel {
    background: #101827;
    border-color: var(--line);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.38);
}

:root[data-theme="dark"] .guest-cart__item {
    background: #141f31;
    border-color: var(--line);
}

:root[data-theme="dark"] .guest-cart__item-media {
    background-color: #0f172a;
}

:root[data-theme="dark"] .guest-cart__item-summary strong,
:root[data-theme="dark"] .guest-cart__summary strong {
    color: var(--text);
}

:root[data-theme="dark"] .guest-cart__summary {
    border-color: var(--line);
}

:root[data-theme="dark"] .notification-button__badge {
    border-color: #101827;
}

:root[data-theme="dark"] .notification-nav-badge {
    border-color: #101827;
}

:root[data-theme="dark"] .notification-button.has-unread::after {
    border-color: #101827;
}

:root[data-theme="dark"] .notification-panel {
    border-color: var(--line);
    background: var(--surface);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
}

:root[data-theme="dark"] .notification-panel__item {
    background: #141f31;
    border-color: var(--line);
}

:root[data-theme="dark"] .notification-panel__item.is-unread {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.36);
}

:root[data-theme="dark"] .notification-panel__empty,
:root[data-theme="dark"] .notification-panel__detail {
    background: var(--surface-soft);
}

:root[data-theme="dark"] .notification-panel__close {
    background: #f8fafc;
    color: #111827;
    border-color: #dbe4f0;
}

:root[data-theme="dark"] .notification-filter-tabs__item {
    background: #172033;
    border-color: #334155;
    color: #dbe7f6;
}

:root[data-theme="dark"] .notification-filter-tabs__item:hover,
:root[data-theme="dark"] .notification-filter-tabs__item:focus-visible,
:root[data-theme="dark"] .notification-filter-tabs__item.is-active {
    background: #10213f;
    border-color: #60a5fa;
    color: #bfdbfe;
}

:root[data-theme="dark"] .notification-history-item {
    background: #172033;
    border-color: #334155;
}

:root[data-theme="dark"] .notification-history-item.is-unread {
    background: rgba(37, 99, 255, 0.14);
    border-color: rgba(96, 165, 250, 0.42);
}

:root[data-theme="dark"] .notification-history-item__icon {
    background: #10213f;
    color: #bfdbfe;
}

:root[data-theme="dark"] .notification-history-item--success .notification-history-item__icon {
    background: rgba(6, 118, 71, 0.18);
    color: #86efac;
}

:root[data-theme="dark"] .notification-history-item--warning .notification-history-item__icon,
:root[data-theme="dark"] .notification-history-item--danger .notification-history-item__icon {
    background: rgba(245, 158, 11, 0.16);
    color: #fbbf24;
}

:root[data-theme="dark"] .notification-history-item__title em {
    background: rgba(245, 158, 11, 0.16);
    color: #fbbf24;
}

:root[data-theme="dark"] .notification-detail-modal__card {
    background: var(--surface);
    border-color: #334155;
}

:root[data-theme="dark"] .notification-detail-modal__close {
    background: #f8fafc;
    color: #111827;
    border-color: #dbe4f0;
}

:root[data-theme="dark"] .notification-detail-modal__meta div {
    background: #172033;
    border-color: #334155;
}

:root[data-theme="dark"] .support-thread,
:root[data-theme="dark"] .support-message,
:root[data-theme="dark"] .support-context-grid article {
    background: #172033;
    border-color: #334155;
}

:root[data-theme="dark"] .support-thread.is-active,
:root[data-theme="dark"] .support-message.is-own {
    background: #10213f;
    border-color: #315c99;
}

:root[data-theme="dark"] .support-message.is-automated {
    background: #111827;
}

:root[data-theme="dark"] .support-notes article {
    background: #2c1a0b;
    border-color: #7c2d12;
}

:root[data-theme="dark"] .btn-edit-icon,
:root[data-theme="dark"] .btn-activate-icon,
:root[data-theme="dark"] .btn-deactivate-icon,
:root[data-theme="dark"] .btn-delete-icon,
:root[data-theme="dark"] .btn-archive-record,
:root[data-theme="dark"] .btn-recover-record {
    background: #f8fafc;
    color: #111827;
    border-color: #dbe4f0;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.24);
}

:root[data-theme="dark"] .btn-edit-icon:hover,
:root[data-theme="dark"] .btn-activate-icon:hover,
:root[data-theme="dark"] .btn-deactivate-icon:hover,
:root[data-theme="dark"] .btn-delete-icon:hover,
:root[data-theme="dark"] .btn-archive-record:hover,
:root[data-theme="dark"] .btn-recover-record:hover {
    background: var(--surface-muted);
    color: var(--text);
    border-color: var(--border);
}

:root[data-theme="dark"] .brand-link__eyebrow,
:root[data-theme="dark"] .eyebrow,
:root[data-theme="dark"] .auth-link {
    color: #b994ff;
}

:root[data-theme="dark"] .brand-link strong,
:root[data-theme="dark"] .customer-topbar__brand strong,
:root[data-theme="dark"] .sidebar__header h2,
:root[data-theme="dark"] .section__heading h1,
:root[data-theme="dark"] .product-card__body h3,
:root[data-theme="dark"] .cart-item__details h3,
:root[data-theme="dark"] h1,
:root[data-theme="dark"] h2,
:root[data-theme="dark"] h3,
:root[data-theme="dark"] h4 {
    color: var(--text);
}

:root[data-theme="dark"] .customer-topbar__nav a,
:root[data-theme="dark"] .sidebar__link {
    color: #d5deec;
}

:root[data-theme="dark"] .activity-list li,
:root[data-theme="dark"] .summary-list li,
:root[data-theme="dark"] .receipt-note,
:root[data-theme="dark"] .token-preview {
    background: var(--surface-soft);
    border-color: var(--line);
}

:root[data-theme="dark"] .product-card__media,
:root[data-theme="dark"] .cart-item__media,
:root[data-theme="dark"] .product-detail-dialog__media {
    background-color: #182235;
}

:root[data-theme="dark"] .product-card__media.is-missing-image::after,
:root[data-theme="dark"] .portal-product-card__media.is-missing-image::after,
:root[data-theme="dark"] .product-detail-dialog__media.is-missing-image::after {
    background: rgba(15, 23, 42, 0.64);
    border-color: rgba(148, 163, 184, 0.34);
    color: #b8c4d8;
}

:root[data-theme="dark"] .product-detail-dialog__close {
    background: #f8fafc;
    color: #111827;
    border-color: #dbe4f0;
}

:root[data-theme="dark"] .data-table th,
:root[data-theme="dark"] .data-table td {
    border-color: var(--line);
}

:root[data-theme="dark"] .data-table th {
    color: var(--muted);
}

:root[data-theme="dark"] .data-table tbody tr:hover {
    background: #172033;
}

:root[data-theme="dark"] .auth-page__logo {
    background: #111827;
    box-shadow: var(--shadow);
}

:root[data-theme="dark"] .auth-card--dashboard-login .auth-card__logo {
    background: #f8fafc;
    border-color: #dbe4f0;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.26);
}

:root[data-theme="dark"] code {
    background: #1d2a44;
    color: #dbeafe;
}

/* Choose Your Portal page refinement */
.landing-portal-body {
    position: relative;
    background:
        linear-gradient(135deg, rgba(235, 243, 255, 0.96) 0%, rgba(248, 250, 255, 0.98) 46%, rgba(242, 236, 255, 0.94) 100%),
        linear-gradient(45deg, #edf6ff 0%, #f8f5ff 100%);
    min-height: 100vh;
    color: #162033;
}

.portal-page {
    min-height: 100%;
    background:
        linear-gradient(135deg, rgba(235, 243, 255, 0.96) 0%, rgba(248, 250, 255, 0.98) 46%, rgba(242, 236, 255, 0.94) 100%),
        linear-gradient(45deg, #edf6ff 0%, #f8f5ff 100%);
}

.landing-portal-body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        linear-gradient(135deg, rgba(235, 243, 255, 0.96) 0%, rgba(248, 250, 255, 0.98) 46%, rgba(242, 236, 255, 0.94) 100%),
        linear-gradient(45deg, #edf6ff 0%, #f8f5ff 100%);
}

.portal-home {
    position: relative;
    z-index: 1;
    width: 100%;
    min-height: 100vh;
    padding: 1.5rem 1.25rem;
    display: grid;
    align-items: center;
    justify-items: center;
    overflow-x: hidden;
    overflow-y: auto;
}

.portal-home__ambient,
.portal-home__ring,
.portal-home__line {
    display: none;
}

.portal-home__wrap {
    width: min(100%, 1080px);
    min-width: 0;
    display: grid;
    justify-items: center;
    gap: 1.3rem;
}

.portal-brand {
    width: min(100%, 680px);
    max-width: 680px;
    margin: 0 auto;
    text-align: center;
}

.portal-brand__logo {
    width: 84px;
    height: 84px;
    margin: 0 auto 0.9rem;
    border-radius: 22px;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: 0 22px 50px rgba(45, 68, 112, 0.14);
    overflow: hidden;
}

.portal-brand__logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.portal-brand h1 {
    margin: 0;
    color: #14213a;
    font-size: 2.5rem;
    line-height: 1.08;
    font-weight: 800;
    letter-spacing: 0;
    text-shadow: none;
}

.portal-brand .portal-brand__subtitle {
    max-width: 52ch;
    margin: 0.6rem auto 0;
    color: #58657a;
    font-size: 1.06rem;
    line-height: 1.6;
}

.portal-choice-grid--two {
    width: min(100%, 980px);
    max-width: 980px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem;
    align-items: stretch;
}

.portal-choice-card {
    min-height: 388px;
    padding: 1.35rem;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(205, 215, 232, 0.88);
    color: #172033;
    box-shadow: 0 26px 70px rgba(45, 68, 112, 0.16);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    overflow: visible;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.portal-choice-card:hover {
    transform: translateY(-4px);
    border-color: rgba(84, 112, 255, 0.28);
    box-shadow: 0 34px 86px rgba(45, 68, 112, 0.22);
}

.portal-choice-card__icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 1rem;
    border-radius: 18px;
    background: linear-gradient(180deg, var(--surface) 0%, var(--surface-accent) 100%);
    border: 1px solid var(--border);
    color: var(--text);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.92), 0 16px 32px rgba(45, 68, 112, 0.12);
}

.portal-choice-card__icon--bag span {
    width: 22px;
    height: 19px;
    border-color: currentColor;
    border-radius: 7px;
}

.portal-choice-card__icon--bag span::before {
    top: -9px;
    width: 12px;
    height: 7px;
    border-color: currentColor;
}

.portal-choice-card__icon--grid {
    grid-template-columns: repeat(2, 10px);
    grid-template-rows: repeat(2, 10px);
    gap: 6px;
}

.portal-choice-card__icon--grid span {
    width: 10px;
    height: 10px;
    border-color: currentColor;
    border-radius: 4px;
}

.portal-choice-card h2 {
    max-width: 22ch;
    margin: 0 auto 0.8rem;
    color: #14213a;
    font-size: 1.32rem;
    line-height: 1.18;
    font-weight: 800;
    letter-spacing: 0;
}

.portal-choice-card p {
    max-width: 34ch;
    min-height: 3.4em;
    margin: 0 auto 0.9rem;
    color: #5d687b;
    font-size: 0.94rem;
    line-height: 1.5;
    overflow-wrap: break-word;
    max-width: 100%;
}

.portal-choice-card__list {
    width: 100%;
    gap: 0.55rem;
    margin: 0 0 1rem;
    text-align: left;
}

.portal-choice-card__list li {
    position: relative;
    min-height: 28px;
    padding: 0.35rem 0.7rem 0.35rem 2.1rem;
    border-radius: 14px;
    background: var(--surface-accent);
    color: var(--text);
    font-size: 0.92rem;
    line-height: 1.4;
}

.portal-choice-card__list li::before {
    content: "\2713";
    left: 0.75rem;
    top: 50%;
    width: 1rem;
    height: 1rem;
    transform: translateY(-50%);
    border-radius: 50%;
    background: #e8f7ef;
    border: 1px solid #b8e9cc;
    color: #15854d;
    font-size: 0.65rem;
}

.portal-choice-card__actions {
    width: 100%;
    margin-top: auto;
    padding-top: 0;
    justify-content: center;
}

.portal-link-button {
    width: 100%;
    min-height: 50px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 0.55rem;
    padding: 0.82rem 1.1rem;
    border-radius: 16px;
    background: linear-gradient(90deg, #245df2 0%, #7337f0 100%);
    color: #fff;
    font-size: 1rem;
    font-weight: 800;
    text-decoration: none;
    box-shadow: 0 18px 34px rgba(49, 83, 231, 0.26);
    transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.portal-link-button:hover {
    transform: translateY(-1px);
    filter: brightness(1.04);
    box-shadow: 0 22px 42px rgba(49, 83, 231, 0.34);
}

.portal-link-button span {
    font-size: 1.15rem;
    line-height: 1;
}

:root[data-theme="dark"] .landing-portal-body {
    background:
        linear-gradient(135deg, rgba(10, 16, 30, 0.98) 0%, rgba(17, 25, 43, 0.98) 52%, rgba(31, 28, 55, 0.96) 100%),
        #0b1120;
}

:root[data-theme="dark"].portal-page {
    background:
        linear-gradient(135deg, rgba(10, 16, 30, 0.98) 0%, rgba(17, 25, 43, 0.98) 52%, rgba(31, 28, 55, 0.96) 100%),
        #0b1120;
}

:root[data-theme="dark"] .landing-portal-body::before {
    background:
        linear-gradient(135deg, rgba(10, 16, 30, 0.98) 0%, rgba(17, 25, 43, 0.98) 52%, rgba(31, 28, 55, 0.96) 100%),
        #0b1120;
}

:root[data-theme="dark"] .portal-brand h1,
:root[data-theme="dark"] .portal-choice-card h2 {
    color: #eef4ff;
}

:root[data-theme="dark"] .portal-brand .portal-brand__subtitle,
:root[data-theme="dark"] .portal-choice-card p {
    color: #b8c4d8;
}

:root[data-theme="dark"] .portal-brand__logo,
:root[data-theme="dark"] .portal-choice-card {
    background: rgba(17, 24, 39, 0.94);
    border-color: #263247;
    box-shadow: 0 26px 70px rgba(0, 0, 0, 0.32);
}

:root[data-theme="dark"] .portal-choice-card__icon,
:root[data-theme="dark"] .portal-choice-card__list li {
    background: #172033;
    border-color: #334155;
    color: #e8eef9;
}

:root[data-theme="dark"] .portal-link-button {
    background: linear-gradient(90deg, #3b82f6 0%, #8b5cf6 100%);
    box-shadow: 0 18px 34px rgba(59, 130, 246, 0.18);
}

.portal-home__actions {
    position: fixed;
    top: 1rem;
    left: 1rem;
    right: 1rem;
    z-index: 10;
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 10px;
    width: auto;
    max-width: calc(100vw - 2rem);
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
}

.portal-home__actions .guest-cart {
    margin-right: auto;
}

.portal-home__actions > .btn,
.portal-home__actions .portal-home__action {
    flex: 0 0 auto;
    min-width: 0;
    min-height: 42px;
    padding: 11px 20px;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 700;
    white-space: nowrap;
}

.portal-home__actions .portal-home__logout-form {
    display: contents;
}

.portal-home__actions > .btn:not(.portal-contact-nav),
.portal-home__actions .portal-home__action:not(.portal-contact-nav) {
    flex-basis: auto;
    max-width: none;
}

.portal-home__actions .portal-contact-nav {
    flex-basis: auto;
    max-width: none;
    order: 3;
}

@media (min-width: 901px) {
    .portal-home__actions {
        width: auto;
        max-width: none;
    }

    .portal-home__actions > .btn,
    .portal-home__actions .portal-home__action,
    .portal-home__actions > .btn:not(.portal-contact-nav),
    .portal-home__actions .portal-home__action:not(.portal-contact-nav),
    .portal-home__actions .portal-contact-nav {
        flex: 0 0 auto;
        max-width: none;
    }
}

.portal-home--browse {
    align-items: start;
    padding-top: 5.25rem;
    padding-bottom: 2rem;
}

.portal-contact-nav {
    scroll-margin-top: 6rem;
}

@media (max-width: 900px) {
    .portal-home__actions {
        left: 1rem;
        right: 1rem;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        flex-wrap: wrap;
        gap: 0.55rem;
        width: auto;
        max-width: calc(100vw - 2rem);
    }

    .portal-home__actions .portal-contact-nav {
        grid-column: auto;
    }

}

.portal-customer-panel {
    width: min(100%, 1120px);
    min-width: 0;
    padding: 1.35rem;
    border: 1px solid rgba(205, 215, 232, 0.88);
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 26px 70px rgba(45, 68, 112, 0.16);
}

.portal-customer-panel__intro {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.portal-customer-panel__intro h2 {
    margin: 0.2rem 0 0.35rem;
    color: #14213a;
    font-size: 1.6rem;
    line-height: 1.18;
    letter-spacing: 0;
}

.portal-customer-panel__intro p {
    margin: 0;
    color: #5d687b;
}

.portal-link-button--compact {
    width: auto;
    min-width: 190px;
    flex: 0 0 auto;
}

.portal-product-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 1rem;
}

.portal-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(215px, 260px));
    justify-content: center;
    align-items: stretch;
    gap: 1rem;
}

.catalog-menu-grid {
    justify-content: start;
}

.portal-product-card {
    width: 100%;
    min-width: 0;
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    text-align: left;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 16px 34px rgba(45, 68, 112, 0.12);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.portal-product-card:hover {
    transform: translateY(-2px);
    border-color: rgba(84, 112, 255, 0.34);
    box-shadow: 0 18px 38px rgba(45, 68, 112, 0.16);
}

.portal-product-card__media {
    flex: 0 0 158px;
    width: 100%;
    height: 158px;
    display: grid;
    place-items: center;
    padding: 0.65rem;
    background: linear-gradient(180deg, var(--surface) 0%, var(--surface-accent) 100%);
    border-bottom: 1px solid var(--border);
}

.portal-product-card__media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 14px;
}

.portal-product-card__body {
    position: relative;
    z-index: 1;
    flex: 1 1 auto;
    min-width: 0;
    display: grid;
    gap: 0.38rem;
    align-content: start;
    padding: 0.85rem 0.95rem 0.65rem;
    background: inherit;
}

.portal-product-card__body h3 {
    margin: 0;
    color: #14213a;
    font-size: 1.03rem;
    line-height: 1.22;
    letter-spacing: 0;
}

.portal-product-card__description {
    min-height: 2.55em;
    color: #5d687b;
    font-size: 0.92rem;
    line-height: 1.38;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.portal-product-card__footer {
    position: relative;
    z-index: 1;
    flex: 0 0 auto;
    display: grid;
    gap: 0.75rem;
    padding: 0.7rem 0.95rem 0.95rem;
    border-top: 1px solid rgba(205, 215, 232, 0.58);
    background: inherit;
}

.portal-product-card__purchase {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.55rem;
}

.portal-product-card__footer strong {
    flex: 0 0 auto;
    width: fit-content;
    padding: 0.28rem 0.6rem;
    border-radius: 999px;
    background: rgba(37, 99, 255, 0.1);
    color: #1d4ed8;
    font-size: 1.03rem;
    font-weight: 800;
    line-height: 1.2;
}

.portal-product-card__stock {
    flex: 1 1 auto;
    display: inline-flex;
    justify-content: flex-end;
    min-width: 0;
    padding: 0.22rem 0.5rem;
    border-radius: 999px;
    text-align: right;
    font-size: 0.76rem;
    font-weight: 800;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.portal-product-card__stock.is-available {
    background: rgba(4, 120, 87, 0.09);
    color: #047857;
}

.portal-product-card__stock.is-out {
    background: rgba(180, 35, 24, 0.09);
    color: #b42318;
}

.portal-product-card__actions {
    display: grid;
    grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
    gap: 0.55rem;
    align-items: stretch;
}

.portal-product-card__cart-form {
    display: grid;
    min-width: 0;
}

.portal-product-card__action {
    min-height: 40px;
    width: 100%;
    white-space: nowrap;
    border-radius: 11px;
    padding-inline: 0.55rem;
    font-size: 0.88rem;
}

.portal-product-card__add {
    min-height: 40px;
    width: 100%;
    border-radius: 11px;
    padding-inline: 0.55rem;
    font-size: 0.88rem;
    box-shadow: 0 12px 20px rgba(37, 99, 255, 0.2);
}

.portal-product-card__add:disabled {
    cursor: not-allowed;
    opacity: 0.65;
    box-shadow: none;
}

.portal-product-card__action:focus-visible,
.portal-product-card__add:focus-visible {
    outline: 3px solid rgba(37, 99, 255, 0.24);
    outline-offset: 3px;
}

.portal-product-card__body .chip {
    width: fit-content;
}

.portal-product-card__body small {
    color: #5d687b;
}

.portal-empty-state {
    margin-top: 1rem;
    box-shadow: none;
}

:root[data-theme="dark"] .portal-customer-panel,
:root[data-theme="dark"] .portal-product-card {
    background: rgba(17, 24, 39, 0.94);
    border-color: #263247;
    color: #e8eef9;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
}

:root[data-theme="dark"] .portal-customer-panel__intro h2,
:root[data-theme="dark"] .portal-product-card__body h3,
:root[data-theme="dark"] .portal-product-card__footer strong {
    color: #eef4ff;
}

:root[data-theme="dark"] .portal-product-card__footer strong {
    background: rgba(59, 130, 246, 0.18);
    color: #dbeafe;
}

:root[data-theme="dark"] .portal-customer-panel__intro p,
:root[data-theme="dark"] .portal-product-card__description {
    color: #b8c4d8;
}

:root[data-theme="dark"] .portal-product-card__media {
    background: #172033;
    border-color: #334155;
}

:root[data-theme="dark"] .portal-product-card__footer {
    border-color: #263247;
}

:root[data-theme="dark"] .portal-product-card__stock.is-available {
    background: rgba(16, 185, 129, 0.14);
    color: #86efac;
}

:root[data-theme="dark"] .portal-product-card__stock.is-out {
    background: rgba(248, 113, 113, 0.14);
    color: #fecaca;
}

.portal-map-section {
    width: min(100%, 1120px);
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(250px, 0.76fr) minmax(380px, 1.24fr);
    align-items: center;
    gap: 1.1rem;
    padding: 1rem;
    border: 1px solid rgba(205, 215, 232, 0.82);
    border-radius: 24px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(249, 251, 255, 0.92) 100%);
    color: #172033;
    box-shadow: 0 20px 54px rgba(45, 68, 112, 0.13);
}

.portal-map-section__content {
    min-width: 0;
    display: grid;
    align-content: center;
    justify-items: start;
    gap: 0.65rem;
    padding: 0.45rem 0.65rem;
}

.portal-map-section__content h2 {
    margin: 0;
    color: #14213a;
    font-size: 1.52rem;
    line-height: 1.18;
    letter-spacing: 0;
}

.portal-map-section__content p {
    max-width: 38ch;
    margin: 0;
    color: #5d687b;
    font-size: 0.96rem;
    line-height: 1.6;
}

.portal-map-section__details {
    display: grid;
    gap: 0.35rem;
}

.portal-map-section__details strong {
    color: #243047;
}

.portal-map-section__button {
    width: fit-content;
    min-width: 142px;
    min-height: 44px;
    margin-top: 0.25rem;
    padding: 0.78rem 1rem;
    border-radius: 14px;
    box-shadow: 0 14px 28px rgba(37, 99, 255, 0.18);
}

.portal-map-section__frame {
    position: relative;
    min-height: 280px;
    aspect-ratio: 1.85 / 1;
    overflow: hidden;
    border: 1px solid rgba(188, 201, 224, 0.86);
    border-radius: 19px;
    background:
        linear-gradient(135deg, rgba(37, 99, 255, 0.1), rgba(138, 28, 243, 0.08)),
        var(--surface-soft);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.84), 0 14px 30px rgba(45, 68, 112, 0.08);
}

.portal-map-section__frame iframe {
    width: 100%;
    height: 100%;
    display: block;
    border: 0;
}

:root[data-theme="dark"] .portal-map-section {
    background: linear-gradient(180deg, rgba(17, 24, 39, 0.96) 0%, rgba(20, 31, 49, 0.94) 100%);
    border-color: #263247;
    color: #e8eef9;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
}

:root[data-theme="dark"] .portal-map-section__content h2 {
    color: #eef4ff;
}

:root[data-theme="dark"] .portal-map-section__content p {
    color: #b8c4d8;
}

:root[data-theme="dark"] .portal-map-section__details strong {
    color: #eef4ff;
}

:root[data-theme="dark"] .portal-map-section__frame {
    background: #172033;
    border-color: #334155;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.2);
}

.portal-contact-footer {
    width: min(100%, 1120px);
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(190px, 0.55fr) minmax(0, 1.45fr);
    align-items: center;
    gap: 0.9rem;
    scroll-margin-top: 6rem;
    padding: 0.9rem 1rem;
    border: 1px solid rgba(205, 215, 232, 0.78);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.82);
    color: #172033;
    box-shadow: 0 14px 34px rgba(45, 68, 112, 0.1);
}

.shop-location-summary {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
    align-items: stretch;
    gap: 1rem;
}

.shop-location-summary__content {
    min-width: 0;
    display: grid;
    align-content: center;
    gap: 0.65rem;
}

.shop-location-summary__content h2 {
    margin: 0;
    color: var(--color-heading, #172033);
    font-size: clamp(1.25rem, 2vw, 1.7rem);
}

.shop-location-summary__content p {
    margin: 0;
    color: var(--color-muted, #5d687b);
    line-height: 1.6;
}

.shop-location-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.shop-location-meta span {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0.45rem 0.7rem;
    border: 1px solid rgba(188, 201, 224, 0.78);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.82);
    color: #334155;
    font-size: 0.9rem;
}

.shop-location-summary__map,
.shop-location-preview {
    position: relative;
    min-height: 280px;
    overflow: hidden;
    border: 1px solid rgba(188, 201, 224, 0.86);
    border-radius: 16px;
    background: var(--surface-soft);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78), 0 14px 30px rgba(45, 68, 112, 0.08);
}

.shop-location-summary__map {
    aspect-ratio: 1.65 / 1;
}

.shop-location-preview {
    aspect-ratio: 1.5 / 1;
}

.shop-location-summary__map iframe,
.shop-location-preview iframe {
    width: 100%;
    height: 100%;
    display: block;
    border: 0;
}

.shop-location-form {
    gap: 0.8rem;
}

.shop-location-selector {
    margin-bottom: 1rem;
}

.shop-location-selector select,
.shop-location-permission-form select {
    min-width: 220px;
}

.shop-location-readout {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 0.45rem 0.75rem;
    margin: 1rem 0 0;
}

.shop-location-readout dt {
    color: #64748b;
    font-size: 0.86rem;
    font-weight: 700;
}

.shop-location-readout dd {
    min-width: 0;
    margin: 0;
    color: #172033;
    overflow-wrap: anywhere;
}

.toggle-row {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #334155;
    font-weight: 700;
}

.toggle-row input {
    width: 18px;
    height: 18px;
}

:root[data-theme="dark"] .shop-location-meta span {
    background: rgba(17, 24, 39, 0.8);
    border-color: #334155;
    color: #dbe7f6;
}

:root[data-theme="dark"] .shop-location-summary__map,
:root[data-theme="dark"] .shop-location-preview {
    background: #172033;
    border-color: #334155;
}

:root[data-theme="dark"] .shop-location-readout dt {
    color: #b8c4d8;
}

:root[data-theme="dark"] .shop-location-readout dd,
:root[data-theme="dark"] .toggle-row {
    color: #eef4ff;
}

.contact-public-shell {
    padding: 1.5rem;
}

.contact-page {
    max-width: 1180px;
}

.contact-layout,
.contact-management-layout {
    display: grid;
    grid-template-columns: minmax(260px, 0.9fr) minmax(360px, 1.1fr);
    gap: 1rem;
    align-items: start;
}

.contact-form-panel {
    grid-column: 1 / -1;
}

.contact-info-panel,
.contact-map-panel,
.contact-form-panel,
.contact-message-detail,
.contact-message-list {
    min-width: 0;
}

.contact-info-list {
    display: grid;
    gap: 0.75rem;
    margin: 0 0 1rem;
}

.contact-info-list div {
    display: grid;
    gap: 0.2rem;
}

.contact-info-list dt {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.contact-info-list dd {
    min-width: 0;
    margin: 0;
    color: var(--text);
    font-weight: 700;
    overflow-wrap: anywhere;
}

.contact-info-list a {
    color: var(--primary);
}

.contact-map-frame {
    min-height: 330px;
    aspect-ratio: 1.55 / 1;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface-soft);
}

.contact-map-frame iframe {
    width: 100%;
    height: 100%;
    display: block;
    border: 0;
}

.contact-honeypot {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.contact-message-list .activity-list {
    display: grid;
    gap: 0.65rem;
}

.contact-message-row {
    display: grid;
    gap: 0.28rem;
    padding: 0.85rem;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
}

.contact-message-row:hover,
.contact-message-row:focus-visible,
.contact-message-row.is-active {
    border-color: #2563ff;
    background: #f6f9ff;
}

.contact-message-row.is-unread strong::after {
    content: "Unread";
    display: inline-flex;
    margin-left: 0.5rem;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    background: #fffbeb;
    color: #92400e;
    font-size: 0.7rem;
    font-weight: 900;
}

.contact-message-row span,
.contact-message-row small {
    color: var(--muted);
    overflow-wrap: anywhere;
}

.contact-message-row small {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.contact-message-body {
    display: grid;
    gap: 0.5rem;
    margin: 1rem 0;
    padding: 1rem;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--surface-accent);
}

.contact-message-body h3,
.contact-message-body p {
    margin: 0;
}

.contact-message-body p {
    color: var(--muted);
    line-height: 1.65;
}

:root[data-theme="dark"] .contact-map-frame,
:root[data-theme="dark"] .contact-message-row,
:root[data-theme="dark"] .contact-message-body {
    background: #172033;
    border-color: #334155;
}

:root[data-theme="dark"] .contact-message-row:hover,
:root[data-theme="dark"] .contact-message-row:focus-visible,
:root[data-theme="dark"] .contact-message-row.is-active {
    background: #10213f;
    border-color: #60a5fa;
}

:root[data-theme="dark"] .contact-message-row.is-unread strong::after {
    background: rgba(245, 158, 11, 0.16);
    color: #fbbf24;
}

.portal-contact-footer__heading {
    min-width: 0;
    display: grid;
    gap: 0.25rem;
}

.portal-contact-footer__heading h2 {
    margin: 0;
    color: #14213a;
    font-size: 1.12rem;
    line-height: 1.18;
    letter-spacing: 0;
}

.portal-contact-footer__heading p {
    max-width: 34ch;
    margin: 0;
    color: #5d687b;
    font-size: 0.88rem;
    line-height: 1.45;
}

.portal-contact-footer__links {
    min-width: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
}

.portal-contact-footer__link {
    min-width: 0;
    min-height: 62px;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.65rem;
    border: 1px solid rgba(205, 215, 232, 0.76);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.88);
    color: #1e293b;
    box-shadow: 0 8px 18px rgba(45, 68, 112, 0.06);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.portal-contact-footer__link:hover {
    transform: translateY(-1px);
    border-color: rgba(84, 112, 255, 0.36);
    color: #1d4ed8;
    box-shadow: 0 12px 24px rgba(37, 99, 255, 0.11);
}

.portal-contact-footer__link:focus-visible {
    outline: 3px solid rgba(37, 99, 255, 0.18);
    outline-offset: 3px;
}

.portal-contact-footer__icon {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    padding: 0.42rem;
    border-radius: 10px;
    background: linear-gradient(180deg, var(--surface-soft) 0%, var(--surface-accent) 100%);
    color: #2563ff;
    border: 1px solid rgba(195, 207, 229, 0.88);
}

.portal-contact-footer__icon path {
    vector-effect: non-scaling-stroke;
}

.portal-contact-footer__link span {
    min-width: 0;
    display: grid;
    gap: 0.2rem;
}

.portal-contact-footer__link strong {
    color: inherit;
    font-size: 0.86rem;
    line-height: 1.2;
}

.portal-contact-footer__link small {
    color: #657186;
    font-size: 0.76rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

:root[data-theme="dark"] .portal-contact-footer {
    background: rgba(17, 24, 39, 0.94);
    border-color: #263247;
    color: #e8eef9;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
}

:root[data-theme="dark"] .portal-contact-footer__heading h2 {
    color: #eef4ff;
}

:root[data-theme="dark"] .portal-contact-footer__heading p,
:root[data-theme="dark"] .portal-contact-footer__link small {
    color: #b8c4d8;
}

:root[data-theme="dark"] .portal-contact-footer__link {
    background: #141f31;
    border-color: #334155;
    color: #f8fafc;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}

:root[data-theme="dark"] .portal-contact-footer__link:hover {
    border-color: rgba(110, 162, 255, 0.48);
    color: #93c5fd;
}

:root[data-theme="dark"] .portal-contact-footer__icon {
    background: linear-gradient(180deg, #172033 0%, #101827 100%);
    border-color: #334155;
    color: #93c5fd;
}

.verification-table td {
    vertical-align: top;
}

.verification-id-link {
    display: inline-grid;
    gap: 0.45rem;
    color: var(--primary);
    font-weight: 800;
}

.verification-id-preview {
    width: 88px;
    height: 64px;
    object-fit: contain;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface-soft);
}

.verification-actions {
    display: grid;
    gap: 0.6rem;
    min-width: 220px;
}

.verification-actions .stack-form {
    display: grid;
    gap: 0.5rem;
}

:root[data-theme="dark"] .verification-id-preview {
    background: #172033;
    border-color: var(--line);
}

@media (max-width: 900px) {
    .portal-home {
        align-items: start;
        padding-top: 2rem;
        padding-bottom: 2rem;
    }

    .portal-home__wrap {
        max-width: 560px;
        gap: 1.5rem;
    }

    .portal-brand__logo {
        width: 96px;
        height: 96px;
        border-radius: 22px;
        margin-bottom: 1rem;
    }

    .portal-brand h1 {
        font-size: 2.45rem;
    }

    .portal-choice-grid--two {
        max-width: 520px;
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .portal-choice-card {
        min-height: auto;
        padding: 1.5rem;
    }

    .portal-choice-card p {
        min-height: 0;
    }

    .portal-customer-panel__intro {
        align-items: stretch;
        flex-direction: column;
    }

    .portal-link-button--compact {
        width: 100%;
    }

    .portal-product-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .portal-map-section {
        grid-template-columns: 1fr;
        max-width: 720px;
        padding: 1rem;
    }

    .shop-location-summary {
        grid-template-columns: 1fr;
    }

    .contact-layout,
    .contact-management-layout {
        grid-template-columns: 1fr;
    }

    .portal-map-section__content {
        justify-items: start;
    }

    .portal-map-section__button {
        width: fit-content;
    }

    .portal-map-section__frame {
        min-height: 260px;
    }

    .shop-location-summary__map,
    .shop-location-preview {
        min-height: 250px;
    }

    .contact-map-frame {
        min-height: 260px;
    }

    .portal-contact-footer {
        grid-template-columns: 1fr;
        max-width: 720px;
    }

    .portal-contact-footer__links {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .portal-home {
        padding: 8.25rem 1rem 1.25rem;
    }

    .portal-home__actions {
        left: 0.75rem;
        right: 0.75rem;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.5rem;
        width: auto;
        max-width: calc(100vw - 1.5rem);
        padding: 0;
    }

    .portal-home__actions > .btn:not(.topbar-home-link),
    .portal-home__actions .portal-home__action {
        width: auto;
        flex: 0 0 auto;
        min-width: 0;
        min-height: 40px;
        padding: 10px 16px;
        font-size: clamp(0.72rem, 2.8vw, 0.82rem);
        white-space: nowrap;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .portal-home__actions .portal-contact-nav {
        grid-column: auto;
        grid-row: auto;
    }

    .portal-home__wrap,
    .portal-choice-grid--two {
        width: 100%;
        max-width: 100%;
    }

    .portal-brand__logo {
        width: 76px;
        height: 76px;
        border-radius: 20px;
        margin-bottom: 0.75rem;
    }

    .portal-brand h1 {
        font-size: clamp(1.72rem, 8vw, 1.9rem);
        line-height: 1.08;
    }

    .portal-brand__subtitle {
        width: 100%;
        max-width: 100%;
        font-size: 0.92rem;
        line-height: 1.55;
        overflow-wrap: anywhere;
    }

    .portal-customer-panel,
    .portal-map-section,
    .portal-contact-footer {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .portal-choice-card {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0;
        padding: 1.2rem;
        border-radius: 22px;
    }

    .portal-choice-card__icon {
        width: 64px;
        height: 64px;
        border-radius: 18px;
        margin-bottom: 1rem;
    }

    .portal-choice-card h2 {
        max-width: 24ch;
        font-size: 1.22rem;
    }

    .portal-choice-card p {
        max-width: 28ch;
    }

    .portal-choice-card__list li {
        font-size: 0.9rem;
    }

    .portal-link-button {
        min-height: 52px;
    }

    .portal-customer-panel {
        padding: 1rem;
        border-radius: 22px;
    }

    .portal-map-section {
        padding: 0.8rem;
        border-radius: 19px;
        gap: 0.8rem;
    }

    .portal-map-section__content {
        padding: 0.15rem;
    }

    .portal-map-section__content h2 {
        font-size: 1.28rem;
    }

    .portal-map-section__content p {
        font-size: 0.9rem;
    }

    .portal-map-section__button {
        width: 100%;
        min-height: 42px;
    }

    .portal-map-section__frame {
        min-height: 220px;
        aspect-ratio: 1.18 / 1;
        border-radius: 16px;
    }

    .shop-location-summary {
        gap: 0.8rem;
    }

    .contact-public-shell {
        padding: 1rem;
    }

    .shop-location-summary__map,
    .shop-location-preview {
        min-height: 220px;
        aspect-ratio: 1.18 / 1;
        border-radius: 14px;
    }

    .contact-map-frame {
        min-height: 220px;
        aspect-ratio: 1.18 / 1;
        border-radius: 14px;
    }

    .shop-location-readout {
        grid-template-columns: 1fr;
    }

    .shop-location-meta span {
        width: 100%;
        border-radius: 14px;
    }

    .portal-contact-footer {
        padding: 0.85rem;
        border-radius: 18px;
        gap: 0.8rem;
    }

    .portal-contact-footer__heading h2 {
        font-size: 1.05rem;
    }

    .portal-contact-footer__heading p {
        font-size: 0.84rem;
    }

    .portal-contact-footer__links {
        grid-template-columns: 1fr;
        gap: 0.55rem;
    }

    .portal-contact-footer__link {
        min-height: 56px;
        padding: 0.55rem 0.6rem;
        border-radius: 13px;
    }

    .portal-product-search {
        grid-template-columns: 1fr;
    }

    .portal-product-grid {
        grid-template-columns: 1fr;
    }

    .portal-product-card {
        display: flex;
        flex-direction: column;
    }

    .portal-product-card__media {
        flex-basis: 170px;
        height: 170px;
    }

    .portal-product-card__footer {
        align-items: stretch;
    }

    .portal-product-card__actions {
        grid-template-columns: 1fr;
    }

    .portal-product-card__action {
        width: 100%;
    }
}

@media (max-width: 1180px) {
    .support-layout,
    .support-layout--console {
        grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
    }

    .support-new {
        grid-column: 1 / -1;
    }
}

@media (max-width: 820px) {
    .support-layout,
    .support-layout--console,
    .support-context-grid {
        grid-template-columns: 1fr;
    }

    .support-thread-list,
    .support-messages {
        max-height: none;
    }

    .support-messages {
        min-height: 280px;
    }

    .support-compose {
        grid-template-columns: 1fr;
    }

    .support-message {
        width: 100%;
    }
}

/* Shared responsive system: desktop >1024px, tablet 640-1024px, mobile <640px. */
.mobile-drawer__extras {
    display: grid;
    gap: 0.85rem;
}

.topbar-drawer-toggle {
    display: none;
}

@media (max-width: 1024px) {
    .topbar-drawer-toggle,
    .menu-toggle {
        display: inline-grid;
    }

    .customer-topbar,
    .ops-topbar,
    .topbar--public {
        flex-wrap: nowrap;
        align-items: center;
        gap: 0.75rem;
    }

    .customer-topbar__brand,
    .topbar__brand,
    .ops-topbar__left {
        min-width: 0;
        flex: 1 1 auto;
    }

    .customer-topbar__brand strong,
    .brand-link strong {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .ops-topbar__left {
        flex-wrap: nowrap;
    }

    .ops-search {
        min-width: 0;
        flex: 1 1 auto;
    }

    .ops-search input {
        width: 100%;
        min-width: 0;
    }

    .btn,
    button,
    input,
    select,
    textarea,
    .portal-link-button,
    .notification-button,
    .customer-topbar__logout,
    .ops-topbar__logout {
        min-height: 44px;
    }

    .topbar__actions,
    .customer-topbar__nav,
    .customer-topbar__user,
    .ops-topbar__right {
        min-width: 0;
    }

    .sidebar,
    .sidebar--shared-drawer {
        position: fixed;
        inset: 74px auto 0 0;
        width: min(84vw, 300px);
        height: calc(100vh - 74px);
        height: calc(100dvh - 74px);
        max-height: calc(100vh - 74px);
        max-height: calc(100dvh - 74px);
        border-right: 0;
        box-shadow: 0 24px 60px rgba(15, 23, 42, 0.16);
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        transform: translateX(-110%);
        transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.22s ease;
        z-index: 45;
    }

    .sidebar.is-open,
    .sidebar--shared-drawer.is-open {
        transform: translateX(0);
    }

    .mobile-drawer__extras {
        border-bottom: 1px solid var(--line);
        margin-bottom: 1rem;
        padding-bottom: 1rem;
    }

    .mobile-drawer__extras > *,
    .mobile-drawer__extras .topbar__actions,
    .mobile-drawer__extras .topbar__account-actions,
    .mobile-drawer__extras .customer-topbar__nav,
    .mobile-drawer__extras .customer-topbar__user,
    .mobile-drawer__extras .ops-topbar__right,
    .mobile-drawer__extras .ops-topbar__user {
        width: 100%;
        margin-left: 0;
        display: grid;
        grid-template-columns: 1fr;
        justify-items: stretch;
        align-items: stretch;
        gap: 0.55rem;
    }

    .mobile-drawer__extras .notification-center,
    .mobile-drawer__extras .btn,
    .mobile-drawer__extras a,
    .mobile-drawer__extras button {
        justify-self: stretch;
    }

    .mobile-drawer__extras .notification-button,
    .mobile-drawer__extras .customer-topbar__avatar,
    .mobile-drawer__extras .ops-topbar__avatar,
    .mobile-drawer__extras .customer-topbar__logout,
    .mobile-drawer__extras .ops-topbar__logout {
        justify-self: start;
    }

    .mobile-drawer__extras .notification-panel {
        left: 0;
        right: auto;
        width: min(100%, 260px);
    }

    .app-shell,
    .content-grid,
    .receipt-card .content-grid {
        display: block;
    }

    .metric-grid,
    .summary-grid,
    .payment-method-grid {
        grid-template-columns: 1fr !important;
    }

    .table-responsive {
        overflow-x: visible;
    }

    .table-responsive .data-table,
    .data-table {
        display: block;
        width: 100%;
        min-width: 0 !important;
        border-spacing: 0;
    }

    .data-table thead {
        display: none;
    }

    .data-table tbody {
        display: grid;
        gap: 0.85rem;
        width: 100%;
    }

    .data-table tr {
        display: block;
        width: 100%;
        border: 1px solid var(--line);
        border-radius: var(--radius-sm);
        background: var(--surface);
        padding: 0.75rem;
    }

    .data-table tbody tr:hover {
        transform: none;
    }

    .data-table td {
        display: grid;
        grid-template-columns: minmax(8rem, 38%) minmax(0, 1fr);
        align-items: start;
        gap: 0.75rem;
        width: 100%;
        border: 0;
        padding: 0.65rem 0;
        text-align: left;
        overflow-wrap: anywhere;
    }

    .data-table td + td {
        border-top: 1px solid var(--line);
    }

    .data-table td::before {
        content: attr(data-label);
        color: var(--muted);
        font-weight: 800;
    }

    .data-table td[colspan] {
        display: block;
    }

    .data-table td[colspan]::before {
        content: none;
    }

    .data-table td .inline-form,
    .data-table td .stack-form,
    .data-table td .table-actions {
        justify-content: flex-start;
        max-width: 100%;
    }
}

@media (max-width: 640px) {
    h1 {
        font-size: clamp(1.7rem, 8vw, 2.2rem);
    }

    h2 {
        font-size: clamp(1.25rem, 6vw, 1.65rem);
    }

    .customer-topbar,
    .ops-topbar,
    .topbar--public {
        padding-left: 0.85rem;
        padding-right: 0.85rem;
    }

    .menu-toggle {
        width: 44px;
        height: 44px;
        flex-basis: 44px;
        border-radius: 14px;
    }

    .customer-topbar > .topbar-drawer-toggle,
    .topbar--public > .topbar-drawer-toggle,
    .portal-home__actions > .topbar-drawer-toggle {
        margin-left: auto;
    }

    .guest-cart__scrim {
        position: fixed;
        inset: 0;
        z-index: 48;
        background: rgba(15, 23, 42, 0.28);
    }

    .guest-cart__panel {
        position: fixed;
        inset: 74px 0.75rem 0.75rem 0.75rem;
        z-index: 50;
        width: auto;
        max-height: none;
        border-radius: 20px;
        animation: mobile-drawer-in 0.24s ease-out;
    }

    .guest-cart__item {
        grid-template-columns: 64px minmax(0, 1fr);
        align-items: start;
    }

    .guest-cart__item-media {
        width: 64px;
        height: 64px;
    }

    .guest-cart__item-summary {
        grid-column: 1 / -1;
        grid-template-columns: 1fr;
        justify-items: stretch;
        text-align: left;
    }

    .guest-cart__item-summary strong {
        text-align: right;
    }

    .guest-cart__item-summary .btn,
    .guest-cart__actions > * {
        width: 100%;
    }

    .guest-cart__actions {
        display: grid;
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .ops-topbar__left .ops-search {
        order: 1;
    }

    .ops-topbar__left .menu-toggle {
        order: 2;
        margin-left: auto;
        flex: 0 0 44px;
    }

    .ops-search input {
        min-height: 44px;
        padding: 0.75rem 0.8rem;
    }

    .customer-topbar__logo {
        width: 38px;
        height: 38px;
    }

    .customer-topbar__brand strong,
    .brand-link strong {
        max-width: 46vw;
    }

    .app-main,
    .customer-shell,
    .landing,
    .portal-home {
        padding-left: 0.85rem;
        padding-right: 0.85rem;
    }

    .section {
        margin-bottom: 1rem;
    }

    .section__heading,
    .card-head,
    .receipt-card__header,
    .cart-summary,
    .summary-total,
    .section__actions,
    .table-actions {
        display: grid;
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .toolbar,
    .form-grid,
    .inline-form,
    .stack-form,
    .checkout-stack,
    .payment-stack,
    .product-card__footer,
    .cart-item__controls,
    .cart-item__summary,
    .support-compose {
        display: grid;
        grid-template-columns: 1fr !important;
        align-items: stretch;
    }

    .toolbar > *,
    .form-grid > *,
    .inline-form > *:not([type="hidden"]),
    .stack-form > *:not([type="hidden"]),
    .section__actions > *,
    .table-actions > *,
    .checkout-stack > *,
    .payment-stack > * {
        width: 100%;
        min-width: 0;
    }

    .btn,
    button,
    input,
    select,
    textarea,
    .portal-link-button {
        min-height: 44px;
    }

    .page-panel,
    .form-card,
    .info-card,
    .receipt-card,
    .metric-box,
    .empty-state,
    .product-card,
    .cart-item {
        max-width: 100%;
        width: 100%;
        padding: 1rem;
    }

    .data-table td {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }

    .data-table td::before {
        font-size: 0.78rem;
        text-transform: uppercase;
        letter-spacing: 0.08em;
    }

    .summary-list li,
    .activity-list li {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.3rem;
    }

    .notification-panel {
        width: min(100vw - 1.7rem, 340px);
        right: 0;
    }
}

/* Shared compact product cards: preserve desktop cards, reflow only below tablet. */
@media (max-width: 640px) {
    .portal-product-grid,
    .catalog-menu-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 0.65rem;
        width: 100%;
    }

    .portal-product-card,
    .product-card {
        min-width: 0;
        width: 100%;
        border-radius: 16px;
    }

    .portal-product-card__media,
    .product-card__media {
        flex: 0 0 auto;
        width: 100%;
        height: auto;
        min-height: 0;
        aspect-ratio: 4 / 3;
        padding: 0.45rem;
    }

    .portal-product-card__media img,
    .product-card__media img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 11px;
    }

    .portal-product-card__body,
    .product-card__body {
        gap: 0.25rem;
        padding: 0.62rem 0.65rem 0.45rem;
    }

    .portal-product-card__body h3,
    .product-card__body h3 {
        min-height: 2.4em;
        margin: 0;
        font-size: 0.82rem;
        line-height: 1.2;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        overflow-wrap: anywhere;
    }

    .portal-product-card__description {
        min-height: 0;
        font-size: 0.76rem;
        line-height: 1.25;
        -webkit-line-clamp: 2;
    }

    .portal-product-card__footer,
    .product-card__footer {
        gap: 0.5rem;
        padding: 0.5rem 0.65rem 0.65rem;
    }

    .portal-product-card__purchase {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.3rem;
    }

    .portal-product-card__footer strong,
    .product-card__footer > strong,
    .product-card__body strong {
        padding: 0.2rem 0.45rem;
        font-size: 0.84rem;
        line-height: 1.2;
    }

    .portal-product-card__stock {
        justify-content: flex-start;
        padding: 0.18rem 0.4rem;
        font-size: 0.68rem;
        text-align: left;
    }

    .portal-product-card__actions {
        grid-template-columns: 1fr;
        gap: 0.4rem;
    }

    .portal-product-card__action,
    .portal-product-card__add {
        min-height: 44px;
        height: 44px;
        padding: 0.45rem 0.5rem;
        border-radius: 9px;
        font-size: 0.76rem;
        line-height: 1.1;
        white-space: normal;
    }
}

@media (max-width: 359px) {
    .portal-product-grid,
    .catalog-menu-grid {
        grid-template-columns: 1fr !important;
        gap: 0.75rem;
    }

    .portal-product-card__actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .portal-product-card__action,
    .portal-product-card__add {
        white-space: nowrap;
    }
}

@media print {
    .customer-topbar,
    .ops-topbar,
    .sidebar,
    .btn,
    .flash-stack,
    .no-print {
        display: none !important;
    }

    body {
        background: #fff;
    }

    .app-shell {
        display: block;
    }

    .app-main,
    .customer-shell {
        padding: 0;
    }

    .section,
    .page-panel {
        max-width: none;
        box-shadow: none;
        border: 0;
    }
}

/* Shared phone density baseline for the components declared before this point. */
@media (max-width: 640px) {
    :root {
        --phone-gutter: 0.7rem;
    }

    html,
    body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    body {
        font-size: clamp(0.875rem, 3.8vw, 0.9375rem);
        line-height: 1.45;
    }

    .customer-topbar,
    .ops-topbar,
    .topbar--public {
        min-height: 60px;
        padding: 0.5rem var(--phone-gutter);
    }

    .app-main,
    .customer-shell,
    .landing,
    .portal-home {
        padding: 0.75rem var(--phone-gutter) 1rem;
    }

    .section {
        margin-bottom: 0.8rem;
    }

    .section__heading,
    .card-head,
    .receipt-card__header {
        gap: 0.4rem;
        margin-bottom: 0.6rem;
    }

    h1,
    .section__heading h1 {
        font-size: clamp(1.45rem, 6.8vw, 1.85rem);
        line-height: 1.15;
    }

    h2,
    .section__heading h2,
    .card-head h2 {
        font-size: clamp(1.08rem, 5.4vw, 1.32rem);
        line-height: 1.22;
    }

    .page-panel,
    .form-card,
    .info-card,
    .receipt-card,
    .metric-box,
    .summary-card,
    .empty-state,
    .portal-choice-card,
    .auth-card,
    .cart-item {
        padding: 0.75rem;
        border-radius: 14px;
    }

    .auth-page {
        padding: 0.75rem 0.7rem;
    }

    .auth-page__inner,
    .auth-card {
        width: 100% !important;
        max-width: 100% !important;
    }

    .portal-home {
        padding-top: 1.25rem;
        padding-bottom: 1.25rem;
    }

    .portal-home.portal-home--browse {
        padding-top: 4.35rem;
    }

    .portal-brand__logo {
        width: 68px;
        height: 68px;
        margin-bottom: 0.65rem;
    }

    .portal-brand h1 {
        font-size: clamp(1.65rem, 8vw, 2.05rem);
    }

    .portal-choice-card {
        min-height: 0;
    }

    .portal-choice-card__icon {
        width: 42px;
        height: 42px;
        margin-bottom: 0.55rem;
        border-radius: 13px;
    }

    .portal-choice-card h2 {
        margin-bottom: 0.3rem;
        font-size: 1rem;
    }

    .portal-choice-card p,
    .portal-choice-card__list {
        margin-top: 0.45rem;
        font-size: 0.8rem;
        line-height: 1.4;
    }

    .metric-grid,
    .summary-grid {
        gap: 0.55rem !important;
    }

    .metric-box,
    .summary-card {
        min-height: 0;
        padding: 0.7rem;
    }

    .metric-box__icon {
        width: 38px;
        height: 38px;
        margin-bottom: 0.4rem;
        border-radius: 11px;
        font-size: 1rem;
    }

    .metric-box strong,
    .summary-card strong {
        font-size: clamp(1.12rem, 5.8vw, 1.45rem);
    }

    .metric-box span,
    .summary-card span {
        font-size: 0.7rem;
    }

    .btn,
    button,
    .portal-link-button {
        min-height: 44px;
        padding: 0.55rem 0.75rem;
        font-size: 0.84rem;
        line-height: 1.2;
    }

    .btn-sm {
        min-height: 38px;
        padding: 0.4rem 0.6rem;
        font-size: 0.76rem;
    }

    input:not([type="checkbox"]):not([type="radio"]),
    select,
    textarea {
        min-height: 44px;
        padding: 0.6rem 0.7rem;
        font-size: 16px;
    }

    textarea {
        min-height: 84px;
    }

    .badge,
    .priority-badge,
    .customer-topbar__badge,
    .topbar-cart-link__badge,
    .notification-button__badge {
        min-width: 0;
        max-width: 100%;
        min-height: 20px;
        padding: 0.18rem 0.45rem;
        font-size: 0.66rem;
        line-height: 1.15;
        white-space: nowrap;
    }

    .data-table tbody {
        gap: 0.55rem;
    }

    .data-table tr {
        padding: 0.65rem 0.7rem;
        border-radius: 12px;
    }

    .data-table td {
        gap: 0.15rem;
        padding: 0.4rem 0;
        font-size: 0.8rem;
        line-height: 1.35;
    }

    .data-table td::before {
        font-size: 0.64rem;
        letter-spacing: 0.06em;
    }

    .notification-panel {
        top: 4.25rem;
        right: 0.6rem;
        left: 0.6rem;
        width: auto;
        max-height: calc(100dvh - 4.9rem);
        border-radius: 14px;
    }

    .notification-panel__header {
        gap: 0.45rem;
        padding: 0.65rem;
    }

    .notification-panel__list {
        gap: 0.35rem;
        padding: 0.5rem;
    }

    .notification-panel__item {
        gap: 0.4rem;
        min-height: 42px;
        padding: 0.5rem;
        border-radius: 10px;
    }

    .notification-panel__item strong,
    .notification-history-item__title strong {
        font-size: 0.82rem;
        line-height: 1.25;
    }

    .notification-panel__item small,
    .notification-history-item small {
        font-size: 0.7rem;
        line-height: 1.35;
    }

    .notification-history-list {
        gap: 0.5rem;
    }

    .notification-history-item,
    .app-shell .notification-history-item {
        grid-template-columns: 36px minmax(0, 1fr);
        gap: 0.5rem;
        padding: 0.65rem;
        border-radius: 12px;
    }

    .notification-history-item__icon,
    .app-shell .notification-history-item__icon {
        width: 36px;
        height: 36px;
        border-radius: 10px;
    }

    .notification-history-item > .badge,
    .app-shell .notification-history-item > .badge {
        min-height: 18px;
        height: 18px;
        padding: 0 0.38rem;
        font-size: 0.6rem;
        white-space: nowrap;
    }

    .flash-stack {
        top: 0.55rem;
        right: 0.55rem;
        left: 0.55rem;
        width: auto;
    }
}

@media (max-width: 389px) {
    :root {
        --phone-gutter: 0.6rem;
    }

    .metric-grid,
    .summary-grid {
        grid-template-columns: 1fr !important;
    }

    .page-panel,
    .form-card,
    .info-card,
    .receipt-card,
    .metric-box,
    .summary-card,
    .empty-state,
    .portal-choice-card,
    .auth-card,
    .cart-item {
        padding: 0.68rem;
        border-radius: 12px;
    }

    .portal-product-grid,
    .catalog-menu-grid {
        gap: 0.5rem;
    }
}

/* Shared request feedback for normal forms and AJAX actions. */
form[data-submitting="true"],
form[data-notification-pending="true"] {
    cursor: progress;
}

button[aria-busy="true"],
input[type="submit"][aria-busy="true"] {
    pointer-events: none;
    cursor: wait !important;
    opacity: 0.72;
}

button[aria-busy="true"] {
    transform: none !important;
}

button[aria-busy="true"]::after {
    content: "";
    flex: 0 0 auto;
    width: 0.82em;
    height: 0.82em;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: system-submit-spin 0.75s linear infinite;
}

@keyframes system-submit-spin {
    to {
        transform: rotate(360deg);
    }
}

.notification-request-status {
    margin: 0;
    padding: 0.65rem 0.75rem;
    border: 1px solid rgba(22, 163, 74, 0.24);
    border-radius: 12px;
    background: rgba(22, 163, 74, 0.08);
    color: #166534;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.4;
}

.notification-request-status.is-error {
    border-color: rgba(220, 38, 38, 0.26);
    background: rgba(220, 38, 38, 0.08);
    color: #b91c1c;
}

.notification-request-status[hidden],
.support-form-status[hidden] {
    display: none !important;
}

:root[data-theme="dark"] .notification-request-status {
    color: #86efac;
}

:root[data-theme="dark"] .notification-request-status.is-error {
    color: #fca5a5;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        transition-delay: 0ms !important;
    }
}

/* Compact operations notifications inside the mobile/tablet drawer. */
@media (max-width: 1024px) {
    .mobile-drawer__extras .ops-topbar__right .notification-center {
        grid-template-columns: 42px minmax(0, 1fr) !important;
        gap: 0.6rem !important;
        min-height: 52px !important;
        padding: 0.3rem 0.5rem !important;
        overflow: visible;
    }

    .mobile-drawer__extras .ops-topbar__right .notification-button {
        width: 42px !important;
        min-width: 42px !important;
        max-width: 42px !important;
        height: 42px !important;
        min-height: 42px !important;
        max-height: 42px !important;
        justify-self: start !important;
        padding: 0 !important;
        border-radius: 13px !important;
    }

    .mobile-drawer__extras .ops-topbar__right .notification-button__icon {
        width: 20px;
        height: 20px;
    }

    .mobile-drawer__extras .ops-topbar__right .notification-button__badge {
        top: -4px;
        right: -4px;
        min-width: 17px;
        height: 17px;
        padding: 0 0.25rem;
        border-width: 1px;
        font-size: 0.58rem;
        box-shadow: 0 4px 10px rgba(255, 77, 79, 0.2);
    }

    .mobile-drawer__extras .ops-topbar__right .notification-button.has-unread::after {
        display: none;
    }

    .mobile-drawer__extras .ops-topbar__right .notification-panel {
        position: static !important;
        inset: auto !important;
        grid-column: 1 / -1;
        grid-template-rows: auto minmax(96px, 1fr) auto;
        width: 100% !important;
        max-width: 100% !important;
        max-height: min(60vh, 480px) !important;
        max-height: min(60dvh, 480px) !important;
        margin: 0.45rem 0 0 !important;
        border-radius: 16px;
        overflow: hidden;
        box-sizing: border-box;
    }

    .mobile-drawer__extras .ops-topbar__right .notification-panel__header {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 0.5rem;
        padding: 0.65rem;
    }

    .mobile-drawer__extras .ops-topbar__right .notification-panel__heading {
        gap: 0.05rem;
    }

    .mobile-drawer__extras .ops-topbar__right .notification-panel__heading strong {
        font-size: 0.9rem;
    }

    .mobile-drawer__extras .ops-topbar__right .notification-panel__heading span {
        font-size: 0.72rem;
    }

    .mobile-drawer__extras .ops-topbar__right .notification-panel__header-actions {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) minmax(0, 0.8fr) 32px;
        align-items: center;
        gap: 0.35rem;
        width: 100%;
        min-width: 0;
    }

    .mobile-drawer__extras .ops-topbar__right .notification-panel__bulk-form {
        display: block !important;
        width: auto !important;
        min-width: 0;
    }

    .mobile-drawer__extras .ops-topbar__right .notification-panel__header-actions .auth-link {
        width: 100% !important;
        min-width: 0;
        min-height: 32px !important;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0.3rem 0.35rem;
        border: 1px solid var(--border);
        border-radius: 9px;
        background: var(--surface);
        font-size: 0.68rem;
        line-height: 1.1;
        text-align: center;
        white-space: nowrap;
    }

    .mobile-drawer__extras .ops-topbar__right .notification-panel__close {
        width: 32px !important;
        min-width: 32px !important;
        max-width: 32px !important;
        height: 32px !important;
        min-height: 32px !important;
        max-height: 32px !important;
        justify-self: end !important;
        border-radius: 9px;
        font-size: 1.05rem;
    }

    .mobile-drawer__extras .ops-topbar__right .notification-panel__list {
        gap: 0.4rem;
        max-height: min(28vh, 210px);
        max-height: min(28dvh, 210px);
        padding: 0.55rem;
        overflow-x: hidden;
        overflow-y: auto;
    }

    .mobile-drawer__extras .ops-topbar__right .notification-panel__item {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 0.45rem;
        min-width: 0;
        min-height: 44px;
        padding: 0.55rem;
        border-radius: 11px;
        box-shadow: none;
    }

    .mobile-drawer__extras .ops-topbar__right .notification-panel__item strong {
        font-size: 0.8rem;
        line-height: 1.25;
    }

    .mobile-drawer__extras .ops-topbar__right .notification-panel__item small {
        font-size: 0.67rem;
        line-height: 1.25;
    }

    .mobile-drawer__extras .ops-topbar__right .notification-panel__item > .badge {
        min-width: 0;
        min-height: 20px;
        height: 20px;
        padding: 0 0.35rem;
        font-size: 0.68rem;
        white-space: nowrap;
    }

    .mobile-drawer__extras .ops-topbar__right .notification-panel__empty {
        padding: 0.7rem;
        border-radius: 11px;
        font-size: 0.78rem;
    }

    .mobile-drawer__extras .ops-topbar__right .notification-panel__detail {
        gap: 0.4rem;
        max-height: min(24vh, 180px);
        max-height: min(24dvh, 180px);
        padding: 0.65rem;
        overflow-x: hidden;
        overflow-y: auto;
    }

    .mobile-drawer__extras .ops-topbar__right .notification-panel__detail .eyebrow {
        font-size: 0.62rem;
    }

    .mobile-drawer__extras .ops-topbar__right .notification-panel__detail h3 {
        font-size: 0.88rem;
        line-height: 1.25;
        overflow-wrap: anywhere;
    }

    .mobile-drawer__extras .ops-topbar__right .notification-panel__detail p {
        font-size: 0.74rem;
        line-height: 1.4;
        overflow-wrap: anywhere;
    }

    .mobile-drawer__extras .ops-topbar__right .notification-panel__detail dl {
        grid-template-columns: 1fr;
        gap: 0.35rem;
    }

    .mobile-drawer__extras .ops-topbar__right .notification-panel__detail dl > div {
        grid-template-columns: 82px minmax(0, 1fr);
        align-items: start;
        gap: 0.35rem;
    }

    .mobile-drawer__extras .ops-topbar__right .notification-panel__detail dt {
        font-size: 0.62rem;
    }

    .mobile-drawer__extras .ops-topbar__right .notification-panel__detail dd {
        min-width: 0;
        font-size: 0.7rem;
        overflow-wrap: anywhere;
    }
}

@media (max-width: 640px) {
    .notification-page > .metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 0.5rem;
    }

    .notification-page > .metric-grid .metric-box {
        min-height: 0;
        padding: 0.7rem;
    }

    .notification-page__panel {
        gap: 0.65rem;
        padding: 0.65rem !important;
    }

    .notification-page__toolbar {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.5rem;
    }

    .notification-filter-tabs {
        grid-column: 1 / -1;
        display: flex !important;
        flex-wrap: nowrap !important;
        gap: 0.35rem;
        width: 100%;
        padding-bottom: 0.2rem;
        overflow-x: auto;
        scrollbar-width: thin;
    }

    .notification-filter-tabs__item {
        min-height: 36px;
        flex: 0 0 auto;
        padding: 0.4rem 0.65rem;
        font-size: 0.75rem;
    }

    .notification-page__toolbar .inline-form,
    .notification-page__toolbar .btn {
        width: 100%;
        min-width: 0;
        min-height: 40px;
        margin: 0;
        padding-left: 0.45rem;
        padding-right: 0.45rem;
        font-size: 0.7rem;
        white-space: normal;
    }

    .notification-history-list {
        gap: 0.5rem;
    }

    .notification-history-item {
        grid-template-columns: 36px minmax(0, 1fr);
        align-items: start;
        gap: 0.55rem;
        min-width: 0;
        padding: 0.65rem;
        border-radius: 13px;
    }

    .notification-history-item__icon {
        width: 36px;
        height: 36px;
        border-radius: 11px;
        font-size: 0.82rem;
    }

    .notification-history-item__body {
        gap: 0.18rem;
    }

    .notification-history-item__title {
        gap: 0.35rem;
    }

    .notification-history-item__title strong {
        font-size: 0.86rem;
        line-height: 1.25;
    }

    .notification-history-item__meta,
    .notification-history-item small {
        font-size: 0.7rem;
        line-height: 1.35;
    }

    .notification-history-item > .badge {
        grid-column: 2;
        justify-self: start;
        min-height: 18px;
        height: 18px;
        padding: 0 0.4rem;
        font-size: 0.6rem;
    }

    .notification-detail-modal {
        width: calc(100vw - 1rem);
        max-height: calc(100dvh - 1rem);
        margin: auto;
    }

    .notification-detail-modal__card {
        gap: 0.6rem;
        max-height: calc(100dvh - 1rem);
        padding: 0.85rem;
        border-radius: 16px;
        overflow-y: auto;
    }

    .notification-detail-modal h2 {
        font-size: 1.05rem;
    }

    .notification-detail-modal p {
        font-size: 0.8rem;
        line-height: 1.45;
    }

    .notification-detail-modal__meta {
        grid-template-columns: 1fr;
        gap: 0.45rem;
    }

    .notification-detail-modal__meta div {
        padding: 0.55rem;
        border-radius: 11px;
    }
}

@media (max-width: 359px) {
    .mobile-drawer__extras .ops-topbar__right .notification-panel__header-actions {
        grid-template-columns: 1fr 1fr;
    }

    .mobile-drawer__extras .ops-topbar__right .notification-panel__close {
        grid-column: 1 / -1;
        justify-self: end !important;
    }

    .mobile-drawer__extras .ops-topbar__right .notification-panel__detail dl > div {
        grid-template-columns: 1fr;
    }
}

/* Shared final responsive guardrails. These rules only affect mobile/tablet. */
@media (max-width: 1024px) {
    html,
    body {
        max-width: 100%;
        overflow-x: hidden;
    }

    .app-main,
    .customer-shell,
    .landing,
    .portal-home,
    .section,
    .page-panel,
    .form-card,
    .content-grid,
    .metric-grid,
    .summary-grid,
    .toolbar,
    .form-grid {
        min-width: 0;
        max-width: 100%;
    }

    .sidebar,
    .sidebar--shared-drawer {
        overscroll-behavior: contain;
        scrollbar-gutter: stable;
    }

    .data-table td,
    .data-table td > *,
    .data-table td .table-actions,
    .data-table td .inline-form,
    .data-table td .stack-form {
        min-width: 0;
        max-width: 100%;
    }
}

@media (max-width: 640px) {
    .btn,
    button,
    input,
    select,
    textarea {
        max-width: 100%;
    }

    .toolbar,
    .form-grid,
    .inline-form,
    .stack-form,
    .checkout-stack,
    .payment-stack,
    .support-compose {
        width: 100%;
        min-width: 0;
    }

    .toolbar > *,
    .form-grid > *,
    .inline-form > *:not([type="hidden"]),
    .stack-form > *:not([type="hidden"]) {
        min-width: 0;
        max-width: 100%;
    }

    .section__heading h1,
    .section__heading h2,
    .card-head h2 {
        overflow-wrap: anywhere;
    }
}

/* Final responsive guardrails for the shared hamburger menu control. */
.menu-toggle[data-toggle-sidebar] {
    display: inline-grid !important;
    place-items: center !important;
    width: 44px !important;
    min-width: 44px !important;
    max-width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    flex: 0 0 44px !important;
    padding: 0 !important;
    border-radius: 14px !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
}

.menu-toggle[data-toggle-sidebar] .menu-toggle__bars {
    display: block !important;
    width: 22px !important;
    height: 17px !important;
    opacity: 1 !important;
    visibility: visible !important;
}

.menu-toggle[data-toggle-sidebar] .menu-toggle__bar {
    display: block !important;
    width: 22px !important;
    height: 3px !important;
    opacity: 1;
    visibility: visible !important;
    background: currentColor !important;
}

.menu-toggle[data-toggle-sidebar].is-open .menu-toggle__bar:nth-child(2) {
    opacity: 0 !important;
}

@media (min-width: 1025px) {
    .customer-topbar > .menu-toggle[data-toggle-sidebar],
    .topbar--public > .menu-toggle[data-toggle-sidebar],
    .portal-home__actions > .menu-toggle[data-toggle-sidebar] {
        display: none !important;
    }
}

.sidebar--shared-drawer {
    position: fixed !important;
    inset: 0 auto 0 0 !important;
    z-index: 1000 !important;
    width: min(85vw, 340px) !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-height: 100vh !important;
    max-height: 100dvh !important;
    padding: 1rem !important;
    border-right: 0 !important;
    border-radius: 0 20px 20px 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    box-shadow: 18px 0 48px rgba(15, 23, 42, 0.28) !important;
    transform: translate3d(-105%, 0, 0) !important;
    transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.22s ease;
}

.sidebar--shared-drawer.is-open {
    transform: translate3d(0, 0, 0) !important;
}

.sidebar--shared-drawer .sidebar__header {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) 44px;
    align-items: center;
    gap: 0.75rem;
}

.sidebar--shared-drawer .sidebar__header > :not(.sidebar__logo):not(.sidebar__close) {
    min-width: 0;
}

.sidebar--shared-drawer .sidebar__close {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--bg-soft);
    color: var(--text);
    font-size: 1.7rem;
    line-height: 1;
    cursor: pointer;
}

body.sidebar-desktop-collapsed .app-shell {
    grid-template-columns: 0 minmax(0, 1fr);
}

body.sidebar-desktop-collapsed .app-shell > .sidebar {
    width: 0;
    min-width: 0;
    padding-left: 0;
    padding-right: 0;
    border-right: 0;
    opacity: 0;
    pointer-events: none;
    overflow: hidden;
}

/* Role portals keep a real sidebar on desktop. The phone/tablet rules below
   convert the same element into the fixed overlay drawer. */
@media (min-width: 1025px) {
    body:has(.app-shell > .sidebar[data-sidebar]) {
        height: 100vh;
        height: 100dvh;
        overflow: hidden;
    }

    body:has(.app-shell > .sidebar[data-sidebar]) .customer-topbar,
    body:has(.app-shell > .sidebar[data-sidebar]) .ops-topbar {
        position: fixed;
        inset: 0 0 auto 0;
        z-index: 20;
        width: 100%;
    }

    .app-shell:has(> .sidebar[data-sidebar]) {
        --desktop-sidebar-width: 270px;
        --desktop-header-height: 74px;
        display: block;
        min-height: 0;
        height: calc(100vh - var(--desktop-header-height));
        height: calc(100dvh - var(--desktop-header-height));
        margin-top: var(--desktop-header-height);
        overflow: hidden;
    }

    .app-shell:has(> .sidebar[data-sidebar]) > .app-main {
        height: calc(100vh - var(--desktop-header-height));
        height: calc(100dvh - var(--desktop-header-height));
        max-height: calc(100vh - var(--desktop-header-height));
        max-height: calc(100dvh - var(--desktop-header-height));
        margin-left: var(--desktop-sidebar-width);
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        transition: margin-left 0.24s ease;
    }

    .app-shell > .sidebar[data-sidebar]:not(.sidebar--shared-drawer) {
        position: fixed !important;
        inset: var(--desktop-header-height) auto 0 0 !important;
        z-index: 19 !important;
        align-self: start;
        width: var(--desktop-sidebar-width) !important;
        min-width: 0;
        height: calc(100vh - var(--desktop-header-height)) !important;
        height: calc(100dvh - var(--desktop-header-height)) !important;
        max-height: calc(100vh - var(--desktop-header-height)) !important;
        max-height: calc(100dvh - var(--desktop-header-height)) !important;
        padding: 1.25rem !important;
        border-right: 1px solid var(--line) !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        opacity: 1;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        pointer-events: auto;
        transform: none !important;
        transition: opacity 0.18s ease, padding 0.24s ease, width 0.24s ease;
    }

    body.sidebar-desktop-collapsed .app-shell:has(> .sidebar[data-sidebar]) > .app-main {
        margin-left: 0;
    }

    body.sidebar-desktop-collapsed .app-shell > .sidebar[data-sidebar]:not(.sidebar--shared-drawer) {
        width: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        border-right: 0 !important;
        opacity: 0;
        pointer-events: none;
    }
}

@media (max-width: 1024px) {
    .menu-toggle[data-toggle-sidebar] {
        display: inline-grid !important;
        place-items: center !important;
        width: 44px !important;
        min-width: 44px !important;
        max-width: 44px !important;
        height: 44px !important;
        min-height: 44px !important;
        max-height: 44px !important;
        flex: 0 0 44px !important;
        padding: 0 !important;
        margin: 0 !important;
        border-radius: 14px !important;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
    }

    .sidebar-backdrop {
        z-index: 990 !important;
    }

    .sidebar,
    .sidebar--shared-drawer,
    .sidebar--portal-drawer {
        position: fixed !important;
        inset: 0 auto 0 0 !important;
        z-index: 1000 !important;
        width: min(85vw, 320px) !important;
        height: 100vh !important;
        height: 100dvh !important;
        max-height: 100vh !important;
        max-height: 100dvh !important;
        padding: 1rem !important;
        border-right: 0 !important;
        border-radius: 0 20px 20px 0 !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        box-shadow: 18px 0 48px rgba(15, 23, 42, 0.28) !important;
        transform: translate3d(-105%, 0, 0) !important;
    }

    .sidebar.is-open,
    .sidebar--shared-drawer.is-open,
    .sidebar--portal-drawer.is-open {
        transform: translate3d(0, 0, 0) !important;
    }

    .menu-toggle.is-open {
        z-index: 1001;
    }

    .menu-toggle[data-toggle-sidebar] .menu-toggle__bars {
        display: block !important;
        width: 22px !important;
        height: 17px !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    .menu-toggle[data-toggle-sidebar] .menu-toggle__bar {
        display: block !important;
        width: 22px !important;
        height: 3px !important;
        opacity: 1;
        visibility: visible !important;
        background: currentColor !important;
    }

    .menu-toggle[data-toggle-sidebar].is-open .menu-toggle__bar:nth-child(2) {
        opacity: 0 !important;
    }

    .customer-topbar > .menu-toggle[data-toggle-sidebar],
    .topbar--public > .menu-toggle[data-toggle-sidebar],
    .portal-home__actions > .menu-toggle[data-toggle-sidebar],
    .ops-topbar__left > .menu-toggle[data-toggle-sidebar] {
        justify-self: end !important;
        align-self: center !important;
        margin-left: auto !important;
    }

    .sidebar .sidebar__header {
        display: grid;
        grid-template-columns: 48px minmax(0, 1fr) 44px;
        align-items: center;
        gap: 0.75rem;
    }

    .sidebar .sidebar__header > :not(.sidebar__logo):not(.sidebar__close) {
        min-width: 0;
    }

    .sidebar .sidebar__close {
        display: grid;
        place-items: center;
        width: 44px;
        height: 44px;
        min-width: 44px;
        min-height: 44px;
        padding: 0;
        border: 1px solid var(--line);
        border-radius: 12px;
        background: var(--bg-soft);
        color: var(--text);
        font-size: 1.7rem;
        line-height: 1;
        cursor: pointer;
    }

    .mobile-drawer__extras .system-theme-toggle {
        display: inline-flex !important;
        width: 44px !important;
        min-width: 44px !important;
        max-width: 44px !important;
        height: 44px !important;
        min-height: 44px !important;
        max-height: 44px !important;
        justify-self: start !important;
        align-self: center !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .mobile-drawer__extras .customer-topbar__user,
    .mobile-drawer__extras .ops-topbar__right {
        display: grid !important;
        grid-template-columns: 52px minmax(0, 1fr) !important;
        align-items: center !important;
        gap: 0.75rem !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0.85rem !important;
        border: 1px solid var(--line);
        border-radius: 18px;
        background: var(--surface-soft);
    }

    .mobile-drawer__extras .customer-topbar__home {
        order: 1;
        grid-column: 1 / -1;
        display: grid !important;
        grid-template-columns: 44px minmax(0, 1fr);
        align-items: center;
        width: 100% !important;
        height: auto !important;
        min-height: 56px;
        justify-content: stretch;
        justify-items: start;
        gap: 0.7rem;
        padding: 0.55rem 0.7rem;
        border: 1px solid var(--line);
        border-radius: 15px;
        background: var(--surface);
        box-shadow: none;
        text-align: left;
    }

    .mobile-drawer__extras .customer-topbar__home svg,
    .mobile-drawer__extras .topbar-home-link svg {
        justify-self: center;
        width: 22px;
        height: 22px;
        flex: 0 0 22px;
    }

    .mobile-drawer__extras .topbar-home-link .sr-only {
        position: static;
        width: auto;
        height: auto;
        padding: 0;
        margin: 0;
        overflow: visible;
        clip: auto;
        white-space: normal;
        border: 0;
        font-size: 0.92rem;
        font-weight: 800;
        line-height: 1.2;
        align-self: center;
        color: var(--text);
    }

    .mobile-drawer__extras .notification-center {
        order: 2;
        grid-column: 1 / -1;
        display: grid !important;
        grid-template-columns: 44px minmax(0, 1fr);
        align-items: center;
        gap: 0.7rem;
        width: 100% !important;
        min-height: 56px;
        padding: 0.55rem 0.7rem;
        border: 1px solid var(--line);
        border-radius: 15px;
        background: var(--surface);
    }

    .mobile-drawer__extras .notification-center::after {
        content: "Notifications";
        min-width: 0;
        color: var(--text);
        font-size: 0.92rem;
        font-weight: 800;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mobile-drawer__extras .notification-button {
        justify-self: start !important;
        width: 44px !important;
        min-width: 44px !important;
        height: 44px !important;
        min-height: 44px !important;
        border-radius: 14px;
    }

    .mobile-drawer__extras .notification-button__badge {
        top: -5px;
        right: -5px;
    }

    .mobile-drawer__extras .notification-panel {
        position: static;
        grid-column: 1 / -1;
        width: 100% !important;
        max-height: min(62vh, 520px);
        margin-top: 0.65rem;
    }

    .mobile-drawer__extras .customer-topbar__theme-control,
    .mobile-drawer__extras .ops-topbar__theme-control {
        order: 3;
        grid-column: 1 / -1;
    }

    .mobile-drawer__extras .customer-topbar__avatar,
    .mobile-drawer__extras .ops-topbar__avatar {
        order: 4;
        grid-column: 1;
        width: 52px !important;
        min-width: 52px !important;
        height: 52px !important;
        min-height: 52px !important;
        align-self: center;
        justify-self: start !important;
        border-radius: 16px;
    }

    .mobile-drawer__extras .customer-topbar__user > div[data-profile-name],
    .mobile-drawer__extras .ops-topbar__user > div[data-profile-name] {
        order: 5;
        grid-column: 2;
        min-width: 0;
        display: grid;
        gap: 0.16rem;
        align-self: center;
        text-align: left !important;
    }

    .mobile-drawer__extras .customer-topbar__user > div[data-profile-name]::before,
    .mobile-drawer__extras .ops-topbar__user > div[data-profile-name]::before {
        content: attr(data-profile-name);
        min-width: 0;
        color: var(--text);
        font-weight: 800;
        line-height: 1.2;
        overflow-wrap: anywhere;
    }

    .mobile-drawer__extras .customer-topbar__user > div[data-profile-name] strong,
    .mobile-drawer__extras .ops-topbar__user > div[data-profile-name] strong {
        display: none;
    }

    .mobile-drawer__extras .customer-topbar__user > div[data-profile-name] span,
    .mobile-drawer__extras .ops-topbar__user > div[data-profile-name] span {
        min-width: 0;
        color: var(--muted);
        font-size: 0.82rem;
        line-height: 1.25;
        overflow-wrap: anywhere;
    }

    .mobile-drawer__extras .logout-form {
        order: 6;
        grid-column: 1 / -1;
        display: block !important;
        width: 100%;
        margin: 0;
    }

    .mobile-drawer__extras .customer-topbar__logout,
    .mobile-drawer__extras .ops-topbar__logout {
        display: inline-flex !important;
        width: 100% !important;
        min-height: 44px;
        justify-content: center;
        align-items: center;
        gap: 0.5rem;
        padding: 0 0.9rem;
        border: 1px solid rgba(240, 68, 56, 0.24);
        border-radius: 14px;
        background: rgba(240, 68, 56, 0.08);
        color: var(--danger);
        font-size: 0;
        font-weight: 800;
    }

    .mobile-drawer__extras .customer-topbar__logout::before,
    .mobile-drawer__extras .ops-topbar__logout::before {
        content: "\2192";
        font-size: 1rem;
        line-height: 1;
    }

    .mobile-drawer__extras .customer-topbar__logout::after,
    .mobile-drawer__extras .ops-topbar__logout::after {
        content: "Log out";
        font-size: 0.92rem;
        line-height: 1;
    }

    .mobile-drawer__extras .ops-topbar__user {
        order: 4;
        grid-column: 1 / -1;
        display: grid !important;
        grid-template-columns: 52px minmax(0, 1fr);
        align-items: center;
        gap: 0.75rem;
        width: 100%;
    }

    .mobile-drawer__extras .ops-topbar__user .logout-form {
        grid-column: 1 / -1;
    }
}

/* Shared management-table action component. */
.system-action-set {
    --action-count: 1;
    display: flex !important;
    align-items: flex-start !important;
    justify-content: flex-start;
    gap: 12px !important;
    width: auto;
    max-width: 100%;
    flex-wrap: nowrap !important;
}

.system-action-set > * {
    width: auto !important;
    min-width: 0;
}

.system-action-form {
    align-items: center;
    margin: 0;
}

.system-action-item {
    display: flex !important;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 7px;
    width: auto !important;
    min-width: 0;
}

.system-action-button {
    width: 42px !important;
    min-width: 42px !important;
    max-width: 42px !important;
    height: 42px !important;
    min-height: 42px !important;
    max-height: 42px !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    padding: 0 !important;
    border: 1px solid #e3e7ef !important;
    border-radius: 50% !important;
    background: #fff !important;
    box-shadow: none !important;
    font-size: 0 !important;
    line-height: 1;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease !important;
}

.system-action-button:hover {
    transform: translateY(-2px);
    border-color: #e3e7ef !important;
    background: #fff !important;
    box-shadow: 0 6px 14px rgba(32, 38, 58, 0.1) !important;
}

.system-action-button:focus-visible {
    outline: 2px solid currentColor !important;
    outline-offset: 2px;
}

.system-action-button svg {
    width: 19px !important;
    height: 19px !important;
    display: block;
    flex: 0 0 19px;
    stroke: currentColor;
}

.system-action-label {
    display: none;
    color: var(--text);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.2;
    text-align: center;
    white-space: nowrap;
}

.system-action-item--edit .system-action-button {
    color: #5b5cf6 !important;
}

.system-action-item--warning .system-action-button {
    color: #f59e0b !important;
}

.system-action-item--danger .system-action-button {
    color: #ef4444 !important;
}

.system-action-item--success .system-action-button {
    color: #16a34a !important;
}

.system-action-item--primary .system-action-button {
    color: #2563eb !important;
}

.system-action-item--neutral .system-action-button {
    color: #475569 !important;
}

@media (max-width: 640px) {
    .data-table td.system-action-cell {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .data-table td.system-action-cell::before {
        color: #5b5cf6;
        font-size: 12px;
        font-weight: 700;
        line-height: 1;
        letter-spacing: 0.08em;
        text-transform: uppercase;
    }

    .system-action-set {
        display: grid !important;
        grid-template-columns: repeat(var(--action-count), minmax(0, 1fr)) !important;
        align-items: start !important;
        justify-items: center;
        gap: 12px !important;
        width: 100% !important;
    }

    .system-action-set > * {
        width: 100% !important;
        min-width: 0;
    }

    .system-action-form {
        display: grid !important;
        grid-template-columns: 1fr !important;
        justify-items: center;
        align-content: start;
        gap: 7px;
    }

    .system-action-form > input:not([type="hidden"]),
    .system-action-form > select,
    .system-action-form > textarea {
        width: 100%;
        min-width: 0;
    }

    .system-action-item {
        width: 100% !important;
    }

    .system-action-label {
        display: block;
        width: 100%;
    }
}

@media (max-width: 360px) {
    .system-action-set {
        gap: 8px !important;
    }

    .system-action-button {
        width: 40px !important;
        min-width: 40px !important;
        max-width: 40px !important;
        height: 40px !important;
        min-height: 40px !important;
        max-height: 40px !important;
    }

    .system-action-label {
        font-size: 11px;
    }
}

/* Shared POS thermal receipt for 58mm and 80mm printers. */
.thermal-receipt-controls {
    display: flex;
    align-items: end;
    justify-content: center;
    gap: 0.75rem;
    margin: 0 auto 1rem;
}

.thermal-receipt-controls label {
    display: grid;
    gap: 0.3rem;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.thermal-receipt-controls select {
    min-width: 110px;
}

.thermal-receipt {
    width: 80mm;
    max-width: 100%;
    box-sizing: border-box;
    margin: 0 auto 1.25rem;
    padding: 4mm;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: #111;
    box-shadow: 0 10px 30px rgba(16, 24, 40, 0.1);
    font-family: "Courier New", Courier, monospace;
    font-size: 11px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.thermal-receipt[data-paper-width="58mm"] {
    width: 58mm;
    padding: 3mm;
    font-size: 10px;
}

.thermal-receipt__header,
.thermal-receipt__footer {
    text-align: center;
}

.thermal-receipt__header h1 {
    margin: 0 0 1.5mm;
    color: #000;
    font-family: inherit;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.15;
}

.thermal-receipt[data-paper-width="58mm"] .thermal-receipt__header h1 {
    font-size: 14px;
}

.thermal-receipt p,
.thermal-receipt dl,
.thermal-receipt dt,
.thermal-receipt dd {
    margin: 0;
}

.thermal-receipt__title {
    margin-top: 2.5mm;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.08em;
}

.thermal-receipt__rule {
    height: 0;
    margin: 2.5mm 0;
    border-top: 1px dashed #111;
}

.thermal-receipt__meta,
.thermal-receipt__totals {
    display: grid;
    gap: 1mm;
}

.thermal-receipt__meta > div,
.thermal-receipt__totals > div,
.thermal-receipt__item > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 2mm;
}

.thermal-receipt__meta dt,
.thermal-receipt__totals dt {
    min-width: 0;
}

.thermal-receipt__meta dd,
.thermal-receipt__totals dd,
.thermal-receipt__item > div span:last-child {
    max-width: 44mm;
    text-align: right;
    overflow-wrap: anywhere;
}

.thermal-receipt__items {
    display: grid;
    gap: 2.5mm;
}

.thermal-receipt__item {
    break-inside: avoid;
}

.thermal-receipt__item strong {
    display: block;
    margin-bottom: 0.5mm;
    font-size: inherit;
}

.thermal-receipt__grand-total {
    margin-top: 1.5mm;
    padding-top: 1.5mm;
    border-top: 1px solid #111;
    font-size: 13px;
    font-weight: 800;
}

.thermal-receipt__payment dd {
    font-weight: 700;
}

.thermal-receipt__footer p {
    font-weight: 700;
}

.thermal-receipt__footer small {
    display: block;
    margin-top: 1.5mm;
    font-size: 9px;
}

.receipt-supporting-details {
    margin-top: 1.25rem;
}

@media (max-width: 640px) {
    .thermal-receipt-controls {
        align-items: stretch;
    }

    .thermal-receipt-controls > * {
        min-height: 44px;
    }
}

@media print {
    @page {
        size: auto;
        margin: 0;
    }

    html,
    body {
        width: auto !important;
        min-width: 0 !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        background: #fff !important;
    }

    body * {
        visibility: hidden !important;
    }

    .thermal-receipt,
    .thermal-receipt * {
        visibility: visible !important;
    }

    .thermal-receipt {
        position: absolute;
        inset: 0 auto auto 0;
        max-width: none !important;
        margin: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        background: #fff !important;
        color: #000 !important;
        print-color-adjust: exact;
        -webkit-print-color-adjust: exact;
    }
}

/* Readable role-notification cards on phones. */
.notification-history-item__reference {
    display: none;
}

.notification-history-item__date {
    display: none;
}

@media (max-width: 640px) {
    .app-shell .notification-history-list {
        gap: 0.75rem;
    }

    .app-shell .notification-history-item {
        grid-template-columns: 40px minmax(0, 1fr);
        grid-template-rows: minmax(0, auto) auto;
        align-items: start;
        gap: 0.65rem;
        min-height: 0;
        padding: 0.8rem;
        border-radius: 15px;
    }

    .app-shell .notification-history-item__icon {
        grid-row: 1 / span 2;
        width: 40px;
        height: 40px;
        border-radius: 12px;
    }

    .app-shell .notification-history-item__body {
        grid-column: 2;
        display: grid;
        gap: 0.38rem;
        min-width: 0;
    }

    .app-shell .notification-history-item__title {
        display: block;
        min-width: 0;
    }

    .app-shell .notification-history-item__title strong {
        display: block;
        overflow: visible;
        overflow-wrap: anywhere;
        font-size: 0.92rem;
        line-height: 1.35;
        white-space: normal;
    }

    .app-shell .notification-history-item__title em {
        display: none;
    }

    .app-shell .notification-history-item__reference {
        display: block;
        color: #475569;
        font-size: 0.74rem;
        font-weight: 800;
        line-height: 1.3;
        overflow-wrap: anywhere;
    }

    .app-shell .notification-history-item__meta {
        display: none;
    }

    .app-shell .notification-history-item__date {
        display: block;
        color: var(--muted);
        font-size: 0.72rem;
        line-height: 1.45;
        overflow-wrap: anywhere;
    }

    .app-shell .notification-history-item small {
        display: block;
        -webkit-line-clamp: unset;
        -webkit-box-orient: initial;
        overflow: visible;
        font-size: 0.74rem;
        line-height: 1.42;
        white-space: normal;
    }

    .app-shell .notification-history-item > .badge {
        grid-column: 2;
        grid-row: 2;
        justify-self: end;
        align-self: end;
        min-height: 20px;
        height: 20px;
        margin-top: 0.05rem;
        padding: 0 0.45rem;
        font-size: 0.68rem;
        white-space: nowrap;
    }
}

@media (max-width: 359px) {
    .app-shell .notification-history-item {
        grid-template-columns: 36px minmax(0, 1fr);
        gap: 0.55rem;
        padding: 0.7rem;
    }

    .app-shell .notification-history-item__icon {
        width: 36px;
        height: 36px;
    }

    .app-shell .notification-history-item__title strong {
        font-size: 0.86rem;
    }
}

/* System-wide phone density baseline.  This is deliberately a final mobile-only
   layer so every public and role portal shares the same compact sizing while
   desktop layouts retain their existing measurements. */
@media (max-width: 640px) {
    :root {
        --phone-gutter: 0.75rem;
    }

    body {
        font-size: 0.9375rem;
    }

    .app-main,
    .customer-shell,
    .landing,
    .portal-home {
        padding: 0.9rem var(--phone-gutter) 1.25rem;
    }

    .section {
        margin-bottom: 1rem;
    }

    .section__heading,
    .card-head,
    .receipt-card__header {
        gap: 0.55rem;
        margin-bottom: 0.75rem;
    }

    .section__heading h1 {
        font-size: clamp(1.55rem, 7.4vw, 2rem);
        line-height: 1.15;
    }

    .section__heading h2,
    .card-head h2 {
        font-size: clamp(1.15rem, 5.7vw, 1.4rem);
        line-height: 1.25;
    }

    .section__heading p,
    .card-head p,
    .page-panel > p,
    .form-card > p,
    .info-card > p {
        font-size: 0.84rem;
        line-height: 1.45;
    }

    .page-panel,
    .form-card,
    .info-card,
    .receipt-card,
    .metric-box,
    .empty-state,
    .summary-card,
    .portal-choice-card {
        padding: 0.85rem;
        border-radius: 16px;
    }

    .metric-grid,
    .summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 0.65rem !important;
    }

    .metric-box,
    .summary-card {
        min-height: 0;
    }

    .metric-box {
        padding: 0.8rem;
    }

    .metric-box__icon {
        width: 42px;
        height: 42px;
        margin-bottom: 0.55rem;
        border-radius: 13px;
        font-size: 1.15rem;
    }

    .metric-box strong,
    .summary-card strong {
        margin-top: 0.25rem;
        font-size: clamp(1.25rem, 6vw, 1.65rem);
        line-height: 1.1;
    }

    .metric-box span,
    .summary-card span {
        margin-top: 0.25rem;
        font-size: 0.75rem;
        line-height: 1.3;
        overflow-wrap: anywhere;
    }

    .form-grid,
    .toolbar,
    .inline-form,
    .stack-form,
    .checkout-stack,
    .payment-stack,
    .support-compose {
        gap: 0.65rem;
    }

    label,
    .form-grid > *,
    .toolbar > *,
    .inline-form > *,
    .stack-form > * {
        min-width: 0;
    }

    input:not([type="checkbox"]):not([type="radio"]),
    select,
    textarea {
        font-size: 16px;
    }

    textarea {
        min-height: 96px;
    }

    .data-table tbody {
        gap: 0.65rem;
    }

    .data-table tr {
        padding: 0.7rem 0.75rem;
        border-radius: 14px;
    }

    .data-table td {
        gap: 0.18rem;
        padding: 0.48rem 0;
        font-size: 0.84rem;
        line-height: 1.35;
    }

    .data-table td::before {
        font-size: 0.68rem;
        line-height: 1.25;
    }

    .data-table td img {
        max-width: min(100%, 120px);
        height: auto;
        object-fit: cover;
    }

    .sidebar,
    .sidebar--shared-drawer,
    .sidebar--portal-drawer {
        width: min(85vw, 320px) !important;
        padding: 0.85rem !important;
    }

    .sidebar__nav {
        gap: 0.25rem;
    }

    .sidebar__link {
        min-height: 44px;
        padding: 0.68rem 0.75rem;
        border-radius: 12px;
        font-size: 0.88rem;
    }

    dialog,
    .modal,
    [role="dialog"] {
        max-width: calc(100vw - 1rem);
    }
}

/* Use two compact cards when a phone has enough usable width, then return to a
   single column on very narrow devices instead of squeezing content. */
@media (max-width: 389px) {
    .metric-grid,
    .summary-grid {
        grid-template-columns: 1fr !important;
    }
}

/* Final priority layer for phone screens.  Keep desktop and tablet dimensions
   untouched while resolving the few older mobile rules that are intentionally
   more spacious. */
@media (max-width: 640px) {
    :root {
        --phone-gutter: 0.7rem;
    }

    html,
    body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    body {
        font-size: clamp(0.875rem, 3.8vw, 0.9375rem);
        line-height: 1.45;
    }

    .customer-topbar,
    .ops-topbar,
    .topbar--public {
        min-height: 60px;
        padding: 0.5rem var(--phone-gutter);
    }

    .app-main,
    .customer-shell,
    .landing,
    .portal-home {
        padding: 0.75rem var(--phone-gutter) 1rem;
    }

    h1,
    .section__heading h1 {
        font-size: clamp(1.45rem, 6.8vw, 1.85rem);
        line-height: 1.15;
    }

    h2,
    .section__heading h2,
    .card-head h2 {
        font-size: clamp(1.08rem, 5.4vw, 1.32rem);
        line-height: 1.22;
    }

    .page-panel,
    .form-card,
    .info-card,
    .receipt-card,
    .metric-box,
    .summary-card,
    .empty-state,
    .portal-choice-card,
    .auth-card,
    .cart-item {
        padding: 0.75rem;
        border-radius: 14px;
    }

    .metric-grid,
    .summary-grid {
        gap: 0.55rem !important;
    }

    .metric-box,
    .summary-card {
        min-height: 0;
        padding: 0.7rem;
    }

    .metric-box__icon {
        width: 38px;
        height: 38px;
        margin-bottom: 0.4rem;
        border-radius: 11px;
    }

    .metric-box strong,
    .summary-card strong {
        font-size: clamp(1.12rem, 5.8vw, 1.45rem);
    }

    .metric-box span,
    .summary-card span {
        font-size: 0.7rem;
    }

    .btn,
    button,
    .portal-link-button {
        min-height: 44px;
        padding: 0.55rem 0.75rem;
        font-size: 0.84rem;
        line-height: 1.2;
    }

    .btn-sm {
        min-height: 38px;
        padding: 0.4rem 0.6rem;
        font-size: 0.76rem;
    }

    input:not([type="checkbox"]):not([type="radio"]),
    select,
    textarea {
        min-height: 44px;
        padding: 0.6rem 0.7rem;
        font-size: 16px;
    }

    textarea {
        min-height: 84px;
    }

    .badge,
    .priority-badge,
    .customer-topbar__badge,
    .topbar-cart-link__badge,
    .notification-button__badge {
        min-width: 0;
        max-width: 100%;
        min-height: 20px;
        padding: 0.18rem 0.45rem;
        font-size: 0.66rem;
        line-height: 1.15;
        white-space: nowrap;
    }

    .data-table tbody {
        gap: 0.55rem;
    }

    .data-table tr {
        padding: 0.65rem 0.7rem;
        border-radius: 12px;
    }

    .data-table td {
        gap: 0.15rem;
        padding: 0.4rem 0;
        font-size: 0.8rem;
        line-height: 1.35;
    }

    .data-table td::before {
        font-size: 0.64rem;
        letter-spacing: 0.06em;
    }

    .notification-panel {
        top: 4.25rem;
        right: 0.6rem;
        left: 0.6rem;
        width: auto;
        max-height: calc(100dvh - 4.9rem);
        border-radius: 14px;
    }

    .notification-panel__header {
        gap: 0.45rem;
        padding: 0.65rem;
    }

    .notification-panel__list {
        gap: 0.35rem;
        padding: 0.5rem;
    }

    .notification-panel__item {
        gap: 0.4rem;
        min-height: 42px;
        padding: 0.5rem;
        border-radius: 10px;
    }

    .notification-panel__item strong,
    .notification-history-item__title strong {
        font-size: 0.82rem;
        line-height: 1.25;
    }

    .notification-panel__item small,
    .notification-history-item small {
        font-size: 0.7rem;
        line-height: 1.35;
    }

    .notification-history-list {
        gap: 0.5rem;
    }

    .notification-history-item,
    .app-shell .notification-history-item {
        grid-template-columns: 36px minmax(0, 1fr);
        gap: 0.5rem;
        padding: 0.65rem;
        border-radius: 12px;
    }

    .notification-history-item__icon,
    .app-shell .notification-history-item__icon {
        width: 36px;
        height: 36px;
        border-radius: 10px;
    }

    .notification-history-item > .badge,
    .app-shell .notification-history-item > .badge {
        min-height: 18px;
        height: 18px;
        padding: 0 0.38rem;
        font-size: 0.6rem;
        white-space: nowrap;
    }

    .flash-stack {
        top: 0.55rem;
        right: 0.55rem;
        left: 0.55rem;
        width: auto;
    }
}

@media (max-width: 389px) {
    :root {
        --phone-gutter: 0.6rem;
    }

    .metric-grid,
    .summary-grid {
        grid-template-columns: 1fr !important;
    }

    .page-panel,
    .form-card,
    .info-card,
    .receipt-card,
    .metric-box,
    .summary-card,
    .empty-state,
    .portal-choice-card,
    .auth-card,
    .cart-item {
        padding: 0.68rem;
        border-radius: 12px;
    }
}
