/* Site-wide responsive finishing layer. Loaded last on purpose. */
:root {
    --responsive-page-gutter: clamp(10px, 3vw, 24px);
    --responsive-card-pad: clamp(12px, 2.4vw, 18px);
    --responsive-control-height: 44px;
}

html,
body {
    width: 100%;
    max-width: 100%;
}

body,
button,
input,
select,
textarea {
    text-size-adjust: 100%;
    -webkit-text-size-adjust: 100%;
}

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

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

iframe {
    border: 0;
}

input,
select,
textarea,
button {
    max-width: 100%;
    font: inherit;
}

input,
select,
textarea {
    min-width: 0;
}

textarea {
    resize: vertical;
}

table {
    max-width: 100%;
}

pre,
code {
    white-space: pre-wrap;
    overflow-wrap: break-word;
    word-break: normal;
}

body:not(:has(.hotel-board-page)) [dir="ltr"],
body:not(:has(.hotel-board-page)) code,
body:not(:has(.hotel-board-page)) .catalog-code,
body:not(:has(.hotel-board-page)) .admin-code,
body:not(:has(.hotel-board-page)) .service-code,
body:not(:has(.hotel-board-page)) .role-code,
body:not(:has(.hotel-board-page)) .permission-code,
body:not(:has(.hotel-board-page)) .operation-code-badge,
body:not(:has(.hotel-board-page)) .operation-currency-badge,
body:not(:has(.hotel-board-page)) .financial-account-number,
body:not(:has(.hotel-board-page)) .exchange-rate-code {
    direction: ltr;
    unicode-bidi: isolate;
    word-break: normal;
    overflow-wrap: normal;
}

.catalog-code,
.admin-code,
.service-code,
.role-code,
.permission-code,
.operation-code-badge,
.operation-currency-badge,
.financial-account-number,
.financial-currency-chip,
.financial-row-balance,
.exchange-rate-code,
.status,
.scope,
.soft-badge,
.availability-badge,
.money,
.amount,
.currency,
[data-label*="كود"],
[data-label*="رقم"],
[data-label*="تاريخ"],
[data-label*="عملة"],
[data-label*="مبلغ"] {
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: normal;
}

body.authenticated-page:not(:has(.hotel-board-page)),
body.operational-wizard-page {
    font-size: 15px;
    line-height: 1.58;
}

body.authenticated-page:not(:has(.hotel-board-page)) :is(input, select, textarea, button),
body.operational-wizard-page :is(input, select, textarea, button) {
    font-size: max(14px, 1em);
}

body.authenticated-page:not(:has(.hotel-board-page)) :is(th, td),
body.operational-wizard-page :is(th, td) {
    font-size: max(13px, .92em);
}

/* Shared application shell */
.content-shell,
.page-main,
.operational-module-content,
.operational-module-main,
.service-selector-shell,
.auth-shell,
.login-v3-shell,
.setup-shell {
    min-width: 0;
}

.page-main {
    width: min(var(--container, 1440px), calc(100% - 48px));
}

.sidebar {
    overscroll-behavior: contain;
}

.sidebar-nav,
.sidebar-nav section,
.sidebar-foot {
    min-width: 0;
}

.nav-link {
    min-width: 0;
}

.nav-link span,
.nav-link strong,
.nav-link small,
.sidebar-user strong,
.sidebar-user small {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mobile-topbar {
    width: 100%;
}

.mobile-logo,
.mobile-logo img {
    min-width: 0;
}

.flash.flash--polished {
    max-width: min(520px, calc(100vw - 24px));
}

/* Generic page sections */
.page-heading,
.admin-dashboard-hero,
.management-hero,
.catalog-hero,
.hotels-hero,
.financial-hero,
.general-hero,
.operation-detail-hero,
.ops-report-hero,
.hotel-section-title,
.financial-card h2,
.report-filter-toolbar,
.heading-actions,
.hotel-actions-bar,
.financial-actions,
.management-hero__actions,
.catalog-hero__actions,
.general-hero__actions,
.operation-detail-hero__actions,
.ops-export-actions,
.general-export-actions,
.form-actions,
.filter-actions,
.hotel-form-actions,
.general-form-actions,
.operation-success-actions {
    min-width: 0;
    flex-wrap: wrap;
}

.page-heading h1,
.admin-dashboard-hero h1,
.management-hero h1,
.catalog-hero h1,
.hotels-hero h1,
.financial-hero h1,
.general-hero h1,
.operation-detail-hero h1,
.ops-report-hero h1,
.hotel-section-title h2,
.financial-card h2 {
    overflow-wrap: break-word;
    word-break: normal;
    text-wrap: balance;
}

.page-heading p,
.admin-dashboard-hero p,
.management-hero p,
.catalog-hero p,
.hotels-hero p,
.financial-hero p,
.general-hero p,
.operation-detail-hero p,
.ops-report-hero p,
.hotel-muted {
    overflow-wrap: break-word;
    word-break: normal;
}

.data-card,
.form-card,
.profile-card,
.access-card,
.admin-quick-card,
.admin-overview-card,
.management-table-card,
.management-filter-card,
.catalog-card,
.general-wizard-panel,
.general-details-card,
.general-review-card,
.general-confirm-card,
.general-success-card,
.general-next-card,
.operation-panel,
.operation-success-card,
.ops-main-card--mockup,
.ops-summary-panel--mockup,
.hotels-page,
.hotel-card,
.financial-card {
    min-width: 0;
}

/* Forms and controls */
.form-grid,
.profile-grid,
.two-column,
.info-list,
.assignment-editor-row,
.hotel-form-grid,
.hotel-form-grid--compact,
.hotel-detail-grid,
.hotel-kpis,
.hotel-filter,
.financial-filter,
.financial-inline-form,
.financial-form,
.financial-kpis,
.financial-balance-grid,
.general-filter-grid,
.general-details-grid,
.general-review-grid,
.general-success-grid,
.ops-filter-grid,
.operation-info-grid,
.operation-success-info-grid,
.ops-fields--mockup,
.ops-details-grid,
.ops-services-workbench,
.management-summary-grid,
.summary-grid,
.admin-quick-grid,
.admin-overview-grid {
    min-width: 0;
}

label,
.field,
.input-wrap,
.hotel-form label,
.financial-form label,
.general-field,
.ops-field {
    min-width: 0;
}

.primary-button,
.secondary-button,
.ghost-button,
.danger-button,
.choice-button,
.hotel-btn,
.financial-btn,
.report-filter-export,
.report-filter-toggle,
button[type="submit"] {
    min-width: 0;
    white-space: nowrap;
    text-align: center;
}

/* Tables: scroll on medium screens, card-style where data-label exists on small screens. */
.table-wrap,
.users-table-wrap,
.management-table-wrap,
.general-table-wrap,
.general-items-table-wrap,
.operation-services-table-wrap,
.financial-card,
.hotel-card:has(.hotel-table),
.hotel-card:has(.hotel-rate-line) {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-inline: contain;
    scrollbar-width: thin;
}

.users-table,
.management-table,
.general-table,
.operation-services-table,
.financial-table,
.hotel-table {
    width: 100%;
}

/* Hotels */
.hotel-rate-line,
.hotel-mini-form,
.hotel-formula-line,
.hotel-formula-meta,
.hotel-preview-grid,
.hotel-default-warning,
.hotel-definition-list div {
    min-width: 0;
}

.hotel-rate-line input,
.hotel-rate-line select,
.hotel-mini-form input,
.hotel-mini-form select,
.hotel-formula-line input,
.hotel-formula-line select,
.hotel-formula-builder textarea {
    min-width: 0;
}

.hotel-preview-grid article,
.hotel-formula-meta span,
.hotel-formula-history article,
.financial-kpis article,
.financial-balance-grid article {
    min-width: 0;
    overflow-wrap: break-word;
    word-break: normal;
}

.hotel-radio-pair,
.hotel-radio-pair label {
    min-width: 0;
}

/* Financial pages */
.financial-actions form,
.financial-row-editor form {
    min-width: 0;
    flex-wrap: wrap;
}

.financial-actions input {
    width: min(140px, 100%);
}

/* Service selector and auth screens */
body.service-selector-page,
body.login-v3-page,
body.setup-page {
    max-width: 100%;
}

body.service-selector-page .service-selector-shell,
.login-v3-shell,
.setup-shell {
    overflow-x: clip;
}

body.service-selector-page .service-choice-grid,
body.service-selector-page .service-choice,
body.service-selector-page .selector-footer,
.login-v3-card,
.setup-card,
.setup-form {
    min-width: 0;
}

/* Report/filter drawers */
.filter-drawer-panel,
.expense-draft-dialog__panel,
.general-service-modal,
.general-account-modal,
.cancel-operation-modal,
.admin-modal-panel,
.general-catalog-modal__panel,
.service-details-dialog,
.profile-modal-panel,
.financial-modal__panel {
    max-width: calc(100vw - 24px) !important;
}

@media (max-width: 860px) {
    .filter-drawer-panel,
    .expense-draft-dialog__panel,
    .general-service-modal,
    .general-account-modal,
    .cancel-operation-modal,
    .admin-modal-panel,
    .general-catalog-modal__panel,
    .service-details-dialog,
    .profile-modal-panel,
    .financial-modal__panel {
        width: min(100%, calc(100vw - 24px)) !important;
        max-height: calc(100dvh - 24px);
        overflow-y: auto;
    }
}

@media (max-width: 1180px) {
    .page-main {
        width: min(var(--container, 1440px), calc(100% - 36px)) !important;
    }

    .hotel-filter,
    .hotel-form-grid--compact,
    .financial-filter,
    .financial-inline-form,
    .ops-filter-grid,
    .general-filter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .hotel-detail-grid,
    .profile-grid,
    .two-column,
    .general-review-grid,
    .general-details-grid,
    .operation-info-grid,
    .operation-success-info-grid,
    .ops-layout--mockup {
        grid-template-columns: 1fr !important;
    }

    .hotel-preview-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }

    .hotel-rate-line,
    .hotel-formula-line {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }

    .hotel-rate-line .wide,
    .hotel-formula-line .wide {
        grid-column: 1 / -1 !important;
    }
}

@media (max-width: 900px) {
    .page-heading,
    .admin-dashboard-hero,
    .management-hero,
    .catalog-hero,
    .hotels-hero,
    .financial-hero,
    .general-hero,
    .operation-detail-hero,
    .ops-report-hero {
        align-items: stretch !important;
        flex-direction: column !important;
        gap: 12px !important;
    }

    .heading-actions,
    .management-hero__actions,
    .catalog-hero__actions,
    .hotel-actions-bar,
    .financial-actions,
    .general-hero__actions,
    .operation-detail-hero__actions,
    .ops-export-actions,
    .general-export-actions,
    .form-actions,
    .filter-actions,
    .hotel-form-actions,
    .general-form-actions,
    .operation-success-actions {
        width: 100%;
    }

    .heading-actions > *,
    .management-hero__actions > *,
    .catalog-hero__actions > *,
    .hotel-actions-bar > *,
    .financial-actions > *,
    .general-hero__actions > *,
    .operation-detail-hero__actions > *,
    .ops-export-actions > *,
    .general-export-actions > *,
    .form-actions > *,
    .filter-actions > *,
    .hotel-form-actions > *,
    .general-form-actions > *,
    .operation-success-actions > * {
        flex: 1 1 170px;
        justify-content: center;
    }

    .admin-quick-grid,
    .admin-overview-grid,
    .hotel-kpis,
    .financial-kpis,
    .summary-grid,
    .management-summary-grid,
    .financial-balance-grid,
    .hotel-formula-meta {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    body.service-selector-page {
        height: auto !important;
        min-height: 100dvh !important;
        overflow-y: auto !important;
    }

    body.service-selector-page .service-selector-shell {
        height: auto !important;
        min-height: 100dvh !important;
        overflow: visible !important;
    }

    body.service-selector-page .service-choice-grid {
        width: min(100%, 560px) !important;
        min-width: 0 !important;
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }

    body.service-selector-page .service-choice {
        width: 100% !important;
        height: auto !important;
        min-height: 260px !important;
    }

    body.service-selector-page .selector-footer {
        width: min(100%, 640px) !important;
    }
}

@media (max-width: 760px) {
    .page-main {
        width: calc(100% - 22px) !important;
        margin: 14px auto 34px !important;
    }

    .mobile-topbar {
        min-height: 60px !important;
        padding-inline: 12px !important;
    }

    .sidebar {
        width: min(312px, 92vw) !important;
    }

    .data-card,
    .form-card,
    .profile-card,
    .access-card,
    .admin-quick-card,
    .admin-overview-card,
    .management-table-card,
    .management-filter-card,
    .catalog-card,
    .general-wizard-panel,
    .general-details-card,
    .general-review-card,
    .general-confirm-card,
    .general-success-card,
    .general-next-card,
    .operation-panel,
    .operation-success-card,
    .hotel-card,
    .financial-card,
    .ops-main-card--mockup,
    .ops-summary-panel--mockup {
        border-radius: 12px !important;
        padding: var(--responsive-card-pad) !important;
    }

    .page-heading h1,
    .admin-dashboard-hero h1,
    .management-hero h1,
    .catalog-hero h1,
    .hotels-hero h1,
    .financial-hero h1,
    .general-hero h1,
    .operation-detail-hero h1,
    .ops-report-hero h1 {
        font-size: clamp(23px, 7vw, 30px) !important;
        line-height: 1.25 !important;
    }

    .hotel-filter,
    .hotel-form-grid,
    .hotel-form-grid--compact,
    .hotel-mini-form,
    .hotel-preview-grid,
    .hotel-rate-line,
    .hotel-formula-line,
    .hotel-formula-meta,
    .financial-filter,
    .financial-inline-form,
    .financial-form,
    .form-grid,
    .info-list,
    .assignment-editor-row,
    .general-filter-grid,
    .general-details-grid,
    .general-review-grid,
    .general-success-grid,
    .ops-filter-grid,
    .ops-fields--mockup,
    .ops-details-grid,
    .ops-services-workbench {
        grid-template-columns: 1fr !important;
    }

    .hotel-rate-line .wide,
    .hotel-formula-line .wide,
    .financial-form .wide,
    .field--wide {
        grid-column: auto !important;
    }

    .admin-quick-grid,
    .admin-overview-grid,
    .hotel-kpis,
    .financial-kpis,
    .summary-grid,
    .management-summary-grid,
    .financial-balance-grid {
        grid-template-columns: 1fr !important;
    }

    .heading-actions > :is(.primary-button, .secondary-button, .ghost-button, .danger-button, .choice-button),
    .form-actions > :is(.primary-button, .secondary-button, .ghost-button, .danger-button, .choice-button),
    .filter-actions > :is(.primary-button, .secondary-button, .ghost-button, .danger-button, .choice-button),
    .hotel-form-actions > .hotel-btn,
    .financial-hero-actions > .financial-btn,
    .financial-account-form-actions > .financial-btn,
    .general-form-actions > :is(.primary-button, .secondary-button, .ghost-button, .danger-button, .choice-button),
    .operation-success-actions > :is(.primary-button, .secondary-button, .ghost-button, .danger-button, .choice-button),
    .report-filter-export,
    .report-filter-toggle {
        width: 100%;
        min-height: var(--responsive-control-height);
    }

    .hotel-definition-list div,
    .financial-actions,
    .financial-actions form,
    .assignment-row,
    .profile-head,
    .empty-state,
    .hotel-formula-history article {
        align-items: stretch !important;
        flex-direction: column !important;
    }

    .hotel-definition-list dt,
    .hotel-definition-list dd {
        width: 100%;
    }

    .hotel-table,
    .users-table,
    .management-table,
    .general-table,
    .operation-services-table,
    .financial-table {
        min-width: 640px;
    }

    .hotel-card:has(.hotel-table),
    .financial-card:has(.financial-table),
    .management-table-wrap,
    .general-table-wrap,
    .operation-services-table-wrap,
    .users-table-wrap {
        padding-bottom: 8px;
    }

    .login-v3-page,
    .auth-shell {
        overflow-y: auto !important;
    }

    .login-v3-panel {
        min-height: 100dvh !important;
        padding: 18px 12px 28px !important;
    }

    .login-v3-card,
    .setup-card {
        width: 100% !important;
        max-height: none !important;
        padding: 20px 16px !important;
        border-radius: 16px !important;
    }

    .setup-shell {
        min-height: 100dvh !important;
        padding: 18px 12px !important;
    }

    .setup-brand {
        position: static !important;
        margin-bottom: 12px !important;
    }

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

@media (max-width: 560px) {
    .page-main {
        width: calc(100% - 16px) !important;
        margin-top: 10px !important;
    }

    .mobile-logo img {
        max-width: 142px !important;
        height: auto !important;
        max-height: 38px !important;
    }

    input,
    select,
    textarea {
        font-size: 16px !important;
    }

    .flash.flash--polished {
        top: calc(66px + env(safe-area-inset-top) + (var(--toast-index, 0) * 92px)) !important;
        right: 8px !important;
        left: 8px !important;
        width: auto !important;
    }

    .report-filter-toolbar,
    .report-filter-exports,
    .hotel-actions,
    .financial-actions,
    .general-row-actions,
    .actions-menu,
    .pagination,
    .pagination div {
        width: 100%;
        align-items: stretch !important;
        justify-content: stretch !important;
    }

    .report-filter-toolbar > *,
    .report-filter-exports > *,
    .hotel-actions > *,
    .financial-actions > *,
    .general-row-actions > *,
    .actions-menu > *,
    .pagination a,
    .pagination button {
        flex: 1 1 auto;
    }

    .hotel-radio-pair {
        grid-template-columns: 1fr !important;
    }

    body.service-selector-page .service-selector-shell {
        padding: 12px !important;
    }

    body.service-selector-page .selector-header {
        flex-direction: column !important;
        align-items: stretch !important;
        min-height: 0 !important;
    }

    body.service-selector-page .selector-header-tools {
        width: 100%;
        justify-content: space-between;
    }

    body.service-selector-page .selector-copy h1 {
        font-size: clamp(30px, 10vw, 40px) !important;
    }

    body.service-selector-page .service-choice {
        min-height: 230px !important;
        padding: 18px 14px !important;
    }

    body.service-selector-page .service-choice .choice-button {
        padding-inline: 14px !important;
    }

    .expense-draft-dialog,
    .filter-drawer-overlay {
        padding: 8px !important;
    }

    .filter-drawer-panel.general-filter-card,
    .filter-drawer-panel.management-filter-card {
        width: calc(100vw - 14px) !important;
        max-width: calc(100vw - 14px) !important;
        max-height: calc(100dvh - 14px) !important;
        padding: 14px !important;
        overflow-y: auto !important;
    }
}

@media (max-width: 420px) {
    .page-main {
        width: calc(100% - 12px) !important;
    }

    .mobile-topbar {
        min-height: 56px !important;
        padding-inline: 8px !important;
    }

    .sidebar {
        width: min(292px, 94vw) !important;
        padding: 10px !important;
    }

    .sidebar-brand img {
        width: 116px;
        height: auto;
        max-width: 100%;
    }

    .sidebar-ship {
        width: 100%;
        height: auto;
        margin-top: 12px;
        margin-bottom: 10px;
        overflow: visible;
    }

    .sidebar-ship img {
        width: 166px;
        margin: 0;
        transform: none;
    }

    .hotel-table,
    .users-table,
    .management-table,
    .general-table,
    .operation-services-table,
    .financial-table {
        min-width: 560px;
    }

    .login-v3-panel {
        padding-inline: 8px !important;
    }

    .login-v3-card .form-meta {
        align-items: flex-start !important;
        flex-direction: column !important;
        gap: 8px !important;
    }
}

/* Final scroll guarantee: every application page must be able to scroll. */
html {
    min-height: 100%;
    height: auto !important;
    overflow-y: auto !important;
}

body:not(.has-expense-draft-dialog):not(.filter-drawer-open),
body.authenticated-page:not(.has-expense-draft-dialog):not(.filter-drawer-open),
body.operational-wizard-page:not(.has-expense-draft-dialog):not(.filter-drawer-open),
body.service-selector-page:not(.has-expense-draft-dialog):not(.filter-drawer-open),
body.auth-page:not(.has-expense-draft-dialog):not(.filter-drawer-open),
body.login-v3-page:not(.has-expense-draft-dialog):not(.filter-drawer-open),
body.setup-page:not(.has-expense-draft-dialog):not(.filter-drawer-open) {
    min-height: 100dvh !important;
    height: auto !important;
    max-height: none !important;
    overflow-y: auto !important;
}

.app-layout,
.operational-module-layout,
.content-shell,
.operational-module-content,
.page-main,
.operational-module-main,
.service-selector-shell,
.auth-shell,
.login-v3-shell,
.setup-shell {
    height: auto !important;
    max-height: none !important;
    overflow-y: visible !important;
}

.app-layout,
.operational-module-layout {
    min-height: 100dvh !important;
    overflow: visible !important;
}

/* Login v3 owns the viewport; keep the page itself from adding stray height. */
body.login-v3-page:not(.has-expense-draft-dialog):not(.filter-drawer-open) {
    min-height: 100dvh !important;
    height: 100dvh !important;
    overflow: hidden !important;
}

body.login-v3-page:not(.has-expense-draft-dialog):not(.filter-drawer-open) .login-v3-shell {
    min-height: 100dvh !important;
    height: 100dvh !important;
    overflow: hidden !important;
}

@media (max-width: 900px) {
    body.login-v3-page:not(.has-expense-draft-dialog):not(.filter-drawer-open) {
        height: auto !important;
        overflow-y: auto !important;
    }

    body.login-v3-page:not(.has-expense-draft-dialog):not(.filter-drawer-open) .login-v3-shell {
        height: auto !important;
        overflow: visible !important;
    }
}

.content-shell,
.operational-module-content {
    min-height: 100dvh !important;
}

/* 2026 reliability and validation finishing layer */
:where(input, select, textarea, button, a):focus-visible {
    outline: 3px solid rgba(46, 74, 190, .28);
    outline-offset: 2px;
}

:where(input, select, textarea)[aria-invalid="true"],
:where(input, select, textarea):user-invalid {
    border-color: #c93245 !important;
    background-color: #fff8f8 !important;
    box-shadow: 0 0 0 4px rgba(201, 50, 69, .10) !important;
}

.has-validation-error > span:first-child,
.has-validation-error .field-label {
    color: #a92536 !important;
}

.sphinx-runtime-notice {
    position: fixed;
    z-index: 10050;
    inset-block-start: max(16px, env(safe-area-inset-top));
    inset-inline-start: 50%;
    display: grid;
    grid-template-columns: 12px minmax(0, 1fr) 32px;
    align-items: center;
    gap: 10px;
    width: min(520px, calc(100vw - 24px));
    min-height: 56px;
    padding: 10px 12px;
    border: 1px solid #efbac2;
    border-radius: 12px;
    background: #fff;
    color: #7f1f2e;
    box-shadow: 0 18px 45px rgba(19, 31, 70, .20);
    transform: translateX(-50%);
}

.sphinx-runtime-notice > span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #d33c50;
}

.sphinx-runtime-notice p { margin: 0; font-weight: 850; line-height: 1.55; }
.sphinx-runtime-notice button {
    display: grid;
    place-items: center;
    width: 32px;
    min-height: 32px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: inherit;
    font-size: 22px;
    cursor: pointer;
}
.sphinx-runtime-notice--success { border-color: #b7e1c7; color: #17653b; }
.sphinx-runtime-notice--success > span { background: #27975a; }

.form-alert,
.hotel-form-validation-summary {
    border: 1px solid #efbac2;
    border-radius: 11px;
    background: #fff5f6;
    color: #92283a;
    padding: 11px 13px;
    font-weight: 850;
    line-height: 1.6;
}
.hotel-form-validation-summary[hidden] { display: none !important; }
.hotel-form-validation-summary strong { display: block; margin-bottom: 5px; }
.hotel-form-validation-summary ul { margin: 0; padding-inline-start: 20px; }

@media (max-width: 720px) {
    .sphinx-runtime-notice {
        inset-inline-start: 12px;
        inset-inline-end: 12px;
        width: auto;
        transform: none;
    }
}

/* Sidebar drawer behavior. Keep this late so it only fixes responsive state. */
@media (max-width: 860px) {
    body.sidebar-open {
        overflow: hidden !important;
        touch-action: none;
    }

    body.authenticated-page .app-layout,
    body.operational-wizard-page .operational-module-layout {
        display: block !important;
        min-height: 100dvh !important;
    }

    body.authenticated-page .mobile-topbar,
    body.operational-wizard-page .mobile-topbar {
        display: flex !important;
    }

    body.authenticated-page .sidebar,
    body.operational-wizard-page .operational-module-layout > .sidebar {
        position: fixed !important;
        inset-block-start: 0 !important;
        inset-block-end: 0 !important;
        inset-inline-start: auto !important;
        inset-inline-end: auto !important;
        left: auto !important;
        right: 0 !important;
        width: min(320px, 88vw) !important;
        height: 100dvh !important;
        max-height: 100dvh !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
        transform: translateX(105%) !important;
        transition: transform 220ms ease !important;
        z-index: 10040 !important;
        will-change: transform;
    }

    body.authenticated-page .app-layout.sidebar-open .sidebar,
    body.operational-wizard-page .operational-module-layout.sidebar-open > .sidebar {
        transform: translateX(0) !important;
    }

    body.authenticated-page .sidebar-close,
    body.operational-wizard-page .sidebar-close {
        display: grid !important;
    }

    body.authenticated-page .drawer-overlay,
    body.operational-wizard-page .drawer-overlay {
        position: fixed !important;
        inset: 0 !important;
        display: block !important;
        visibility: hidden;
        opacity: 0;
        pointer-events: none;
        background: rgba(7, 22, 60, .48);
        backdrop-filter: blur(2px);
        -webkit-backdrop-filter: blur(2px);
        transition: opacity 220ms ease, visibility 220ms ease !important;
        z-index: 10030 !important;
    }

    body.authenticated-page .app-layout.sidebar-open .drawer-overlay,
    body.operational-wizard-page .operational-module-layout.sidebar-open .drawer-overlay {
        visibility: visible;
        opacity: 1;
        pointer-events: auto;
    }

    body.authenticated-page .sidebar-nav,
    body.operational-wizard-page .sidebar-nav {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
    }
}

@media (max-width: 760px) {
    body.authenticated-page .sidebar,
    body.operational-wizard-page .operational-module-layout > .sidebar {
        width: min(312px, 92vw) !important;
    }
}

@media (max-width: 420px) {
    body.authenticated-page .sidebar,
    body.operational-wizard-page .operational-module-layout > .sidebar {
        width: 100vw !important;
        max-width: 100vw !important;
    }
}

@media (min-width: 861px) {
    body.authenticated-page .drawer-overlay,
    body.operational-wizard-page .drawer-overlay {
        display: none !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    body.authenticated-page .sidebar,
    body.operational-wizard-page .operational-module-layout > .sidebar,
    body.authenticated-page .drawer-overlay,
    body.operational-wizard-page .drawer-overlay {
        transition: none !important;
    }
}
