#blazor-error-ui {
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

:root {
    font-size: var(--rz-root-font-size);
    --rz-white: #ffffff;
    --rz-black: #000000;
    --rz-base: #505f65;
    --rz-base-50: #ffffff;
    --rz-base-100: #f5f8f9;
    --rz-base-200: #e9eef0;
    --rz-base-300: #dae0e2;
    --rz-base-400: #c1c8cb;
    --rz-base-500: #95a2a8;
    --rz-base-600: #77858b;
    --rz-base-700: #505f65;
    --rz-base-800: #3a474d;
    --rz-base-900: #28363c;
    --rz-primary: #598087;
    --rz-primary-light: #6d8f95;
    --rz-primary-lighter: rgba(89, 128, 135, 0.16);
    --rz-primary-dark: #52767c;
    --rz-primary-darker: #436065;
    --rz-secondary: #80a4ab;
    --rz-secondary-light: #8fafb5;
    --rz-secondary-lighter: rgba(128, 164, 171, 0.2);
    --rz-secondary-dark: #76979d;
    --rz-secondary-darker: #607b80;
    --rz-info: #2cc8c8;
    --rz-info-light: #4ed1d1;
    --rz-info-lighter: rgba(44, 200, 200, 0.2);
    --rz-info-dark: #25a8a8;
    --rz-info-darker: #219696;
    --rz-success: #5dbf74;
    --rz-success-light: #77c98a;
    --rz-success-lighter: rgba(93, 191, 116, 0.16);
    --rz-success-dark: #4ea061;
    --rz-success-darker: #468f57;
    --rz-warning: #fac152;
    --rz-warning-light: #fbcb6e;
    --rz-warning-lighter: rgba(250, 193, 82, 0.2);
    --rz-warning-dark: #d2a245;
    --rz-warning-darker: #bc913e;
    --rz-danger: #f9777f;
    --rz-danger-light: #fa8d93;
    --rz-danger-lighter: rgba(249, 119, 127, 0.2);
    --rz-danger-dark: #d1646b;
    --rz-danger-darker: #bb595f;
    --rz-link-color: #62c2d5;
    --rz-link-hover-color: #82cfde;
}

body {
    font-family: var(--rz-text-font-family);
    color: var(--rz-text-color);
    font-size: var(--rz-body-font-size);
    line-height: var(--rz-body-line-height);
    background-color: var(--rz-body-background-color);
}

.rz-body {
    --rz-body-padding: 0;
}

a {
    color: var(--rz-link-color);
}

    a:hover,
    a:focus {
        color: var(--rz-link-hover-color);
    }

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }

/* Layout container */
.container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

    .filters > * {
        flex: 1;
        min-width: 150px;
    }

.pagination-controls {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Default: show grid, hide cards */
.desktop-grid {
    display: block !important;
}

.mobile-cards {
    display: none !important;
}

/* MOBILE: hide grid, show cards */
@media (max-width: 768px) {
    .desktop-grid {
        display: none !important;
    }

    .mobile-cards {
        display: flex !important;
        flex-direction: column;
        gap: 10px;
    }

    .patient-card {
        border: 1px solid #ddd;
        border-radius: 6px;
        padding: 10px;
        background-color: #fff;
        box-shadow: 0 1px 3px rgba(0,0,0,0.08);
        color: #000 !important; /* FIX: make text visible */
    }

        .patient-card * {
            color: #000 !important; /* FIX: force all text to black */
        }

    .patient-card-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .patient-name {
        font-weight: 600;
        color: #000 !important; /* FIX: ensure name is visible */
    }
}

/* ---------- Login page (navy & gold) ---------- */
.aox-login {
    box-sizing: border-box;
    --aox-navy: var(--rz-base-900, #28363c);
    --aox-gold: #a29061;
    --aox-gold-light: #cdb57a;
    position: fixed;
    inset: 0;
    overflow: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    font-family: 'Inter', system-ui, sans-serif;
    color: #e8eef3;
    background: radial-gradient(1200px 700px at 20% 10%, var(--rz-base-700, #505f65) 0%, var(--rz-base-800, #3a474d) 45%, var(--aox-navy) 100%);
}

.aox-login-arc {
    position: absolute;
    left: 50%;
    bottom: -1050px;
    width: 1400px;
    height: 1400px;
    transform: translateX(-50%);
    border-radius: 50%;
    border: 1px solid rgba(162, 144, 97, .25);
    pointer-events: none;
}

.aox-login-arc-outer {
    bottom: -1300px;
    width: 1700px;
    height: 1700px;
    border-color: rgba(162, 144, 97, .12);
}

.aox-login-card {
    position: relative;
    box-sizing: border-box;
    width: 100%;
    max-width: 420px;
    padding: 44px 40px;
    border-radius: 16px;
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .09);
    backdrop-filter: blur(14px);
    box-shadow: 0 30px 80px rgba(0, 0, 0, .4);
}

.aox-login-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 40px;
    right: 40px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--aox-gold), transparent);
}

.aox-login-logo {
    display: block;
    width: 190px;
    margin: 0 auto 22px;
}

.aox-login-title {
    margin: 0;
    text-align: center;
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 500;
    font-size: 30px;
    color: #fff;
}

.aox-login-subtitle {
    margin: 6px 0 32px;
    text-align: center;
    font-size: 14px;
    color: #94a8b8;
}

.aox-login-footer {
    position: relative;
    margin: 28px 0 0;
    font-size: 12px;
    color: var(--rz-base-500, #95a2a8);
}

/* RadzenLogin overrides */
.aox-login .rz-login > .rz-form {
    gap: 18px;
}

.aox-login .rz-login .rz-form-row {
    display: block;
    margin: 0;
}

.aox-login .rz-login .rz-label {
    display: block;
    width: auto;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #b9c7d2;
}

.aox-login .rz-login .rz-form-row:last-child > .rz-label {
    display: none;
}

.aox-login .rz-login .rz-form-input-wrapper {
    width: 100%;
}

.aox-login .rz-login .rz-textbox {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    border-radius: 8px;
    font-size: 15px;
    color: #fff;
    background: rgba(40, 54, 60, .7);
    border: 1px solid rgba(255, 255, 255, .14);
    box-shadow: none;
}

.aox-login .rz-login .rz-textbox:focus {
    outline: 2px solid var(--aox-gold);
    border-color: transparent;
}

.aox-login .rz-login-buttons {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 6px;
}

.aox-login .rz-login-buttons .rz-button {
    margin: 0;
}

.aox-login .rz-login-buttons .rz-primary {
    width: 100%;
    height: 48px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 15px;
    text-transform: none;
    letter-spacing: .02em;
    color: #0a1e33;
    background: linear-gradient(180deg, #b9a46e, var(--aox-gold));
    box-shadow: none;
}

.aox-login .rz-login-buttons .rz-primary:hover {
    background: linear-gradient(180deg, #c6b17b, #ad9b6a);
}

.aox-login .rz-login-buttons .rz-button.rz-variant-text.rz-secondary {
    align-self: center;
    font-weight: 600;
    font-size: 13px;
    text-transform: none;
    color: var(--aox-gold-light);
    background: transparent;
}

.aox-login .rz-alert {
    margin: 0 0 18px;
}

@media (max-width: 480px) {
    .aox-login-card {
        padding: 36px 24px;
    }
}

/* ---------- Designers (calendar colors) ---------- */

.designer-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 8px;
    vertical-align: -1px;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15);
    flex: none;
}

.designer-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 24px;
    padding: 0 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
}

.designer-swatch {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid transparent;
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15);
    cursor: pointer;
    padding: 0;
}

.designer-swatch.selected {
    outline: 2px solid var(--rz-text-color);
    outline-offset: 2px;
}

.designer-preview {
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 13px;
    max-width: 280px;
}

.calendar-designer-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 16px;
    margin: 4px 0 12px;
}

.calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.calendar-legend-item {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 16px;
    border: 1px solid var(--rz-base-300, #d6dbe0);
    background: var(--rz-base-background-color, #fff);
    color: var(--rz-text-color);
    font-size: 13px;
    cursor: pointer;
}

.calendar-legend-item:hover {
    border-color: var(--rz-base-500, #9aa4ae);
}

.calendar-legend-item.is-hidden {
    opacity: .45;
    text-decoration: line-through;
}

.calendar-legend-count {
    margin-left: 6px;
    font-size: 11px;
    font-weight: 700;
    color: var(--rz-text-secondary-color);
}

.calendar-legend-note {
    display: inline-flex;
    align-items: center;
    font-size: 13px;
    color: var(--rz-text-secondary-color);
}

/* =====================================================================
   Responsive / mobile
   Phone: up to 768px. Tablet: 769px to 1100px. Desktop is unchanged.
   ===================================================================== */

/* Login: keep the card reachable on short screens (landscape phones), and clip the
   decorative gold arcs so the page can't scroll sideways and push the card off center. */
.aox-login {
    justify-content: safe center;
    min-height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
}

@media (max-height: 560px) {
    .aox-login {
        justify-content: flex-start;
    }

    .aox-login-card {
        padding-top: 28px;
        padding-bottom: 28px;
    }

    .aox-login-logo {
        width: 150px;
        margin-bottom: 12px;
    }

    .aox-login-subtitle {
        margin-bottom: 20px;
    }
}

/* Backdrop behind the slide-out menus (phones only). */
.aox-nav-backdrop {
    display: none;
}

/* Patient name in the patient menu bar (phones only). */
.pd-header-title {
    display: none;
}

/* Tablet: give pages a little more room. */
@media (max-width: 1100px) {
    .rz-dialog-wrapper .rz-dialog:not(.rz-dialog-confirm):not(.rz-dialog-alert) {
        max-width: calc(100vw - 32px) !important;
    }
}

/* Patient pages on phones and tablets: the patient menu slides over the page
   (opened with its ☰ button) and the bar above the page names the patient. */
@media (max-width: 1100px) {
    .rz-layout.pd-layout {
        grid-template-columns: minmax(0, 1fr) !important;
        grid-template-areas: 'rz-header' 'rz-body' !important;
        margin-top: 4px;
    }

    .pd-layout > .rz-header,
    .pd-layout > .rz-body {
        width: 100% !important;
        margin-inline-start: 0 !important;
        inset-inline-start: 0 !important;
    }

    .pd-layout > .rz-header {
        position: static;
        border-radius: 8px;
    }

    .pd-layout > .rz-body {
        padding: 0 !important;
    }

    .pd-layout > .rz-sidebar {
        position: fixed !important;
        top: 0;
        bottom: 0;
        left: 0;
        width: min(280px, 85vw) !important;
        max-width: none;
        z-index: 1003 !important;
        overflow-y: auto;
        display: block !important;
        transform: translateX(-105%);
        visibility: hidden;
        transition: transform .2s ease, visibility 0s linear .2s;
        box-shadow: none;
    }

    .rz-layout.pd-layout.pd-menu-open > .rz-sidebar.rz-sidebar-responsive,
    .rz-layout.pd-layout.pd-menu-open > .rz-sidebar {
        transform: translateX(0);
        opacity: 1 !important;
        visibility: visible !important;
        transition: transform .2s ease;
        box-shadow: 8px 0 32px rgba(0, 0, 0, .45);
    }

    .pd-layout > .pd-nav-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1002;
        background: rgba(0, 0, 0, .45);
        border: 0;
        padding: 0;
        cursor: pointer;
    }

    .patient-details-container > .rz-row {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .pd-header-title {
        display: flex;
        flex-direction: column;
        justify-content: center;
        min-width: 0;
        padding: 0 12px;
        line-height: 1.2;
    }

    .pd-header-title strong {
        font-size: 15px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .pd-header-title span {
        font-size: 12px;
        color: var(--rz-text-secondary-color);
    }

    /* Tabs scroll sideways instead of squeezing. */
    .rz-tabview-nav {
        flex-wrap: nowrap !important;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
    }

    .rz-tabview-nav::-webkit-scrollbar {
        display: none;
    }

    .rz-tabview-nav > li {
        flex: 0 0 auto;
    }

    .rz-tabview-nav > li > a,
    .rz-tabview-nav > li > button {
        white-space: nowrap;
    }
}

@media (max-width: 768px) {
    /* --- Layout: one column, menus slide over the page instead of pushing it --- */
    .rz-layout {
        grid-template-columns: minmax(0, 1fr) !important;
        grid-template-areas: 'rz-header' 'rz-body' !important;
    }

    .rz-layout > .rz-header,
    .rz-layout > .rz-body {
        width: 100% !important;
        margin-inline-start: 0 !important;
        inset-inline-start: 0 !important;
    }

    .rz-layout > .rz-sidebar.rz-sidebar-responsive {
        position: fixed !important;
        top: 0;
        bottom: 0;
        left: 0;
        width: min(280px, 85vw) !important;
        max-width: none;
        z-index: 1003 !important;
        overflow-y: auto;
        transform: translateX(-105%);
        transition: transform .2s ease;
        box-shadow: none;
    }

    .rz-layout > .rz-sidebar.rz-sidebar-responsive.rz-sidebar-expanded {
        transform: translateX(0);
        box-shadow: 8px 0 32px rgba(0, 0, 0, .45);
    }

    .aox-nav-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1002;
        background: rgba(0, 0, 0, .45);
        border: 0;
        padding: 0;
        cursor: pointer;
    }

    /* Main header stays put while scrolling. */
    .rz-layout > .rz-header {
        position: sticky;
        top: 0;
        z-index: 5;
    }

    .rz-profile-menu .rz-navigation-item-text,
    .rz-header .rz-profile-menu .rz-navigation-item-wrapper > .rz-navigation-item-link > span:not(.rz-navigation-item-icon-children) {
        max-width: 38vw;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    /* --- Page spacing and headings --- */
    .rz-layout > .rz-body {
        padding: 0 !important;
    }

    .rz-body > .rz-row.rz-px-4 {
        padding-left: 14px !important;
        padding-right: 14px !important;
    }

    .patient-details-container > .rz-row {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .rz-tabview-panel {
        padding: 0 !important;
    }

    .rz-body > .rz-row,
    .patient-details-container > .rz-row {
        padding-top: 12px !important;
    }

    .rz-body .rz-text-h3 {
        font-size: 1.75rem;
        line-height: 1.2;
    }

    .rz-body .rz-text-h4 {
        font-size: 1.4rem;
    }

    /* Stop iOS from zooming into form fields. */
    input.rz-textbox,
    textarea.rz-textarea,
    .rz-inputtext,
    .rz-dropdown .rz-inputtext,
    .rz-datepicker input,
    .rz-numeric input,
    .aox-login .rz-login .rz-textbox {
        font-size: 16px !important;
    }

    .rz-tabview-panels {
        padding: 12px 10px !important;
    }

    /* --- Data grids: keep columns readable and let the grid scroll sideways --- */
    .rz-data-grid-data {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .rz-grid-table:has(thead th:nth-child(3)) {
        min-width: 560px;
    }

    .rz-grid-table:has(thead th:nth-child(6)) {
        min-width: 820px;
    }

    .rz-pager {
        flex-wrap: wrap;
        justify-content: center;
        row-gap: 8px;
    }

    .rz-pager .rz-pager-summary {
        width: 100%;
        text-align: center;
    }

    /* --- Dialogs open full screen --- */
    .rz-dialog-wrapper .rz-dialog:not(.rz-dialog-confirm):not(.rz-dialog-alert) {
        position: fixed !important;
        inset: 0 !important;
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        min-height: 0 !important;
        margin: 0 !important;
        transform: none !important;
        border-radius: 0 !important;
        display: flex;
        flex-direction: column;
    }

    .rz-dialog-wrapper .rz-dialog:not(.rz-dialog-confirm):not(.rz-dialog-alert) > .rz-dialog-titlebar {
        flex: 0 0 auto;
    }

    .rz-dialog-wrapper .rz-dialog:not(.rz-dialog-confirm):not(.rz-dialog-alert) > .rz-dialog-content {
        flex: 1 1 auto;
        height: auto !important;
        max-height: none !important;
        overflow: auto;
        padding: 12px 16px calc(16px + env(safe-area-inset-bottom));
    }

    .rz-dialog-resizable .rz-dialog-resize-handle,
    .rz-dialog .rz-resizable-handle {
        display: none;
    }

    /* Wizard steps inside dialogs: show compact. */
    .rz-steps .rz-steps-title {
        font-size: 12px;
    }

    /* --- Buttons and toolbars wrap instead of running off the edge --- */
    .rz-body .rz-stack.rz-flex-row,
    .rz-dialog .rz-stack.rz-flex-row {
        flex-wrap: wrap;
    }

    .rz-splitbutton,
    .rz-button {
        max-width: 100%;
    }

    .rz-button {
        min-height: 40px;
    }

    .rz-button.rz-button-xs,
    .rz-button.rz-button-sm,
    .rz-scheduler .rz-button,
    .rz-pager .rz-button,
    .rz-datepicker .rz-button,
    .rz-tabview-nav .rz-button {
        min-height: 0;
    }

    /* Radzen columns that only set a fixed size stack on phones. */
    .rz-body .rz-row > .rz-col-1, .rz-body .rz-row > .rz-col-2, .rz-body .rz-row > .rz-col-3,
    .rz-body .rz-row > .rz-col-4, .rz-body .rz-row > .rz-col-5, .rz-body .rz-row > .rz-col-6,
    .rz-body .rz-row > .rz-col-7, .rz-body .rz-row > .rz-col-8, .rz-body .rz-row > .rz-col-9,
    .rz-body .rz-row > .rz-col-10, .rz-body .rz-row > .rz-col-11,
    .rz-dialog .rz-row > .rz-col-1, .rz-dialog .rz-row > .rz-col-2, .rz-dialog .rz-row > .rz-col-3,
    .rz-dialog .rz-row > .rz-col-4, .rz-dialog .rz-row > .rz-col-5, .rz-dialog .rz-row > .rz-col-6,
    .rz-dialog .rz-row > .rz-col-7, .rz-dialog .rz-row > .rz-col-8, .rz-dialog .rz-row > .rz-col-9,
    .rz-dialog .rz-row > .rz-col-10, .rz-dialog .rz-row > .rz-col-11 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    /* Form fields fill the width. */
    .rz-body .rz-form-field,
    .rz-dialog .rz-form-field,
    .rz-dialog .rz-dropdown,
    .rz-dialog .rz-datepicker,
    .rz-dialog .rz-textbox,
    .rz-dialog .rz-textarea {
        max-width: 100%;
    }

    /* --- Patient dashboard: case cards fill the width --- */
    .rz-tabview-panel .rz-row > .rz-button:has(.rz-card) {
        flex: 1 1 100%;
        width: 100%;
    }

    .rz-tabview-panel .rz-row > .rz-button:has(.rz-card) > .rz-button-box {
        display: block;
        width: 100%;
    }

    .rz-tabview-panel .rz-row > .rz-button:has(.rz-card) .rz-card {
        width: 100%;
        min-width: 0 !important;
        text-align: start;
    }

    /* --- Calendar --- */
    .calendar-designer-bar {
        gap: 8px;
    }

    .calendar-legend {
        overflow-x: auto;
        flex-wrap: nowrap;
        max-width: 100%;
        padding-bottom: 2px;
    }

    .calendar-legend-item {
        flex: 0 0 auto;
    }

    .rz-scheduler {
        height: auto !important;
        min-height: 560px;
    }

    .rz-scheduler-nav {
        flex-wrap: wrap;
        gap: 8px;
    }

    .rz-scheduler-nav .rz-scheduler-nav-title {
        order: -1;
        width: 100%;
        text-align: center;
    }

    .rz-month-view .rz-slot-header,
    .rz-month-view .rz-slot-title {
        font-size: 12px;
    }
}

/* Small phones */
@media (max-width: 400px) {
    .rz-body > .rz-row.rz-px-4 {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }
}

/* Fix: the designer note's link was laid out as its own flex item. */
.calendar-legend-note {
    display: inline-block;
}

.calendar-legend-note .designer-dot {
    vertical-align: middle;
}

/* ==========================================================================
   Chat: Messages page (/messages) and the slide-out chat drawer
   iMessage-style bubbles. Colors follow the Radzen theme so light mode works too.
   ========================================================================== */
:root {
    --aox-chat-blue: #0A84FF;
    --aox-chat-gold: #A29061;
    --aox-chat-text: var(--rz-text-color, #fff);
    --aox-chat-muted: var(--rz-text-tertiary-color, #95a2a8);
    --aox-chat-line: rgba(127, 140, 145, 0.25);
    --aox-chat-panel: var(--rz-card-background-color, #3a474d);
    --aox-chat-bg: var(--rz-base-background-color, #28363c);
    --aox-chat-gray: color-mix(in srgb, var(--aox-chat-text) 13%, transparent);
    --aox-chat-field: color-mix(in srgb, var(--aox-chat-text) 8%, transparent);
}

.aox-chat-badge {
    background: #ff3b30; color: #fff; font-size: 11px; font-weight: 700; line-height: 18px;
    border-radius: 9px; padding: 0 6px; min-width: 18px; text-align: center; display: inline-block;
}

/* --- one conversation ---------------------------------------------------- */
.aox-chat { display: flex; flex-direction: column; flex: 1; min-height: 0; color: var(--aox-chat-text); }
.aox-chat-msgs { flex: 1; min-height: 0; overflow-y: auto; padding: 14px 22px 8px; display: flex; flex-direction: column; gap: 2px; }
.aox-chat-compact .aox-chat-msgs { padding: 10px 14px 6px; }
.aox-chat-empty { margin: auto; text-align: center; color: var(--aox-chat-muted); font-size: 14px; padding: 24px; }
.aox-chat-empty .rzi { font-size: 40px; opacity: .6; display: block; margin-bottom: 6px; }
.aox-chat-stamp { text-align: center; font-size: 11.5px; color: var(--aox-chat-muted); margin: 14px 0 6px; }
.aox-chat-stamp b { color: var(--aox-chat-text); opacity: .8; font-weight: 600; }
.aox-chat-who { font-size: 11.5px; color: var(--aox-chat-muted); margin: 8px 0 1px 46px; }
.aox-chat-compact .aox-chat-who { margin-left: 12px; }
.aox-chat-row { display: flex; align-items: flex-end; gap: 8px; }
.aox-chat-row.me { justify-content: flex-end; margin-top: 8px; }
.aox-chat-row.me.grouped, .aox-chat-row.in.grouped { margin-top: 0; }
.aox-chat-stack { display: flex; flex-direction: column; gap: 3px; max-width: min(70%, 520px); position: relative; }
.aox-chat-row.me .aox-chat-stack { align-items: flex-end; }
.aox-chat-row.in .aox-chat-stack { align-items: flex-start; }
.aox-chat-compact .aox-chat-stack { max-width: 82%; }
.aox-chat-b {
    padding: 8px 13px; border-radius: 19px; font-size: 15px; line-height: 1.32;
    white-space: pre-wrap; overflow-wrap: anywhere; cursor: pointer; user-select: text;
}
.aox-chat-compact .aox-chat-b { font-size: 14px; padding: 7px 12px; }
.aox-chat-row.in .aox-chat-b { background: var(--aox-chat-gray); color: var(--aox-chat-text); }
.aox-chat-row.me .aox-chat-b { background: var(--aox-chat-blue); color: #fff; }
.aox-chat-row.in .aox-chat-b.tail { border-bottom-left-radius: 5px; }
.aox-chat-row.me .aox-chat-b.tail { border-bottom-right-radius: 5px; }
.aox-chat-av {
    width: 32px; height: 32px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700; font-size: 12px; background: #6d8f95;
}
.aox-chat-av.big { width: 42px; height: 42px; font-size: 14px; }
.aox-chat-av.office { background: linear-gradient(135deg, #a29061, #7c6c43); }
.aox-chat-av .rzi { font-size: 20px; }
.aox-chat-av-space { width: 32px; flex: none; }
.aox-chat-read { text-align: right; font-size: 11.5px; color: var(--aox-chat-muted); margin: 2px 4px 0; }
.aox-chat-photo img { display: block; max-width: 260px; max-height: 240px; border-radius: 16px; object-fit: cover; }
.aox-chat-file {
    display: flex; gap: 10px; align-items: center; border-radius: 16px; padding: 9px 13px; min-width: 220px; max-width: 300px;
    background: var(--aox-chat-gray); color: var(--aox-chat-text) !important; text-decoration: none !important;
}
.aox-chat-row.me .aox-chat-file { background: var(--aox-chat-blue); color: #fff !important; }
.aox-chat-file-ic { width: 36px; height: 36px; border-radius: 8px; background: rgba(255,255,255,.18); display: flex; align-items: center; justify-content: center; flex: none; }
.aox-chat-file-tx { display: flex; flex-direction: column; min-width: 0; }
.aox-chat-file-tx b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aox-chat-file-tx small { opacity: .75; }
.aox-chat-tapback {
    position: absolute; top: -12px; font-size: 13px; line-height: 1; padding: 3px 5px; border-radius: 12px; cursor: pointer;
    background: var(--aox-chat-panel); border: 2px solid var(--aox-chat-bg); box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.aox-chat-row.me .aox-chat-tapback { left: -16px; top: -14px; }
.aox-chat-row.in .aox-chat-tapback { right: -16px; top: -14px; }
.aox-chat-tapbar {
    display: flex; gap: 2px; padding: 4px 6px; border-radius: 22px; background: var(--aox-chat-panel);
    box-shadow: 0 4px 16px rgba(0,0,0,.3); margin-bottom: 2px;
}
.aox-chat-tapbar button { border: 0; background: none; font-size: 19px; width: 34px; height: 34px; border-radius: 50%; cursor: pointer; }
.aox-chat-tapbar button:hover, .aox-chat-tapbar button.on { background: var(--aox-chat-gray); }
.aox-chat-typing { background: var(--aox-chat-gray); border-radius: 19px; padding: 12px 14px; display: flex; gap: 4px; }
.aox-chat-typing i { width: 8px; height: 8px; border-radius: 50%; background: var(--aox-chat-muted); animation: aox-chat-dot 1.2s infinite; }
.aox-chat-typing i:nth-child(2) { animation-delay: .2s; }
.aox-chat-typing i:nth-child(3) { animation-delay: .4s; }
@keyframes aox-chat-dot { 0%, 60%, 100% { opacity: .35; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }
.aox-chat-error { margin: 0 16px 6px; color: #ff6b61; font-size: 13px; }
.aox-chat-quick { display: flex; gap: 6px; padding: 2px 14px 6px; flex-wrap: wrap; }
.aox-chat-quick button {
    border: 1px solid var(--aox-chat-line); background: none; color: var(--aox-chat-text); border-radius: 14px;
    padding: 4px 11px; font-size: 12.5px; cursor: pointer;
}
.aox-chat-quick button:hover { background: var(--aox-chat-field); }
.aox-chat-comp { display: flex; gap: 10px; align-items: flex-end; padding: 8px 16px 14px; margin: 0; }
.aox-chat-compact .aox-chat-comp { padding: 6px 12px 12px; gap: 8px; }
.aox-chat-plus {
    width: 34px; height: 34px; border-radius: 50%; background: var(--aox-chat-field); display: flex; align-items: center; justify-content: center;
    color: var(--aox-chat-muted); cursor: pointer; flex: none; margin: 0 0 2px;
}
.aox-chat-field { flex: 1; min-width: 0; border: 1px solid var(--aox-chat-line); border-radius: 20px; padding: 3px 4px 3px 14px; }
.aox-chat-inputrow { display: flex; align-items: flex-end; gap: 6px; }
.aox-chat-field textarea {
    flex: 1; min-width: 0; resize: none; border: 0; outline: 0; background: transparent; color: var(--aox-chat-text);
    font: inherit; font-size: 15px; line-height: 20px; padding: 6px 0; max-height: 120px;
}
.aox-chat-field textarea::placeholder { color: var(--aox-chat-muted); }
.aox-chat-send {
    width: 28px; height: 28px; border-radius: 50%; border: 0; background: var(--aox-chat-blue); color: #fff;
    display: flex; align-items: center; justify-content: center; cursor: pointer; flex: none; margin-bottom: 3px;
}
.aox-chat-send:disabled { background: var(--aox-chat-gray); color: var(--aox-chat-muted); cursor: default; }
.aox-chat-send .rzi { font-size: 18px; }
.aox-chat-pending { display: flex; align-items: center; gap: 6px; font-size: 13px; padding: 6px 0 2px; color: var(--aox-chat-text); }
.aox-chat-pending span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aox-chat-pending button { border: 0; background: none; color: var(--aox-chat-muted); cursor: pointer; padding: 0 6px; }
.aox-chat-pending .rzi { font-size: 16px; }

/* --- Messages page ------------------------------------------------------- */
.aox-msgs {
    display: grid; grid-template-columns: 340px 1fr; height: calc(100vh - 150px); min-height: 480px;
    border: 1px solid var(--aox-chat-line); border-radius: 12px; overflow: hidden; background: var(--aox-chat-panel);
}
.aox-msgs-list { display: flex; flex-direction: column; min-height: 0; min-width: 0; border-right: 1px solid var(--aox-chat-line); position: relative; }
.aox-msgs-lh { display: flex; align-items: center; padding: 16px 16px 10px; }
.aox-msgs-lh h2 { font-size: 22px; font-weight: 700; flex: 1; margin: 0; }
.aox-msgs-new { border: 0; background: none; color: var(--aox-chat-blue); cursor: pointer; padding: 4px; }
.aox-msgs-new .rzi { font-size: 24px; }
.aox-msgs-search {
    margin: 0 16px 10px; background: var(--aox-chat-field); border-radius: 9px; padding: 0 10px; display: flex; gap: 6px; align-items: center;
    color: var(--aox-chat-muted);
}
.aox-msgs-search .rzi { font-size: 18px; }
.aox-msgs-search input, .aox-msgs-picker input {
    flex: 1; border: 0; outline: 0; background: transparent; color: var(--aox-chat-text); font: inherit; font-size: 14px; padding: 8px 0; min-width: 0;
}
.aox-msgs-seg {
    margin: 0 16px 8px; background: var(--aox-chat-field); border-radius: 8px; display: grid; grid-template-columns: 1fr 1fr 1fr; padding: 2px;
}
.aox-msgs-seg button {
    border: 0; background: none; color: var(--aox-chat-text); opacity: .8; font-size: 13px; font-weight: 600; padding: 5px; border-radius: 6px; cursor: pointer;
}
.aox-msgs-seg button.on { background: var(--aox-chat-gray); opacity: 1; box-shadow: 0 1px 2px rgba(0,0,0,.15); }
.aox-msgs-items { flex: 1; overflow-y: auto; padding-bottom: 10px; }
.aox-msgs-sect { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--aox-chat-muted); padding: 10px 16px 4px; font-weight: 700; }
.aox-msgs-it {
    display: flex; gap: 10px; padding: 9px 12px 9px 6px; align-items: center; width: calc(100% - 12px); margin: 0 6px; border: 0; border-radius: 10px;
    background: none; color: var(--aox-chat-text); text-align: left; cursor: pointer; font: inherit;
}
.aox-msgs-it:hover { background: var(--aox-chat-field); }
.aox-msgs-it.sel { background: var(--aox-chat-blue); color: #fff; }
.aox-msgs-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.aox-msgs-it.unread .aox-msgs-dot { background: var(--aox-chat-blue); }
.aox-msgs-it.sel .aox-msgs-dot { background: transparent; }
.aox-msgs-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.aox-msgs-tx .r1 { display: flex; align-items: baseline; gap: 6px; }
.aox-msgs-tx .nm { font-weight: 700; font-size: 15px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aox-msgs-tx .tm { font-size: 12px; color: var(--aox-chat-muted); flex: none; }
.aox-msgs-tx .sub { font-size: 12px; color: var(--aox-chat-muted); margin: 1px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aox-msgs-tx .pv { font-size: 13px; color: var(--aox-chat-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aox-msgs-it.unread .pv { color: var(--aox-chat-text); }
.aox-msgs-it.sel .tm, .aox-msgs-it.sel .sub, .aox-msgs-it.sel .pv { color: #e3f0ff; }
.aox-msgs-chip { display: inline-block; font-size: 10.5px; font-weight: 700; padding: 0 6px; border-radius: 5px; background: var(--aox-chat-gray); margin-left: 6px; }
.aox-msgs-it.sel .aox-msgs-chip { background: rgba(255,255,255,.22); }
.aox-msgs-empty { color: var(--aox-chat-muted); font-size: 13px; padding: 16px; text-align: center; }
.aox-msgs-picker {
    position: absolute; left: 10px; right: 10px; top: 56px; bottom: 10px; z-index: 3; background: var(--aox-chat-panel);
    border: 1px solid var(--aox-chat-line); border-radius: 12px; box-shadow: 0 12px 30px rgba(0,0,0,.35); display: flex; flex-direction: column; padding: 10px;
}
.aox-msgs-picker-h { display: flex; align-items: center; padding: 2px 4px 8px; }
.aox-msgs-picker-h b { flex: 1; }
.aox-msgs-picker-h button { border: 0; background: none; color: var(--aox-chat-muted); cursor: pointer; }
.aox-msgs-picker input { background: var(--aox-chat-field); border-radius: 8px; padding: 8px 10px; flex: none; }
.aox-msgs-picker-list { flex: 1; overflow-y: auto; margin-top: 6px; }
.aox-msgs-pick {
    display: flex; gap: 10px; align-items: center; width: 100%; border: 0; background: none; color: var(--aox-chat-text); text-align: left;
    padding: 8px 6px; border-radius: 8px; cursor: pointer; font: inherit;
}
.aox-msgs-pick:hover { background: var(--aox-chat-field); }
.aox-msgs-pick span { display: flex; flex-direction: column; }
.aox-msgs-pick small { color: var(--aox-chat-muted); }
.aox-msgs-thread { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: color-mix(in srgb, var(--aox-chat-panel) 88%, #000); }
.aox-msgs-placeholder { margin: auto; text-align: center; color: var(--aox-chat-muted); }
.aox-msgs-placeholder .rzi { font-size: 48px; opacity: .5; }
.aox-msgs-th { display: flex; align-items: center; gap: 12px; padding: 10px 18px; border-bottom: 1px solid var(--aox-chat-line); background: var(--aox-chat-panel); }
.aox-msgs-th-tx { flex: 1; min-width: 0; }
.aox-msgs-th .t1 { font-weight: 700; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aox-msgs-th .t2 { font-size: 12.5px; color: var(--aox-chat-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aox-msgs-open {
    border: 1px solid var(--aox-chat-line); border-radius: 8px; padding: 6px 12px; font-size: 13px; font-weight: 600; display: flex; gap: 6px;
    align-items: center; color: var(--aox-chat-text) !important; text-decoration: none !important; flex: none;
}
.aox-msgs-open .rzi { font-size: 18px; }
.aox-msgs-back { display: none; border: 0; background: none; color: var(--aox-chat-blue); cursor: pointer; padding: 4px 0; }
.aox-msgs-nochat { max-width: 640px; }
.aox-nav-messages .rz-navigation-item-link { position: relative; }
.aox-nav-messages-text { flex: 1; }
.aox-nav-messages .aox-chat-badge { margin-left: auto; margin-right: 4px; }

/* --- chat button and drawer ---------------------------------------------- */
.aox-chat-fab {
    position: fixed; right: 24px; bottom: 24px; z-index: 1001; width: 56px; height: 56px; border-radius: 50%; border: 0; cursor: pointer;
    background: var(--rz-primary, #598087); color: #fff; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 8px 22px rgba(0,0,0,.35); transition: transform .15s;
}
.aox-chat-fab:hover { transform: scale(1.06); }
.aox-chat-fab .rzi { font-size: 27px; font-variation-settings: 'FILL' 1; }
.aox-chat-fab .aox-chat-badge { position: absolute; top: -2px; right: -2px; }
.aox-chat-scrim { position: fixed; inset: 0; z-index: 1001; background: rgba(0,0,0,.25); }
.aox-chat-drawer {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 1002; width: 420px; max-width: 100vw; display: flex; flex-direction: column;
    background: var(--aox-chat-bg); color: var(--aox-chat-text); border-left: 1px solid var(--aox-chat-line);
    box-shadow: -20px 0 40px rgba(0,0,0,.35); animation: aox-chat-in .18s ease-out;
}
@keyframes aox-chat-in { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.aox-chat-dh { display: flex; align-items: center; gap: 8px; padding: 14px 14px 10px 16px; }
.aox-chat-dh-ic { color: var(--rz-primary-light, #6d8f95); font-variation-settings: 'FILL' 1; }
.aox-chat-dh-t { font-weight: 700; font-size: 17px; flex: 1; }
.aox-chat-icon {
    border: 0; background: none; color: var(--aox-chat-muted) !important; cursor: pointer; padding: 4px; display: inline-flex; text-decoration: none !important;
}
.aox-chat-icon:hover { color: var(--aox-chat-text) !important; }
.aox-chat-seg { margin: 0 16px 10px; background: var(--aox-chat-field); border-radius: 9px; display: grid; grid-template-columns: 1fr 1fr; padding: 3px; }
.aox-chat-seg button {
    border: 0; background: none; color: var(--aox-chat-text); opacity: .85; padding: 6px; border-radius: 7px; font-size: 13px; font-weight: 600;
    display: flex; justify-content: center; align-items: center; gap: 6px; cursor: pointer;
}
.aox-chat-seg button.on { background: var(--rz-primary, #598087); color: #fff; opacity: 1; }
.aox-chat-seg .rzi { font-size: 17px; }
.aox-chat-ctx {
    margin: 0 16px 4px; padding: 9px 12px; background: var(--aox-chat-field); border-radius: 10px; font-size: 12.5px;
    display: flex; gap: 10px; align-items: center; color: var(--aox-chat-muted);
}
.aox-chat-ctx b { color: var(--aox-chat-text); }
.aox-chat-ctx .rzi { color: var(--rz-primary-light, #6d8f95); }
.aox-chat-recent { flex: 1; overflow-y: auto; padding: 0 8px 12px; }
.aox-chat-recent-h { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--aox-chat-muted); padding: 6px 8px; font-weight: 700; }
.aox-chat-recent-it {
    display: flex; gap: 10px; align-items: center; width: 100%; border: 0; background: none; color: var(--aox-chat-text); text-align: left;
    padding: 8px; border-radius: 10px; cursor: pointer; font: inherit;
}
.aox-chat-recent-it:hover { background: var(--aox-chat-field); }
.aox-chat-recent-it .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.aox-chat-recent-it .r1 { display: flex; gap: 6px; }
.aox-chat-recent-it .r1 b { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aox-chat-recent-it small, .aox-chat-recent-it .pv { color: var(--aox-chat-muted); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Phones: Messages shows the list or the open conversation, and the drawer fills the screen. */
@media (max-width: 768px) {
    .aox-msgs { grid-template-columns: minmax(0, 1fr); height: calc(100dvh - 110px); border-radius: 10px; }
    .aox-msgs .aox-msgs-thread { display: none; }
    .aox-msgs.has-thread .aox-msgs-list { display: none; }
    .aox-msgs.has-thread .aox-msgs-thread { display: flex; }
    .aox-msgs-back { display: inline-flex; }
    .aox-msgs-th { padding: 8px 12px; gap: 10px; }
    .aox-msgs-th .aox-chat-av.big { width: 36px; height: 36px; }
    .aox-msgs-open span { display: none; }
    .aox-chat-msgs { padding: 10px 12px 6px; }
    .aox-chat-who { margin-left: 40px; }
    .aox-chat-stack { max-width: 80%; }
    .aox-chat-drawer { width: 100vw; border-left: 0; }
    .aox-chat-fab { right: 16px; bottom: 16px; width: 52px; height: 52px; }
    .aox-chat-field textarea { font-size: 16px; } /* stops iOS zooming into the box */
}

/* ==========================================================================
   Home-screen app: notifications banner (Components/Layout/PushPrompt.razor)
   ========================================================================== */
.aox-push {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0 0 16px;
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--rz-card-background-color, #3a474d);
    border: 1px solid color-mix(in srgb, #a29061 45%, transparent);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
    color: var(--rz-text-color, #fff);
}
.aox-push-icon {
    flex: none;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #cdb57a;
    background: color-mix(in srgb, #a29061 18%, transparent);
}
.aox-push-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: 14px; line-height: 1.4; }
.aox-push-text strong { font-size: 15px; }
.aox-push-text > span { color: var(--rz-text-secondary-color, #c3ccd0); }
.aox-push-share { display: inline-flex; vertical-align: -3px; color: #0A84FF; }
.aox-push-actions { flex: none; display: flex; gap: 8px; }
.aox-push-actions button {
    border: 0;
    border-radius: 8px;
    padding: 8px 14px;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
.aox-push-on { background: linear-gradient(180deg, #b9a46e, #a29061); color: #1d262b; }
.aox-push-on:disabled { opacity: 0.6; cursor: default; }
.aox-push-later { background: transparent; color: var(--rz-text-secondary-color, #c3ccd0); }
.aox-push-later:hover { background: color-mix(in srgb, currentColor 10%, transparent); }

@media (max-width: 768px) {
    .aox-push { flex-wrap: wrap; align-items: flex-start; gap: 10px 12px; }
    .aox-push-text { flex-basis: calc(100% - 56px); }
    .aox-push-actions { flex-basis: 100%; justify-content: flex-end; }
}

/* Notifications page (Components/Pages/Notifications) */
.aox-notif { max-width: 720px; }
.aox-notif-lead { color: var(--rz-text-secondary-color, #c3ccd0); margin: 0 0 16px; }
.aox-notif-card { background: var(--rz-card-background-color, #3a474d); border-radius: 12px; padding: 16px 18px; margin-bottom: 16px; }
.aox-notif-card h2 { font-size: 17px; margin: 0 0 10px; }
.aox-notif-checks, .aox-notif-devices { list-style: none; margin: 0; padding: 0; }
.aox-notif-checks li { display: flex; gap: 10px; align-items: flex-start; padding: 7px 0; border-top: 1px solid rgba(127, 140, 145, 0.25); }
.aox-notif-checks li:first-child { border-top: 0; }
.aox-notif-checks li.ok .rzi { color: #4caf7d; }
.aox-notif-checks li.bad .rzi { color: #e8a33d; }
.aox-notif-checks li div { display: flex; flex-direction: column; gap: 2px; }
.aox-notif-checks small { color: var(--rz-text-secondary-color, #c3ccd0); font-size: 13px; }
.aox-notif-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.aox-notif-actions button { border: 0; border-radius: 8px; padding: 9px 14px; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.aox-notif-test { background: var(--rz-primary, #5a8189); color: #fff; }
.aox-notif-results { margin-top: 12px; font-size: 14px; }
.aox-notif-results p { margin: 4px 0; }
.aox-notif-hint { color: var(--rz-text-secondary-color, #c3ccd0); font-size: 13px; margin: 10px 0 0; }
.aox-notif-devices li { padding: 6px 0; display: flex; flex-wrap: wrap; gap: 4px 10px; }
.aox-notif-devices span { color: var(--rz-text-secondary-color, #c3ccd0); font-size: 13px; }

/* ==========================================================================
   Puck Production calendar (Components/Pages/PuckProduction)
   ========================================================================== */
:root {
    --aox-puck-zr: #8fb7d6;
    --aox-puck-zr-text: #10222e;
    --aox-puck-pmma: #d8b26e;
    --aox-puck-pmma-text: #2a1f0b;
    --aox-puck-line: rgba(127, 140, 145, 0.25);
    --aox-puck-cell: var(--rz-card-background-color, #3a474d);
    --aox-puck-muted: var(--rz-text-secondary-color, #c3ccd0);
}

.puck-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin: 4px 0 12px; }
.puck-month-nav { display: flex; align-items: center; gap: 6px; }
.puck-month-title { font-size: 20px; font-weight: 600; margin: 0 6px; min-width: 150px; text-align: center; }
.puck-month-totals { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-left: auto; }
.puck-total-label { font-size: 13px; color: var(--aox-puck-muted); margin-right: 2px; }

.puck-pill { display: inline-flex; align-items: baseline; gap: 3px; border-radius: 10px; padding: 1px 8px; font-size: 12px; line-height: 18px; white-space: nowrap; }
.puck-pill b { font-size: 13px; }
.puck-zr { background: var(--aox-puck-zr); color: var(--aox-puck-zr-text); }
.puck-pmma { background: var(--aox-puck-pmma); color: var(--aox-puck-pmma-text); }
.puck-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; flex: none; }

.puck-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }

.puck-cal { border: 1px solid var(--aox-puck-line); border-radius: 10px; overflow: hidden; }
.puck-cal-head, .puck-cal-row { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)) 64px; }
.puck-cal-head div { padding: 8px 8px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--aox-puck-muted); border-bottom: 1px solid var(--aox-puck-line); }
.puck-cal-row + .puck-cal-row { border-top: 1px solid var(--aox-puck-line); }

.puck-day {
    display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-height: 92px; padding: 6px 8px;
    background: transparent; color: var(--rz-text-color); border: 0; border-right: 1px solid var(--aox-puck-line);
    font: inherit; text-align: left; cursor: pointer;
}
.puck-day:hover { background: color-mix(in srgb, var(--rz-text-color, #fff) 5%, transparent); }
.puck-day:focus-visible { outline: 2px solid var(--aox-puck-zr); outline-offset: -2px; }
.puck-day.is-other { color: var(--aox-puck-muted); opacity: .55; }
.puck-day.is-unloaded .puck-day-num { text-decoration: line-through; }
.puck-day.is-selected { background: color-mix(in srgb, var(--aox-puck-zr) 16%, transparent); box-shadow: inset 0 0 0 2px var(--aox-puck-zr); }
.puck-day-num { font-size: 13px; font-weight: 600; min-width: 22px; height: 22px; line-height: 22px; text-align: center; border-radius: 11px; }
.puck-day.is-today .puck-day-num { background: var(--aox-chat-gold, #A29061); color: #fff; }
.puck-day-pills { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }

.puck-week-col { text-align: center; }
.puck-week-total { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; background: color-mix(in srgb, var(--rz-text-color, #fff) 4%, transparent); }
.puck-week-line { display: inline-flex; align-items: center; }

.puck-panel { background: var(--aox-puck-cell); border-radius: 12px; padding: 14px 16px; position: sticky; top: 12px; }
.puck-panel-head h2 { font-size: 17px; margin: 0 0 8px; }
.puck-panel-totals { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.puck-empty { color: var(--aox-puck-muted); margin: 12px 0 4px; }
.puck-group-title { display: flex; align-items: center; font-size: 14px; font-weight: 600; margin: 14px 0 6px; }
.puck-group-title span:last-child { margin-left: auto; font-weight: 400; color: var(--aox-puck-muted); font-size: 13px; }
.puck-jobs { list-style: none; margin: 0; padding: 0; }
.puck-job { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--aox-puck-line); }
.puck-job-count { flex: none; width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; }
.puck-job-main { flex: 1; min-width: 0; }
.puck-job-name { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 6px; }
.puck-job-meta { font-size: 12px; color: var(--aox-puck-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.puck-rush { background: #e8573d; color: #fff; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; border-radius: 6px; padding: 0 5px; line-height: 16px; }
.puck-job-open { flex: none; display: inline-flex; align-items: center; font-size: 13px; font-weight: 600; color: var(--aox-puck-zr); text-decoration: none; white-space: nowrap; }
.puck-job-open:hover { text-decoration: underline; }
.puck-job-open .rzi { font-size: 18px; }
.puck-rules { font-size: 12px; color: var(--aox-puck-muted); margin: 14px 0 0; max-width: 820px; }

/* Tablets: the day panel goes under the calendar. */
@media (max-width: 1100px) {
    .puck-layout { grid-template-columns: minmax(0, 1fr); }
    .puck-panel { position: static; }
}

/* Phones: compact cells with numbers only, no week column. */
@media (max-width: 768px) {
    .puck-month-totals { margin-left: 0; }
    .puck-month-title { min-width: 0; font-size: 17px; }
    .puck-cal-head, .puck-cal-row { grid-template-columns: repeat(7, minmax(0, 1fr)); }
    .puck-week-col { display: none; }
    .puck-cal-head div { padding: 6px 2px; text-align: center; font-size: 11px; }
    .puck-day { min-height: 62px; padding: 4px 2px; align-items: center; }
    .puck-day-pills { align-items: center; }
    .puck-pill { padding: 0 6px; }
    .puck-pill-name { display: none; }
    .puck-day-pills .puck-pill b { font-size: 12px; }
    .puck-job-open { font-size: 0; }
    .puck-job-open .rzi { font-size: 24px; }
}

/* Puck Production: Magic Touch cases */
.puck-panel-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.puck-source { background: color-mix(in srgb, var(--rz-text-color, #fff) 14%, transparent); color: var(--rz-text-color); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; border-radius: 6px; padding: 0 5px; line-height: 16px; white-space: nowrap; }
.puck-job-notes { font-style: italic; }
button.puck-job-open { background: none; border: 0; padding: 0; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; gap: 3px; }
button.puck-job-open .rzi { font-size: 16px; }
.puck-entry-lead { color: var(--aox-puck-muted); margin: 0; }
.puck-entry-form .rz-datepicker, .puck-entry-form .rz-autocomplete { width: 100%; }

/* Puck Production: Add case dialog (pick a portal case) */
.puck-job-actions { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.puck-pick-loading { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--aox-puck-muted); }
.puck-pick-list { list-style: none; margin: 0; padding: 0; max-height: 340px; overflow-y: auto; border: 1px solid var(--aox-puck-line); border-radius: 8px; }
.puck-pick-list li + li { border-top: 1px solid var(--aox-puck-line); }
.puck-pick-list .puck-empty { padding: 10px 12px; margin: 0; }
.puck-pick { display: flex; width: 100%; gap: 10px; align-items: center; padding: 8px 12px; background: transparent; border: 0; color: var(--rz-text-color); font: inherit; text-align: left; cursor: pointer; }
.puck-pick:hover, .puck-pick:focus-visible { background: color-mix(in srgb, var(--aox-puck-zr) 14%, transparent); outline: none; }
.puck-pick-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.puck-pick-name { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 6px; }
.puck-pick-side { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: 12px; }
.puck-pick-due { color: var(--aox-puck-muted); white-space: nowrap; }
.puck-pick-on { color: var(--aox-puck-zr); font-weight: 600; white-space: nowrap; }
.puck-picked { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; background: color-mix(in srgb, var(--aox-puck-zr) 12%, transparent); }
.puck-entry-material { display: flex; flex-direction: column; justify-content: center; }
@media (max-width: 768px) {
    .puck-job-actions { flex-direction: row; gap: 10px; }
    .puck-pick-list { max-height: 50vh; }
}

/* Puck Production: high workload (more than 12 of one material on a day) */
.puck-pill.puck-high { background: #e8573d; color: #fff; }
.puck-warn-icon { font-size: 14px; line-height: 18px; vertical-align: -2px; margin-right: 2px; }
.puck-day.is-high { background: color-mix(in srgb, #e8573d 12%, transparent); }
.puck-day.is-high.is-selected { background: color-mix(in srgb, #e8573d 18%, transparent); }
.puck-pill.puck-high-days { background: color-mix(in srgb, #e8573d 85%, transparent); color: #fff; }
.puck-high-alert { margin: 6px 0 2px; }
@media (max-width: 768px) {
    .puck-day-pills .puck-warn-icon { display: none; }
}
