html, body {
    font-family: var(--font-body);
    background-color: var(--mud-palette-background, #f3f6fa);
    background-image: radial-gradient(circle at top right, rgba(31, 95, 139, 0.08), transparent 44%), linear-gradient(
        180deg,
        color-mix(in srgb, var(--mud-palette-background, #f3f6fa) 92%, #ffffff 8%),
        color-mix(in srgb, var(--mud-palette-background, #f3f6fa) 86%, #d9e2ec 14%)
    );
    color: var(--mud-palette-text-primary, #1e293b);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    letter-spacing: 0.005em;
}

:root {
    --mud-appbar-height: 72px;
    --font-body: 'Source Sans 3', 'Segoe UI', sans-serif;
    --font-display: 'Public Sans', 'Source Sans 3', sans-serif;
    --zaq-accent: #1f5f8b;
    --zaq-accent-strong: #174a6c;
    --zaq-ink-soft: #475569;
    --zaq-surface-subtle: #f8fafc;
}

html.mud-theme-dark,
body.mud-theme-dark {
    --zaq-accent: #74a9d8;
    --zaq-accent-strong: #94bfe3;
    --zaq-ink-soft: #c3cfdd;
    --zaq-surface-subtle: #0f172a;
    background-color: #0f1b2d;
    background-image: none;
    color: var(--mud-palette-text-primary, #e5eaf2);
}

html.mud-theme-dark .mud-layout,
body.mud-theme-dark .mud-layout,
html.mud-theme-dark .mud-main-content,
body.mud-theme-dark .mud-main-content,
html.mud-theme-dark .zaq-main-container,
body.mud-theme-dark .zaq-main-container {
    background-color: #0f1b2d !important;
    background-image: none !important;
}

/* Force AppBar toolbar to always use the full height (override MudBlazor responsive reductions) */
.mud-appbar .mud-toolbar-appbar {
    height: var(--mud-appbar-height) !important;
    min-height: var(--mud-appbar-height) !important;
}

/* Force clipped drawer to align with the fixed AppBar height at all breakpoints */
.mud-drawer--clipped-always {
    top: var(--mud-appbar-height) !important;
    height: calc(100% - var(--mud-appbar-height)) !important;
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: var(--zaq-accent);
}

html.mud-theme-dark a,
html.mud-theme-dark .btn-link,
body.mud-theme-dark a,
body.mud-theme-dark .btn-link {
    color: #a8c1d9;
}

html.mud-theme-dark a:hover,
html.mud-theme-dark .btn-link:hover,
body.mud-theme-dark a:hover,
body.mud-theme-dark .btn-link:hover {
    color: #c8d8e8;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-ui {
    display: none;
    position: fixed;
    bottom: 0;
    width: 100%;
    z-index: 9999;
    padding: 0.6rem 1.25rem;
    background: #b32121;
    color: #fff;
    text-align: center;
}

.blazor-error-ui .dismiss {
    color: #fff;
    margin-left: 8px;
}

.boot-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: linear-gradient(180deg, #f8fafc, #eef2f7);
}

.boot-screen__content {
    text-align: center;
}

.boot-screen__logo {
    width: 120px;
    height: 120px;
    object-fit: contain;
    margin-bottom: 24px;
    border-radius: 24px;
}

.boot-screen__label {
    color: #1f5f8b;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.boot-screen__track {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin: 0 auto;
}

.boot-screen__bar {
    width: 40%;
    height: 100%;
    background: linear-gradient(90deg, #1f5f8b, #4b637a);
    border-radius: 2px;
    animation: boot-loading 1.2s ease-in-out infinite;
}

@keyframes boot-loading {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(350%); }
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

/* ==================== ZAQ MART LANDING — MudBlazor-native ==================== */

/* Gradient text utility */
.zaq-gradient-text {
    color: var(--zaq-accent);
}

/* ——— Hero section ——————————————————————————————————— */
.landing-hero {
    padding: 36px 0 22px;
    overflow: visible;
}

.zaq-hero-title {
    font-size: clamp(2.3rem, 3vw, 2.9rem);
    letter-spacing: .003em;
}

.zaq-wolf-hero-wrap {
    width: 100%;
    max-width: 500px;
    min-height: 260px;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: none;
    margin-bottom: 0;
    z-index: 1;
    padding-bottom: 0;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

.zaq-wolf-hero-wrap::before,
.zaq-wolf-hero-wrap::after {
    content: none;
}

.zaq-wolf-hero-image {
    display: block;
    width: min(100%, 360px);
    height: auto;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    opacity: 0.88;
    filter: saturate(0.72) contrast(0.96) brightness(0.98) drop-shadow(0 8px 18px rgba(15, 23, 42, 0.14));
}

.zaq-wolf-hero-wrap .mud-image,
.zaq-wolf-hero-wrap .mud-image-container,
.zaq-wolf-hero-wrap img,
.zaq-wolf-hero-wrap picture {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

/* ——— Stats bar ——————————————————————————————————————— */
.landing-stats-wrap {
    position: relative;
    z-index: 2;
    margin-top: -44px;
    margin-bottom: 30px;
}

.landing-stats-bar {
    border-radius: 14px;
    padding: 8px 0;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

html.mud-theme-dark .landing-hero,
body.mud-theme-dark .landing-hero {
    background: linear-gradient(135deg, rgba(18, 33, 53, 0.96) 0%, rgba(20, 37, 58, 0.94) 55%, rgba(17, 31, 49, 0.94) 100%);
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 14px;
}

html.mud-theme-dark .landing-stats-bar,
body.mud-theme-dark .landing-stats-bar {
    background: linear-gradient(180deg, rgba(19, 30, 47, 0.96), rgba(14, 22, 35, 0.96));
    border: 1px solid rgba(148, 163, 184, 0.17);
    box-shadow: 0 12px 26px rgba(2, 6, 23, 0.34);
}

/* ——— Utility spacing ————————————————————————————————— */
.py-12 { padding-top: 80px; padding-bottom: 80px; }
.mb-8  { margin-bottom: 48px; }

/* ——— Responsive —————————————————————————————————————— */
@media (max-width: 960px) {
    .landing-hero { padding: 24px 0 14px; }
    .landing-stats-wrap { margin-top: -24px; }
    .py-12 { padding-top: 48px; padding-bottom: 48px; }
    .zaq-wolf-hero-wrap {
        max-width: 480px;
        min-height: 224px;
        transform: none;
        margin-bottom: 0;
        padding-bottom: 0;
    }
    .zaq-wolf-hero-image {
        width: min(100%, 320px);
    }
    .zaq-hero-title {
        font-size: clamp(2.05rem, 5.4vw, 2.55rem);
    }
}

@media (max-width: 600px) {
    .landing-hero { padding: 18px 0 10px; }
    .py-12 { padding-top: 36px; padding-bottom: 36px; }
    .zaq-wolf-hero-wrap {
        min-height: 196px;
        justify-content: center;
        transform: none;
        margin-bottom: 0;
        padding-bottom: 0;
    }
    .zaq-wolf-hero-wrap::before {
        inset: 6% 10% 10%;
    }
    .landing-stats-wrap {
        margin-top: -8px;
    }
    .zaq-hero-title {
        font-size: clamp(1.85rem, 7.6vw, 2.15rem);
    }
    .zaq-wolf-hero-image {
        width: min(100%, 268px);
    }
}

html.mud-theme-dark .zaq-wolf-hero-image,
body.mud-theme-dark .zaq-wolf-hero-image {
    opacity: 0.82;
    filter: saturate(0.66) contrast(0.95) brightness(0.9) drop-shadow(0 10px 20px rgba(2, 6, 23, 0.35));
}

html.mud-theme-dark .zaq-wolf-hero-wrap,
html.mud-theme-dark .zaq-wolf-hero-wrap .mud-image,
html.mud-theme-dark .zaq-wolf-hero-wrap .mud-image-container,
html.mud-theme-dark .zaq-wolf-hero-wrap img,
body.mud-theme-dark .zaq-wolf-hero-wrap,
body.mud-theme-dark .zaq-wolf-hero-wrap .mud-image,
body.mud-theme-dark .zaq-wolf-hero-wrap .mud-image-container,
body.mud-theme-dark .zaq-wolf-hero-wrap img {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

/* ==================== ROLE SELECTOR ==================== */
.role-selector .mud-input {
    color: var(--mud-palette-text-primary) !important;
    font-size: 0.85rem;
    font-weight: 500;
}
.role-selector .mud-input-adornment svg {
    fill: var(--mud-palette-text-secondary) !important;
}
.role-selector .mud-input-outlined-border {
    border-color: rgba(100, 116, 139, .35) !important;
}
.role-selector:hover .mud-input-outlined-border {
    border-color: rgba(31, 95, 139, .55) !important;
}

/* ==================== ROLE DASHBOARD WIDGETS ==================== */
.role-dashboard-header {
    border-radius: 16px;
    padding: 24px 32px;
    margin-bottom: 24px;
    background: linear-gradient(135deg, rgba(31, 95, 139, .1) 0%, rgba(75, 99, 122, .08) 100%);
    border: 1px solid rgba(31, 95, 139, .2);
}

.stat-card {
    border-radius: 14px;
    transition: transform .15s ease, box-shadow .15s ease;
}

/* Apply motion cues only to cards that are explicitly clickable. */
.stat-card[style*="cursor:pointer"] {
    cursor: pointer;
}

.stat-card[style*="cursor:pointer"]:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 26px rgba(0,0,0,.14) !important;
}

.stat-card[style*="cursor:pointer"]:active {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0,0,0,.12) !important;
}

.quick-action-btn {
    text-transform: none !important;
    font-weight: 600 !important;
    border-radius: 12px !important;
    justify-content: flex-start !important;
    padding: 12px 20px !important;
}

.section-title {
    font-weight: 700;
    letter-spacing: -.01em;
}

/* ==================== BARCODE SCANNER ==================== */
.barcode-scanner-container {
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid var(--mud-palette-primary);
    background: #000;
    min-height: 200px;
}
.barcode-scanner-container video {
    border-radius: 10px;
}
.barcode-decoded-panel {
    border-radius: 12px;
    border: 1px solid rgba(31, 95, 139, .25);
    background: linear-gradient(135deg, rgba(31, 95, 139, .08) 0%, rgba(75, 99, 122, .08) 100%);
    padding: 16px;
}
.barcode-segment {
    font-family: 'Courier New', monospace;
    font-weight: 700;
    letter-spacing: 0.08em;
}

/* ==================== SHOP / CART ==================== */
.mud-card {
    transition: transform .15s ease, box-shadow .15s ease;
}
.mud-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(15, 23, 42, .09) !important;
}

/* ==================== ORDER CARDS ==================== */
.order-expansion .mud-expand-panel {
    box-shadow: none !important;
}
.order-expansion .mud-expand-panel::before {
    display: none;
}
.order-expansion .mud-expand-panel-header {
    padding: 8px 16px;
    min-height: auto;
    border-top: 1px solid var(--mud-palette-lines-default);
}

/* ==================== PWA / OFFLINE ==================== */

/* Blazor WASM loading screen override */
#app .loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem;
}

/* Offline banner animation */
@keyframes offlinePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.offline-pulse {
    animation: offlinePulse 2s ease-in-out infinite;
}

.zaq-appbar {
    background: linear-gradient(90deg, #ffffff 0%, #f8fafc 100%);
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.zaq-appbar .mud-icon-button,
.zaq-appbar .mud-button-root,
.zaq-appbar .mud-typography {
    color: #1f2937 !important;
}

.zaq-appbar .mud-button-filled.mud-button-filled-surface {
    background: #1f5f8b !important;
    color: #ffffff !important;
}

html.mud-theme-dark .zaq-appbar,
body.mud-theme-dark .zaq-appbar {
    background: linear-gradient(90deg, #111827 0%, #0f172a 100%);
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

html.mud-theme-dark .zaq-appbar .mud-icon-button,
html.mud-theme-dark .zaq-appbar .mud-button-root,
html.mud-theme-dark .zaq-appbar .mud-typography,
body.mud-theme-dark .zaq-appbar .mud-icon-button,
body.mud-theme-dark .zaq-appbar .mud-button-root,
body.mud-theme-dark .zaq-appbar .mud-typography {
    color: #e5eaf2 !important;
}

.zaq-appbar-logo {
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.7);
    padding: 2px;
}

.zaq-avatar-fallback {
    background: linear-gradient(135deg, #1f5f8b, #4b637a);
    color: #ffffff;
    font-weight: 700;
    font-size: 0.7rem;
    width: 32px;
    height: 32px;
}

.zaq-offline-banner {
    background: #b7791f;
    color: #ffffff;
    text-align: center;
    padding: 6px 16px;
    position: relative;
    z-index: 1099;
}

.zaq-hero-snapshot {
    border-radius: 18px;
    border: 1px solid rgba(31, 95, 139, 0.14);
    background: linear-gradient(180deg, #ffffff, #f8fafc);
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.08);
}

.zaq-snapshot-label {
    color: var(--zaq-ink-soft);
    font-weight: 600;
}

.zaq-snapshot-value {
    color: var(--zaq-accent-strong);
    font-weight: 700;
}

.zaq-cta-surface {
    border-radius: 20px;
    border: 1px solid rgba(31, 95, 139, 0.18);
    background: linear-gradient(180deg, #f8fafc 0%, #edf2f7 100%);
}

.zaq-cta-surface .mud-typography {
    color: #1f2937;
}

.zaq-cta-primary {
    background: #1f5f8b !important;
    color: #ffffff !important;
}

.zaq-cta-secondary {
    border-color: #1f5f8b !important;
    color: #1f5f8b !important;
}

.mud-drawer:not(.mud-drawer-temporary) {
    border-right: 1px solid rgba(15, 23, 42, 0.08);
}

.mud-navmenu .mud-nav-link {
    border-radius: 10px;
    margin: 2px 8px;
}

.mud-navmenu .mud-nav-link.active,
.mud-navmenu .mud-nav-link:hover {
    background: rgba(31, 95, 139, 0.1);
}

/* PWA install prompt */
.pwa-install-prompt {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,.25);
}

/* Offline indicator pulse */
@keyframes pulse-offline {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ==================== GLOBAL RESPONSIVE POLISH ====================
   Applied to every page: keeps the AppBar, drawer, containers,
   cards and dialogs rendering cleanly on phone, tablet and desktop. */

/* Prevent horizontal scrolling caused by wide cards/tables on mobile. */
html, body {
    overflow-x: hidden;
}

/* Long single-word numbers like "R 2.4M+" or unbroken English words must not
   blow out the layout on a 360px screen. */
.zaq-gradient-text,
.mud-typography {
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* ───────── AppBar (mobile-first sizing) ───────── */
@media (max-width: 599.95px) {
    :root {
        --mud-appbar-height: 56px;
    }
    .zaq-appbar .mud-toolbar { padding-left: 4px !important; padding-right: 4px !important; }
    .zaq-appbar .mud-icon-button { padding: 6px !important; }
    .zaq-appbar-logo { height: 40px !important; }
}

/* ───────── Main content container ───────── */
.zaq-main-container {
    padding-left: 16px;
    padding-right: 16px;
}
@media (max-width: 599.95px) {
    .zaq-main-container {
        padding-left: 8px !important;
        padding-right: 8px !important;
        padding-top: 12px !important;
        padding-bottom: 12px !important;
    }
}

/* ───────── Drawer: temporary on mobile must overlay full-height under AppBar ───────── */
@media (max-width: 959.95px) {
    .mud-drawer.mud-drawer-temporary {
        width: min(280px, 85vw) !important;
    }
}

/* ───────── Hero typography scales down on phones ───────── */
.zaq-hero-title {
    font-size: clamp(1.75rem, 6vw, 3rem) !important;
    line-height: 1.15 !important;
    word-break: break-word;
}

/* ───────── Quick Overview (Home page) — wraps cleanly ───────── */
.zaq-quick-overview-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
}
.zaq-quick-overview-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 0;
    text-align: center;
    padding: 4px;
}
.zaq-quick-overview-cell .mud-typography {
    word-break: break-word;
    line-height: 1.2;
}
@media (max-width: 380px) {
    .zaq-quick-overview .pa-6 { padding: 16px !important; }
    .zaq-quick-overview-grid { gap: 4px; }
}

/* ───────── MudCard / MudPaper never overflow their parent ───────── */
.mud-card, .mud-paper {
    max-width: 100%;
}

/* MudGrid items with text content shouldn't blow out the grid track. */
.mud-grid-item { min-width: 0; }

/* ───────── Dialogs: full-width on phone, generous padding everywhere ───────── */
@media (max-width: 599.95px) {
    .mud-dialog-container .mud-dialog {
        margin: 8px !important;
        width: calc(100vw - 16px) !important;
        max-width: calc(100vw - 16px) !important;
    }
    .mud-dialog-content { padding: 16px !important; }
}

/* ───────── Tables & data grids scroll horizontally on small screens ───────── */
.mud-table-container,
.mud-data-grid {
    overflow-x: auto;
}

/* ───────── MudTabs slide horizontally instead of stacking awkwardly ───────── */
@media (max-width: 599.95px) {
    .mud-tabs-toolbar { overflow-x: auto; }
}

/* ───────── Stats grid cells (Home landing) — keep large numbers contained ───────── */
.landing-stats-bar .mud-typography-h4 {
    font-size: clamp(1.25rem, 4vw, 2.125rem);
}

/* ───────── Form inputs full-width on phones ───────── */
@media (max-width: 599.95px) {
    .mud-input-control,
    .mud-select { width: 100%; }
}

/* ───────── Buttons: prevent text overflow next to icons on phones ───────── */
.mud-button { max-width: 100%; }
.mud-button .mud-button-label { white-space: normal; }

/* ───────── Shared mobile row utilities (profile/cards/dialogs) ───────── */
.zaq-stack-wrap {
    flex-wrap: wrap;
}

.zaq-text-content {
    min-width: 0;
    flex: 1 1 220px;
}

.zaq-text-content .mud-typography,
.zaq-break-anywhere {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.zaq-checkout-option-card {
    width: min(100%, 420px);
    align-self: flex-start;
    border-radius: 14px;
}

.zaq-checkout-stepper .mud-stepper-actions {
    display: none;
}

.ai-chat-history-paper {
    border-radius: 12px;
    min-height: 520px;
}

.ai-chat-history-paper.is-collapsed {
    min-height: unset;
    padding-top: 10px;
    padding-bottom: 10px;
}

.ai-chat-history-panel.is-collapsed {
    min-width: 88px;
}

.ai-chat-history-collapsed-new {
    border: 1px solid var(--mud-palette-primary);
    border-radius: 10px;
}

.ai-chat-history-row {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    width: 100%;
}

.ai-chat-history-title {
    min-width: 0;
    width: 100%;
    justify-content: flex-start !important;
    text-align: left;
}

.ai-chat-history-title .mud-button-label {
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
    text-align: left;
    justify-content: flex-start;
}

.ai-chat-history-meta {
    flex-wrap: nowrap !important;
    justify-content: flex-end;
    align-items: center;
    white-space: nowrap;
}

.ai-chat-history-time {
    white-space: nowrap;
}

/* Keep readable text on cyan/primary filled surfaces across themes. */
.mud-button-filled-primary,
.mud-button-filled-primary .mud-button-label,
.mud-chip-filled-primary,
.mud-chip-filled-primary .mud-chip-content,
.mud-alert-filled-primary,
.mud-alert-filled-primary .mud-alert-message,
.mud-avatar.mud-avatar-filled.mud-avatar-color-primary,
.mud-badge-primary {
    color: #04111f !important;
}

.ai-chat-message-user,
.ai-chat-message-user .mud-typography,
.ai-chat-message-user .mud-chip-content,
.ai-chat-message-user .mud-chip,
.ai-chat-message-user .mud-chip-text,
.ai-chat-message-user .mud-button-label,
.ai-chat-message-user .mud-button-text {
    color: #04111f !important;
}

.ai-chat-thread,
.ai-chat-message,
.ai-chat-history-entry,
.ai-stock-table-shell,
.ai-stock-card {
    color: var(--mud-palette-text-primary);
}

html.mud-theme-dark .ai-chat-thread,
body.mud-theme-dark .ai-chat-thread {
    background: rgba(15, 23, 42, 0.78);
    border: 1px solid rgba(148, 163, 184, 0.18);
}

html.mud-theme-dark .ai-chat-message-assistant,
body.mud-theme-dark .ai-chat-message-assistant {
    background: rgba(30, 41, 59, 0.92) !important;
    color: #f8fafc;
    border: 1px solid rgba(148, 163, 184, 0.18);
}

html.mud-theme-dark .ai-chat-message-assistant .mud-typography,
html.mud-theme-dark .ai-chat-message-assistant .mud-chip-content,
html.mud-theme-dark .ai-chat-message-assistant .mud-chip,
html.mud-theme-dark .ai-chat-message-assistant .mud-chip-text,
html.mud-theme-dark .ai-chat-message-assistant .mud-button-label,
html.mud-theme-dark .ai-chat-message-assistant .mud-button-text,
body.mud-theme-dark .ai-chat-message-assistant .mud-typography,
body.mud-theme-dark .ai-chat-message-assistant .mud-chip-content,
body.mud-theme-dark .ai-chat-message-assistant .mud-chip,
body.mud-theme-dark .ai-chat-message-assistant .mud-chip-text,
body.mud-theme-dark .ai-chat-message-assistant .mud-button-label,
body.mud-theme-dark .ai-chat-message-assistant .mud-button-text {
    color: #f8fafc !important;
}

html.mud-theme-dark .ai-chat-message-user,
body.mud-theme-dark .ai-chat-message-user {
    background: rgba(116, 169, 216, 0.92) !important;
    color: #102033;
    border: 1px solid rgba(148, 189, 223, 0.32);
}

html.mud-theme-dark .ai-chat-message-user .mud-typography,
html.mud-theme-dark .ai-chat-message-user .mud-chip-content,
html.mud-theme-dark .ai-chat-message-user .mud-chip,
html.mud-theme-dark .ai-chat-message-user .mud-chip-text,
html.mud-theme-dark .ai-chat-message-user .mud-button-label,
html.mud-theme-dark .ai-chat-message-user .mud-button-text,
body.mud-theme-dark .ai-chat-message-user .mud-typography,
body.mud-theme-dark .ai-chat-message-user .mud-chip-content,
body.mud-theme-dark .ai-chat-message-user .mud-chip,
body.mud-theme-dark .ai-chat-message-user .mud-chip-text,
body.mud-theme-dark .ai-chat-message-user .mud-button-label,
body.mud-theme-dark .ai-chat-message-user .mud-button-text {
    color: #04111f !important;
}

html.mud-theme-dark .ai-chat-message .mud-typography,
html.mud-theme-dark .ai-chat-history-entry .mud-typography,
body.mud-theme-dark .ai-chat-message .mud-typography,
body.mud-theme-dark .ai-chat-history-entry .mud-typography {
    color: inherit;
}

html.mud-theme-dark .ai-chat-history-paper,
body.mud-theme-dark .ai-chat-history-paper {
    background: rgba(15, 23, 42, 0.76);
    border: 1px solid rgba(148, 163, 184, 0.14);
}

html.mud-theme-dark .ai-chat-history-entry,
body.mud-theme-dark .ai-chat-history-entry {
    background: rgba(30, 41, 59, 0.42);
    border-color: rgba(148, 163, 184, 0.12) !important;
}

html.mud-theme-dark .ai-chat-history-entry .mud-button-root.mud-button-text,
body.mud-theme-dark .ai-chat-history-entry .mud-button-root.mud-button-text {
    color: #e2e8f0;
}

html.mud-theme-dark .ai-stock-table-shell,
body.mud-theme-dark .ai-stock-table-shell {
    background: rgba(15, 23, 42, 0.48);
    border-radius: 12px;
}

html.mud-theme-dark .ai-stock-table,
body.mud-theme-dark .ai-stock-table {
    color: #e5eefb;
}

html.mud-theme-dark .ai-stock-table thead,
body.mud-theme-dark .ai-stock-table thead {
    background: rgba(51, 65, 85, 0.95);
}

html.mud-theme-dark .ai-stock-table th,
body.mud-theme-dark .ai-stock-table th {
    color: #f8fafc;
    font-weight: 700;
    border-color: rgba(148, 163, 184, 0.18);
}

html.mud-theme-dark .ai-stock-table td,
body.mud-theme-dark .ai-stock-table td {
    color: #f8fafc !important;
    background: rgba(30, 41, 59, 0.72);
    border-color: rgba(148, 163, 184, 0.12);
}

html.mud-theme-dark .ai-stock-card,
body.mud-theme-dark .ai-stock-card {
    background: rgba(30, 41, 59, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.16);
}

html.mud-theme-dark .ai-stock-card-label,
body.mud-theme-dark .ai-stock-card-label {
    color: #93c5fd;
}

html.mud-theme-dark .ai-stock-col-text,
html.mud-theme-dark .ai-stock-col-numeric,
html.mud-theme-dark .ai-stock-table .mud-table-cell,
html.mud-theme-dark .ai-stock-table .mud-table-cell *,
body.mud-theme-dark .ai-stock-col-text,
body.mud-theme-dark .ai-stock-col-numeric {
    color: #f8fafc !important;
}

body.mud-theme-dark .ai-stock-table .mud-table-cell,
body.mud-theme-dark .ai-stock-table .mud-table-cell * {
    color: #f8fafc !important;
}

@media (max-width: 599.95px) {
    .zaq-stack-mobile-column {
        flex-direction: column !important;
        align-items: flex-start !important;
    }

    .zaq-mobile-full-width {
        width: 100% !important;
    }

    .zaq-checkout-option-card {
        width: 100%;
        align-self: stretch;
    }

    .ai-chat-history-paper {
        min-height: 220px;
    }

    .ai-chat-history-paper.is-collapsed {
        min-height: 110px;
    }
}
