:root {
    --soft-blue: #e9f1fb;
    --danger-soft: #fef3f2;
    --success-soft: #ecfdf3;
    --warning-soft: #fff8db;
    --app-main-padding: clamp(18px, 3vw, 36px);
    --survai-white-header-width: 100%;
    --survai-white-header-min-height: 44px;
    --survai-white-header-gap: 10px;
    --survai-white-header-padding: 10px 0 4px;
    --survai-white-header-radius: 0;
    --survai-white-header-border: 0;
    --survai-white-header-background: transparent;
    --survai-white-header-color: var(--survai-text);
    --survai-white-header-shadow: none;
    --survai-white-header-title-size: 1.18rem;
    --survai-white-header-title-weight: 800;
    --survai-white-header-title-line-height: 1.25;
    /* Identity row + the single stage-nav row. The old subnav row is gone
       (children are hover dropdowns now), so this dropped ~46px of chrome. */
    --survai-report-workspace-header-offset: calc(var(--survai-white-header-min-height) + 50px);
    /* Minimum space between fixed workspace toolbar bottom and first content card. */
    --survai-toolbar-content-gap: 40px;
    /* Grouped stage subnav row below the embedded mobile report header (icons + padding). */
    --survai-report-workspace-mobile-subnav-offset: 64px;
    /* Extra space below the fixed workspace toolbar before the first content card/panel. */
    --survai-workspace-mobile-first-card-offset: 50px;
    --survai-report-workspace-context-padding-block: 0;
}

@media (max-width: 900px) {
    :root {
        --app-main-padding: clamp(16px, 3.5vw, 26px);
    }
}

/* ==========================================================
   Survai Premium SaaS V2: explicit high-visibility app shell
   Targets the real dashboard/workspace class names used by live pages.
   ========================================================== */

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar,
body.dashboard-body .sidebar,
body.ops-dashboard-page .sidebar,
body.survey-workflow-surface .sidebar,
body.progress-page .sidebar {
    box-shadow: 28px 0 70px rgba(11, 19, 33, 0.2) !important;
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar-brand,
body.dashboard-body .sidebar-brand,
body.ops-dashboard-page .sidebar-brand,
body.survey-workflow-surface .sidebar-brand,
body.progress-page .sidebar-brand {
    margin-bottom: 10px;
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar-nav a,
body.dashboard-body .sidebar-nav a,
body.ops-dashboard-page .sidebar-nav a,
body.survey-workflow-surface .sidebar-nav a,
body.progress-page .sidebar-nav a {
    border-radius: 18px !important;
}

.ops-hero,
.page-header,
.progress-hero,
.report-overview-hero {
    padding: clamp(10px, 1.2vw, 18px) 0 !important;
}

.toolbar {
    padding: clamp(14px, 1.6vw, 22px) !important;
}

.ops-donut-block,
.ops-action-row,
.ops-diary-row,
.ops-activity-row,
.ops-team-table,
.client-profile-card {
    border: 1px solid var(--survai-border) !important;
    border-radius: 18px !important;
    background: var(--survai-card) !important;
    box-shadow: 0 18px 50px rgba(11, 19, 33, 0.075) !important;
}

.ops-kpi-card {
    min-height: 132px !important;
    padding: 24px !important;
}

.ops-kpi-card__value {
    color: var(--survai-navy-ink) !important;
    font-size: clamp(2rem, 2.7vw, 3.25rem) !important;
    letter-spacing: -0.055em !important;
}

.ops-kpi-card__label,
.ops-card h2,
.card h2,
.page-header h1 {
    color: var(--survai-text) !important;
}

.ops-card-link,
.table-card a,
.card a:not(.btn):not(:where(.output-icon-action, .output-action-bar__button)) {
    color: var(--survai-ink-1b5af9);
}

button,
input,
select,
textarea {
    font-family: inherit;
}

/* ==========================================================
   Survai Official Colour System
   Reference: premium SaaS navy navigation, white workspace,
   blue primary actions, restrained green success only.
   Keep last in the stylesheet so it normalises older page CSS.
   ========================================================== */

:root {
    /* One sidebar in every mode (surveyor, 3 Oct 2026: "the toolbars to the left of the
       screen need to always be the same size, but just different content within each
       mode"): the reports list, the dashboards, the Settings hub and the report workspace
       all use the same 232px rail of icon-and-label rows; only the entries differ.
       --survai-workspace-sidebar-width stays as an alias for the rules written against it. */
    --survai-app-rail-width: 232px;
    --survai-workspace-sidebar-width: var(--survai-app-rail-width);
    /* No collapsed rail: the sidebar is always this width (see initDesktopSidebarCollapse in
       assets/js/app.js, which clears a collapsed state stored by an older build). */
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body),
body.dashboard-body,
body.ops-dashboard-page,
body.survey-workflow-surface,
body.progress-page {
    background: var(--survai-bg) !important;
    color: var(--survai-text) !important;
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body):not(.output-report-page) .main-panel,
body.dashboard-body .main-panel,
body.ops-dashboard-page .main-panel,
body.survey-workflow-surface .main-panel,
body.progress-page .main-panel {
    background:
        radial-gradient(circle at 92% 0%, rgba(27, 90, 249, 0.045), transparent 28%),
        linear-gradient(180deg, var(--survai-card) 0%, var(--survai-bg) 44%, var(--survai-bg-hover) 100%) !important;
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar,
body.dashboard-body .sidebar,
body.ops-dashboard-page .sidebar,
body.survey-workflow-surface .sidebar,
body.progress-page .sidebar {
    /* Flat navy rail only — radial blue halo was washing through icon tiles beside the logo */
    background: linear-gradient(180deg, var(--survai-navy) 0%, var(--survai-navy-deep) 100%) !important;
    color: #ffffff !important;
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar-nav a,
body.dashboard-body .sidebar-nav a,
body.ops-dashboard-page .sidebar-nav a,
body.survey-workflow-surface .sidebar-nav a,
body.progress-page .sidebar-nav a {
    color: rgba(255, 255, 255, 0.78) !important;
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar-nav a.active,
body.dashboard-body .sidebar-nav a.active,
body.ops-dashboard-page .sidebar-nav a.active,
body.survey-workflow-surface .sidebar-nav a.active,
body.progress-page .sidebar-nav a.active {
    color: #ffffff !important;
    border-color: transparent !important;
    background: transparent !important;
    box-shadow: none !important;
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar-nav a.active::before,
body.dashboard-body .sidebar-nav a.active::before,
body.ops-dashboard-page .sidebar-nav a.active::before,
body.survey-workflow-surface .sidebar-nav a.active::before,
body.progress-page .sidebar-nav a.active::before {
    display: none !important;
}

.eyebrow,
label span,
.po-hero-grid dt,
.po-doc-cat-stats {
    color: var(--survai-muted) !important;
}

.ops-line-icon,
.po-inline-icon,
.po-act-icon,
.sidebar-nav-icon,
.workspace-tool-button__icon {
    color: currentColor;
}

.ops-kpi-card .ops-line-icon,
.transcript-document-icon {
    color: var(--survai-blue) !important;
    background: rgba(27, 90, 249, 0.10) !important;
}

.status-completed,
.status-complete,
.status-success,
.ops-trend--positive,
.condition-rating-badge.rating-cr1 {
    color: var(--survai-ink-15803d) !important;
    background: rgba(34, 197, 94, 0.12) !important;
}

.status-processing,
.status-assigned,
.status-draft,
.ops-trend--neutral,
.condition-rating-badge.rating-ni,
.condition-rating-badge.rating-na {
    color: var(--survai-secondary) !important;
    background: rgba(152, 162, 179, 0.14) !important;
}

.status-warning,
.ops-trend--warning,
.condition-rating-badge.rating-cr2 {
    color: var(--survai-ink-b45309) !important;
    background: rgba(245, 158, 11, 0.14) !important;
}

.status-failed,
.status-danger,
.condition-rating-badge.rating-cr3 {
    color: var(--survai-ink-b91c1c) !important;
    background: rgba(239, 68, 68, 0.12) !important;
}

table thead,
.wizard-documents-table th {
    background: var(--survai-bg) !important;
}

table tr:hover td,
.wizard-documents-table tbody tr:hover {
    background: rgba(27, 90, 249, 0.035) !important;
}

.ops-donut {
    --ops-donut-accent: var(--survai-blue);
}

@media (max-width: 560px) {
    :root {
        --app-main-padding: clamp(14px, 4vw, 22px);
    }
}

html[data-theme="dark"] {
    --navy: #f5f5f3;
    --navy-2: #dcdcd8;
    --ink: #ffffff;
    --muted: #bdbdbd;
    --line: rgba(255, 255, 255, 0.14);
    --panel: rgba(23, 23, 23, 0.82);
    --surface: #0a0a0a;
    --soft-blue: #2f2f2f;
    --accent: #f2f2f0;
    --accent-dark: #f5f5f3;
    --danger: #ff9d93;
    --danger-soft: #2c1513;
    --success: #86d6a6;
    --success-soft: #13261b;
    --warning: #f0c56e;
    --warning-soft: #2a2111;
    --shadow: 0 22px 70px rgba(0, 0, 0, 0.28);
    --theme-bg: #0a0a0a;
    --theme-bg-strong: #0a0a0a;
    --theme-panel: rgba(23, 23, 23, 0.84);
    --theme-panel-soft: rgba(255, 255, 255, 0.06);
    --theme-text: #ffffff;
    --theme-muted: #bdbdbd;
    --theme-border: rgba(255, 255, 255, 0.14);
    --theme-accent: #f2f2f0;
    --theme-accent-ink: #151515;
    --theme-sidebar: #1c1c1c;
    --theme-sidebar-panel: #1c1c1c;
    --theme-input: rgba(10, 10, 10, 0.58);
    --theme-input-text: #ffffff;
}

/* Final Survai Camera zoom rail placement. This must stay at the end of the stylesheet. */

/* Final Survai Camera landscape mode selector placement: keep the portrait-style selector position. */

/* Absolute final correction: landscape keeps the portrait selector shape, sideways on the right edge. */

/* Site-wide responsive containment guardrails. Keep long user/report content inside its card. */
html,
body {
    max-width: 100%;
    overflow-x: clip;
}

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

.app-shell,
.main-panel,
.card,
.workflow-page-card,
.section-card,
.output-section,
.output-summary-card,
.output-preview-card,
.workflow-builder-layout,
.report-form,
.table-card,
.section-head,
.page-header,
.header-actions,
.section-actions,
.section-head-actions,
.diagnostic-grid,
.condition-rating-summary-grid,
.matched-photo-grid,
.output-photo-grid,
.room-table-wrap,
.table-wrap {
    min-width: 0;
    max-width: 100%;
}

.main-panel,
.card,
.workflow-page-card,
.section-card,
.output-section,
.output-summary-card,
.output-preview-card,
.diagnostic-stat,
.condition-rating-summary-card,
.rating-sections-list a,
.section-body,
.form-note,
.page-header,
.section-head,
.workflow-page-header,
.report-heading,
.report-renderer {
    overflow-wrap: anywhere;
    word-break: normal;
}

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

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

.section-head > div,
.page-header > div,
.report-heading > div,
.diagnostic-stat span,
.diagnostic-stat strong,
.condition-rating-summary-card span,
.condition-rating-summary-card strong {
    min-width: 0;
}

.section-head-actions,
.header-actions,
.section-actions,
.form-actions,
.processing-actions,
.media-actions,
.photo-panel-actions,
.voice-button-row,
.voice-sync-actions,
.voice-note-actions {
    flex-wrap: wrap;
}

.table-wrap,
.room-table-wrap,
.wizard-documents-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 720px) {
    .main-panel {
        width: 100%;
        padding-right: max(12px, env(safe-area-inset-right));
        padding-left: max(12px, env(safe-area-inset-left));
    }

    .workflow-page-card,
    .output-summary-card,
    .output-preview-card {
        border-radius: 14px;
    }

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

    .condition-rating-summary-card {
        min-height: 220px;
    }

    .section-head,
    .page-header,
    .report-heading {
        align-items: stretch;
    }

    .section-head-actions,
    .header-actions,
    .section-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 420px) {
    .workflow-page-card,
    .output-summary-card,
    .output-preview-card,
    .section-card,
    .report-form,
    .card {
        padding-right: 14px;
        padding-left: 14px;
    }

    .diagnostic-stat {
        padding: 10px;
    }

    .condition-rating-badge {
        width: 42px;
        height: 42px;
        font-size: 0.78rem;
    }

}

/* Global Survai light/dark theme layer. Kept last so legacy hard-coded colours inherit the selected mode. */
html,
body,
.app-shell,
.main-panel {
    transition: background-color 180ms ease, color 180ms ease, border-color 180ms ease;
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body),
.app-shell,
.main-panel {
    background: var(--theme-bg);
    color: var(--theme-text);
}

html[data-theme="dark"] body:not(.login-body):not(.survaicam-page):not(.capture-mode-body) {
    background: var(--survai-page-bg);
}

html[data-theme="light"] body:not(.login-body):not(.survaicam-page):not(.capture-mode-body) {
    background: #fafcfe;
}

.workflow-page-card,
.processing-card,
.report-overview-card,
.client-profile-card,
.document-category-card,
.media-uploader-card,
.pdf-settings-card,
.transcript-workspace-card,
.voice-note-item,
.media-file-item,
.queue-item,
.diagnostic-stat,
.supporting-image-panel,
.supporting-document-item {
    border-color: var(--theme-border) !important;
    background: var(--theme-panel) !important;
    color: var(--theme-text) !important;
    box-shadow: var(--shadow);
}

.card,
.report-form {
    color: var(--theme-text) !important;
}

.sidebar {
    background: var(--theme-sidebar) !important;
}

.sidebar-nav a,
.sidebar .user-pill strong {
    color: rgba(255, 255, 255, 0.88);
}

h1,
h2,
h3,
.section-head h2,
.page-header h1,
.workflow-page-header h1,
.voice-note-main strong,
.diagnostic-stat strong,
.transcript-card-head h2,
.transcript-section-title-row h2,
.transcript-workspace-header h1,
.transcript-recording-main strong,
.transcript-recording-summary span,
.transcript-recording-status,
.transcript-document-copy strong {
    color: var(--theme-text) !important;
}

p,
.form-note,
.workflow-page-guidance,
.section-head p,
.voice-note-main span,
.voice-note-main em,
.transcript-card-head p,
.transcript-section-title-row p,
.transcript-recording-main p,
.transcript-document-copy em,
.transcript-workspace-header p,
.transcript-mic-state,
.transcript-workspace-message {
    color: var(--theme-muted) !important;
}

input,
select,
textarea,
.transcript-workspace-editor {
    border-color: var(--theme-border) !important;
    background-color: var(--theme-input) !important;
    color: var(--theme-input-text) !important;
}

input::placeholder,
textarea::placeholder {
    color: color-mix(in srgb, var(--theme-muted) 78%, transparent) !important;
}

.theme-toggle-control button.active,
.theme-toggle-control button[aria-pressed="true"] {
    border-color: transparent !important;
    background: var(--theme-accent) !important;
    color: var(--theme-accent-ink) !important;
}

.theme-toggle-control button {
    border-color: transparent !important;
    background: var(--theme-panel-soft) !important;
    color: var(--theme-text) !important;
}

.transcript-workspace-page {
    background: var(--theme-bg) !important;
}

html[data-theme="dark"] .transcript-workspace-page {
    background: var(--survai-page-bg) !important;
}

html[data-theme="light"] .transcript-workspace-page,
html[data-theme="light"] .transcript-workspace-page .app-shell,
html[data-theme="light"] .transcript-workspace-page .transcript-workspace-main {
    background: #fafcfe !important;
    color: #17202c !important;
}

html[data-theme="light"] .transcript-workspace-card,
html[data-theme="light"] .transcript-recording-card,
html[data-theme="light"] .transcript-document-card {
    border-color: #dce3ec !important;
    background: #ffffff !important;
    color: #17202c !important;
}

html[data-theme="light"] .transcript-document-card.is-selected,
html[data-theme="light"] .transcript-recording-status {
    border-color: rgba(27, 90, 249, 0.72) !important;
    background: rgba(27, 90, 249, 0.18) !important;
    color: #315000 !important;
}

.settings-theme-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    border: 1px solid var(--theme-border);
    border-radius: 14px;
    padding: 18px;
    background: var(--theme-panel-soft);
}

.settings-theme-panel h2 {
    margin: 0 0 4px;
    color: var(--theme-text);
}

.theme-toggle-control {
    display: inline-flex;
    gap: 4px;
    border: 1px solid var(--theme-border);
    border-radius: 999px;
    padding: 4px;
    background: var(--theme-panel);
}

.theme-toggle-control button {
    min-height: 38px;
    border-radius: 999px;
    padding: 0 14px;
    cursor: pointer;
    font-weight: 800;
}

@media (max-width: 720px) {
    .settings-theme-panel {
        align-items: stretch;
        flex-direction: column;
    }

    .theme-toggle-control,
    .theme-toggle-control button {
        width: 100%;
    }
}

/* Final Survai Camera zoom rail placement. This must remain after older camera rules. */

.capture-mode-body.is-camera-first-launch .main-panel > .alert {
    position: fixed;
    z-index: 1200;
    top: calc(14px + env(safe-area-inset-top));
    left: max(14px, env(safe-area-inset-left));
    right: max(14px, env(safe-area-inset-right));
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    min-height: 100%;
    margin: 0;
    overflow-x: hidden;
    color: var(--ink);
    background: var(--surface);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 16px;
    line-height: 1.5;
}

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

button,
input,
select,
textarea {
    font: inherit;
}


.login-screen {
    --login-blue: #1b5af9;
    --login-navy: #0b1321;
    --login-navy-soft: #0b1321;
    --login-muted: #b6c2d3;
    position: relative;
    min-height: 100vh;
    background:
        linear-gradient(110deg, rgba(7, 17, 31, 0.9), rgba(7, 17, 31, 0.7)),
        url("../images/login-background-survai.png") 45% center / cover no-repeat;
    background-repeat: no-repeat;
    color: #ffffff;
}

.login-shell {
    display: grid;
    width: 100%;
    max-width: 1440px;
    grid-template-columns: minmax(0, 1.05fr) minmax(440px, 0.95fr);
    min-height: 100vh;
    gap: clamp(28px, 4vw, 64px);
    margin: 0 auto;
    padding: clamp(32px, 5vw, 80px);
}

.login-hero-content {
    position: relative;
    z-index: 1;
    display: flex;
    width: min(480px, 100%);
    min-height: 100%;
    flex-direction: column;
    justify-content: center;
    padding: clamp(36px, 5vw, 68px);
}

.login-hero-logo {
    width: min(265px, 68vw);
    height: auto;
    margin-bottom: 14px;
}

.login-card {
    width: min(100%, 450px);
    padding: clamp(30px, 3.1vw, 40px);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 18px;
    background: rgba(7, 17, 31, 0.72);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        0 28px 80px rgba(0, 0, 0, 0.34);
    backdrop-filter: blur(18px);
}

.login-card-title {
    display: block;
    margin: 0 0 8px;
    color: #ffffff;
    font-size: clamp(1.58rem, 2vw, 1.95rem);
    line-height: 1.1;
}

.login-card-subtitle {
    display: block;
    margin: 0 0 28px;
    color: rgba(182, 194, 211, 0.88);
    font-size: 0.95rem;
}

.login-card label {
    color: #ffffff;
}

.login-card label span {
    color: rgba(255, 255, 255, 0.95);
}

.login-form input[type="email"],
.login-form input[type="password"] {
    min-height: 58px;
    border-color: rgba(182, 194, 211, 0.28);
    border-radius: 10px;
    background: rgba(6, 15, 29, 0.56);
    color: #ffffff;
    font-weight: 600;
}

.login-form input::placeholder {
    color: rgba(182, 194, 211, 0.72);
}

.login-form input:focus {
    border-color: var(--login-blue);
    box-shadow: 0 0 0 4px rgba(27, 90, 249, 0.12);
}

.login-form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: -2px;
}

.login-remember {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #ffffff;
    font-weight: 700;
}

.login-remember input {
    width: 21px;
    height: 21px;
    min-height: 0;
    accent-color: var(--login-blue);
}

.login-subtle-link,
.login-support a {
    color: var(--login-blue);
    font-weight: 800;
}

.login-card .login-submit {
    display: flex;
    min-height: 58px;
    align-items: center;
    justify-content: center;
    gap: 18px;
    border-color: var(--login-blue);
    border-radius: 10px;
    background: var(--login-blue);
    color: var(--login-navy);
    font-weight: 900;
}

.login-card .login-submit:hover {
    border-color: #c9ff55;
    background: #c9ff55;
    color: var(--login-navy);
}

.login-card .alert-error {
    color: #fecaca;
    background: rgba(180, 35, 24, 0.18);
    border: 1px solid rgba(254, 202, 202, 0.34);
}

.login-support {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 32px;
    padding-top: 26px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--login-muted);
    text-align: center;
}

.login-support p {
    margin-bottom: 0;
}

.login-support > span {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(182, 194, 211, 0.72);
    border-bottom-color: transparent;
    border-radius: 50%;
}

@media (max-width: 980px) {
    .login-shell {
        grid-template-columns: 1fr;
        gap: 0;
        padding: 28px 18px;
    }
}

@media (max-width: 560px) {

    .login-card {
        border-radius: 14px;
    }

    .login-form-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }
}

.brand-logo {
    display: block;
    max-width: 100%;
    height: auto;
    background-color: transparent;
    object-fit: contain;
}

.brand-logo-sidebar {
    display: block;
    width: min(420px, 100%);
    height: auto;
    max-height: 108px;
    background-color: transparent;
    object-fit: contain;
    object-position: left center;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 8px;
    font-size: clamp(1.75rem, 2.8vw, 2.5rem);
    line-height: 1.1;
    letter-spacing: 0;
}

/* Section headings take output.php's card-heading size and weight (surveyor, 27 Sep 2026:
   output.php leads every page); the tokens are set at the top of this sheet. */
h2 {
    margin-bottom: 10px;
    font-size: var(--survai-white-header-title-size);
    font-weight: var(--survai-white-header-title-weight);
    line-height: var(--survai-white-header-title-line-height);
    letter-spacing: 0;
}

.form-note,
.empty-state p,
.user-pill span,
.section-order {
    color: var(--muted);
}

.form-stack,
.report-form {
    display: grid;
    gap: 18px;
}

label {
    display: grid;
    gap: 7px;
    color: var(--ink);
    font-weight: 700;
}

label span {
    font-size: 0.92rem;
}

/* ==========================================================
   Form fields: one definition for every page.
   output.php is the reference (surveyor, 27 Sep 2026: "yes go ahead with
   cards, form fields and tables"). A field's surface and text are set
   here, through these tokens, and nowhere else; the design-system layer
   reads the same tokens. A field's text no longer follows the label it
   sits in: typed text is 1rem at weight 500 (surveyor, 29 Sep 2026: field
   text at 700 read as "overly bold" across the site; medium keeps a typed
   value distinct from its caption without shouting), matching output.php's Add item and
   photo filter fields), paragraphs in a text box are output.php's section
   editor (0.98rem, regular, line-height 1.55). On phones both are 16px, so
   iOS does not zoom when a field is tapped. Width, and extra padding for
   an icon inside a field, stay with the page.
   ========================================================== */

:root {
    --field-height: 46px;
    --field-padding-block: 10px;
    --field-padding-inline: 12px;
    --field-radius: 14px;
    --field-border-color: #e6ebf2;
    --field-bg: #ffffff;
    --field-ink: #111827;
    --field-placeholder: #98a2b3;
    --field-shadow: inset 0 1px 0 rgba(11, 19, 33, 0.02);
    --field-focus-border: #1b5af9;
    --field-focus-ring: 0 0 0 4px rgba(27, 90, 249, 0.18);
    --field-font-size: 1rem;
    --field-font-weight: 500;
    --field-text-font-size: 0.98rem;
    --field-text-font-weight: 400;
    --field-text-line-height: 1.55;
    --field-text-padding: 13px 14px;
}

/* Text-like inputs only: a checkbox, radio, slider, file or colour input is not a field box
   (surveyor, 28 Sep 2026, settings.php: "the check boxes are ridiculously large"). */
input:not(:where([type="checkbox"], [type="radio"], [type="range"], [type="file"], [type="color"], [type="hidden"], [type="submit"], [type="button"], [type="reset"], [type="image"])),
select,
textarea {
    width: 100%;
    border: 1px solid var(--field-border-color);
    border-radius: var(--field-radius);
    background: var(--field-bg);
    color: var(--field-ink);
    outline: none;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

input:not(:where([type="checkbox"], [type="radio"], [type="range"], [type="file"], [type="color"], [type="hidden"], [type="submit"], [type="button"], [type="reset"], [type="image"])),
select,
textarea,
.input {
    border-color: var(--field-border-color) !important;
    background-color: var(--field-bg) !important;
    color: var(--field-ink) !important;
}

input:not(:where([type="checkbox"], [type="radio"], [type="range"], [type="file"], [type="color"], [type="hidden"], [type="submit"], [type="button"], [type="reset"], [type="image"])),
select {
    min-height: var(--field-height);
    padding: var(--field-padding-block) var(--field-padding-inline);
}

/* Checkboxes and radios: the browser's control in Survai blue, sized to the text beside it. */
input[type="checkbox"],
input[type="radio"] {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    accent-color: var(--survai-blue);
    cursor: pointer;
}

input[type="range"] {
    width: 100%;
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
    accent-color: var(--survai-blue);
}

input[type="file"],
input[type="color"] {
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
}

/* A checkbox with its label: control and text on one line, text wrapping beside it. */
.checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    color: var(--survai-text);
}

.checkbox-row > label {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

/* The text beside a checkbox is the choice itself, not a field caption: body ink, normal case. */
.checkbox-row > span,
.checkbox-row > label > span {
    margin: 0;
    /* !important: the generic `label span` caption rule is !important too. */
    color: var(--survai-text) !important;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: normal;
    text-transform: none;
}

input:not(:where([type="checkbox"], [type="radio"], [type="range"], [type="file"], [type="color"], [type="hidden"], [type="submit"], [type="button"], [type="reset"], [type="image"])),
select {
    font-size: var(--field-font-size);
    font-weight: var(--field-font-weight);
}

select {
    appearance: none;
    padding-right: 36px;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--muted) 50%),
        linear-gradient(135deg, var(--muted) 50%, transparent 50%);
    background-position:
        calc(100% - 18px) 50%,
        calc(100% - 12px) 50%;
    background-size: 6px 6px, 6px 6px;
    background-repeat: no-repeat;
}

textarea {
    resize: vertical;
    padding: var(--field-text-padding);
    font-size: var(--field-text-font-size);
    font-weight: var(--field-text-font-weight);
    line-height: var(--field-text-line-height);
}

input:focus,
select:focus,
textarea:focus,
.input:focus {
    border-color: var(--field-focus-border) !important;
    box-shadow: var(--field-focus-ring) !important;
}

input::placeholder,
textarea::placeholder {
    color: var(--field-placeholder) !important;
}

/* ==========================================================
   Tables: one definition for every page.
   output.php is the reference (surveyor, 27 Sep 2026: "yes go ahead with
   cards, form fields and tables"): its section costs table. Header text
   and cell text are set here, through these tokens; the design-system
   layer reads the same tokens. The header colour is slate (#64748b, about
   4.6:1 on the header band); the pale grey it replaced (#98a2b3) was about
   2.5:1. Cell padding and borders stay with each table: a compact table
   inside a card and a full-page list need different density.
   ========================================================== */

:root {
    --table-head-font-size: 0.72rem;
    --table-head-font-weight: 850;
    --table-head-tracking: 0.035em;
    --table-head-ink: #64748b;
    --table-cell-ink: #111827;
}

th {
    color: var(--table-head-ink);
    font-size: var(--table-head-font-size);
    font-weight: var(--table-head-font-weight);
    letter-spacing: var(--table-head-tracking);
    text-transform: uppercase;
}

td {
    color: var(--table-cell-ink);
}

/* ==========================================================
   Buttons: one definition for every page.
   output.php is the reference (surveyor, 27 Sep 2026: "all the buttons on
   output.php to be the source of truth for all buttons on the site"). Change
   a button's look here, through these tokens, and nowhere else. Two sizes
   (.btn and .btn-small), four variants (primary, secondary, outline,
   danger). The camera screens keep their own controls.
   ========================================================== */

:root {
    --btn-height: 42px;
    --btn-height-small: 34px;
    --btn-padding-block: 9px;
    --btn-padding-block-small: 7px;
    --btn-padding-inline: 18px;
    --btn-padding-inline-small: 14px;
    --btn-radius: 999px;
    --btn-font-size-small: 0.9rem;
    --btn-font-weight: 800;
    --btn-line-height: 1.2;
    --btn-shadow: 0 10px 26px rgba(11, 19, 33, 0.07);
    --btn-shadow-small: 0 6px 16px rgba(11, 19, 33, 0.05);
    --btn-shadow-hover: 0 14px 32px rgba(11, 19, 33, 0.11);
    --btn-transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
    --btn-primary-bg: var(--theme-accent);
    --btn-primary-ink: #ffffff;
    --btn-primary-shadow: 0 10px 24px rgba(27, 90, 249, 0.18);
    --btn-secondary-bg: #ffffff;
    --btn-secondary-ink: var(--sai-text-main, #111827);
    --btn-secondary-shadow: 0 6px 18px rgba(16, 24, 40, 0.04);
    --btn-danger-bg: #fff1f3;
    --btn-danger-ink: #b42318;
    --btn-danger-shadow: inset 0 0 0 1px #ffd6db;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    max-width: 100%;
    min-height: var(--btn-height);
    padding: var(--btn-padding-block) var(--btn-padding-inline);
    border: 0;
    border-radius: var(--btn-radius);
    background: var(--btn-secondary-bg);
    color: var(--btn-secondary-ink);
    font-family: inherit;
    font-weight: var(--btn-font-weight);
    line-height: var(--btn-line-height);
    text-align: center;
    overflow-wrap: anywhere;
    cursor: pointer;
    box-shadow: var(--btn-shadow);
    transition: var(--btn-transition) !important;
}

.btn:hover {
    opacity: 1;
    transform: translateY(-1px);
}

.btn:not(.btn-primary):not(.btn-secondary):not(.btn-outline):not(.btn-danger):hover {
    box-shadow: var(--btn-shadow-hover);
}

.btn:disabled {
    cursor: wait;
    opacity: 0.72;
}

.btn-small {
    min-height: var(--btn-height-small);
    padding: var(--btn-padding-block-small) var(--btn-padding-inline-small);
    font-size: var(--btn-font-size-small);
    box-shadow: var(--btn-shadow-small);
}

.btn-full {
    width: 100%;
}

.btn-primary {
    background: var(--btn-primary-bg);
    color: var(--btn-primary-ink);
    box-shadow: var(--btn-primary-shadow) !important;
}

.btn-primary *,
.btn-primary svg {
    color: inherit;
}

.btn-primary svg {
    fill: none;
    stroke: currentColor;
}

.btn-secondary,
.btn-outline {
    background: var(--btn-secondary-bg);
    color: var(--btn-secondary-ink);
    box-shadow: var(--btn-secondary-shadow) !important;
}

.btn-danger {
    background: var(--btn-danger-bg);
    color: var(--btn-danger-ink);
    box-shadow: var(--btn-danger-shadow);
}

.app-shell {
    --sidebar-width: 260px;
    display: grid;
    min-height: 100vh;
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    transition: grid-template-columns 180ms ease;
}

.sidebar {
    position: sticky;
    top: 0;
    align-self: start;
    display: flex;
    width: var(--sidebar-width);
    height: 100vh;
    max-height: 100vh;
    overflow-y: auto;
    flex-direction: column;
    gap: 18px;
    padding: 18px 14px;
    color: #ffffff;
    background:
        linear-gradient(180deg, rgba(15, 27, 47, 0.96), rgba(7, 17, 31, 1)),
        var(--navy);
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 18px 0 48px rgba(7, 17, 31, 0.12);
    transition: width 180ms ease, padding 180ms ease;
}

.sidebar-brand {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 12px;
    font-size: 1.2rem;
    font-weight: 900;
    background-color: transparent;
    -webkit-tap-highlight-color: transparent;
    isolation: isolate;
}

.sidebar-brand:hover,
.sidebar-brand:focus,
.sidebar-brand:focus-visible,
.sidebar-brand:active {
    background-color: transparent;
}

/* Default: no sidebar glyph tile (collapsed/mobile/drawer rules set the transparent wordmark). */
.sidebar-brand::before {
    display: none;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    content: "";
    background-color: transparent;
    background-image: none;
    background-position: center;
    background-size: contain;
    background-repeat: no-repeat;
}

/* Desktop expanded rail: real RGBA wordmark only — avoids WebKit black rects + opaque mislabeled assets. */
.sidebar-brand.brand-logo-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sidebar .sidebar-brand img.brand-logo-sidebar,
.brand-logo-sidebar {
    background-color: transparent !important;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
    will-change: opacity;
}

.sidebar .sidebar-brand:hover img.brand-logo-sidebar,
.sidebar .sidebar-brand:focus-visible img.brand-logo-sidebar,
.brand-logo-link:hover .brand-logo-sidebar,
.brand-logo-link:focus-visible .brand-logo-sidebar {
    opacity: 0.92;
    transform: none;
}

.sidebar-nav {
    display: grid;
    gap: 5px;
}

/* KPIs appear only below Settings — subtle separator from primary nav */

.sidebar-nav a {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 11px;
    min-height: auto;
    border-radius: 12px;
    padding: 10px 8px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.78rem;
    font-weight: 400;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    background: transparent;
    transition: color 160ms ease;
}

.sidebar-nav a::before {
    display: none;
}

.sidebar-nav a.active {
    color: #ffffff;
    background: transparent;
}

.sidebar-nav a.active::before {
    background: transparent;
}

/* The stage buttons (Overview / Report / Advanced) in the rail, on the Property Overview
   (workspace_nav_grouped.php, survai_workspace_stage_nav_in_sidebar): the header's blue pills
   stacked, their menus opening to the right of the rail (fixed to the viewport by the stage
   script, because the rail scrolls and would clip them). */
.sidebar .workspace-stage-nav--sidebar {
    display: grid;
    gap: 6px;
    width: 100%;
    min-height: 0;
    margin: 0;
    padding: 0 0 12px;
    border-bottom: 1px solid var(--survai-border);
}

.sidebar .workspace-stage-nav--sidebar .workspace-stage-nav__item {
    position: relative;
    display: block;
    flex: 0 0 auto;
    width: 100%;
}

.sidebar .workspace-stage-nav--sidebar .workspace-stage-nav__stage {
    display: flex;
    width: 100%;
    min-height: 40px;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 0 8px;
    border-radius: 10px;
    background: transparent !important;
    color: var(--survai-text) !important;
    font-size: 0.8rem;
    font-weight: 500;
    line-height: 1.1;
    text-decoration: none;
}

/* The current stage is a little bolder, with no blue field (surveyor, 3 Oct 2026); hover and
   an open menu show the quiet grey. */
.sidebar .workspace-stage-nav--sidebar .workspace-stage-nav__stage.is-active {
    background: transparent !important;
    color: var(--survai-text) !important;
    font-weight: 650;
}

.sidebar .workspace-stage-nav--sidebar .workspace-stage-nav__stage:hover,
.sidebar .workspace-stage-nav--sidebar .workspace-stage-nav__stage:focus-visible,
.sidebar .workspace-stage-nav--sidebar .workspace-stage-nav__item.is-open .workspace-stage-nav__stage {
    background: var(--survai-neutral-hover) !important;
    color: var(--survai-text) !important;
}

.sidebar .workspace-stage-nav--sidebar .workspace-stage-nav__stage :is(span, svg) {
    color: inherit !important;
}

.sidebar .workspace-stage-nav--sidebar .workspace-stage-nav__stage .workspace-stage-subnav__icon {
    display: inline-flex;
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
}

.sidebar .workspace-stage-nav--sidebar .workspace-stage-nav__stage .workspace-stage-subnav__icon svg {
    width: 16px;
    height: 16px;
}

.sidebar .workspace-stage-nav--sidebar .workspace-stage-dropdown {
    position: fixed;
    top: auto;
    left: auto;
    /* The header's last-stage rule anchors its menu to the right edge; a fixed menu with both
       edges set would stretch across the page. The script sets left and top. */
    right: auto !important;
    z-index: 900;
    min-width: 200px;
    max-width: min(340px, calc(100vw - 16px));
    transform: translateX(-4px);
}

.sidebar .workspace-stage-nav--sidebar .workspace-stage-nav__item.is-open .workspace-stage-dropdown {
    transform: none;
}

.sidebar .workspace-stage-nav--sidebar .workspace-stage-dropdown .workspace-stage-subnav__link,
.sidebar .workspace-stage-nav--sidebar .workspace-stage-dropdown .workspace-stage-subnav__link :is(span, svg) {
    color: var(--survai-text) !important;
}

.sidebar-nav-icon {
    display: inline-flex;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    align-items: center;
    justify-content: center;
    color: currentColor;
}

.sidebar-nav-icon svg {
    display: block;
    width: 100%;
    height: 100%;
    stroke: currentColor;
    stroke-width: 2.25;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

.sidebar-nav-label {
    display: block;
    max-width: 100%;
    min-width: 0;
    overflow-wrap: anywhere;
    hyphens: auto;
    font-weight: 400;
    line-height: 1.25;
    text-align: center;
    white-space: normal;
}

.main-panel {
    width: 100%;
    max-width: none;
    min-width: 0;
    box-sizing: border-box;
    padding: var(--app-main-padding);
}

/*
 * Desktop: viewport-fixed primary sidebar (reports, dashboard, etc.). JS adds
 * .app-shell-has-main-sidebar — menu stays pinned while page content scrolls.
 * Workspace report shells (.sidebar--workspace) use dedicated fixed rules farther below.
 */
@media (min-width: 901px) {
    body:not(.login-body):not(.survaicam-page):not(.capture-mode-body).app-shell-has-main-sidebar .app-shell {
        display: block;
        min-height: 100vh;
        min-height: 100dvh;
        padding-left: var(--sidebar-width);
        box-sizing: border-box;
    }

    body:not(.login-body):not(.survaicam-page):not(.capture-mode-body).app-shell-has-main-sidebar
        .app-shell
        > .sidebar:not(.sidebar--workspace) {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: var(--sidebar-width);
        height: auto;
        min-height: 100vh;
        min-height: 100dvh;
        max-height: 100dvh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        z-index: 60;
    }

    @supports selector(:has(.sidebar)) {
        body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.app-shell-has-main-sidebar)
            .app-shell:has(> .sidebar:not(.sidebar--workspace)) {
            display: block;
            min-height: 100vh;
            min-height: 100dvh;
            padding-left: var(--sidebar-width);
            box-sizing: border-box;
        }

        body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.app-shell-has-main-sidebar)
            .app-shell
            > .sidebar:not(.sidebar--workspace) {
            position: fixed;
            top: 0;
            left: 0;
            bottom: 0;
            width: var(--sidebar-width);
            height: auto;
            min-height: 100vh;
            min-height: 100dvh;
            max-height: 100dvh;
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
            z-index: 60;
        }
    }

    /*
     * Expanded workspace hides the sidebar rail but keeps the pinned-shell padding-left;
     * clear the inset so reports list and main content span the viewport.
     */
    body.workspace-expanded-mode.app-shell-has-main-sidebar:not(.login-body):not(.survaicam-page):not(.capture-mode-body)
        .app-shell {
        padding-left: 0 !important;
        padding-right: 0;
    }

    @supports selector(:has(.sidebar)) {
        body.workspace-expanded-mode:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.app-shell-has-main-sidebar)
            .app-shell:has(> .sidebar:not(.sidebar--workspace)) {
            padding-left: 0 !important;
            padding-right: 0;
        }
    }

    body.workspace-expanded-mode.dashboard-body.reports-page .app-shell {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (min-width: 901px) {
    .mobile-app-header {
        display: none !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }
}

.mobile-app-header,
.mobile-menu-toggle,
.mobile-menu-overlay {
    display: none;
}

/**
 * Fixed white top bar (mobile). Stays in place; sidebar + scrim use higher z-index
 * so they appear in front of this bar when the menu is open.
 */
.mobile-app-header {
    box-sizing: border-box;
}

.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
    min-width: 0;
}

.page-header h1 {
    margin-bottom: 0;
}

.eyebrow {
    margin-bottom: 6px;
    color: var(--accent-dark);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

/* ==========================================================
   Cards: one definition for every page.
   output.php is the reference (surveyor, 27 Sep 2026: "yes go ahead with
   cards, form fields and tables"). A card's surface (border, corners,
   background, shadow) is set here, through these tokens, and nowhere else;
   the design-system layer reads the same tokens. Padding belongs to what a
   card holds and stays with each component.
   ========================================================== */

:root {
    --card-border-color: #e6ebf2;
    --card-radius: 18px;
    --card-bg: rgba(255, 255, 255, 0.96);
    --card-shadow: 0 18px 50px rgba(11, 19, 33, 0.07);
    --card-shadow-hover: 0 22px 62px rgba(11, 19, 33, 0.11);
}

.card {
    min-width: 0;
}

.card,
.table-card,
.toolbar,
.supporting-upload,
.section-card,
.report-form,
.ops-card,
.ops-kpi-card,
.lifecycle-card,
.cost-card,
.cost-item-card,
.sai-report-card,
.po-card,
.documents-carousel-card {
    border: 1px solid var(--card-border-color) !important;
    border-radius: var(--card-radius) !important;
    background: var(--card-bg) !important;
    box-shadow: var(--card-shadow) !important;
}

.card:hover,
.ops-card:hover,
.ops-kpi-card:hover,
.po-card:hover {
    box-shadow: var(--card-shadow-hover) !important;
}

.toolbar {
    margin-bottom: 18px;
}

.search-field {
    max-width: 460px;
}

.table-card {
    overflow: hidden;
}

.reports-page .table-card,
.reports-page .toolbar {
    width: 100%;
}

/* Reports card-row list */
.reports-page .table-card {
    padding: 0;
}
.reports-page .table-card .empty-state {
    padding: 48px 32px;
}
.reports-page .reports-list {
    display: flex;
    flex-direction: column;
}
.reports-page .report-row {
    position: relative;
    display: grid;
    grid-template-columns: 116px minmax(0, 1.6fr) minmax(0, 1.1fr) minmax(0, 1.5fr) minmax(0, 0.9fr) 48px;
    gap: 22px;
    align-items: center;
    padding: 16px 22px;
    border-bottom: 1px solid #edf2f7;
    transition: background 0.16s ease;
}
.reports-page .report-row:last-child { border-bottom: 0; }
.reports-page .report-row:hover { background: var(--survai-bg-soft); }
.reports-page .report-row__link {
    position: absolute;
    inset: 0;
    z-index: 2;
}
/* Exclude the actions menu: this rule's :not() made it more specific than the
   .report-row__menu z-index below, so the menu inherited z-index:1 and sank
   UNDER the row's stretched click overlay (.report-row__link, z-index:2) —
   clicking the ⋯ opened the report instead of the menu. */
.reports-page .report-row > *:not(.report-row__link):not(.report-row__menu) {
    position: relative;
    z-index: 1;
    min-width: 0;
}
.reports-page .report-row > .report-row__menu {
    position: relative;
    z-index: 4;
    justify-self: end;
    margin: 0;
}
.reports-page .report-row__menu[open] {
    z-index: 5;
}
.reports-page .report-row__thumb {
    width: 108px;
    height: 78px;
    object-fit: cover;
    border-radius: 12px;
    background: var(--survai-tint-eef4fb);
    border: 0;
}
.reports-page .report-row__thumb--placeholder {
    display: grid;
    place-items: center;
    color: #9db2cd;
}
.reports-page .report-row__thumb--placeholder svg { width: 30px; height: 30px; }
.reports-page .report-property h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--survai-ink-0b1736);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.reports-page .report-property p {
    margin: 3px 0 7px;
    color: var(--survai-ink-52637f);
    font-weight: 600;
    font-size: 0.85rem;
}
.reports-page .report-property span {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--survai-tint-eef3f8);
    color: var(--survai-ink-52637f);
    font-size: 0.72rem;
    font-weight: 800;
}
.reports-page .report-status__badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.reports-page .report-status__badge strong {
    font-weight: 800;
    font-size: 0.9rem;
    color: var(--survai-ink-0b1736);
}
.reports-page .report-media {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 20px;
}
.reports-page .report-media div {
    display: flex;
    align-items: baseline;
    gap: 6px;
}
.reports-page .report-media strong { font-size: 0.95rem; font-weight: 800; color: var(--survai-ink-0b1736); }
.reports-page .report-media span { font-size: 0.76rem; color: var(--survai-secondary-slate); }
.reports-page .report-media .muted { opacity: 0.5; }
.reports-page .report-date strong { display: block; font-size: 0.92rem; font-weight: 800; color: var(--survai-ink-0b1736); }
.reports-page .report-date span { font-size: 0.76rem; color: var(--survai-secondary-slate); }
.reports-page .report-date.is-unset strong { color: var(--survai-muted-cool); }
.reports-page .report-row__menu .row-menu {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: 1px solid var(--survai-border-soft);
    background: var(--survai-card);
    border-radius: 12px;
    color: var(--survai-secondary-slate);
    cursor: pointer;
    transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}
.reports-page .report-row__menu .row-menu::-webkit-details-marker {
    display: none;
}
.reports-page .report-row__menu .row-menu::marker {
    content: "";
}
.reports-page .report-row__menu .row-menu svg {
    width: 20px;
    height: 20px;
}
.reports-page .report-row__menu .row-menu:hover,
.reports-page .report-row__menu .row-menu:focus-visible,
.reports-page .report-row__menu[open] .row-menu {
    background: var(--survai-bg);
    color: var(--survai-text-strong);
    border-color: var(--survai-border-mid);
    outline: none;
}
.reports-page .report-row__menu-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    display: grid;
    min-width: 172px;
    padding: 6px;
    border: 1px solid var(--survai-border-soft);
    border-radius: 14px;
    background: var(--survai-card);
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.16);
}

/* Invisible bridge over the 8px offset between the ⋯ button and the panel:
   without it the pointer "leaves" the menu while crossing the gap and the
   panel closes before it can be reached. */
.reports-page .report-row__menu-panel::before {
    content: "";
    position: absolute;
    top: -12px;
    left: -12px;
    right: -12px;
    height: 12px;
}
.reports-page .report-row__menu-panel form {
    margin: 0;
}
.reports-page .report-row__menu-action {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 10px;
    padding: 10px 11px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--survai-text-strong);
    font: inherit;
    font-size: 0.86rem;
    font-weight: 400;
    text-align: left;
    cursor: pointer;
}
.reports-page .report-row__menu-action svg {
    width: 17px;
    height: 17px;
    flex: 0 0 auto;
}
.reports-page .report-row__menu-action:hover,
.reports-page .report-row__menu-action:focus-visible {
    background: var(--survai-bg);
    outline: none;
}
.reports-page .report-row__menu-action--danger {
    color: var(--survai-ink-b42318);
}
.reports-page .report-row__menu-action--danger:hover,
.reports-page .report-row__menu-action--danger:focus-visible {
    background: var(--survai-tint-fff1f1);
}

/* Reports page: plain white background. Specificity here must match/beat the
   dashboard gradient rule (body:not()...:not() .main-panel ~ 0,6,1). */
body.reports-page:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body):not(.output-report-page) {
    background: var(--survai-card) !important;
}
body.reports-page:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body):not(.output-report-page) .main-panel {
    background: var(--survai-card) !important;
}

/* Reports premium search + Filters dropdown */
/* Both edges line up with the report rows' content edge below. The row content
   sits at the card's 1px border plus .report-row's 22px padding, so the inset
   is derived from those two rather than eyeballed — change either and the
   search follows. */
.reports-page .reports-content {
    --reports-card-border: 1px;
    --reports-row-inset: 22px;
    --reports-content-edge: calc(var(--reports-card-border) + var(--reports-row-inset));
}
.reports-page .reports-command-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    margin: -34px 0 16px;
    padding-right: var(--reports-content-edge, 23px);
}
.reports-page .premium-search {
    position: relative;
    min-height: 60px;
    /* The field only ever needs to hold an address; letting it run the full
       width of the page made it look like the page's main object. */
    max-width: 520px;
    display: flex;
    align-items: center;
    gap: 10px;
    /* No left inset: the field's own border starts on the card's left edge
       below, while the icon and text stay on the row content edge. */
    padding: 0 14px 0 0;
    border-radius: 16px;
    background: transparent;
    border: 0;
    box-shadow: none;
    transition: border-color .18s ease, box-shadow .18s ease;
}
.reports-page .premium-search:focus-within {
    border-color: transparent;
    box-shadow: none;
}
.reports-page .premium-search__icon {
    position: absolute;
    left: var(--reports-content-edge, 23px);
    top: 50%;
    transform: translateY(-50%);
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--survai-ink-155dfc);
    cursor: pointer;
}
.reports-page .premium-search__icon svg { width: 22px; height: 22px; }
.reports-page .premium-search input {
    flex: 1 1 auto;
    min-width: 0;
    border: 0;
    outline: 0;
    padding: 0 0 0 calc(var(--reports-content-edge, 23px) + 40px);
    background: transparent;
    color: var(--survai-text-strong);
    font-size: 16px;
    font-weight: 600;
}
.reports-page .reports-command-tools {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    min-width: 0;
}
.reports-page .reports-order-by {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.reports-page .reports-order-by label {
    color: var(--survai-secondary-slate);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}
/* Size and typography only: the chevron itself is painted by the app-wide
   select rule in the design-system layer, which restores what its own
   background shorthand was wiping. */
body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .reports-order-by select {
    width: auto;
    min-width: 0;
    max-width: 230px;
    min-height: 44px;
    height: 44px;
    padding: 0 36px 0 14px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}
.reports-page .reports-order-by select:focus-visible {
    outline: 2px solid #155dfc;
    outline-offset: 2px;
}
.reports-page .reports-density {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    border: 1px solid var(--survai-border-soft);
    border-radius: 12px;
    background: var(--survai-bg);
    flex: 0 0 auto;
}
.reports-page .reports-density__btn {
    display: grid;
    place-items: center;
    width: 40px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--survai-secondary-slate);
    cursor: pointer;
    transition: background .16s ease, color .16s ease;
}
.reports-page .reports-density__btn svg { width: 20px; height: 20px; }
.reports-page .reports-density__btn:hover { background: var(--survai-tint-e9eef6); color: var(--survai-text-strong); }
.reports-page .reports-density__btn[aria-pressed="true"] {
    background: #4f46e5;
    color: #ffffff;
}
.reports-page .reports-density__btn:focus-visible {
    outline: 2px solid #155dfc;
    outline-offset: 2px;
}

/* Compact rows: defined at the end of this file (one lean line per report —
   no thumbnail, media counts or second address line; surveyor, 6 Sep 2026). */

.reports-page .premium-search input::placeholder {
    color: #8a97ad;
    font-weight: 500;
}
.reports-page .premium-search input::-webkit-search-cancel-button,
.reports-page .premium-search input::-webkit-search-decoration {
    -webkit-appearance: none;
    appearance: none;
    display: none;
}
.reports-page .premium-search__clear {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    color: var(--survai-secondary-slate);
    text-decoration: none;
    transition: background .14s ease, color .14s ease;
}
.reports-page .premium-search__clear:hover {
    background: var(--survai-tint-fdeaea);
    color: var(--survai-ink-d2333a);
}
.reports-page .reports-filter-dd { position: relative; }
.reports-page .premium-filter {
    min-height: 68px;
    padding: 0 24px;
    border-radius: 22px;
    border: 1px solid rgba(210, 220, 235, .9);
    background: var(--survai-card);
    color: var(--survai-ink-0f1b33);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 850;
    box-shadow: 0 18px 45px rgba(15, 23, 42, .045);
    cursor: pointer;
    white-space: nowrap;
    list-style: none;
}
.reports-page .premium-filter::-webkit-details-marker { display: none; }
.reports-page .premium-filter:hover {
    border-color: rgba(37, 99, 235, .28);
    box-shadow: 0 22px 55px rgba(15, 23, 42, .065);
}
.reports-page .reports-filter-dd[open] .premium-filter {
    border-color: rgba(37, 99, 235, .45);
    color: var(--survai-ink-2563eb);
}

@media (max-width: 760px) {
    .reports-page .reports-command-search { grid-template-columns: 1fr; }
    /* Stacked: the field takes the width it now has to itself, and the tools
       drop below it left-aligned on the same 22px vertical as the rows. */
    .reports-page .premium-search { max-width: none; }
    .reports-page .reports-command-tools {
        padding-left: var(--reports-content-edge, 23px);
    }
    .reports-page .reports-order-by select { max-width: none; width: 100%; }
}

@media (max-width: 1100px) {
    .reports-page .report-row {
        grid-template-columns: 84px minmax(0, 1fr) 40px;
        gap: 14px 16px;
    }
    .reports-page .report-status,
    .reports-page .report-media,
    .reports-page .report-date {
        grid-column: 2 / 3;
    }
    .reports-page .report-row__thumb { width: 80px; height: 60px; }
}

/* Hide media counts (Videos/Images/Audio/Docs) and the thumbnail on mobile to
   give the property more room */
@media (max-width: 640px) {
    .reports-page .report-media { display: none; }
    .reports-page .report-row__thumb { display: none; }
    .reports-page .report-row {
        grid-template-columns: minmax(0, 1fr) 40px;
    }
    .reports-page .report-status,
    .reports-page .report-date {
        grid-column: 1 / 2;
    }
}

/* Match Business Dashboard (narrow icon rail) — reports grid sidebar column */
body.reports-page .app-shell {
    --sidebar-width: var(--survai-app-rail-width);
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    min-width: 0;
}

/*
 * Narrow icon rail: same geometry as Reports / Operational dashboard whenever the shell
 * uses the global sidebar (desk tools, Settings, Create Report File). Report workspaces
 * use .sidebar--workspace and keep separate layout rules (see body:has(.sidebar--workspace)).
 */
body:not(.login-body):not(.capture-mode-body):not(.survaicam-page):not(.pdf-viewer-body):not(
        .sai-studio-app
    )
    .app-shell:has(> aside.sidebar:not(.sidebar--workspace)) {
    --sidebar-width: var(--survai-app-rail-width);
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    min-width: 0;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

.report-status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--navy);
    font-weight: 500;
    white-space: nowrap;
}

.status-cell {
    white-space: nowrap;
}

.media-cell-wrap {
    white-space: nowrap;
}

.media-cell {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    flex-wrap: nowrap;
    color: var(--survai-muted-grey);
}

.media-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
    color: var(--survai-secondary-slate);
}

.media-item.is-zero {
    color: #a8b4c5;
}

.media-item.is-zero .media-icon,
.media-item.is-zero .media-count {
    color: #a8b4c5;
}

.media-icon {
    display: inline-flex;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: var(--survai-muted-cool);
}

.media-icon svg {
    display: block;
    width: 16px;
    height: 16px;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.media-count {
    font-variant-numeric: tabular-nums;
    color: var(--survai-secondary-strong);
}

.status-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    flex: 0 0 auto;
    background: #9ca3af;
}

.status-dot--not-started {
    background: #9ca3af;
}

.status-dot--processed {
    background: #f59e0b;
}

.status-dot--complete {
    background: #22c55e;
}

.status-dot--sent {
    background: #166534;
}

.status-dot--assigned {
    background: #2563eb;
}

.status-dot--in-progress {
    background: #ea580c;
}

.status-dot--processing {
    background: #d97706;
}

.status-dot--ready-for-review {
    background: #7c3aed;
}

.status-dot--closed {
    background: #475569;
}

.report-status-pill-wrap {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}

.report-status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 1.75rem;
    padding: 0.2rem 0.65rem;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    white-space: nowrap;
}

.report-status-pill:disabled {
    opacity: 0.7;
    cursor: wait;
}

.report-status-pill.status-assigned {
    color: var(--survai-ink-1d4ed8) !important;
    background: rgba(37, 99, 235, 0.14) !important;
    border-color: rgba(37, 99, 235, 0.22);
}

.report-status-pill.status-in-progress {
    color: var(--survai-ink-c2410c) !important;
    background: rgba(234, 88, 12, 0.14) !important;
    border-color: rgba(234, 88, 12, 0.22);
}

.report-status-pill.status-processing {
    color: var(--survai-ink-b45309) !important;
    background: rgba(245, 158, 11, 0.16) !important;
    border-color: rgba(245, 158, 11, 0.24);
}

.report-status-pill.status-awaiting-review {
    color: var(--survai-ink-6d28d9) !important;
    background: rgba(124, 58, 237, 0.14) !important;
    border-color: rgba(124, 58, 237, 0.22);
}

.report-status-pill.status-completed {
    color: var(--survai-ink-15803d) !important;
    background: rgba(34, 197, 94, 0.14) !important;
    border-color: rgba(34, 197, 94, 0.22);
}

.report-status-pill.status-sent-to-client {
    color: var(--survai-ink-14532d) !important;
    background: rgba(22, 101, 52, 0.16) !important;
    border-color: rgba(22, 101, 52, 0.28);
}

.report-status-pill.status-archived {
    color: var(--survai-text-soft) !important;
    background: rgba(71, 85, 105, 0.14) !important;
    border-color: rgba(71, 85, 105, 0.26);
}

.report-status-pill.status-stopped {
    color: #ffffff !important;
    background: #dc2626 !important;
    border-color: #b91c1c;
}

.report-status-pill.report-status-pill--workspace-dot {
    position: relative;
    display: inline-flex;
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px !important;
    max-width: 24px;
    max-height: 24px;
    padding: 0 !important;
    font-size: 0 !important;
    line-height: 0 !important;
    color: transparent !important;
    border: 0 !important;
    border-radius: 999px; margin-block: -7px;
    background: transparent !important;
    cursor: pointer;
    overflow: visible;
    white-space: nowrap;
    text-indent: 100%;
}

.report-status-pill.report-status-pill--workspace-dot::before {
    content: attr(data-status-label);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 10px);
    transform: translateX(-50%);
    z-index: 1500;
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
    background: var(--survai-ink-surface);
    color: #ffffff !important;
    font-size: 0.72rem !important;
    font-weight: 600;
    line-height: 1.25 !important;
    letter-spacing: normal;
    text-indent: 0;
    white-space: nowrap;
    width: max-content;
    max-width: min(18rem, calc(100vw - 24px));
    height: auto;
    min-width: 0;
    min-height: 0;
    max-height: none;
    overflow: visible;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0.15s ease;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.18);
}

.report-status-pill-wrap--workspace-dot:hover .report-status-pill--workspace-dot::before,
.report-status-pill-wrap--workspace-dot:focus-within .report-status-pill--workspace-dot::before {
    opacity: 1;
    visibility: visible;
}

/* Touch screens: no label (M44). A tap that reveals hover content can be taken by iOS as a hover with
   no click, and :focus-within kept the label up after the tap; the open menu marks the status. */
@media (hover: none) {
    .report-status-pill-wrap--workspace-dot .report-status-pill--workspace-dot::before {
        display: none;
    }
}

.report-status-pill.report-status-pill--workspace-dot.status-assigned,
.report-status-pill.report-status-pill--workspace-dot.status-in-progress,
.report-status-pill.report-status-pill--workspace-dot.status-processing,
.report-status-pill.report-status-pill--workspace-dot.status-awaiting-review,
.report-status-pill.report-status-pill--workspace-dot.status-completed,
.report-status-pill.report-status-pill--workspace-dot.status-sent-to-client,
.report-status-pill.report-status-pill--workspace-dot.status-stopped,
.report-status-pill.report-status-pill--workspace-dot.status-failed,
.report-status-pill.report-status-pill--workspace-dot.status-draft {
    color: transparent !important;
    background: transparent !important;
    border-color: transparent !important;
}

.report-status-pill.report-status-pill--workspace-dot::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.95);
}

.report-status-pill.report-status-pill--workspace-dot.status-assigned::after {
    background: #2563eb;
}

.report-status-pill.report-status-pill--workspace-dot.status-in-progress::after {
    background: #ea580c;
}

.report-status-pill.report-status-pill--workspace-dot.status-processing::after {
    background: #d97706;
}

.report-status-pill.report-status-pill--workspace-dot.status-awaiting-review::after {
    background: #7c3aed;
}

.report-status-pill.report-status-pill--workspace-dot.status-awaiting-transcript-review::after {
    background: #059669;
}

.report-status-pill.report-status-pill--workspace-dot.status-completed::after {
    background: #16a34a;
}

.report-status-pill.report-status-pill--workspace-dot.status-sent-to-client::after {
    background: #166534;
}

.report-status-pill.report-status-pill--workspace-dot.status-stopped::after,
.report-status-pill.report-status-pill--workspace-dot.status-failed::after {
    background: #dc2626;
}

.report-status-pill.report-status-pill--workspace-dot.status-draft::after {
    background: #2563eb;
}

.report-status-pill.report-status-pill--workspace-dot:not(
        .status-assigned,
        .status-in-progress,
        .status-processing,
        .status-awaiting-review,
        .status-awaiting-transcript-review,
        .status-completed,
        .status-sent-to-client,
        .status-stopped,
        .status-failed,
        .status-draft
    )::after {
    background: #64748b;
}

.report-status-pill-menu {
    position: fixed;
    top: calc(100% + 0.35rem);
    right: 0;
    z-index: 1400;
    min-width: 11.5rem;
    padding: 0.35rem;
    border: 1px solid var(--survai-border-ink);
    border-radius: 0.65rem;
    background: var(--survai-card);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
}

.report-status-pill-menu__option {
    display: block;
    width: 100%;
    padding: 0.45rem 0.55rem;
    border: none;
    border-radius: 0.45rem;
    background: transparent;
    color: var(--survai-text-strong);
    font: inherit;
    font-size: 0.84rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.report-status-pill-menu__option:hover,
.report-status-pill-menu__option:focus-visible {
    background: var(--survai-bg-tint);
}

.report-status-pill-menu__option.is-selected {
    background: rgba(27, 90, 249, 0.1);
    color: var(--survai-ink-1d4ed8);
}

.report-status-pill-feedback {
    margin: 0;
    font-size: 0.72rem;
    color: var(--survai-secondary-slate);
}

.report-status-pill-feedback.is-error {
    color: var(--survai-ink-b91c1c);
    font-weight: 600;
}

.status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 28px;
    border-radius: 999px;
    padding: 3px 10px;
    font-size: 0.82rem;
    font-weight: 900;
}

.status-completed {
    color: var(--survai-ink-166534);
    background: var(--survai-tint-dcfce7);
}

.status-completed_with_errors {
    color: var(--survai-ink-9a3412);
    background: var(--survai-tint-ffedd5);
}

.status-processing {
    color: var(--warning);
    background: var(--warning-soft);
}

.status-draft {
    color: var(--survai-ink-1e3a8a);
    background: var(--survai-tint-dbeafe);
}

.status-failed {
    color: var(--survai-ink-991b1b);
    background: var(--survai-tint-fee2e2);
}

.status-stopped {
    color: #ffffff;
    background: #dc2626;
}

.alert {
    margin-bottom: 18px;
    border-radius: 8px;
    padding: 13px 15px;
    font-weight: 700;
}

.alert-error,
.alert-warning {
    color: #ffffff;
    background: #dc2626;
    border: none;
}

.alert-success,
.alert-info {
    color: #ffffff;
    background: #165ffa;
    border: none;
}

.alert-warning a,
.alert-error a,
.alert-success a,
.alert-info a {
    color: #ffffff;
    text-decoration: underline;
}

.empty-state {
    display: grid;
    justify-items: start;
    gap: 10px;
    padding: 34px;
}

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

.report-form {
    padding: 24px;
}

.compact-form {
    padding: 0;
    box-shadow: none;
}

.transcript-input {
    min-height: 420px;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.form-note {
    margin: 0;
    font-size: 0.92rem;
}

.form-note.vector-test-success {
    color: var(--success);
    font-weight: 800;
}

.form-note.vector-test-error {
    color: var(--danger);
    font-weight: 800;
}

body.knowledge-base-page .knowledge-base-main {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

body.knowledge-base-page .knowledge-base-page-header {
    align-items: flex-start;
    gap: 18px;
}

body.knowledge-base-page .knowledge-base-page-header__actions {
    flex-shrink: 0;
    flex-wrap: wrap;
    gap: 10px;
}

body.knowledge-base-page .knowledge-base-status-banner {
    padding: 12px 16px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--theme-panel-soft);
    color: var(--theme-text);
    font-size: 0.92rem;
}

body.knowledge-base-page .knowledge-base-status-banner.is-success {
    border-color: rgba(22, 112, 74, 0.24);
    background: var(--success-soft);
    color: var(--success);
}

body.knowledge-base-page .knowledge-base-status-banner.is-error {
    border-color: rgba(180, 35, 24, 0.24);
    background: var(--danger-soft);
    color: var(--danger);
}

body.knowledge-base-page .knowledge-base-metrics {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
}

body.knowledge-base-page .knowledge-base-metric {
    display: grid;
    gap: 6px;
    min-width: 0;
    padding: 16px 18px;
    border: 1px solid var(--survai-border);
    border-radius: 14px;
    background: var(--survai-card);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.04);
}

body.knowledge-base-page .knowledge-base-metric__label {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

body.knowledge-base-page .knowledge-base-metric__value {
    color: var(--theme-text);
    font-size: clamp(1.35rem, 2vw, 1.65rem);
    font-weight: 700;
    line-height: 1.1;
}

body.knowledge-base-page .knowledge-base-metric__hint {
    margin: 0;
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.45;
}

body.knowledge-base-page .knowledge-base-metric--hint {
    grid-column: span 1;
}

body.knowledge-base-page .knowledge-base-migration-alert code {
    font-size: 0.86em;
}

body.knowledge-base-page .knowledge-base-upload-card .section-head,
body.knowledge-base-page .knowledge-base-documents-card .section-head {
    margin-bottom: 14px;
}

body.knowledge-base-page .knowledge-base-documents-card__actions {
    flex-wrap: wrap;
    gap: 8px;
}

body.knowledge-base-page .knowledge-base-dropzone,
.knowledge-base-upload .knowledge-base-dropzone {
    position: relative;
    display: grid;
    justify-items: center;
    gap: 8px;
    min-height: 210px;
    padding: 30px 24px;
    border: 1px dashed rgba(100, 116, 139, 0.34);
    border-radius: 16px;
    background:
        radial-gradient(circle at 50% 0%, rgba(27, 90, 249, 0.08), transparent 42%),
        linear-gradient(180deg, rgba(248, 250, 252, 0.92), color-mix(in srgb, var(--survai-card) 98%, transparent));
    text-align: center;
    transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

body.knowledge-base-page .knowledge-base-dropzone.is-dragover,
.knowledge-base-upload .knowledge-base-dropzone.is-dragover {
    border-color: rgba(27, 90, 249, 0.5);
    box-shadow: 0 18px 48px rgba(27, 90, 249, 0.12);
    transform: translateY(-1px);
}

body.knowledge-base-page .knowledge-base-dropzone input,
.knowledge-base-upload .knowledge-base-dropzone input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

body.knowledge-base-page .knowledge-base-dropzone__icon,
.knowledge-base-upload .knowledge-base-dropzone__icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: rgba(27, 90, 249, 0.1);
    color: var(--survai-ink-1b5af9);
}

body.knowledge-base-page .knowledge-base-dropzone__icon svg,
.knowledge-base-upload .knowledge-base-dropzone__icon svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    stroke-width: 1.8;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

body.knowledge-base-page .knowledge-base-dropzone strong,
.knowledge-base-upload .knowledge-base-dropzone strong {
    color: var(--theme-text, #17202c);
    font-size: 1.05rem;
}

body.knowledge-base-page .knowledge-base-dropzone span,
body.knowledge-base-page .knowledge-base-dropzone em,
.knowledge-base-upload .knowledge-base-dropzone span,
.knowledge-base-upload .knowledge-base-dropzone em {
    max-width: 34rem;
    color: var(--muted);
    font-size: 0.9rem;
    font-style: normal;
    line-height: 1.45;
}

body.knowledge-base-page .knowledge-base-selected-file,
.knowledge-base-upload .knowledge-base-selected-file {
    margin: 4px 0 0;
    padding: 0.45rem 0.75rem;
    border-radius: 999px;
    background: rgba(27, 90, 249, 0.08);
    color: var(--survai-ink-1b5af9);
    font-size: 0.86rem;
    font-weight: 700;
}

body.knowledge-base-page .knowledge-base-progress,
.knowledge-base-upload .knowledge-base-progress {
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.08);
    margin-top: 14px;
}

body.knowledge-base-page .knowledge-base-progress span,
.knowledge-base-upload .knowledge-base-progress span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #1b5af9, #4f8dff);
    transition: width 180ms ease;
}

body.knowledge-base-page .knowledge-base-upload-footer,
.knowledge-base-upload .knowledge-base-upload-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-top: 16px;
}

body.knowledge-base-page .knowledge-base-upload-status,
.knowledge-base-upload .knowledge-base-upload-status {
    margin: 0;
    min-height: 1.25rem;
}

body.knowledge-base-page .knowledge-base-upload-status[data-tone='success'],
.knowledge-base-upload .knowledge-base-upload-status[data-tone='success'] {
    color: var(--success);
    font-weight: 700;
}

body.knowledge-base-page .knowledge-base-upload-status[data-tone='error'],
.knowledge-base-upload .knowledge-base-upload-status[data-tone='error'] {
    color: var(--danger);
    font-weight: 700;
}

body.knowledge-base-page .knowledge-base-upload-status[data-tone='loading'],
.knowledge-base-upload .knowledge-base-upload-status[data-tone='loading'] {
    color: var(--muted);
}

body.knowledge-base-page .knowledge-base-search {
    display: grid;
    gap: 6px;
    max-width: 420px;
    margin: 0 0 16px;
}

body.knowledge-base-page .knowledge-base-search span {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
}

body.knowledge-base-page .knowledge-base-table-wrap,
.knowledge-base-upload .knowledge-base-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

body.knowledge-base-page .knowledge-base-table,
.knowledge-base-upload .knowledge-base-table {
    min-width: 760px;
}

body.knowledge-base-page .knowledge-base-table__filename {
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.knowledge-base-page .knowledge-base-type-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: rgba(27, 90, 249, 0.08);
    color: var(--survai-ink-1b5af9);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}

body.knowledge-base-page .knowledge-base-status-pill {
    white-space: nowrap;
}

body.knowledge-base-page .knowledge-base-row-actions {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
}

body.knowledge-base-page .knowledge-base-empty {
    margin: 14px 0 0;
    padding: 18px;
    border: 1px dashed var(--line);
    border-radius: 12px;
    background: var(--theme-panel-soft);
    text-align: center;
}

@media (max-width: 1100px) {
    body.knowledge-base-page .knowledge-base-metrics {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    body.knowledge-base-page .knowledge-base-page-header {
        display: grid;
    }

    body.knowledge-base-page .knowledge-base-page-header__actions {
        width: 100%;
    }

    body.knowledge-base-page .knowledge-base-page-header__actions .btn {
        flex: 1 1 auto;
    }

    body.knowledge-base-page .knowledge-base-metrics {
        grid-template-columns: 1fr;
    }

    body.knowledge-base-page .knowledge-base-documents-card .section-head {
        display: grid;
        gap: 12px;
    }

    body.knowledge-base-page .knowledge-base-search {
        max-width: none;
    }
}

.supporting-upload,
.room-picker {
    display: grid;
    gap: 12px;
    border-top: 1px solid var(--line);
    padding-top: 18px;
}

.supporting-upload h2,
.room-picker h2 {
    margin-bottom: 4px;
}

.media-uploader-card {
    border-top: 1px solid var(--line);
}

.report-media-card {
    display: grid;
    gap: 12px;
    margin-bottom: 20px;
    padding: 20px;
}

.media-dropzone {
    position: relative;
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 6px;
    min-height: 136px;
    border: 1px dashed #c8d8ec;
    border-radius: 8px;
    padding: 20px;
    background: var(--survai-bg-soft);
    color: var(--muted);
    text-align: center;
    cursor: pointer;
    transition: border-color 150ms ease, background 150ms ease;
}

.media-dropzone strong {
    color: var(--navy);
}

.media-dropzone span {
    max-width: 680px;
}

.media-dropzone input {
    display: none !important;
}

.media-dropzone.is-dragover,
.media-dropzone.is-uploading {
    border-color: var(--accent);
    background: var(--soft-blue);
}

.media-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.media-status-panel {
    display: grid;
    gap: 12px;
}

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

.media-file-list {
    display: grid;
    gap: 8px;
}

.media-file-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 12px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 10px 12px;
    background: var(--survai-card);
}

.media-file-item strong {
    overflow-wrap: anywhere;
}

.media-file-item span {
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 800;
}

.media-file-item em {
    grid-column: 1 / -1;
    color: var(--muted);
    font-style: normal;
    overflow-wrap: anywhere;
}

.media-file-item.status-completed {
    border-color: #bbf7d0;
    background: var(--success-soft);
}

.media-file-item.status-completed span {
    color: var(--success);
}

.media-file-item.status-uploading,
.media-file-item.status-transcribing,
.media-file-item.status-selected {
    border-color: #c8d8ec;
    background: var(--survai-tint-f8fbff);
}

.media-file-item.status-uploading span,
.media-file-item.status-transcribing span,
.media-file-item.status-selected span {
    color: var(--accent-dark);
}

.media-file-item.status-failed {
    border-color: #fecdca;
    background: var(--danger-soft);
}

.media-file-item.status-failed span,
.media-file-item.status-failed em {
    color: var(--danger);
}

.media-transcript-preview {
    min-height: 170px;
    background: var(--survai-bg-soft);
}

.media-diagnostics {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    color: var(--muted);
    font-size: 0.86rem;
}

.media-diagnostics span {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 5px 10px;
    background: var(--survai-card);
}

.media-diagnostics strong {
    color: var(--navy);
}

.pdf-settings-card {
    margin-bottom: 20px;
}

.limitations-card {
    margin-bottom: 20px;
}

.limitations-block-list {
    display: grid;
    gap: 20px;
}

.limitation-block-title {
    margin: 0 0 8px;
    font-size: 1rem;
}

.limitation-actions {
    margin-top: 8px;
}

.pdf-settings-layout {
    display: grid;
    grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
    gap: 22px;
}

.cover-preview {
    display: grid;
    place-items: center;
    min-height: 260px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--survai-tint-f3f4f8);
    color: var(--muted);
    font-weight: 800;
    text-align: center;
}

.cover-preview img {
    width: 100%;
    height: 100%;
    min-height: 260px;
    object-fit: cover;
}

.file-input {
    display: grid;
    gap: 8px;
    max-width: 520px;
}

.file-input input {
    border: 1px dashed #c8d8ec;
    background: var(--survai-bg-soft);
    cursor: pointer;
}

.pill-grid {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.pill-toggle {
    display: inline-block;
    gap: 0;
    font-weight: 400;
}

.pill-toggle .pill-input {
    display: none;
    appearance: none;
}

.pill-toggle .pill-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 8px 14px;
    background: var(--survai-card);
    color: var(--navy);
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1;
    white-space: nowrap;
    max-width: 100%;
    transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}

.pill-toggle .pill-label:hover {
    border-color: #c8d8ec;
    background: var(--soft-blue);
}

.pill-toggle .pill-input:checked + .pill-label {
    border-color: var(--accent);
    background: var(--accent);
    color: #ffffff;
}

.pill-toggle .pill-input:focus + .pill-label {
    box-shadow: 0 0 0 3px rgba(11, 18, 32, 0.14);
}

.survey-context-card {
    display: grid;
    gap: 18px;
}

.context-block {
    display: grid;
    gap: 14px;
    border-top: 1px solid var(--line);
    padding-top: 18px;
}

.context-block:first-of-type {
    border-top: 0;
    padding-top: 0;
}

.context-block h3 {
    margin: 0;
    color: var(--navy);
    font-size: 1rem;
}

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

.context-field {
    display: grid;
    gap: 8px;
}

.context-field > span {
    color: var(--navy);
    font-weight: 800;
}

.context-pill-grid {
    align-items: flex-start;
    gap: 8px;
}

.voice-notes-card {
    display: grid;
    gap: 18px;
}

.voice-network-status {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 8px 12px;
    background: var(--survai-tint-eef9f2);
    color: var(--survai-ink-17653a);
    font-size: 0.86rem;
    font-weight: 800;
}

.voice-network-status.is-offline {
    background: var(--survai-tint-fff6e8);
    color: var(--survai-ink-8a4b00);
}

.voice-recorder-controls {
    position: sticky;
    top: 12px;
    z-index: 5;
    display: grid;
    gap: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
    background: var(--survai-card);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
}

.voice-recorder-meta {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 0.55fr);
    gap: 14px;
}

.voice-recorder-status {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
}

.voice-recorder-status strong {
    color: var(--navy);
    font-size: 1.35rem;
}

.recording-dot {
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: #cbd5e1;
}

.recording-dot.is-active {
    background: #d92d20;
    box-shadow: 0 0 0 6px rgba(217, 45, 32, 0.14);
}

.voice-button-row,
.voice-sync-actions,
.voice-note-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.voice-button-row .btn {
    min-height: 46px;
}

.voice-preview {
    width: 100%;
}

.voice-note-list {
    display: grid;
    gap: 12px;
}

.progress-voice-notes {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

.progress-voice-notes__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.progress-voice-notes__head h3 {
    margin: 0;
    color: var(--navy);
    font-size: 1rem;
    font-weight: 800;
}

.progress-voice-notes__head span {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 700;
}

.progress-voice-note__player {
    display: grid;
    gap: 8px;
    justify-items: start;
}

.progress-voice-note__player audio {
    width: 100%;
}

.compact-empty-state {
    padding: 16px;
    border: 1px dashed var(--line);
    border-radius: 8px;
    color: var(--muted);
    font-weight: 700;
}

.voice-note-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 0.65fr);
    gap: 12px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
    background: var(--survai-card);
}

.voice-note-item.is-offline {
    border-color: #f2c879;
    background: var(--survai-tint-fffaf0);
}

.voice-note-item.is-synced {
    border-color: #bde5ca;
    background: var(--survai-tint-f7fdf9);
}

.voice-note-main {
    display: grid;
    gap: 4px;
}

.voice-note-main strong {
    color: var(--navy);
}

.voice-note-main span,
.voice-note-main em {
    color: var(--muted);
    font-size: 0.9rem;
}

.voice-sync-actions .error-text {
    color: var(--survai-ink-b42318);
}

.transcription-progress-panel {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    background: var(--survai-tint-eff6ff);
}

.transcription-progress-panel.is-complete {
    border-color: #bbf7d0;
    background: var(--survai-tint-f0fdf4);
}

.transcription-progress-panel.is-error {
    border-color: #fecaca;
    background: var(--survai-tint-fef2f2);
}

.transcription-progress-heading {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--navy);
}

.transcription-progress-heading span {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 700;
    text-align: right;
}

.transcription-progress-track {
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--survai-tint-dbeafe);
}

.transcription-progress-track span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--primary);
    transition: width 0.25s ease;
}

.transcription-progress-panel.is-complete .transcription-progress-track span {
    background: var(--success);
}

.transcription-progress-panel.is-error .transcription-progress-track span {
    background: var(--danger);
}

.transcription-next-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    background: var(--survai-tint-f0fdf4);
    color: var(--navy);
    font-weight: 800;
}

.transcription-progress-panel[hidden],
.transcription-next-actions[hidden] {
    display: none;
}

.voice-note-item audio,
.voice-transcript-preview {
    width: 100%;
}

.voice-transcript-preview {
    grid-column: 1 / -1;
    border-top: 1px solid var(--line);
    padding-top: 10px;
}

.voice-transcript-preview p {
    margin: 8px 0 0;
    color: var(--navy);
}

.voice-note-actions {
    grid-column: 1 / -1;
}

.profile-image-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.profile-image-preview {
    width: 100%;
    max-height: 190px;
    border: 1px solid var(--line);
    border-radius: 8px;
    object-fit: cover;
    background: var(--survai-bg);
}

.signature-preview {
    object-fit: contain;
    padding: 12px;
}

.profile-textarea {
    min-height: 140px;
}

.profile-tools-list {
    display: grid;
    gap: 14px;
}

.profile-tool-row {
    display: grid;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 14px;
    background: var(--survai-bg-soft);
}

.profile-tool-row textarea {
    min-height: 110px;
}

.muted-tool-row {
    border-style: dashed;
    background: var(--survai-card);
}

.tool-checks,
.tool-checkbox-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tool-check-card {
    flex: 1 1 260px;
    align-items: flex-start;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    background: var(--survai-card);
}

.tool-check-card span {
    display: grid;
    gap: 4px;
}

.tool-check-card em {
    color: var(--muted);
    font-size: 0.86rem;
    font-style: normal;
    font-weight: 400;
}

.ai-settings-textarea {
    min-height: 190px;
    line-height: 1.5;
}

.ai-settings-textarea.tall-textarea {
    min-height: 280px;
}

.ai-settings-textarea.compact-textarea {
    min-height: 135px;
}

.ai-global-rules-panel {
    border: 1px solid rgba(10, 25, 47, 0.1);
    border-radius: 14px;
    padding: 20px;
    background:
        linear-gradient(135deg, rgba(27, 90, 249, 0.08), rgba(255, 255, 255, 0) 42%),
        var(--survai-bg-soft);
}

.quick-rule-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ai-exclusion-panel .ai-exclusion-warning {
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(255, 59, 79, 0.08);
    border: 1px solid rgba(255, 59, 79, 0.22);
}

.ai-exclusion-behaviour-field select {
    width: 100%;
    max-width: 420px;
}

.ai-terminology-panel {
    border: 1px solid rgba(10, 25, 47, 0.1);
    border-radius: 14px;
    padding: 20px;
    background:
        linear-gradient(135deg, rgba(27, 90, 249, 0.06), rgba(255, 255, 255, 0) 42%),
        var(--survai-card);
}

.ai-terminology-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.ai-terminology-control {
    display: grid;
    gap: 10px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 14px;
    padding: 14px;
    background: color-mix(in srgb, var(--survai-card) 88%, transparent);
}

.ai-terminology-add-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
}

.ai-terminology-chip-list {
    display: flex;
    min-height: 34px;
    flex-wrap: wrap;
    gap: 8px;
}

.ai-terminology-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(27, 90, 249, 0.14);
    border-radius: 999px;
    padding: 7px 10px;
    color: var(--survai-ink-1f2a44);
    background: rgba(27, 90, 249, 0.06);
    font-size: 0.82rem;
    font-weight: 650;
    line-height: 1;
    cursor: pointer;
}

.ai-terminology-chip strong {
    color: var(--survai-ink-7b8798);
    font-size: 0.9rem;
    line-height: 1;
}

@media (max-width: 760px) {
    .ai-terminology-grid {
        grid-template-columns: 1fr;
    }
}

.global-rules-mode {
    display: grid;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 14px;
    background: var(--survai-card);
}

.global-rules-mode legend {
    padding: 0 6px;
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 800;
}

.global-rules-preview {
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--survai-card);
}

.global-rules-preview summary {
    cursor: pointer;
    padding: 14px;
    color: var(--navy);
    font-weight: 800;
}

.global-rules-preview-grid {
    display: grid;
    gap: 14px;
    padding: 0 14px 14px;
}

.global-rules-preview-grid h3 {
    margin: 0 0 8px;
    font-size: 0.9rem;
}

.global-rules-preview-grid pre {
    min-height: 120px;
    max-height: 260px;
    margin: 0;
    overflow: auto;
    white-space: pre-wrap;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    background: var(--survai-tint-f7fafc);
    color: var(--navy);
    font: 0.86rem/1.5 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

.section-prompts-panel {
    gap: 16px;
}

.section-prompt-list {
    display: grid;
    gap: 14px;
}

.section-prompt-card {
    display: grid;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
    background: var(--survai-bg-soft);
}

.section-prompt-card span {
    color: var(--navy);
    font-weight: 800;
}

.section-prompt-textarea {
    min-height: 150px;
}

.processing-panel {
    display: flex;
    align-items: center;
    gap: 14px;
    border: 1px solid #c8d8ec;
    border-radius: 8px;
    padding: 14px;
    background: var(--survai-tint-f8fbff);
}

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

.processing-panel span {
    display: block;
    color: var(--muted);
}

.processing-card {
    display: grid;
    gap: 14px;
    margin-bottom: 20px;
    padding: 20px;
}

.processing-diagnostics-card,
.processing-log-card {
    display: grid;
    gap: 16px;
    margin-bottom: 20px;
}

.diagnostic-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
}

.diagnostic-stat,
.diagnostic-detail > div {
    display: grid;
    gap: 4px;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px;
    background: var(--survai-bg-soft);
}

.diagnostic-stat span,
.diagnostic-detail span {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 800;
    text-transform: uppercase;
}

.diagnostic-stat strong,
.diagnostic-detail strong {
    color: var(--navy);
    overflow-wrap: anywhere;
}

.diagnostic-detail {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
    gap: 10px;
}

.processing-admin-actions form {
    margin: 0;
}

.processing-log-list {
    display: grid;
    gap: 8px;
}

.processing-log-entry {
    display: grid;
    grid-template-columns: 140px 86px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 12px;
    background: var(--survai-bg-soft);
}

.processing-log-entry time,
.processing-log-entry strong {
    color: var(--muted);
    font-size: 0.82rem;
}

.processing-log-entry span {
    overflow-wrap: anywhere;
}

.processing-log-entry.log-error {
    border-color: #fecdca;
    background: var(--danger-soft);
}

.processing-log-entry.log-warning {
    border-color: #fed7aa;
    background: var(--survai-tint-fff7ed);
}

.processing-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.processing-head h2 {
    margin-bottom: 0;
}

.processing-count {
    color: var(--navy);
    font-weight: 900;
}

.progress-track {
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--survai-tint-e4ecf6);
}

.progress-track span {
    display: block;
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: var(--accent);
    transition: width 200ms ease;
}

.capture-sync-shell.card {
    margin-top: 1rem;
}

.capture-sync-panel {
    display: grid;
    gap: 0.75rem;
}

.capture-sync-status {
    margin: 0;
    font-weight: 700;
    color: var(--navy);
}

.capture-sync-overall {
    margin-top: 0.25rem;
}

.capture-sync-items {
    display: grid;
    gap: 0.85rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.capture-sync-item {
    padding-top: 0.85rem;
    border-top: 1px solid #e2e8f0;
}

.capture-sync-item:first-child {
    padding-top: 0;
    border-top: 0;
}

.capture-sync-item-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.65rem;
    margin-bottom: 0.35rem;
}

.capture-sync-item-label {
    font-size: 0.95rem;
    font-weight: 650;
    color: var(--navy);
}

.capture-sync-item-state {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--muted);
}

.capture-sync-item-bar {
    margin-top: 0.25rem;
}

.processing-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.processing-actions .btn {
    flex: 0 1 auto;
}

.queue-list {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.queue-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px 12px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 10px 12px;
    background: var(--survai-bg-soft);
}

.queue-item span {
    font-weight: 800;
    overflow-wrap: anywhere;
}

.queue-item strong {
    color: var(--muted);
    font-size: 0.82rem;
    text-transform: uppercase;
}

.queue-item em {
    grid-column: 1 / -1;
    color: var(--danger);
    font-style: normal;
}

.queue-retry-form {
    grid-column: 1 / -1;
    margin: 4px 0 0;
}

.queue-completed {
    border-color: #bbf7d0;
    background: var(--success-soft);
}

.queue-completed strong {
    color: var(--success);
}

.queue-processing {
    border-color: #c8d8ec;
    background: var(--survai-tint-f8fbff);
}

.queue-processing strong {
    color: var(--accent-dark);
}

.queue-failed {
    border-color: #fecdca;
    background: var(--danger-soft);
}

.queue-failed strong {
    color: var(--danger);
}

.spinner {
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    background: url('../icons/loading-spinner.svg') center / contain no-repeat;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.report-heading {
    align-items: center;
}

.report-heading-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-left: auto;
}

.report-type-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    max-width: 100%;
    min-height: 34px;
    border-radius: 999px;
    padding: 7px 13px;
    background: var(--survai-navy-surface);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 900;
    line-height: 1.15;
    letter-spacing: 0;
    white-space: nowrap;
    box-shadow: 0 8px 18px rgba(9, 23, 45, 0.14);
}

.report-type-badge--level-2 {
    background: #1b5af9;
}

.report-type-badge--level-3 {
    background: var(--survai-navy-surface);
}

.report-type-badge--level-3-plus {
    background: #16844a;
}

.report-type-badge--specific-defect {
    background: #b76b00;
}

.report-type-badge--diagnosis {
    background: #6d3ccf;
}

.report-type-badge--roof {
    background: #475569;
}

.workflow-title-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

body:has(.sidebar--workspace) .workflow-title-meta {
    display: none !important;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.inline-action-form {
    margin: 0;
}

.transcript-panel {
    margin-bottom: 20px;
    padding: 0;
}

.transcript-panel .section-head {
    padding: 16px 18px;
    margin-bottom: 0;
}

.transcript-panel [data-card-collapsible] {
    border-top: 1px solid var(--line);
}

.transcript-panel summary {
    cursor: pointer;
    padding: 16px 18px;
    font-weight: 900;
}

.transcript-panel pre {
    max-height: 360px;
    margin: 0;
    overflow: auto;
    border-top: 1px solid var(--line);
    padding: 18px;
    color: var(--survai-ink-253246);
    background: var(--survai-bg-soft);
    white-space: pre-wrap;
}

.supporting-document {
    display: grid;
    gap: 6px;
    padding: 18px;
    background: var(--survai-bg-soft);
}

.supporting-document strong {
    color: var(--navy);
}

.supporting-document-list {
    display: grid;
    gap: 10px;
    border-top: 1px solid var(--line);
    padding: 18px;
}

.supporting-document-item {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    background: var(--survai-bg-soft);
}

.supporting-document-preview {
    display: grid;
    width: 82px;
    height: 70px;
    place-items: center;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--survai-card);
    color: var(--navy);
    font-weight: 900;
}

.supporting-document-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.supporting-document-item strong,
.supporting-document-item span {
    display: block;
    overflow-wrap: anywhere;
}

.supporting-document-item span {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 800;
}

.supporting-document-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.supporting-document-layout {
    display: grid;
    grid-template-columns: minmax(240px, 0.75fr) minmax(0, 1fr);
    gap: 18px;
    border-top: 1px solid var(--line);
    padding: 18px;
}

.supporting-document-layout .supporting-document {
    border: 1px solid var(--line);
    border-radius: 8px;
}

.supporting-document img {
    width: 100%;
    max-height: 260px;
    border-radius: 8px;
    object-fit: contain;
    background: var(--survai-tint-eef3f8);
}

.sections-list {
    display: grid;
    gap: 18px;
}

.section-image-uploader {
    margin-top: 16px;
    border-top: 1px solid var(--line);
    padding-top: 16px;
}

.upload-dropzone {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 104px;
    border: 1px dashed #c8d8ec;
    border-radius: 8px;
    background: var(--survai-bg-soft);
    color: var(--muted);
    text-align: center;
    cursor: pointer;
    transition: border-color 150ms ease, background 150ms ease;
}

.upload-dropzone strong {
    color: var(--navy);
}

.upload-dropzone input {
    display: none;
}

.upload-dropzone.is-dragover,
.upload-dropzone.is-uploading {
    border-color: var(--accent);
    background: var(--soft-blue);
}

.wizard-documents-table-wrap {
    overflow-x: auto;
}

.wizard-documents-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

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

.wizard-documents-table th {
    color: var(--muted);
    font-weight: 600;
}

.section-image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;
}

.section-thumb {
    display: grid;
    gap: 8px;
    margin: 0;
    border: 0;
    border-radius: 8px;
    padding: 10px;
    background: var(--survai-card);
}

.section-thumb img {
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 6px;
    object-fit: cover;
    background: #f3f4f8;
}

.section-thumb figcaption {
    display: grid;
    gap: 8px;
}

.photo-review-card {
    display: grid;
    gap: 16px;
    margin-bottom: 20px;
    padding: 20px;
}

.photo-panel-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.photo-dropzone {
    position: relative;
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 6px;
    min-height: 126px;
    border: 1px dashed #c8d8ec;
    border-radius: 8px;
    padding: 20px;
    background: var(--survai-bg-soft);
    color: var(--muted);
    text-align: center;
    cursor: pointer;
    transition: border-color 150ms ease, background 150ms ease;
}

.photo-dropzone strong {
    color: var(--navy);
}

.photo-dropzone input {
    display: none !important;
}

.photo-dropzone.is-dragover,
.photo-dropzone.is-uploading {
    border-color: var(--accent);
    background: var(--soft-blue);
}

.sort-settings-panel {
    display: flex;
    flex-direction: column;
    gap: 18px;
    border: 1px solid var(--survai-border, #e6ebf2);
    border-radius: 18px;
    padding: 24px;
    margin: 14px 0 6px;
    background: var(--survai-card, #ffffff);
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 20px 44px rgba(16, 24, 40, 0.10);
    max-width: 680px;
    animation: sortSettingsPanelIn 180ms cubic-bezier(0.2, 0.8, 0.3, 1);
}

@keyframes sortSettingsPanelIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .sort-settings-panel {
        animation: none;
    }
}

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

.sort-settings-panel__head {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sort-settings-panel__eyebrow {
    margin: 0;
    color: var(--survai-blue, #1b5af9);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sort-settings-panel__title {
    margin: 0;
    color: var(--survai-navy-ink);
    font-size: 1.14rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.3;
}

.sort-settings-panel__subtitle {
    margin: 2px 0 0;
    color: var(--survai-secondary, #667085);
    font-size: 0.88rem;
    line-height: 1.5;
    max-width: 56ch;
}

.sort-settings-panel__options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 12px;
}

/* Blur tolerance: three short choices side by side (stacked on a phone). */
.sort-settings-panel__options--tolerance {
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 10px;
}

.sort-settings-option--compact {
    padding: 12px 14px;
}

/* What Sort Images does: three modes, stacked so each reads in full. */
.sort-settings-panel__options--modes {
    grid-template-columns: 1fr;
    gap: 10px;
}

.sort-settings-panel__group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 16px;
    border-top: 1px solid var(--survai-border, #e6ebf2);
}

.sort-settings-panel__group[hidden] {
    display: none;
}

.sort-settings-panel__group .sort-settings-panel__subtitle {
    margin: 0;
}

.sort-settings-panel__group-title {
    margin: 0;
    color: var(--survai-navy-ink);
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.3;
}

.sort-settings-option {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--survai-border, #e6ebf2);
    border-radius: 14px;
    background: var(--survai-card, #ffffff);
    cursor: pointer;
    transition: border-color 140ms ease, background-color 140ms ease, box-shadow 140ms ease;
}

.sort-settings-option:hover {
    border-color: rgba(27, 90, 249, 0.45);
    box-shadow: 0 6px 18px rgba(16, 24, 40, 0.07);
}

.sort-settings-option:has(input:checked) {
    border-color: var(--survai-blue, #1b5af9);
    background: linear-gradient(180deg, rgba(27, 90, 249, 0.055), rgba(27, 90, 249, 0.02));
    box-shadow: inset 0 0 0 1px var(--survai-blue, #1b5af9), 0 8px 22px rgba(27, 90, 249, 0.12);
}

.sort-settings-option:has(input:focus-visible) {
    box-shadow: var(--survai-focus, 0 0 0 4px rgba(27, 90, 249, 0.18));
}

/* Native radio stays for a11y/tests but the drawn indicator is the visual. */
.sort-settings-option input[type="radio"] {
    position: absolute;
    width: 18px;
    height: 18px;
    margin: 0;
    opacity: 0;
    pointer-events: none;
}

.sort-settings-option__indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    margin-top: 1px;
    flex: 0 0 auto;
    border: 2px solid #c3cdda;
    border-radius: 999px;
    background: var(--survai-card);
    transition: border-color 140ms ease, box-shadow 140ms ease;
}

.sort-settings-option__indicator::after {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--survai-blue, #1b5af9);
    transform: scale(0);
    transition: transform 140ms cubic-bezier(0.2, 0.8, 0.3, 1);
}

.sort-settings-option:has(input:checked) .sort-settings-option__indicator {
    border-color: var(--survai-blue, #1b5af9);
}

.sort-settings-option:has(input:checked) .sort-settings-option__indicator::after {
    transform: scale(1);
}

.sort-settings-option__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    border-radius: 11px;
    color: var(--survai-blue, #1b5af9);
    background: var(--soft-blue, #e9f1fb);
    transition: background-color 140ms ease, color 140ms ease;
}

.sort-settings-option:has(input:checked) .sort-settings-option__icon {
    color: #ffffff;
    background: var(--survai-blue, #1b5af9);
}

.sort-settings-option__icon svg {
    width: 21px;
    height: 21px;
}

.sort-settings-option__body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.sort-settings-option__name {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.sort-settings-option__body strong {
    color: var(--survai-navy-ink);
    font-size: 0.94rem;
    font-weight: 600;
    letter-spacing: -0.005em;
}

.sort-settings-option__badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 999px;
    color: var(--survai-ink-14804a);
    background: rgba(34, 197, 94, 0.12);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    white-space: nowrap;
}

.sort-settings-option__body em {
    font-style: normal;
    color: var(--survai-secondary, #667085);
    font-size: 0.84rem;
    line-height: 1.5;
}

.sort-settings-panel__footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-top: 1px solid var(--survai-border, #e6ebf2);
    padding-top: 16px;
}

.sort-settings-panel__note {
    margin: 0;
    color: var(--survai-muted, #98a2b3);
    font-size: 0.82rem;
}

.sort-settings-panel__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

@media (max-width: 560px) {
    .sort-settings-panel {
        padding: 18px;
        gap: 14px;
    }

    .sort-settings-panel__footer {
        flex-direction: column;
        align-items: stretch;
    }

    .sort-settings-panel__note {
        order: 2;
        text-align: center;
    }

    .sort-settings-panel__actions {
        margin-left: 0;
    }

    .sort-settings-panel__actions .btn {
        flex: 1 1 auto;
    }
}

.photo-bulk-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 10px;
    border: 1px solid #c8d8ec;
    border-radius: 8px;
    padding: 12px;
    background: var(--survai-tint-f8fbff);
}

.photo-bulk-toolbar[hidden] {
    display: none;
}

.photo-bulk-toolbar > strong {
    align-self: center;
    min-width: 92px;
    color: var(--navy);
}

.photo-bulk-toolbar label {
    min-width: min(220px, 100%);
}

.photo-grid-review {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 14px;
}

.photo-review-item {
    position: relative;
    display: grid;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    background: var(--survai-card);
}

.photo-review-item.is-selected {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(45, 105, 219, 0.16);
}

.photo-select-check {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 3;
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    background: rgba(9, 30, 66, 0.76);
    cursor: pointer;
}

.is-photo-selecting .photo-select-check {
    display: flex;
}

/* The checkbox fills the whole 36px ring so every tap lands on it and one
   tap always toggles (a small centred input made hits inconsistent). */
.photo-select-check input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 0;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.photo-select-check span {
    width: 22px;
    height: 22px;
    border: 2px solid var(--survai-card);
    border-radius: 999px;
}

.photo-select-check input:checked + span {
    border-color: var(--primary);
    background: var(--primary);
    box-shadow: inset 0 0 0 4px #ffffff;
}

.photo-review-item.status-matched,
.photo-review-item.status-annotated {
    border-color: #bbf7d0;
}

.photo-review-item.status-failed {
    border-color: #fecdca;
    background: var(--danger-soft);
}

.photo-thumb-pair {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.photo-thumb-pair img {
    width: 100%;
    aspect-ratio: 4 / 3;
    border: 0;
    border-radius: 6px;
    object-fit: cover;
    background: var(--survai-tint-f3f4f8);
}

.photo-thumb-pair img:only-child {
    grid-column: 1 / -1;
}

.photo-form {
    display: grid;
    gap: 12px;
}

.photo-meta {
    display: grid;
    gap: 3px;
}

.photo-meta strong {
    overflow-wrap: anywhere;
}

.photo-meta span,
.photo-meta em {
    color: var(--muted);
    font-size: 0.88rem;
    font-style: normal;
}

.photo-notes {
    min-height: 86px;
}

.photo-checks {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.photo-actions {
    margin-top: 0;
}

.matched-photo-strip {
    display: grid;
    gap: 10px;
    margin-top: 16px;
    border-top: 1px solid var(--line);
    padding-top: 16px;
}

.matched-photo-strip > strong {
    color: var(--navy);
}

.matched-photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}

.matched-photo-grid figure {
    display: grid;
    gap: 6px;
    margin: 0;
}

.matched-photo-grid img {
    width: 100%;
    aspect-ratio: 4 / 3;
    border: 0;
    border-radius: 6px;
    object-fit: cover;
    background: var(--survai-tint-f3f4f8);
}

.matched-photo-grid figcaption {
    color: var(--muted);
    font-size: 0.84rem;
}

/* Shared photo card: the Media Manager grid card rendered on any page
   (rolls, output modal grids, uploads page) — same markup, same look,
   clicking opens the image editor. */
.survai-shared-photo-card {
    position: relative;
    display: block;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 5px;
    background: transparent;
    box-shadow: none;
}

.survai-shared-photo-card .image-manager-card__frame {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--survai-tint-e8edf4);
}

.survai-photo-card-delete {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: none;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.62);
    color: #ffffff;
    cursor: pointer;
}

.survai-photo-card-delete svg { width: 15px; height: 15px; }
/* On the shared photo tile the top corners hold the selection circle and the AI badge and the
   bottom-right the eye, so delete sits bottom-left. */
.survai-photo-tile .survai-photo-card-delete {
    top: auto;
    right: auto;
    bottom: 6px;
    left: 6px;
    width: 28px;
    height: 28px;
    border-radius: 5px;
}
.survai-photo-card-delete:hover,
.survai-photo-card-delete:focus-visible { background: #dc2626; }
.survai-photo-card-delete:disabled { opacity: 0.5; cursor: default; }

/* Quick-add-cost: existing costs listed inside the Add Repair card. */
.output-repair-modal__existing {
    padding: 10px 14px;
    border: 1px solid rgba(37, 99, 235, 0.25);
    border-radius: 10px;
    background: rgba(37, 99, 235, 0.06);
}

.output-repair-modal__existing[hidden] { display: none; }

.output-repair-modal__existing-title {
    margin: 0 0 6px;
    color: var(--navy);
    font-size: 0.85rem;
    font-weight: 800;
}

.output-repair-modal__existing-list {
    margin: 0;
    padding-left: 18px;
    font-size: 0.85rem;
    color: var(--survai-text-soft);
}

.output-repair-modal__existing-list li { margin: 2px 0; }

/* Smart job tools inside the quick-add card: section jobs + AI wand. */
.output-repair-modal__smart {
    display: grid;
    gap: 10px;
    padding: 12px 14px;
    border: 1px dashed var(--survai-border-mid);
    border-radius: 10px;
    background: var(--survai-bg-soft);
}

.output-repair-modal__smart[hidden] { display: none; }

.output-repair-modal__wand {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.output-repair-modal__wand .form-note { margin: 0; flex: 1 1 220px; }

.output-repair-modal__price-note {
    font-style: normal;
    color: var(--survai-ink-2563eb);
    font-weight: 800;
    font-size: 0.78rem;
}

.survai-shared-photo-card .image-manager-card__open {
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    cursor: pointer;
}

.survai-shared-photo-card .image-manager-card__open img,
.survai-shared-photo-card .image-manager-card__open .image-manager-photo-image,
.survai-shared-photo-card .image-manager-card__open img[data-photo-preview-img] {
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: none;
    aspect-ratio: auto !important;
    border: 0;
    border-radius: 0 !important;
    object-fit: cover !important;
    object-position: center;
    background: var(--survai-tint-e8edf4);
}

.survai-shared-photo-card__caption {
    padding: 6px 8px 8px;
    overflow: hidden;
    color: var(--muted);
    font-size: 0.8rem;
    white-space: nowrap;
    text-overflow: ellipsis;
}

[data-image-gallery-open] {
    cursor: pointer;
}

.matched-photo-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.matched-photo-actions .btn {
    width: 100%;
    justify-content: center;
}

.floating-report-toolbar {
    position: fixed;
    left: 304px;
    bottom: 22px;
    z-index: 80;
    display: grid;
    gap: 10px;
    align-items: end;
    width: min(320px, calc(100vw - 34px));
    pointer-events: none;
}

.floating-toolbar-buttons,
.floating-toolbar-panel {
    pointer-events: auto;
}

.floating-toolbar-buttons {
    display: inline-flex;
    width: max-content;
    overflow: hidden;
    border: 1px solid rgba(100, 116, 139, 0.28);
    border-radius: 14px;
    background: var(--survai-bg-tint);
    box-shadow: 0 18px 42px rgba(11, 18, 32, 0.2), 0 2px 8px rgba(11, 18, 32, 0.08);
}

.floating-tool-button {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    overflow: hidden;
    border: 0;
    border-right: 1px solid var(--line);
    color: var(--survai-text-deep);
    background: color-mix(in srgb, var(--survai-card) 72%, transparent);
    font-size: 1.35rem;
    font-weight: 900;
    line-height: 1;
    cursor: pointer;
}

.floating-tool-button:last-child {
    border-right: 0;
}

.floating-tool-button:hover,
.floating-tool-button:focus-visible {
    color: var(--survai-text-deep);
    background: var(--survai-border-soft);
    outline: none;
}

.floating-toolbar-buttons .floating-tool-button:focus-visible {
    box-shadow: none !important;
}

a.floating-tool-button {
    box-sizing: border-box;
    margin: 0;
    text-decoration: none;
    color: inherit;
    -webkit-appearance: none;
    appearance: none;
}

.floating-toolbar-buttons > .floating-tool-button:first-child {
    border-top-left-radius: 13px;
    border-bottom-left-radius: 13px;
}

.floating-toolbar-buttons > .floating-tool-button:last-child {
    border-top-right-radius: 13px;
    border-bottom-right-radius: 13px;
}

.floating-tool-glyph,
.floating-download-glyph {
    display: block;
    width: 28px;
    height: 28px;
    color: var(--survai-text-deep);
    fill: none;
    stroke: currentColor;
    stroke-width: 2.1;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.floating-tool-glyph {
    overflow: visible;
}

.floating-download-glyph {
    overflow: visible;
}

.floating-toolbar-panel {
    display: grid;
    max-height: min(440px, calc(100vh - 130px));
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--survai-card);
    box-shadow: 0 18px 60px rgba(11, 18, 32, 0.2);
}

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

.floating-toolbar-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--line);
    padding: 12px 14px;
    color: var(--navy);
}

.floating-toolbar-panel-head button {
    display: grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--navy);
    background: var(--survai-card);
    cursor: pointer;
}

.floating-section-list {
    display: grid;
    max-height: min(370px, calc(100vh - 190px));
    overflow: auto;
    padding: 8px;
}

.floating-section-list a {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) 38px;
    gap: 8px;
    align-items: center;
    border-radius: 6px;
    padding: 6px 8px;
    color: var(--ink);
    font-size: 0.92rem;
    font-weight: 800;
}

/* Slight indent for child sub-section entries so the hierarchy reads clearly. */
.floating-section-list a.is-child-section {
    padding-left: 22px;
}

.floating-section-list a:hover,
.floating-section-list a:focus-visible {
    background: var(--soft-blue);
    outline: none;
}

.floating-section-list a.is-active {
    background: var(--soft-blue);
    box-shadow: inset 0 0 0 1px #c8d8ec;
}

.floating-section-list .floating-section-order {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border-radius: 999px;
    color: #ffffff;
    background: var(--survai-navy-surface);
    font-size: 0.72rem;
    font-weight: 800;
}

.floating-section-list .floating-section-title {
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: 0.86rem;
    font-weight: 700;
    line-height: 1.25;
}

.floating-section-list .condition-rating-badge {
    justify-self: end;
    width: 34px;
    height: 34px;
    aspect-ratio: 1 / 1;
    font-size: 0.68rem;
}

.floating-section-list .form-note {
    padding: 10px;
}

.live-capture-mode-row {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 10px;
}

.live-capture-mode-btn {
    flex: 1;
    max-width: 160px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    font-weight: 800;
    font-size: 0.78rem;
    letter-spacing: 0.02em;
    cursor: pointer;
}

.live-capture-mode-btn.active {
    background: color-mix(in srgb, var(--survai-card) 95%, transparent);
    color: var(--survai-text-strong);
    border-color: rgba(255, 255, 255, 0.92);
}

.capture-preview-touch-layer {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    bottom: var(--capture-tray-h, 168px);
    z-index: 4;
    touch-action: manipulation;
    cursor: pointer;
}

.capture-focus-square {
    position: absolute;
    z-index: 5;
    width: 72px;
    height: 72px;
    margin: 0;
    border: 2px solid rgba(255, 214, 10, 0.95);
    border-radius: 4px;
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.45),
        0 0 0 9999px rgba(0, 0, 0, 0.05);
    opacity: 1;
    pointer-events: none;
    transition: opacity 0.6s ease;
}

.capture-focus-square.is-fading {
    opacity: 0;
}

.capture-focus-square.is-focus-grid::after {
    position: absolute;
    inset: 0;
    content: "";
    pointer-events: none;
    background:
        linear-gradient(rgba(255, 214, 10, 0.55), rgba(255, 214, 10, 0.55)) 50% 0 / 1px 100% no-repeat,
        linear-gradient(rgba(255, 214, 10, 0.55), rgba(255, 214, 10, 0.55)) 0 50% / 100% 1px no-repeat;
    opacity: 0.95;
}

.capture-training-reticle {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 5;
    width: 104px;
    height: 104px;
    margin: 0;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.capture-training-reticle-ring {
    position: absolute;
    inset: 0;
    border: 2px solid rgba(255, 214, 10, 0.85);
    border-radius: 999px;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.35);
}

.capture-training-reticle-cross::before,
.capture-training-reticle-cross::after {
    position: absolute;
    background: rgba(255, 214, 10, 0.75);
    content: "";
}

.capture-training-reticle-cross::before {
    top: 50%;
    left: 18%;
    width: 64%;
    height: 2px;
    margin-top: -1px;
}

.capture-training-reticle-cross::after {
    top: 18%;
    left: 50%;
    width: 2px;
    height: 64%;
    margin-left: -1px;
}

.capture-training-tap-chip {
    position: absolute;
    right: 12px;
    bottom: calc(var(--capture-tray-h, 168px) + 14px);
    z-index: 6;
    max-width: min(100%, 280px);
    padding: 8px 11px;
    border-radius: 12px;
    color: #0f172a;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.28);
    font-size: 0.78rem;
    line-height: 1.3;
    pointer-events: auto;
    touch-action: none;
    cursor: grab;
}

.capture-training-tap-chip.is-dragging {
    cursor: grabbing;
}

.capture-training-tap-chip.is-positioned {
    right: auto;
    bottom: auto;
}

.capture-training-tap-chip strong {
    display: block;
    margin-bottom: 3px;
    font-size: 0.84rem;
    font-weight: 850;
    line-height: 1.2;
}

.capture-training-tap-chip span {
    display: block;
    color: #334155;
}

.capture-training-hint-body {
    display: block;
    margin-top: 4px;
    white-space: pre-line;
    font-weight: 650;
    line-height: 1.32;
}

.capture-exposure-compact {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 auto 8px;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.35);
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 800;
}

.capture-exposure-label {
    opacity: 0.85;
}

.capture-exposure-step {
    width: 34px;
    min-height: 34px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 999px;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
}

.capture-exposure-slider {
    width: min(160px, 38vw);
    accent-color: #ffd60a;
    cursor: pointer;
}

.capture-preview .capture-exposure-compact.capture-exposure-overlay {
    position: absolute;
    z-index: 12;
    left: 8px;
    top: 8px;
    margin: 0;
    max-width: calc(100% - 16px);
    padding: 8px 12px;
    pointer-events: auto;
    touch-action: manipulation;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
    opacity: 1;
    transition: opacity 380ms ease;
}

.capture-preview .capture-exposure-compact.capture-exposure-overlay[hidden] {
    display: none !important;
}

.capture-preview .capture-exposure-compact.capture-exposure-overlay.is-fading-out {
    opacity: 0;
}

.capture-pause-recording-button {
    display: grid;
    width: 58px;
    height: 58px;
    margin: 0;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
    cursor: pointer;
}

.capture-pause-recording-button.is-paused .capture-pause-icon::before,
.capture-pause-recording-button.is-paused .capture-pause-icon::after {
    display: none;
}

.capture-pause-recording-button.is-paused .capture-pause-icon {
    width: 0;
    height: 0;
    margin-left: 5px;
    border-style: solid;
    border-width: 9px 0 9px 14px;
    border-color: transparent transparent transparent #ffffff;
    background: none;
}

.capture-recorder-controls {
    position: relative;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}

.capture-control-tray .capture-record-toggle {
    position: absolute;
    left: 50%;
    z-index: 5;
    transform: translateX(-50%);
}

.capture-control-tray.is-video-mode .capture-record-toggle {
    position: relative;
    left: auto;
    transform: none;
}

.capture-top-camera-tools {
    position: absolute;
    z-index: 6;
    top: max(10px, env(safe-area-inset-top));
    left: max(10px, env(safe-area-inset-left));
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px;
    max-width: min(240px, 46vw);
    pointer-events: none;
}

.capture-top-camera-tools > * {
    pointer-events: auto;
}

.capture-top-camera-tools[hidden] {
    display: none !important;
}

.capture-top-camera-tools .capture-flash-button,
.capture-top-camera-tools .capture-flip-button {
    position: relative !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
}

.capture-top-camera-tools .capture-torch-cluster {
    margin-right: 0;
}

.capture-record-toggle.btn-record {
    border-radius: 999px;
    transition: transform 0.16s ease, box-shadow 0.16s ease, width 0.16s ease, height 0.16s ease;
}

.capture-record-toggle.btn-record--idle .capture-record-icon {
    display: none;
}

.capture-record-toggle.btn-record--active .capture-record-icon {
    display: block;
}

.capture-record-toggle.btn-record--idle {
    width: 88px !important;
    height: 88px !important;
    min-height: 88px !important;
    border: 3px solid rgba(255, 255, 255, 0.38) !important;
    background: radial-gradient(circle at 50% 38%, #ff3b30, #b91c1c) !important;
    box-shadow:
        0 0 0 6px rgba(255, 255, 255, 0.07),
        0 12px 32px rgba(0, 0, 0, 0.45) !important;
}

.capture-record-toggle.btn-record--active {
    width: 72px !important;
    height: 72px !important;
    min-height: 72px !important;
    border: 4px solid rgba(255, 255, 255, 0.9) !important;
    background: radial-gradient(circle at 50% 50%, #ff3b30 40%, #c62828 44%) !important;
    box-shadow:
        0 0 0 2px rgba(255, 59, 48, 0.5),
        0 10px 28px rgba(0, 0, 0, 0.38) !important;
}

.capture-record-toggle.btn-record--active .capture-record-icon::before {
    inset: 5px;
    border-radius: 999px;
    background: #ff3b30;
}

.capture-record-toggle.btn-record--active.is-recording .capture-record-icon::before {
    inset: 5px;
    border-radius: 4px;
    background: #ffffff;
}

.capture-control-tray.is-capture-idle-survey .capture-recorder-controls {
    justify-content: center;
}

.capture-control-tray.is-capture-idle-survey .capture-gallery.live-photo-strip:empty {
    display: none !important;
}

.capture-torch-cluster {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    flex: 0 0 auto;
}

.capture-torch-auto-chip {
    min-width: 44px;
    padding: 3px 8px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.92);
    background: rgba(0, 0, 0, 0.35);
    font-size: 0.62rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.capture-torch-auto-chip[aria-pressed="true"] {
    color: #0f172a;
    background: #ffd60a;
    border-color: rgba(255, 214, 10, 0.95);
    box-shadow: 0 0 0 2px rgba(255, 214, 10, 0.25);
}

.capture-control-tray .capture-pause-recording-button {
    margin-right: 36px;
}

.capture-control-tray .capture-photo-button:not(.capture-video-record-button) {
    margin-left: 36px;
}

.capture-control-tray.is-video-mode .capture-pause-recording-button {
    margin-right: 0;
}

.capture-control-tray.is-video-mode .capture-photo-button.capture-video-record-button {
    margin-left: 0;
}

.capture-control-tray .capture-toolbar-button {
    flex: 0 0 auto;
}

.capture-control-tray .capture-video-record-button {
    display: none;
}

.capture-control-tray.is-video-mode .capture-video-record-button {
    display: grid !important;
}

.capture-control-tray.is-video-mode .capture-recorder-controls {
    justify-content: center;
}

.capture-control-tray.is-video-mode .capture-photo-button:not(.capture-video-record-button) {
    display: grid !important;
    margin-left: 0;
}

.capture-control-tray.is-video-mode .capture-record-toggle {
    width: 58px !important;
    height: 58px !important;
    min-height: 58px !important;
}

.capture-control-tray.is-video-mode .capture-video-record-button {
    width: 78px !important;
    height: 78px !important;
    min-height: 78px !important;
    padding: 0;
    border-radius: 999px;
    font-size: 0.68rem;
    line-height: 1.05;
    text-align: center;
    color: #ffffff;
    background: radial-gradient(circle at 50% 50%, #ff3b30 42%, #9f1239 46%);
    border: 4px solid rgba(255, 255, 255, 0.88);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.38);
}

.workflow-nav-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.workflow-nav-heading h2 {
    margin-bottom: 0;
}

.workflow-page-card {
    display: grid;
    gap: 18px;
    margin-bottom: 20px;
    padding: 22px;
}

.workflow-builder-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    align-items: start;
}

.output-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    margin-bottom: 20px;
}

.output-summary-card,
.output-preview-card {
    display: grid;
    gap: 14px;
    padding: 22px;
}

.output-workspace-shell {
    display: grid;
    /* One full-width column, and every panel/child stretched across it. The
       single implicit `auto` track otherwise sized to the ACTIVE panel's
       content (Report tab's wide QA bar = full width; Fixed Text's narrow text
       = shrunk), and justify-items:stretch guarantees each panel fills the
       column rather than left/right-aligning to its own content width. */
    grid-template-columns: minmax(0, 1fr);
    justify-items: stretch;
    gap: 18px;
    width: 100%;
}

.output-workspace-shell > * {
    min-width: 0;
    width: 100%;
    justify-self: stretch;
}

.output-qa-summary-bar {
    display: grid;
    grid-template-columns: repeat(8, minmax(110px, 1fr));
    gap: 10px;
    min-width: 0;
}

.output-qa-summary-item {
    display: grid;
    gap: 5px;
    min-width: 0;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 12px;
    padding: 12px;
    background: var(--survai-card);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.05);
}

.output-qa-summary-item span {
    overflow: hidden;
    color: var(--survai-secondary-slate);
    font-size: 0.72rem;
    font-weight: 800;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

.output-qa-summary-item strong {
    color: var(--navy);
    font-size: clamp(1.05rem, 1.45vw, 1.5rem);
    font-weight: 900;
    line-height: 1;
}

.output-workspace-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 18px;
    padding: 8px;
    background: var(--survai-card);
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.05);
    scrollbar-width: thin;
}

.output-workspace-tab {
    flex: 0 0 auto;
    border: 0;
    border-radius: 11px;
    padding: 11px 14px;
    background: transparent;
    color: var(--survai-ink-3d4861);
    cursor: pointer;
    font: inherit;
    font-weight: 500;
    white-space: nowrap;
}

.output-workspace-tab.is-active {
    background: transparent;
    color: var(--survai-ink-3d4861);
    font-weight: 800;
    box-shadow: none;
}

.output-workspace-panel,
.output-workspace-panel.is-active {
    display: grid;
    gap: 18px;
    background: transparent !important;
    background-color: transparent !important;
    box-shadow: none !important;
}

/* output.php — neutral workspace and cards (no blue radial wash behind sections) */
body.output-report-page {
    background: var(--sai-workspace-soft, #f8fafc) !important;
}

body.output-report-page .main-panel {
    background: var(--sai-workspace-soft, #f8fafc) !important;
    overflow-anchor: none;
}

body.output-report-page .output-workspace-shell .report-renderer .output-preview-card,
body.output-report-page .output-workspace-shell .report-renderer .output-summary-card,
body.output-report-page .output-workspace-shell .report-renderer .report-render-report-body,
body.output-report-page .output-workspace-shell .report-renderer .condition-ratings-panel {
    border: 1px solid rgba(15, 23, 42, 0.1) !important;
    background: #ffffff !important;
    box-shadow: 0 10px 32px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04) !important;
}

body.output-report-page .output-workspace-shell .report-renderer .output-preview-card:hover,
body.output-report-page .output-workspace-shell .report-renderer .output-summary-card:hover {
    box-shadow: 0 12px 36px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.05) !important;
}

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

.output-workspace-loading {
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 14px;
    padding: 28px;
    background: var(--survai-card);
    color: var(--survai-secondary-slate);
    font-weight: 750;
}

.output-room-generation-head {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    justify-content: space-between;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 16px;
    padding: 16px;
    background: var(--survai-card);
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.05);
}

.output-room-generation-head h3 {
    margin: 0 0 4px;
    color: var(--navy);
    font-weight: 900;
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .output-room-generation-head .btn-primary,
body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .output-room-generation-head .btn-primary:hover,
body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .output-room-generation-head .btn-primary:focus-visible {
    color: #ffffff !important;
}

.output-room-generation-status {
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 14px;
    padding: 13px 14px;
    background: var(--survai-card);
    color: var(--survai-ink-3d4861);
    font-weight: 750;
}

.output-room-generation-status.is-loading {
    color: var(--survai-secondary-slate);
}

.output-room-generation-status.is-success {
    border-color: rgba(34, 197, 94, 0.28);
    background: var(--survai-tint-f0fdf4);
}

.output-room-generation-status.is-error {
    border-color: rgba(220, 38, 38, 0.26);
    background: var(--survai-tint-fef2f2);
    color: var(--survai-ink-991b1b);
}

.output-room-generation-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.output-room-generation-summary span {
    display: grid;
    gap: 3px;
    color: var(--survai-secondary-slate);
    font-size: 0.76rem;
    font-weight: 850;
    text-transform: uppercase;
}

.output-room-generation-summary strong {
    color: var(--navy);
    font-size: 1.05rem;
}

.output-accommodation-table {
    display: grid;
    overflow: hidden;
    gap: 0;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 14px;
    background: var(--survai-card);
}

.output-accommodation-workspace {
    background: var(--survai-card);
}

.output-accommodation-add {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 14px;
    padding: 12px;
    background: var(--survai-card);
}

.output-accommodation-add label {
    flex: 1 1 auto;
    min-width: 0;
}

.output-accommodation-bulk-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 14px;
    padding: 10px 12px;
    background: var(--survai-bg-hover);
}

.output-accommodation-bulk-bar[hidden] {
    display: none;
}

/* Nothing selected: the bar is not shown at all — it appears when a row is
   ticked (surveyor, 6 Sep 2026: an always-present bar took space, worst on a
   phone). */
.output-accommodation-bulk-bar.is-empty {
    display: none;
}

.output-accommodation-bulk-bar.is-empty [data-output-room-bulk-action],
.output-accommodation-bulk-bar.is-empty label {
    opacity: 0.45;
}

.output-accommodation-bulk-bar strong {
    color: var(--survai-ink-3d4861);
    font-size: 0.9rem;
}

.output-accommodation-bulk-bar label {
    min-width: 140px;
}

.output-accommodation-bulk-bar input {
    min-height: 36px;
    border-radius: 10px;
}

.output-accommodation-row {
    display: grid;
    grid-template-columns: 48px minmax(150px, 1.05fr) minmax(90px, 0.55fr) minmax(110px, 0.65fr) minmax(280px, 1.8fr) minmax(120px, 0.65fr) minmax(132px, 0.58fr);
    gap: 0;
    align-items: center;
    border: 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 0;
    padding: 0;
    background: var(--survai-card);
    box-shadow: none;
    cursor: pointer;
}

.output-accommodation-row:last-child {
    border-bottom: 0;
}

.output-accommodation-row:not(.output-accommodation-row--head):hover,
.output-accommodation-row:not(.output-accommodation-row--head):focus {
    background: var(--survai-bg-soft);
    outline: none;
}

.output-accommodation-row.is-dragging {
    opacity: 0.68;
}

.output-accommodation-row--head {
    cursor: default;
    background: var(--survai-card);
    box-shadow: none;
    color: var(--survai-secondary-slate);
    font-size: 0.74rem;
    font-weight: 900;
    text-transform: uppercase;
}

.output-accommodation-row--head span,
.output-accommodation-cell,
.output-accommodation-actions {
    min-width: 0;
    padding: 13px 12px;
}

.output-accommodation-row input,
.output-accommodation-row textarea {
    border-radius: 10px;
    background: var(--survai-card) !important;
}

.output-accommodation-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    min-width: 0;
}

.output-accommodation-room-cell {
    display: flex;
    align-items: center;
    gap: 9px;
    font-weight: 400;
}

.output-accommodation-room-cell [data-room-name] {
    font-weight: 400;
}

.output-accommodation-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    min-width: 24px;
}

.output-accommodation-check input {
    width: 18px;
    height: 18px;
    accent-color: #3d4861;
}

.output-accommodation-drag-handle {
    display: inline-flex;
    width: 18px;
    height: 18px;
    color: var(--survai-muted-cool);
}

.output-accommodation-drag-handle svg,
.output-room-modal__close svg {
    width: 100%;
    height: 100%;
}

.output-accommodation-drag-handle svg {
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.output-accommodation-icon {
    display: block;
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
    pointer-events: none;
}

.output-accommodation-summary {
    overflow: hidden;
    color: var(--survai-secondary-strong);
    font-size: 0.9rem;
    line-height: 1.38;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.output-accommodation-image-count {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 999px;
    padding: 5px 9px;
    background: var(--survai-card);
    color: var(--survai-ink-3d4861);
    font-size: 0.8rem;
    font-weight: 850;
}

.output-accommodation-image-count--icon {
    gap: 6px;
    min-height: 36px;
    border-color: rgba(148, 163, 184, 0.18);
    border-radius: 9px;
    padding: 0 10px;
    color: var(--survai-secondary-slate);
    font-size: 0.86rem;
}

.output-accommodation-image-count--icon .output-accommodation-icon {
    width: 18px;
    height: 18px;
}

.output-accommodation-icon-btn {
    display: inline-grid;
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    place-items: center;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 9px;
    background: var(--survai-card);
    color: var(--survai-secondary-slate);
    cursor: pointer;
    padding: 0;
    flex: 0 0 auto;
}

.output-accommodation-icon-btn:hover {
    color: var(--survai-ink-3d4861);
}

.output-accommodation-icon-btn:focus-visible {
    outline: 2px solid rgba(27, 90, 249, 0.85);
    outline-offset: 2px;
}

.output-accommodation-icon-btn--danger:hover {
    border-color: rgba(185, 28, 28, 0.22);
    color: var(--survai-ink-b91c1c);
    background: var(--survai-tint-fef2f2);
}

.output-accommodation-icon-btn[aria-busy="true"] {
    opacity: 1;
    cursor: wait;
    pointer-events: none;
}

.output-accommodation-actions .output-icon-action,
.output-accommodation-regenerate-btn {
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    flex: 0 0 36px;
}

.output-accommodation-actions .output-icon-action .output-action-icon {
    width: 18px;
    height: 18px;
}

.output-accommodation-row.is-room-regenerating [data-regenerate-room] {
    pointer-events: none;
}

.output-accommodation-reorder-btn {
    display: none;
}

.output-accommodation-observations p,
.output-accommodation-images p {
    margin: 0;
    color: var(--survai-secondary-slate);
    font-size: 0.9rem;
}

.output-accommodation-observations textarea {
    min-height: 140px;
    font-size: 0.92rem;
}

.has-output-room-modal {
    overflow: hidden;
}

/* Touch devices: while a job card (room, legal, repair, FI) is open the page
   behind it is pinned in place. iOS Safari otherwise scrolls the document to
   reveal a focused field inside the fixed card and, when the keyboard closes,
   leaves the fixed layer displaced — a half-height card with the grey
   backdrop filling the rest of the screen (surveyor, 6 Sep 2026). app.js adds
   the modifier and restores the scroll position on close. */
html.has-output-room-modal.has-output-room-modal--pinned body {
    position: fixed;
    left: 0;
    right: 0;
    width: 100%;
    overflow: hidden;
}

.output-room-modal[hidden] {
    display: none;
}

.output-room-modal {
    position: fixed;
    z-index: 2000;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 22px;
    /* Clear the home indicator, or the card's last row sits under it. */
    padding-bottom: calc(22px + env(safe-area-inset-bottom, 0px));
}

.output-room-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.38);
}

.output-room-modal__panel {
    position: relative;
    z-index: 1;
    overflow: auto;
    width: min(980px, 100%);
    /* dvh, like the workspace shell around it: on iOS 100vh is the LARGE
       viewport, so a vh-sized card runs past the bottom of what is on
       screen and takes its footer with it. */
    max-height: min(860px, calc(100dvh - 44px - env(safe-area-inset-bottom, 0px)));
    border: 1px solid var(--survai-border-soft);
    border-radius: 18px;
    background: var(--survai-card);
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.28);
}

.output-room-modal__form {
    display: grid;
    gap: 16px;
    padding: 20px 62px;
}

.output-room-modal__head,
.output-room-modal__subhead,
.output-room-modal__foot {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

/* The room card header stays put while the card scrolls: it bleeds over the
   form's padding so content passes underneath it, never above it. */
.output-room-modal__head {
    position: sticky;
    top: 0;
    z-index: 6;
    margin: -20px -62px 0;
    padding: 16px 62px 12px;
    background: var(--survai-card);
    border-bottom: 1px solid var(--survai-border-soft);
}

.output-room-modal__foot .save-state {
    min-height: 1.2rem;
    color: var(--survai-secondary-slate);
    font-size: 0.86rem;
    font-weight: 800;
}

.output-room-modal__head h3,
.output-room-modal__subhead h4 {
    margin: 0;
    color: var(--navy);
}

.output-room-modal__close {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border: 1px solid var(--survai-border-soft);
    border-radius: 10px;
    background: var(--survai-card);
    color: var(--survai-secondary-slate);
    cursor: pointer;
    font-size: 1.35rem;
    line-height: 1;
}

.output-room-modal__grid {
    display: grid;
    grid-template-columns: minmax(220px, 1.2fr) minmax(140px, 0.7fr) minmax(160px, 0.8fr);
    gap: 12px;
}

.output-room-modal__field {
    display: grid;
    gap: 8px;
}

.output-room-observations-editor {
    min-height: 220px;
    max-height: min(52vh, 520px);
    overflow-y: auto;
    padding: 12px 14px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 10px;
    background: var(--survai-card);
    color: var(--survai-text-slate);
    font-size: 0.92rem;
    line-height: 1.5;
    outline: none;
}

.output-room-observations-editor:focus {
    border-color: rgba(59, 130, 246, 0.55);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

.output-room-observations-editor:empty::before {
    content: attr(data-placeholder);
    color: var(--survai-muted-cool);
    pointer-events: none;
}

.output-room-observation-bullet {
    position: relative;
    padding-left: 1.15rem;
    margin-bottom: 12px;
    min-height: 1.5em;
    white-space: pre-wrap;
    word-break: break-word;
}

.output-room-observation-bullet:last-child {
    margin-bottom: 0;
}

.output-room-observation-bullet::before {
    content: "•";
    position: absolute;
    left: 0;
    top: 0;
    color: var(--survai-secondary-slate);
    font-weight: 700;
}

/* Plain observation line: pasted paragraphs and "N. " numbered lines keep the
   format they arrived with — no forced bullet marker. */
.output-room-observation-line {
    margin-bottom: 12px;
    min-height: 1.5em;
    white-space: pre-wrap;
    word-break: break-word;
}

.output-room-observation-line:last-child {
    margin-bottom: 0;
}

.room-observation-list {
    margin: 0;
    padding: 0 0 0 1.1rem;
    list-style: disc;
    color: var(--survai-text-soft);
    font-size: 0.92rem;
}

.room-observation-list li {
    margin-bottom: 12px;
    line-height: 1.5;
}

.room-observation-list li:last-child {
    margin-bottom: 0;
}

.output-room-modal__field span,
.output-room-modal__grid label span {
    color: var(--survai-ink-3d4861);
    font-size: 0.82rem;
    /* Captions are labels: weight 700 like every other label (CSS_STYLE_GUIDE),
       not 850, which read as overly bold (surveyor, 29 Sep 2026). */
    font-weight: 700;
}

/* The saved-job preview is the job's own wording inside a caption label: it
   reads as prose, normal weight and grey, never as a caption. Specificity
   beats the caption rule above. */
.output-room-modal__field .output-repair-modal__job-preview,
.output-room-modal__grid label .output-repair-modal__job-preview {
    font-weight: 400;
    font-size: 0.82rem;
    /* !important: the generic `label span` caption rule sets its colour !important. */
    color: var(--survai-secondary-strong) !important;
}

.output-room-modal__photos {
    display: grid;
    gap: 12px;
    border-top: 1px solid var(--survai-border-soft);
    padding-top: 14px;
}

.output-room-modal__photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
    gap: 10px;
}

.output-room-modal__photo-grid a {
    display: block;
    overflow: hidden;
    border-radius: 10px;
    background: var(--survai-bg);
    aspect-ratio: 1;
}

.output-room-modal__photo-grid img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.output-accommodation-image-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

.output-accommodation-image-link {
    color: var(--navy);
    font-size: 0.86rem;
    font-weight: 850;
    text-decoration: none;
}

.output-accommodation-image-link:hover {
    text-decoration: underline;
}

.output-accommodation-image-strip a {
    display: block;
    overflow: hidden;
    border-radius: 10px;
    background: var(--survai-bg-line);
    aspect-ratio: 1;
}

.output-accommodation-image-strip img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.output-accommodation-actions .save-state {
    flex: 1 1 100%;
    min-width: 0;
    min-height: 1rem;
    font-size: 0.78rem;
    font-weight: 700;
}

.output-room-qa-list,
.output-legal-qa,
.output-legal-list {
    display: grid;
    gap: 12px;
}

.output-legal-summary-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(105px, 1fr));
    gap: 10px;
}

.output-legal-summary-grid div {
    display: grid;
    gap: 4px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 12px;
    padding: 12px;
    background: var(--survai-card);
}

.output-legal-summary-grid span {
    color: var(--survai-secondary-slate);
    font-size: 0.72rem;
    font-weight: 850;
    text-transform: uppercase;
}

.output-legal-summary-grid strong {
    color: var(--navy);
    font-size: 1.2rem;
    font-weight: 900;
}

.output-legal-add {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 14px;
    padding: 12px;
    background: var(--survai-card);
}

.output-legal-add label {
    flex: 1 1 auto;
    min-width: 0;
}

.output-legal-table {
    display: grid;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 14px;
    background: var(--survai-card);
}

.output-legal-row {
    display: grid;
    grid-template-columns: minmax(220px, 1.4fr) minmax(150px, 0.8fr) minmax(100px, 0.5fr) minmax(120px, 0.62fr) minmax(260px, 1.4fr) minmax(120px, 0.5fr);
    align-items: center;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    background: var(--survai-card);
    cursor: pointer;
}

.output-legal-row:last-child {
    border-bottom: 0;
}

.output-legal-row:not(.output-legal-row--head):hover,
.output-legal-row:not(.output-legal-row--head):focus {
    background: var(--survai-bg-soft);
    outline: none;
}

.output-legal-row--head {
    cursor: default;
    color: var(--survai-secondary-slate);
    font-size: 0.74rem;
    font-weight: 900;
    text-transform: uppercase;
}

.output-legal-row--head span,
.output-legal-cell,
.output-legal-actions {
    min-width: 0;
    padding: 13px 12px;
}

.output-legal-item-cell {
    display: flex;
    align-items: center;
    gap: 9px;
}

.output-legal-notes {
    overflow: hidden;
    color: var(--survai-secondary-strong);
    font-size: 0.9rem;
    line-height: 1.38;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.output-legal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
}

.output-legal-reorder-btn {
    display: none;
}

.output-legal-priority {
    display: inline-flex;
    width: fit-content;
    border-radius: 999px;
    padding: 5px 9px;
    background: var(--survai-bg-line);
    color: var(--survai-ink-3d4861);
    font-size: 0.78rem;
    font-weight: 900;
}

.output-legal-priority--high {
    background: var(--survai-tint-fff7ed);
    color: var(--survai-ink-9a3412);
}

.output-legal-priority--critical {
    background: var(--survai-tint-fef2f2);
    color: var(--survai-ink-991b1b);
}

.output-legal-priority--low {
    background: var(--survai-tint-f0fdf4);
    color: var(--survai-ink-166534);
}

.output-repair-schedule {
    display: grid;
    gap: 12px;
}

.output-repair-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 16px;
    padding: 16px;
    background: var(--survai-card);
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.05);
}

.output-repair-head__actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
    flex-shrink: 0;
}

.output-repair-head h3 {
    margin: 0 0 4px;
    color: var(--navy);
    font-weight: 900;
}

.output-repair-summary-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(118px, 1fr));
    gap: 10px;
}

.output-repair-summary-grid div {
    display: grid;
    gap: 5px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 12px;
    padding: 12px;
    background: var(--survai-card);
}

.output-repair-summary-total {
    border-color: rgba(61, 72, 97, 0.28) !important;
    background: var(--survai-bg-hover) !important;
}

.output-repair-summary-grid span {
    color: var(--survai-secondary-slate);
    font-size: 0.72rem;
    font-weight: 850;
    text-transform: uppercase;
}

.output-repair-summary-grid strong {
    color: var(--navy);
    font-size: 0.98rem;
    font-weight: 900;
    line-height: 1.25;
}

.output-repair-status {
    display: flex;
    align-items: center;
    gap: 9px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 14px;
    padding: 12px 14px;
    background: var(--survai-bg-hover);
    color: var(--survai-secondary-slate);
    font-size: 0.92rem;
    font-weight: 750;
}

.output-repair-status[hidden] {
    display: none;
}

.output-repair-status.is-error {
    border-color: rgba(220, 38, 38, 0.22);
    background: var(--survai-tint-fef2f2);
    color: var(--survai-ink-991b1b);
}

.output-repair-add {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 14px;
    padding: 12px;
    background: var(--survai-card);
}

.output-repair-add label {
    flex: 1 1 auto;
    min-width: 0;
}

.output-repair-add label.output-repair-add__title {
    flex: 1 1 auto;
}

.output-repair-add label.output-repair-add__group {
    flex: 0 0 200px;
    max-width: 200px;
}

.output-repair-add__group select {
    width: 100%;
}

.output-repair-catalog__box {
    position: relative;
    display: block;
}

.output-repair-catalog__box input {
    width: 100%;
}

.output-repair-catalog__results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 40;
    max-height: min(340px, 55vh);
    overflow-y: auto;
    background: var(--survai-card);
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 12px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
}

.output-repair-catalog__option {
    display: block;
    width: 100%;
    text-align: left;
    padding: 10px 14px;
    background: transparent;
    border: 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    cursor: pointer;
    font: inherit;
}

.output-repair-catalog__option:last-child {
    border-bottom: 0;
}

.output-repair-catalog__option:hover,
.output-repair-catalog__option:focus-visible,
.output-repair-catalog__option.is-active {
    background: rgba(37, 99, 235, 0.08);
    outline: none;
}

.output-repair-catalog__option strong {
    display: block;
    font-size: 0.9rem;
    color: var(--survai-text-strong);
}

.output-repair-catalog__option span {
    display: block;
    font-size: 0.82rem;
    color: var(--survai-secondary-strong);
    margin-top: 2px;
    overflow-wrap: anywhere;
}

.output-repair-catalog__option em {
    display: block;
    font-size: 0.78rem;
    font-style: normal;
    font-weight: 600;
    color: var(--survai-ink-2563eb);
    margin-top: 4px;
}

.output-repair-catalog__option--new {
    font-weight: 600;
    color: var(--survai-ink-2563eb);
    font-size: 0.85rem;
}

.output-repair-bulk-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.output-repair-bulk-selectall {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--survai-text-soft);
    cursor: pointer;
}

.output-repair-bulk-count {
    font-size: 0.8rem;
    color: var(--survai-secondary-slate);
}

.output-repair-bulk-toolbar [data-output-repair-bulk-action] {
    margin-left: auto;
}

/* Constrain native checkboxes so the global input { width:100%; min-height:46px } rule can't stretch them. */
.output-repair-select,
.output-repair-bulk-selectall input[type="checkbox"] {
    width: 18px;
    height: 18px;
    min-width: 18px;
    min-height: 18px;
    max-width: 18px;
    margin: 0;
    padding: 0;
    flex: 0 0 18px;
    transform: none;
    box-shadow: none;
    border-radius: 4px;
    appearance: auto;
    -webkit-appearance: auto;
    cursor: pointer;
}

.output-repair-select {
    margin-right: 6px;
}

.output-repair-table {
    display: grid;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 14px;
    background: var(--survai-card);
}

.output-repair-row {
    display: grid;
    grid-template-columns: minmax(118px, 0.62fr) minmax(160px, 0.95fr) minmax(280px, 2.1fr) minmax(100px, 0.5fr) minmax(96px, 0.48fr) minmax(146px, 0.56fr);
    align-items: center;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    background: var(--survai-card);
    cursor: pointer;
}

.output-repair-group-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 14px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    background: var(--survai-bg-tint);
    color: var(--survai-text-strong);
    font-size: 0.74rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.output-repair-group-total {
    font-variant-numeric: tabular-nums;
    color: var(--survai-text-soft);
}

.output-repair-row:last-child {
    border-bottom: 0;
}

.output-repair-row:not(.output-repair-row--head):hover,
.output-repair-row:not(.output-repair-row--head):focus {
    background: var(--survai-bg-soft);
    outline: none;
}

.output-repair-row.is-dragging {
    opacity: 0.68;
}

.output-repair-row--head {
    cursor: default;
    color: var(--survai-secondary-slate);
    font-size: 0.74rem;
    font-weight: 900;
    text-transform: uppercase;
}

.output-repair-row--head span,
.output-repair-cell,
.output-repair-actions {
    min-width: 0;
    padding: 13px 10px;
}

.output-repair-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.output-repair-source,
.output-repair-copy {
    overflow: hidden;
    color: var(--survai-secondary-strong);
    font-size: 0.9rem;
    line-height: 1.38;
    /* Clamp to two lines on every view so a long description can never
       elongate the row/column. Full text remains in the edit modal. */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.output-repair-priority {
    display: inline-flex;
    width: fit-content;
    color: var(--survai-ink-3d4861);
    font-size: 0.78rem;
    font-weight: 900;
}

.output-repair-priority--critical {
    color: var(--survai-ink-991b1b);
}

.output-repair-priority--high {
    color: var(--survai-ink-9a3412);
}

.output-repair-priority--medium {
    color: var(--survai-ink-92400e);
}

.output-repair-priority--low {
    color: var(--survai-ink-1d4ed8);
}

.output-repair-priority--optional {
    color: var(--survai-secondary-slate);
}

.output-repair-actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
}

.output-repair-reorder-btn {
    display: none;
}

.output-repair-modal .output-room-modal__panel {
    width: min(1080px, 100%);
}

.output-repair-modal__grid {
    grid-template-columns: repeat(4, minmax(130px, 1fr));
}

.output-risk-review {
    display: grid;
    gap: 12px;
}

.output-risk-review-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 16px;
    padding: 16px;
    background: var(--survai-card);
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.05);
}

.output-risk-review-head h3 {
    margin: 0 0 4px;
    color: var(--navy);
    font-weight: 900;
}

.output-risk-summary-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(105px, 1fr));
    gap: 10px;
}

.output-risk-summary-grid div {
    display: grid;
    gap: 4px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 12px;
    padding: 12px;
    background: var(--survai-card);
}

.output-risk-summary-grid span {
    color: var(--survai-secondary-slate);
    font-size: 0.72rem;
    font-weight: 850;
    text-transform: uppercase;
}

.output-risk-summary-grid strong {
    color: var(--navy);
    font-size: 1.2rem;
    font-weight: 900;
}

.output-risk-critical-warning,
.output-risk-review-status {
    display: flex;
    align-items: center;
    gap: 9px;
    border: 1px solid rgba(180, 83, 9, 0.2);
    border-radius: 14px;
    padding: 12px 14px;
    background: var(--survai-tint-fffbeb);
    color: var(--survai-ink-92400e);
    font-size: 0.92rem;
    font-weight: 750;
}

.output-risk-critical-warning svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.output-risk-review-status[hidden] {
    display: none;
}

.output-risk-review-status.is-loading {
    border-color: rgba(148, 163, 184, 0.22);
    background: var(--survai-bg-hover);
    color: var(--survai-secondary-slate);
}

.output-risk-review-status.is-error {
    border-color: rgba(220, 38, 38, 0.22);
    background: var(--survai-tint-fef2f2);
    color: var(--survai-ink-991b1b);
}

.output-risk-table {
    display: grid;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 14px;
    background: var(--survai-card);
}

.output-risk-row {
    display: grid;
    grid-template-columns: minmax(150px, 0.82fr) minmax(220px, 1.25fr) minmax(220px, 1.15fr) minmax(190px, 1fr) minmax(92px, 0.45fr) minmax(180px, 0.7fr);
    align-items: center;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
    background: var(--survai-card);
}

.output-risk-row:last-child {
    border-bottom: 0;
}

.output-risk-row:not(.output-risk-row--head):hover {
    background: var(--survai-bg-soft);
}

.output-risk-row--head {
    color: var(--survai-secondary-slate);
    font-size: 0.74rem;
    font-weight: 900;
    text-transform: uppercase;
}

.output-risk-row--head span,
.output-risk-cell,
.output-risk-actions {
    min-width: 0;
    padding: 13px 12px;
}

.output-risk-cell {
    display: grid;
    gap: 5px;
}

.output-risk-cell em,
.output-risk-issue small {
    overflow: hidden;
    color: var(--survai-secondary-slate);
    font-size: 0.78rem;
    font-style: normal;
    font-weight: 740;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.output-risk-issue strong {
    overflow: hidden;
    color: var(--navy);
    font-size: 0.92rem;
    font-weight: 760;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.output-risk-copy {
    overflow: hidden;
    color: var(--survai-secondary-strong);
    font-size: 0.9rem;
    line-height: 1.38;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.output-risk-badge,
.output-risk-status {
    display: inline-flex;
    width: fit-content;
    border-radius: 999px;
    padding: 5px 9px;
    background: var(--survai-bg-line);
    color: var(--survai-ink-3d4861);
    font-size: 0.78rem;
    font-weight: 900;
}

.output-risk-badge--critical {
    background: var(--survai-tint-fef2f2);
    color: var(--survai-ink-991b1b);
}

.output-risk-badge--high {
    background: var(--survai-tint-fff7ed);
    color: var(--survai-ink-9a3412);
}

.output-risk-badge--medium {
    background: var(--survai-tint-eff6ff);
    color: var(--survai-ink-1d4ed8);
}

.output-risk-badge--low {
    background: var(--survai-tint-f0fdf4);
    color: var(--survai-ink-166534);
}

.output-risk-status--fixed {
    background: var(--survai-tint-f0fdf4);
    color: var(--survai-ink-166534);
}

.output-risk-status--dismissed {
    background: var(--survai-bg);
    color: var(--survai-secondary-slate);
}

.output-risk-actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
}

.output-risk-text-action {
    display: inline-flex;
    min-width: 38px;
    height: 32px;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 9px;
    background: var(--survai-card);
    color: var(--survai-secondary-slate);
    cursor: pointer;
    font-size: 0.74rem;
    font-weight: 900;
}

.output-risk-text-action:hover {
    border-color: rgba(61, 72, 97, 0.28);
    color: var(--survai-ink-3d4861);
}

.output-risk-detail {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    border-top: 1px solid rgba(148, 163, 184, 0.16);
    padding: 14px;
    background: var(--survai-bg-hover);
}

.output-risk-detail[hidden] {
    display: none;
}

.output-risk-detail section {
    display: grid;
    gap: 6px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 12px;
    padding: 12px;
    background: var(--survai-card);
}

.output-risk-detail h4 {
    margin: 0;
    color: var(--survai-ink-3d4861);
    font-size: 0.82rem;
    font-weight: 900;
}

.output-risk-detail p {
    margin: 0;
    color: var(--survai-secondary-strong);
    line-height: 1.45;
}

.output-risk-export-alert {
    margin: 0;
}

.output-legal-modal .output-room-modal__panel {
    width: min(920px, 100%);
}

.output-room-qa-card,
.output-legal-group,
.output-legal-item {
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 16px;
    background: var(--survai-card);
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.05);
}

.output-room-qa-summary {
    display: grid;
    width: 100%;
    grid-template-columns: minmax(190px, 1.6fr) repeat(5, minmax(98px, 1fr));
    gap: 10px;
    align-items: center;
    border: 0;
    padding: 14px;
    background: transparent;
    color: var(--survai-ink-3d4861);
    cursor: pointer;
    font: inherit;
    text-align: left;
}

.output-room-qa-summary strong,
.output-image-qa-head h3,
.output-legal-group__head h3,
.output-room-detail-grid h3 {
    margin: 0;
    color: var(--navy);
    font-weight: 900;
}

.output-room-qa-summary em {
    display: block;
    margin-top: 3px;
    color: var(--survai-secondary-slate);
    font-size: 0.82rem;
    font-style: normal;
    font-weight: 750;
}

.output-room-qa-pill {
    display: inline-flex;
    width: fit-content;
    min-width: 48px;
    justify-content: center;
    border-radius: 999px;
    padding: 6px 9px;
    background: var(--survai-bg-line);
    color: var(--navy);
    font-weight: 900;
}

.output-room-qa-detail {
    border-top: 1px solid rgba(148, 163, 184, 0.18);
    padding: 16px;
}

.output-room-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.output-room-detail-grid section {
    border-radius: 12px;
    padding: 14px;
    background: var(--survai-bg);
}

.output-source-list,
.output-source-list li {
    display: grid;
    gap: 6px;
}

.output-source-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.output-source-list li {
    border-radius: 10px;
    padding: 10px;
    background: var(--survai-card);
}

.output-evidence-dl {
    display: grid;
    gap: 8px;
    margin: 0;
}

.output-evidence-dl div {
    display: grid;
    grid-template-columns: minmax(110px, 0.7fr) minmax(0, 1fr);
    gap: 10px;
}

.output-evidence-dl dt {
    color: var(--survai-secondary-slate);
    font-size: 0.78rem;
    font-weight: 850;
    text-transform: uppercase;
}

.output-evidence-dl dd {
    margin: 0;
    color: var(--survai-ink-1f2a44);
    font-weight: 700;
}

.output-image-qa-head,
.output-legal-group__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 16px;
    padding: 16px;
    background: var(--survai-card);
}

.output-image-qa-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
}

.output-image-qa-card {
    display: grid;
    gap: 0;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 16px;
    background: var(--survai-card);
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.05);
}

.output-image-qa-card > img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: var(--survai-bg-line);
}

.output-image-quarantine-badge,
.image-manager-quarantine-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 999px;
    padding: 5px 9px;
    background: var(--survai-bg-hover);
    color: var(--survai-ink-3d4861);
    font-size: 0.78rem;
    font-weight: 760;
}

.output-image-quarantine-badge {
    margin: 10px 12px 0;
}

.output-image-quarantine-badge svg,
.image-manager-quarantine-badge svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

.output-image-qa-form {
    display: grid;
    gap: 10px;
    padding: 12px;
}

.output-image-qa-form label {
    display: grid;
    gap: 5px;
}

.output-image-qa-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.output-legal-group {
    display: grid;
    gap: 12px;
    padding: 16px;
}

.output-legal-group__head {
    border: 0;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}

.output-legal-group__head span {
    display: inline-flex;
    min-width: 34px;
    justify-content: center;
    border-radius: 999px;
    padding: 6px 9px;
    background: var(--survai-bg-line);
    color: var(--navy);
    font-weight: 900;
}

.output-legal-item {
    display: grid;
    gap: 10px;
    padding: 14px;
    box-shadow: none;
}

@media (max-width: 1180px) {
    .output-qa-summary-bar {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .output-accommodation-row {
        grid-template-columns: 48px minmax(150px, 1fr) minmax(90px, 0.55fr) minmax(120px, 0.75fr) minmax(160px, 1fr) minmax(90px, 0.5fr) minmax(120px, 0.6fr);
    }

    .output-legal-summary-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .output-repair-summary-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .output-risk-summary-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .output-legal-row {
        grid-template-columns: minmax(180px, 1.3fr) minmax(120px, 0.85fr) minmax(88px, 0.55fr) minmax(110px, 0.7fr) minmax(160px, 1fr) minmax(112px, 0.55fr);
    }

    .output-risk-row {
        grid-template-columns: minmax(130px, 0.8fr) minmax(190px, 1fr) minmax(170px, 1fr) minmax(160px, 0.9fr) minmax(86px, 0.45fr) minmax(160px, 0.65fr);
    }

    .output-repair-row {
        grid-template-columns: minmax(118px, 0.7fr) minmax(150px, 0.95fr) minmax(250px, 1.9fr) minmax(96px, 0.5fr) minmax(92px, 0.46fr) minmax(128px, 0.56fr);
    }

    .output-accommodation-row--head,
    .output-legal-row--head,
    .output-repair-row--head,
    .output-risk-row--head {
        display: none;
    }

    .output-room-qa-summary {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .output-qa-summary-bar {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .output-room-qa-summary,
    .output-room-detail-grid,
    .output-accommodation-row,
    .output-legal-row,
    .output-repair-row,
    .output-risk-row,
    .output-risk-detail,
    .output-room-generation-summary,
    .output-room-modal__grid,
    .output-legal-summary-grid,
    .output-repair-summary-grid,
    .output-risk-summary-grid {
        grid-template-columns: 1fr;
    }

    .output-accommodation-row,
    .output-legal-row,
    .output-repair-row,
    .output-risk-row {
        padding: 10px 0;
    }

    .output-accommodation-actions,
    .output-legal-actions,
    .output-repair-actions,
    .output-risk-actions {
        justify-content: flex-start;
    }

    .output-accommodation-reorder-btn,
    .output-legal-reorder-btn,
    .output-repair-reorder-btn {
        display: inline-grid;
    }

    .output-room-modal {
        align-items: stretch;
        padding: 12px;
        padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    }

    .output-room-modal__panel {
        max-height: calc(100dvh - 24px - env(safe-area-inset-bottom, 0px));
        border-radius: 14px;
    }

    .output-room-modal__form {
        padding: 16px 20px;
    }

    .output-room-modal__head,
    .output-room-modal__subhead {
        align-items: stretch;
        flex-direction: column;
    }

    .output-room-modal__head {
        margin: -16px -20px 0;
        padding: 12px 20px 10px;
    }

    .output-accommodation-row > [data-label]::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 5px;
        color: var(--survai-secondary-slate);
        font-size: 0.72rem;
        font-weight: 900;
        text-transform: uppercase;
    }

    .output-legal-row > [data-label]::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 5px;
        color: var(--survai-secondary-slate);
        font-size: 0.72rem;
        font-weight: 900;
        text-transform: uppercase;
    }

    .output-repair-row > [data-label]::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 5px;
        color: var(--survai-secondary-slate);
        font-size: 0.72rem;
        font-weight: 900;
        text-transform: uppercase;
    }

    .output-risk-row > [data-label]::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 5px;
        color: var(--survai-secondary-slate);
        font-size: 0.72rem;
        font-weight: 900;
        text-transform: uppercase;
    }

    .output-room-generation-head {
        align-items: stretch;
        flex-direction: column;
    }

    .output-risk-review-head {
        align-items: stretch;
        flex-direction: column;
    }

    .output-repair-head {
        align-items: stretch;
        flex-direction: column;
    }

    .output-accommodation-add,
    .output-legal-add,
    .output-repair-add,
    .output-accommodation-bulk-bar {
        align-items: stretch;
        flex-direction: column;
    }

    .output-repair-add label,
    .output-repair-add label.output-repair-add__group {
        width: 100%;
        max-width: none;
        flex: 0 0 auto;
    }

    .output-accommodation-bulk-bar > *,
    .output-accommodation-bulk-bar label,
    .output-accommodation-bulk-bar input {
        width: 100%;
    }

    .output-image-qa-head,
    .output-legal-group__head {
        align-items: stretch;
        flex-direction: column;
    }

    .output-image-qa-grid {
        grid-template-columns: 1fr;
    }
}

.condition-ratings-panel {
    display: grid;
    width: 100%;
    gap: clamp(18px, 2.4vw, 36px);
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: clamp(22px, 2.2vw, 34px);
    padding: clamp(18px, 3vw, 46px);
    background: var(--survai-card);
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.08);
}

.condition-ratings-panel__head {
    display: grid;
    gap: 12px;
}

.condition-ratings-panel__head h2 {
    margin: 0;
    color: var(--navy);
    font-size: clamp(1.65rem, 2.4vw, 2.35rem);
    font-weight: 900;
    letter-spacing: -0.01em;
    line-height: 1.05;
}

.condition-ratings-panel__head p {
    margin: 0;
    color: var(--survai-ink-52627a);
    font-size: clamp(1rem, 1.35vw, 1.22rem);
    line-height: 1.45;
}

.condition-rating-summary-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: clamp(8px, 1.25vw, 22px);
    min-width: 0;
}

.condition-rating-summary-card {
    position: relative;
    display: grid;
    min-width: 0;
    min-height: clamp(170px, 20vw, 310px);
    align-content: center;
    justify-items: center;
    gap: clamp(12px, 1.6vw, 30px);
    overflow: hidden;
    appearance: none;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 18px;
    padding: clamp(16px, 2vw, 34px) clamp(8px, 1.5vw, 24px);
    background: var(--survai-card);
    color: var(--navy);
    cursor: pointer;
    font: inherit;
    text-align: center;
    text-decoration: none;
    box-shadow: 0 16px 42px rgba(15, 23, 42, 0.07);
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.condition-rating-summary-card::after {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 4px;
    background: var(--rating-accent, #94a3b8);
    content: "";
}

.condition-rating-summary-badge {
    display: inline-flex;
    width: clamp(58px, 6vw, 112px);
    height: clamp(58px, 6vw, 112px);
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--rating-soft, #f1f5f9);
    color: var(--rating-accent, #64748b);
    font-size: clamp(1rem, 1.5vw, 1.75rem);
    font-weight: 900;
    line-height: 1;
}

.condition-rating-summary-label {
    color: var(--survai-ink-52627a);
    font-size: clamp(0.66rem, 0.86vw, 1rem);
    font-weight: 850;
    letter-spacing: 0.02em;
    line-height: 1.25;
    text-transform: uppercase;
}

.condition-rating-summary-card strong {
    color: var(--navy);
    font-size: clamp(2.1rem, 4.5vw, 5.2rem);
    font-weight: 950;
    letter-spacing: -0.04em;
    line-height: 0.88;
}

.condition-rating-summary-card--cr3 {
    --rating-soft: #fde8e8;
    --rating-accent: #c81e1e;
}

.condition-rating-summary-card--cr2 {
    --rating-soft: #fff2d8;
    --rating-accent: #c27803;
}

.condition-rating-summary-card--cr1 {
    --rating-soft: #dcfce7;
    --rating-accent: #159447;
}

.condition-rating-summary-card--ni,
.condition-rating-summary-card--na {
    --rating-soft: #eef2f7;
    --rating-accent: #64748b;
}

.condition-rating-summary-card:hover {
    border-color: rgba(15, 23, 42, 0.16);
    box-shadow: 0 22px 54px rgba(15, 23, 42, 0.1);
    transform: translateY(-2px);
}

.condition-rating-summary-card:focus-visible {
    outline: 3px solid rgba(27, 90, 249, 0.26);
    outline-offset: 3px;
}

.rating-sections-modal {
    width: min(620px, calc(100vw - 32px));
    padding: 0;
    border: 0;
    border-radius: 18px;
    background: transparent;
    color: var(--navy);
}

.rating-sections-modal::backdrop {
    background: rgba(7, 20, 33, 0.55);
    backdrop-filter: blur(3px);
}

.rating-sections-modal__inner {
    display: grid;
    gap: 16px;
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--panel, #ffffff);
    box-shadow: 0 24px 70px rgba(7, 20, 33, 0.28);
}

.rating-sections-modal__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.rating-sections-modal__head h2 {
    margin: 0;
    font-size: 1.35rem;
}

.rating-sections-modal__head button {
    width: 36px;
    height: 36px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--survai-bg);
    color: var(--navy);
    cursor: pointer;
    font-size: 1.4rem;
    line-height: 1;
}

.rating-sections-list {
    display: grid;
    gap: 10px;
}

.rating-sections-list a {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 52px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--survai-bg-soft);
    color: var(--navy);
    font-weight: 800;
}

.rating-sections-list__code {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    min-width: 40px;
    height: 40px;
    border-radius: 999px;
    background: var(--survai-navy-surface);
    color: #ffffff;
    font-size: 0.74rem;
    font-weight: 900;
}

@media (min-width: 721px) and (max-width: 1180px) {
    .condition-ratings-panel {
        gap: clamp(16px, 2vw, 24px);
        padding: clamp(18px, 2.4vw, 28px);
    }

    .condition-rating-summary-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        gap: clamp(8px, 1.1vw, 14px);
    }

    .condition-rating-summary-card {
        min-height: clamp(160px, 19vw, 230px);
        gap: clamp(10px, 1.4vw, 18px);
        padding: clamp(14px, 1.7vw, 22px) clamp(8px, 1vw, 14px);
    }

    .condition-rating-summary-badge {
        width: clamp(56px, 6vw, 82px);
        height: clamp(56px, 6vw, 82px);
        font-size: clamp(1rem, 1.35vw, 1.3rem);
    }

    .condition-rating-summary-label {
        font-size: clamp(0.66rem, 0.78vw, 0.78rem);
        line-height: 1.16;
    }

    .condition-rating-summary-card strong {
        font-size: clamp(2.1rem, 3.8vw, 3.4rem);
    }
}

@media (max-width: 720px) {
    .condition-rating-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .condition-rating-summary-card {
        min-height: clamp(150px, 34vw, 220px);
    }
}

@media (max-width: 560px) {
    .condition-rating-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.output-section-list {
    display: grid;
    gap: 18px;
}

.output-main-section {
    display: grid;
    gap: 10px;
    scroll-margin-top: var(--output-section-header-scroll-margin, 132px);
}

.output-main-section-toggle {
    display: flex;
    width: var(--survai-white-header-width);
    min-height: var(--survai-white-header-min-height);
    align-items: center;
    gap: var(--survai-white-header-gap);
    border: var(--survai-white-header-border);
    border-radius: var(--survai-white-header-radius);
    padding: var(--survai-white-header-padding);
    background: var(--survai-white-header-background);
    color: var(--survai-white-header-color);
    text-align: left;
    cursor: pointer;
    box-shadow: var(--survai-white-header-shadow);
}

.output-main-section-toggle:hover,
.output-main-section-toggle:focus-visible {
    color: var(--survai-ink-1d4ed8);
    background: transparent;
    outline: none;
}

.output-main-section-icon {
    display: none;
}

.output-main-section-title {
    display: flex;
    min-width: 0;
    flex: 1 1 auto;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px;
    font-size: var(--survai-white-header-title-size);
    font-weight: var(--survai-white-header-title-weight);
    line-height: var(--survai-white-header-title-line-height);
}

.output-main-section-number {
    display: none;
    color: var(--survai-secondary-strong);
    font-size: 0.92rem;
    font-weight: 850;
}

.output-main-section.is-collapsed .output-main-section-number {
    display: inline;
}

.output-main-section-chevron {
    width: 11px;
    height: 11px;
    flex: 0 0 11px;
    border-right: 2px solid #64748b;
    border-bottom: 2px solid #64748b;
    transform: rotate(45deg);
    transition: transform 0.18s ease;
}

.output-main-section.is-collapsed .output-main-section-chevron {
    transform: rotate(-45deg);
}

.output-main-section-content {
    display: grid;
    gap: 16px;
    padding: 2px 0 8px;
}

.output-main-section-content[hidden] {
    display: none;
}

.output-section {
    display: grid;
    gap: 12px;
    border-top: 1px solid var(--line);
    padding-top: 18px;
}

.output-main-section-content .output-section:first-child {
    border-top: 0;
    padding-top: 0;
}

/* The output workspace is one ~35,000px scroll layer; backdrop-filter on the
   rating pills (one per section), docks and toolbars multiplies compositing
   over the whole canvas until Chromium stops painting the content entirely
   (grey page, fixed chrome still visible). Blur sits over near-opaque
   backgrounds here, so disabling it is visually negligible. */
body.output-report-page .pill,
body.output-report-page .survai-progress-action-dock,
body.output-report-page .survai-image-action-dock,
body.output-report-page .survai-output-action-dock__bar,
body.output-report-page .floating-toolbar-panel,
body.output-report-page .workspace-topbar,
body.output-report-page .report-workspace-header,
body.output-report-page .mobile-app-header {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* While jumping to a section, hide fixed compositor layers so Chromium keeps
   painting the long report canvas underneath. */
body.output-report-page.is-output-section-navigating .workspace-topbar,
body.output-report-page.is-output-section-navigating .report-workspace-header,
body.output-report-page.is-output-section-navigating .floating-report-toolbar,
body.output-report-page.is-output-section-navigating .mobile-app-header,
body.output-report-page.is-output-section-navigating .survai-voice-assistant {
    visibility: hidden !important;
    pointer-events: none !important;
}

.output-section:first-child {
    border-top: 0;
    padding-top: 0;
}

.output-section header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

/* Collapsed rows: a very light grey hover across the ENTIRE row so the
   surveyor can see which row (and whose buttons) the mouse is on. The
   section's own border-top is the divider above it; padding-bottom +
   equal negative margin extends the painted box across the container's
   16px row gap so the tint touches the next divider too — margin-box
   height is unchanged, so nothing moves. Static when collapsed; only the
   background changes on hover (output.php gesture rule). Hover-capable
   pointers only — no sticky hover states on touch. */
@media (hover: hover) {
    .output-section.is-collapsed {
        padding-bottom: 16px;
        margin-bottom: -16px;
        transition: background-color 0.12s ease;
    }

    .output-section.is-collapsed:hover {
        background-color: rgba(15, 23, 42, 0.028);
    }
}

.output-section h3 {
    margin: 0;
    /* Charcoal headings (surveyor, 3 Oct 2026 neutral theme); the size is
       deliberately unchanged (1.12rem). */
    color: var(--survai-text);
    font-size: 1.12rem;
}

.output-copy {
    color: var(--survai-text);
    font-size: 0.98rem;
    line-height: 1.65;
}

.output-section-form {
    display: grid;
    gap: 12px;
}

.workflow-section-text-editor {
    display: grid;
    gap: 12px;
}

.workflow-section-text-preview {
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px 16px;
    background: var(--survai-tint-f9fafb);
    color: var(--survai-text);
    font-size: 0.98rem;
    line-height: 1.65;
}

.workflow-section-text-preview p {
    margin: 0 0 0.85rem;
}

.workflow-section-text-preview p:last-child {
    margin-bottom: 0;
}

.output-surveyor-overall-opinion-heading,
.workflow-section-text-preview .output-surveyor-overall-opinion-heading {
    margin: 1.1rem 0 0.55rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--survai-ink-111a2e);
    letter-spacing: 0.01em;
}

.output-section-text {
    width: 100%;
    min-height: 180px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px;
    color: var(--survai-text);
    background: var(--survai-card);
    font-size: 0.98rem;
    line-height: 1.65;
    resize: vertical;
}

/* Formatting bar: floats IN FRONT of the text box, never inside it. Fixed to
   the viewport just under the blue stage-nav buttons (offset measured at
   runtime into --survai-format-bar-top); the script left-aligns it with the
   focused box. Hidden until the surveyor clicks into the box (:focus-within —
   clicking the bar keeps the textarea focused, so it stays visible while in
   use). z-index sits above the page content but below the fixed workspace
   header (880). */
.output-format-bar {
    position: fixed;
    top: var(--survai-format-bar-top, 128px);
    left: 16px;
    z-index: 60;
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 4px 10px;
    /* Neutral toolbar (surveyor, 3 Oct 2026): white surface, charcoal glyphs. */
    background: var(--survai-surface);
    border: 1px solid var(--survai-border);
    border-radius: 7px;
    box-shadow: 0 8px 22px rgba(15, 37, 64, 0.12);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-3px);
    transition: opacity 140ms ease, transform 140ms ease;
}

.output-inline-editor:focus-within .output-format-bar {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

/* The bar floats over the page (position:fixed, out of flow), so showing or
   hiding it never changes any height (no layout shifts mid-gesture).
   display:block kills the inline descender gap below the textarea. */
.output-inline-editor textarea {
    display: block;
}

.output-format-bar__btn svg text {
    user-select: none;
}

.output-format-bar .output-icon-action {
    width: 35px;
    height: 35px;
    border: 0;
    background: transparent;
    color: var(--survai-text);
}

.output-format-bar .output-icon-action .output-action-icon {
    width: 21px;
    height: 21px;
}

/* £ icon hover popover: "Add a job" / "View jobs on this section". One shared
   element appended to <body>, fixed-position anchored to the hovered icon. */
.output-section-cost-popover {
    /* Centred on the viewport rather than pinned to the £ icon: the list
       carries full job wording and opened half off-screen when anchored to
       an icon low on the page. Centring also gives it room to grow. */
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 10050;
    width: min(560px, calc(100vw - 32px));
    max-width: none;
    min-width: 0;
    max-height: min(80vh, 720px);
    display: flex;
    flex-direction: column;
    padding: 16px 18px;
    border: 1px solid var(--survai-border-mid);
    border-radius: 16px;
    background: var(--survai-card);
    color: var(--survai-text-soft);
    text-align: left;
    /* The second shadow IS the backdrop: a viewport-wide spread dims the
       page behind the centred panel without adding an element that could
       swallow the hover or the click-outside-to-close. */
    box-shadow: 0 28px 70px rgba(15, 23, 42, 0.32), 0 0 0 100vmax rgba(15, 23, 42, 0.18);
}
.output-section-cost-popover[hidden] { display: none; }

.output-section-cost-popover__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    flex: 0 0 auto;
}
/* Click-opened, so it needs a visible way out — Escape and click-outside
   still work, but neither is discoverable. */
.output-section-cost-popover__close {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: none;
    color: var(--survai-secondary-slate);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}
.output-section-cost-popover__close:hover { background: var(--survai-bg-tint); color: var(--survai-text-strong); }
.output-section-cost-popover__title {
    margin: 0 0 8px;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--survai-secondary-slate);
    flex: 0 0 auto;
}

.output-section-cost-popover__option {
    display: block;
    width: 100%;
    padding: 8px 10px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    text-align: left;
    font: 600 0.9rem/1.3 inherit;
    font-family: inherit;
    color: var(--survai-text-strong);
    cursor: pointer;
}

.output-section-cost-popover__option:hover,
.output-section-cost-popover__option:focus-visible {
    background: var(--survai-tint-eff6ff);
    color: var(--survai-ink-1d4ed8);
    outline: none;
}

.output-section-cost-popover__jobs {
    /* Inside the centred flex panel: take the leftover height and scroll
       within it, so the title and "+ Add a job" never scroll away. */
    flex: 1 1 auto;
    min-height: 0;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--survai-border-soft);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.output-section-cost-popover__group + .output-section-cost-popover__group {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--survai-border-soft);
}
/* The works-category heading sits top-left above its jobs, small and
   upper-case like the panel title, with the count of jobs beside it. */
.output-section-cost-popover__group-title {
    margin: 0 0 8px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--survai-secondary-slate);
    display: flex;
    align-items: center;
    gap: 6px;
}
.output-section-cost-popover__group-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--survai-bg-tint);
    color: var(--survai-text-strong);
    font-size: 0.66rem;
    letter-spacing: 0;
}

.output-section-cost-popover__job-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 8px;
}

.output-section-cost-popover__job-list li {
    display: grid;
    gap: 2px;
}

.output-section-cost-popover__job-desc {
    /* Normal weight, as the section text reads in its own box: the job
       wording is prose, not a label. Only the price line carries any weight. */
    font-size: 0.85rem;
    font-weight: 400;
    color: var(--survai-text-strong);
    line-height: 1.35;
}
.output-section-cost-popover__job-detail {
    display: block;
    color: var(--survai-secondary-slate);
    font-size: 0.76rem;
    line-height: 1.35;
}

.output-section-cost-popover__job-meta {
    /* Price and due on the left, Edit pushed to the right of the same line. */
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--survai-secondary-strong);
}
.output-section-cost-popover__edit {
    flex: 0 0 auto;
    padding: 0;
    border: 0;
    background: none;
    color: var(--survai-ink-1b5af9);
    font: inherit;
    font-size: 0.76rem;
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
}
.output-section-cost-popover__edit:hover { color: var(--survai-text-strong); }

.output-section-cost-popover__note {
    margin: 8px 0 0;
    font-size: 0.78rem;
    color: var(--survai-secondary-slate);
}

.output-format-bar .output-icon-action:hover,
.output-format-bar .output-icon-action:focus-visible {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

/* ---- Per-section costed works: the optional table under a section's text
   box, plus the count badge on its £ button. The table is a WORKING view,
   off unless "Show costed works per section" is ticked in Display options
   (the workspace carries .output-image-option-section-costs then). ---- */
.output-section-costs { display: none; }
.output-image-option-section-costs .output-section-costs {
    display: block;
    margin: 10px 0 0;
    padding: 12px 14px;
    border: 1px solid var(--survai-border-soft);
    border-radius: 12px;
    background: var(--survai-bg-soft);
    color: var(--survai-text-soft);
    font-size: 0.85rem;
}
.output-section-costs__table {
    width: 100%;
    border-collapse: collapse;
}
.output-section-costs__table th,
.output-section-costs__table td {
    padding: 6px 8px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--survai-border-faint);
}
.output-section-costs__table th:last-child,
.output-section-costs__table td:last-child { text-align: right; white-space: nowrap; }
.output-section-costs__table td strong { display: block; color: var(--survai-text-strong); }
/* The works description prints in full and must WRAP — this table is read
   against the section text to check the wording, so nothing is clipped. */
.output-section-costs__table td span {
    display: block;
    color: var(--survai-secondary-slate);
    font-size: 0.8rem;
    line-height: 1.45;
    white-space: normal;
    overflow-wrap: anywhere;
}
.output-section-costs__table td:first-child { width: 62%; }
.output-section-costs__price { display: block; font-variant-numeric: tabular-nums; }
/* height:1px + height:100% is the standard way to stretch a block to a table
   cell's real height, so Edit can sit on the row's bottom edge no matter how
   tall the full description makes it. */
.output-section-costs__table tbody td:last-child { height: 1px; }
.output-section-costs__meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: space-between;
    gap: 6px;
    height: 100%;
    min-height: 100%;
}
/* Bottom-right of the row, under the price. */
.output-section-costs__edit {
    display: inline-block;
    padding: 0;
    border: 0;
    background: none;
    color: var(--survai-ink-1b5af9);
    font: inherit;
    font-size: 0.76rem;
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
}
.output-section-costs__edit:hover { color: var(--survai-text-strong); }
.output-section-costs__edit:disabled { opacity: 0.5; cursor: default; }
.output-section-costs__table tfoot td {
    border-bottom: 0;
    font-weight: 700;
}
.output-section-costs__empty { margin: 0; color: var(--survai-secondary-slate); }
.output-section-costs__add {
    margin-top: 8px;
    padding: 6px 12px;
    border: 1px solid #dbe3ee;
    border-radius: 999px;
    background: var(--survai-card);
    color: var(--survai-ink-1b5af9);
    font: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
}
.output-section-costs__add:hover { border-color: #1b5af9; }
.output-section-add-cost__count {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: #1b5af9;
    color: #ffffff;
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
}
@media (max-width: 640px) {
    .output-image-option-section-costs .output-section-costs { padding: 10px; font-size: 0.8rem; }
    /* Head and body only: the footer's middle cell is a spacer, and
       blanket nth-child would have hidden the section TOTAL on phones. */
    .output-section-costs__table thead th:nth-child(2),
    .output-section-costs__table tbody td:nth-child(2) { display: none; }
    .output-section-costs__table tfoot td:nth-child(2) { display: none; }
}

/* Colour chart popover anchored below the colour icon (the bar floats above
   the box, so the chart drops down towards it). */
/* Inline variant: sits statically above a contenteditable field (the
   accommodation room modal) instead of floating fixed under the stage nav. */
.output-format-bar--inline {
    position: relative;
    top: auto;
    left: auto;
    opacity: 1;
    pointer-events: auto;
    transform: none;
    width: fit-content;
    margin: 4px 0 6px;
}

.output-format-bar__palette {
    position: absolute;
    top: calc(100% + 8px);
    left: 8px;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    background: var(--survai-card);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 10px 28px rgba(15, 37, 64, 0.18);
}

.output-format-bar__palette[hidden] {
    display: none;
}

.output-format-bar__swatch {
    width: 22px;
    height: 22px;
    padding: 0;
    border: 2px solid #ffffff;
    border-radius: 50%;
    box-shadow: 0 0 0 1px rgba(17, 24, 39, 0.2);
    cursor: pointer;
}

.output-format-bar__swatch:hover,
.output-format-bar__swatch:focus-visible {
    transform: scale(1.12);
}

/* Live styled view behind each output textarea: shows bold/underline/colour
   applied while the tokens stay visible but dimmed. Activated (is-styled)
   only when the text contains formatting tokens. Every style is metric-safe
   (fake bold via text-shadow) so the caret lines up with the styled glyphs. */
.output-inline-editor {
    position: relative;
}

.output-inline-editor__view {
    position: absolute;
    inset: 0;
    z-index: 0;
    display: none;
    overflow: hidden;
    background: var(--survai-card);
    color: var(--survai-text);
    white-space: pre-wrap;
    overflow-wrap: break-word;
    word-wrap: break-word;
    pointer-events: none;
}

.output-inline-editor.is-styled .output-inline-editor__view {
    display: block;
}

.output-inline-editor textarea {
    position: relative;
    z-index: 1;
}

.output-inline-editor.is-styled textarea {
    background: transparent;
    color: transparent;
    caret-color: #111827;
}

/* Formatting markers are invisible while reading — the styling just shows
   applied — and fade in dimmed only when the caret touches them. They keep
   their exact width either way so the caret stays aligned. */
.output-inline-editor__tok {
    opacity: 0;
    transition: opacity 0.12s ease;
}

.output-inline-editor__tok.is-revealed {
    opacity: 0.38;
}

.output-inline-editor__bold {
    text-shadow: 0.045em 0 0 currentColor;
}

/* "Preview formatting" panel: the PDF-faithful rendering of the box's text. */
.output-format-preview {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--survai-bg);
    padding: 12px 14px;
    font-size: 0.98rem;
    line-height: 1.65;
    color: var(--survai-text);
}

.output-format-preview p {
    margin: 0 0 0.8em;
}

.output-format-preview p:last-child {
    margin-bottom: 0;
}

.output-autosize-textarea {
    overflow-y: hidden;
    overscroll-behavior: auto;
    touch-action: pan-y;
}

.output-autosize-textarea.is-editing-output {
    overflow-y: hidden;
}

.output-autosize-textarea.is-scroll-enabled {
    overflow-y: auto;
    overscroll-behavior: contain;
}

.output-section-footer-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.output-section-footer-actions .output-section-actions {
    margin-top: 0;
}

.output-section-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px 10px;
    margin-top: 0;
    overflow: visible;
    text-align: right;
}

.output-section-gallery-trigger {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    background: var(--survai-surface);
    color: var(--survai-text-secondary);
    border: 1px solid var(--survai-border);
    box-shadow: none;
    text-decoration: none;
    transition: background 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

.output-section-gallery-trigger .output-action-icon {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.8;
}

.output-section-gallery-trigger:hover,
.output-section-gallery-trigger:focus-visible {
    background: var(--survai-brand-soft);
    border-color: var(--survai-brand);
    color: var(--survai-brand);
    outline: none;
    transform: translateY(-1px);
}

.output-icon-action {
    position: relative;
    display: inline-flex;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--survai-border);
    border-radius: 999px;
    padding: 0;
    background: var(--survai-surface);
    color: var(--survai-text-secondary);
    cursor: pointer;
    transition: border-color 140ms ease, color 140ms ease, background 140ms ease, transform 140ms ease;
}

.output-icon-action::after {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    z-index: 60;
    max-width: 160px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    padding: 6px 10px;
    background: var(--survai-navy-surface);
    color: #ffffff;
    content: attr(data-tooltip);
    font-size: 0.72rem;
    font-weight: 750;
    line-height: 1;
    opacity: 0;
    pointer-events: none;
    text-align: center;
    transform: translate(-50%, 4px);
    transition: opacity 140ms ease, transform 140ms ease;
    white-space: nowrap;
}

.output-icon-action:not([data-tooltip])::after,
.output-icon-action[data-tooltip=""]::after {
    content: none;
}

.output-icon-action:hover,
.output-icon-action:focus-visible {
    color: var(--survai-secondary-slate);
    outline: none;
    transform: translateY(-1px);
    /* The transform above makes the button its own stacking context, which
       TRAPS the tooltip's z-index inside it — the label then slid behind the
       text box above (it renders upward, over the editor). Lifting the whole
       button lifts the label with it. */
    z-index: 30;
}

.output-icon-action:hover::after,
.output-icon-action:focus-visible::after {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* Reading aloud: the Listen button wears the brand blue and a pause glyph, so
   the colour alone says the phone is still talking (surveyor, 18 Sep 2026).
   Grey is "not in use", which covers both stopped and paused. Placed after the
   hover rule so hovering a playing button keeps it blue instead of dropping it
   back to grey. */
.output-icon-action.is-speech-playing,
.output-icon-action.is-speech-playing:hover,
.output-icon-action.is-speech-playing:focus-visible {
    border-color: var(--survai-blue, #1b5af9);
    color: #ffffff;
    background: var(--survai-blue, #1b5af9);
}

.output-icon-action:disabled {
    cursor: not-allowed;
    opacity: 0.45;
    transform: none;
}

.output-icon-action[aria-busy="true"] {
    cursor: wait;
    opacity: 1;
    pointer-events: none;
}

.output-icon-action[aria-busy="true"]::after {
    opacity: 0;
}

.output-icon-action:disabled::after {
    opacity: 0;
}

/* Self-contained CSS spinner — no external asset, so it can never fail to
   appear because of a missing/cached SVG, and it always animates. */
.output-icon-action__spinner {
    display: block;
    width: 16px;
    height: 16px;
    box-sizing: border-box;
    border-radius: 50%;
    border: 2px solid rgba(100, 116, 139, 0.25);
    border-top-color: currentColor;
    background: none;
    animation: output-icon-action-spin 0.7s linear infinite;
}

@keyframes output-icon-action-spin {
    to { transform: rotate(360deg); }
}

.output-action-icon {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Proofed-by-surveyor toggle: red X = not proofed, green check = proofed. */
.output-section-proof {
    color: var(--survai-ink-dc2626);
    border-color: rgba(220, 38, 38, 0.4);
}

.output-section-proof:hover,
.output-section-proof:focus-visible {
    color: var(--survai-ink-dc2626);
    border-color: rgba(220, 38, 38, 0.6);
    background: rgba(220, 38, 38, 0.08);
}

.output-section-proof.is-proofed {
    color: var(--survai-ink-16a34a);
    border-color: rgba(22, 163, 74, 0.45);
    background: rgba(22, 163, 74, 0.1);
}

.output-section-proof.is-proofed:hover,
.output-section-proof.is-proofed:focus-visible {
    color: var(--survai-ink-16a34a);
    border-color: rgba(22, 163, 74, 0.65);
    background: rgba(22, 163, 74, 0.16);
}

.output-section-proof__check {
    display: none;
}

.output-section-proof.is-proofed .output-section-proof__x {
    display: none;
}

.output-section-proof.is-proofed .output-section-proof__check {
    display: inline;
}

.output-section-actions + .output-photo-grid,
.output-section-actions + .report-section-photo-strip {
    margin-top: 25px;
}

.output-photo-grid {
    margin-top: 4px;
}

.output-image-display-panel {
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 16px;
    padding: 0;
    background: var(--survai-card);
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.05);
}

/* Output report image bulk actions use .survai-image-action-dock (shared with Media Manager). */

.output-image-display-panel details {
    padding: 12px 14px;
}

.output-image-display-panel summary {
    cursor: pointer;
    color: var(--survai-ink-3d4861);
    font-size: 0.9rem;
    font-weight: 850;
}

.report-workspace-header__display-options {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.report-workspace-header__display-options .output-image-display-panel {
    position: relative;
    border: 0;
    border-radius: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
}

.report-workspace-header__display-options .output-image-display-panel details {
    position: relative;
    padding: 0;
}

.report-workspace-header__display-options .output-image-display-panel summary {
    list-style: none;
}

.report-workspace-header__display-options .output-image-display-panel summary::-webkit-details-marker {
    display: none;
}

.report-workspace-header__display-options .output-display-options-trigger {
    color: var(--survai-text-secondary);
}

.report-workspace-header__display-options .output-image-display-panel details[open] .output-display-options-trigger,
.report-workspace-header__display-options .output-display-options-trigger:hover,
.report-workspace-header__display-options .output-display-options-trigger:focus-visible {
    color: var(--survai-text-secondary);
    background: transparent;
}

.report-workspace-header__display-options .output-image-display-grid {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 1300;
    width: min(920px, calc(100vw - 36px));
    max-height: min(72vh, 640px);
    overflow: auto;
    padding: 16px;
    border: 1px solid var(--survai-border-ink);
    border-radius: 18px;
    background: var(--survai-card);
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.18), 0 2px 8px rgba(15, 23, 42, 0.08);
}

/* On mobile the trigger lives in the fixed mobile header, which clips an
   absolutely-positioned dropdown. Open it as a fixed panel anchored below the
   header instead (matching the voice/progress header panels). */
@media (max-width: 900px) {
    .report-workspace-header__display-options .output-image-display-grid {
        position: fixed;
        top: calc(var(--survai-mobile-app-header-total, 110px) + 8px);
        right: max(12px, env(safe-area-inset-right, 0px));
        left: auto;
        width: min(360px, calc(100vw - 24px));
        max-height: min(72vh, calc(100dvh - var(--survai-mobile-app-header-total, 110px) - 24px));
    }
}

.output-image-display-grid {
    display: grid;
    grid-template-columns: minmax(180px, 0.7fr) minmax(220px, 1fr) minmax(260px, 1.2fr);
    gap: 14px;
    padding-top: 14px;
}

.output-image-display-grid fieldset {
    display: grid;
    gap: 8px;
    min-width: 0;
    border: 1px solid var(--survai-border-soft);
    border-radius: 12px;
    padding: 12px;
    background: var(--survai-bg-hover);
}

.output-image-display-grid legend {
    padding: 0 4px;
    color: var(--survai-ink-3d4861);
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.output-image-display-grid label {
    display: flex;
    align-items: center;
    gap: 7px;
    color: var(--survai-secondary-strong);
    font-size: 0.86rem;
    font-weight: 650;
}

.output-image-display-grid label:has(select) {
    display: grid;
    gap: 5px;
}

.output-display-options input[type="checkbox"],
.output-display-options input[type="radio"],
.output-image-display-panel input[type="checkbox"],
.output-image-display-panel input[type="radio"] {
    width: 18px;
    height: 18px;
    min-width: 18px;
    min-height: 18px;
    max-width: 18px;
    margin: 0;
    padding: 0;
    flex: 0 0 18px;
    transform: none;
    box-shadow: none;
    border-radius: 4px;
    appearance: auto;
    -webkit-appearance: auto;
}

.output-display-options label:has(input[type="checkbox"]),
.output-display-options label:has(input[type="radio"]),
.output-image-display-panel label:has(input[type="checkbox"]),
.output-image-display-panel label:has(input[type="radio"]) {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 650;
}

.output-display-options label:has(select),
.output-image-display-panel label:has(select) {
    display: grid;
    gap: 5px;
}

.output-display-options label:has(select) select,
.output-image-display-panel label:has(select) select {
    width: 100%;
    min-height: 40px;
}

.output-photo-edit-link {
    position: relative;
    display: block;
    color: inherit;
    text-decoration: none;
}

.output-photo-edit-link span {
    position: absolute;
    right: 8px;
    bottom: 8px;
    display: inline-flex;
    min-height: 24px;
    align-items: center;
    border-radius: 999px;
    padding: 0 9px;
    background: rgba(6, 19, 33, 0.86);
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 900;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 140ms ease, transform 140ms ease;
}

.output-photo-edit-link:hover span,
.output-photo-edit-link:focus-visible span {
    opacity: 1;
    transform: translateY(0);
}

.image-labelling-setting-options {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    border: 0;
}

.image-labelling-setting-options label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.report-settings-page .report-settings-main {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.report-settings-page .workflow-page-card {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-wrap: break-word;
    word-break: normal;
}

.report-settings-page .section-head,
.report-settings-page .section-head > div,
.report-settings-page .form-note,
.report-settings-page .image-labelling-setting-options label {
    overflow-wrap: break-word;
    word-break: normal;
}

.report-settings-page .section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px 16px;
}

.report-settings-page .section-head > div {
    flex: 1 1 240px;
    min-width: min(100%, 240px);
}

.report-settings-page .section-head > .btn {
    flex: 0 0 auto;
    width: auto;
    max-width: 100%;
    align-self: flex-start;
}

.report-settings-page .workflow-page-header {
    flex-wrap: wrap;
    gap: 10px 12px;
}

.report-settings-page .workflow-page-header .header-actions {
    width: auto;
    flex: 0 0 auto;
}

.report-settings-page .image-labelling-setting-options {
    display: grid;
    gap: 8px;
    width: 100%;
}

.report-settings-page .image-labelling-setting-options label {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 10px;
    background: var(--survai-card);
    color: var(--navy);
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.35;
    white-space: normal;
    cursor: pointer;
}

.report-settings-page .image-labelling-setting-options input[type="radio"] {
    width: 16px;
    height: 16px;
    min-width: 16px;
    min-height: 16px;
    margin: 0;
    flex: 0 0 16px;
    accent-color: #1b5af9;
}

@media (min-width: 640px) {
    .report-settings-page .image-labelling-setting-options {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    body.report-settings-page .section-head {
        flex-direction: row;
        align-items: flex-start;
    }

    body.report-settings-page .section-head > .btn,
    body.report-settings-page .workflow-page-header .header-actions .btn {
        width: auto;
        max-width: 100%;
    }

    body.report-settings-page .workflow-page-header .header-actions {
        width: auto;
    }

    body.report-settings-page .image-labelling-setting-options {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 420px) {
    .report-settings-page .workflow-page-card {
        padding: 16px;
    }

    .report-settings-page .section-head > .btn {
        white-space: normal;
        text-align: center;
    }
}

.survai-image-ai-label-btn {
    position: absolute;
    z-index: 11;
    top: 8px;
    right: 8px;
    min-width: 34px;
    height: 30px;
    padding: 0 10px;
    border: 1px solid rgba(255, 255, 255, 0.85);
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.82);
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    transform: translateY(-3px);
    transition: opacity 140ms ease, transform 140ms ease, background 140ms ease;
}

.survai-image-ai-label-btn:hover,
.survai-image-ai-label-btn:focus-visible {
    background: #2563eb;
    outline: none;
}

.image-manager-card__frame:hover .survai-image-ai-label-btn,
.image-manager-card__frame:focus-within .survai-image-ai-label-btn,
.image-manager-card:hover .survai-image-ai-label-btn,
.image-manager-card:focus-within .survai-image-ai-label-btn,
.output-embedded-image:hover .survai-image-ai-label-btn,
.output-embedded-image:focus-within .survai-image-ai-label-btn,
.survai-image-ai-label-btn.is-loading,
.survai-image-ai-label-btn[aria-busy="true"] {
    opacity: 1;
    transform: translateY(0);
}

.output-embedded-image {
    position: relative;
    display: block;
    margin: 0;
}

.output-image-select-control {
    position: absolute;
    z-index: 9;
    top: 8px;
    left: 8px;
    display: inline-grid;
    width: 30px;
    height: 30px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.78);
    border-radius: 999px;
    background: color-mix(in srgb, var(--survai-card) 92%, transparent);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
    cursor: pointer;
    opacity: 0;
    transform: translateY(-3px);
    transition: opacity 140ms ease, transform 140ms ease;
}

.output-embedded-image:hover .output-image-select-control,
.output-embedded-image:focus-within .output-image-select-control,
.output-embedded-image.is-selected .output-image-select-control {
    opacity: 1;
    transform: translateY(0);
}

.output-image-select-control input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.output-image-select-control span {
    display: grid;
    width: 16px;
    height: 16px;
    place-items: center;
    border: 1.6px solid #94a3b8;
    border-radius: 5px;
    color: #ffffff;
}

.output-image-select-control input:checked + span {
    border-color: #2563eb;
    background: #2563eb;
}

.output-image-select-control input:checked + span::after {
    content: "";
    width: 7px;
    height: 4px;
    border-left: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(-45deg) translate(1px, -1px);
}

.output-embedded-image.is-selected .output-image-surface img {
    outline: 3px solid rgba(37, 99, 235, 0.42);
    outline-offset: -3px;
}

.output-image-surface {
    position: relative;
    display: block;
    width: 100%;
    border: 0;
    padding: 0;
    background: transparent;
    cursor: pointer;
    text-align: left;
}

.output-image-surface img {
    display: block;
}

.output-image-info {
    position: absolute;
    right: 8px;
    bottom: 8px;
    display: inline-grid;
    width: 26px;
    height: 26px;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 999px;
    background: color-mix(in srgb, var(--survai-card) 90%, transparent);
    color: var(--survai-ink-3d4861);
    font-size: 0.82rem;
    font-weight: 900;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14);
}

.output-image-tip {
    position: absolute;
    z-index: 8;
    right: 8px;
    bottom: 42px;
    display: grid;
    max-width: min(260px, calc(100% - 16px));
    gap: 6px;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 12px;
    padding: 10px;
    background: color-mix(in srgb, var(--survai-card) 96%, transparent);
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.18);
    color: var(--survai-ink-3d4861);
    opacity: 0;
    pointer-events: none;
    transform: translateY(5px);
    transition: opacity 150ms ease, transform 150ms ease;
}

.output-image-tip strong {
    color: var(--navy);
    font-size: 0.85rem;
    font-weight: 850;
    line-height: 1.25;
}

.output-image-tip span {
    color: var(--survai-secondary-slate);
    font-size: 0.78rem;
    line-height: 1.35;
}

.output-image-tip button {
    justify-self: start;
    border: 0;
    padding: 0;
    background: transparent;
    color: var(--survai-ink-3d4861);
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 850;
}

[data-image-label-mode="hover"] .output-embedded-image:hover .output-image-tip,
[data-image-label-mode="hover"] .output-embedded-image:focus-within .output-image-tip,
[data-image-label-mode="hover"] .output-embedded-image.is-tip-open .output-image-tip,
[data-image-label-mode="always"] .output-image-tip {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

[data-image-label-mode="hide"] .output-image-tip,
.output-workspace-shell:not(.output-image-option-editor) .output-image-info {
    display: none;
}

.output-workspace-shell:not(.output-image-option-annotations) .output-image-tip span {
    display: none;
}

.output-workspace-shell:not(.output-image-option-captions) .output-image-tip strong {
    display: none;
}

.output-workspace-shell.output-image-option-compact .output-photo-grid {
    grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
}

.has-output-image-modal {
    overflow: hidden;
}

.output-image-editor-modal[hidden] {
    display: none;
}

.output-image-editor-modal {
    position: fixed;
    z-index: 2100;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 22px;
}

.output-image-editor-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.38);
}

.output-image-editor-modal__panel {
    position: relative;
    z-index: 1;
    overflow: auto;
    width: min(980px, 100%);
    max-height: min(820px, calc(100vh - 44px));
    /* dvh where supported: on iOS 100vh is the large viewport, so a vh-sized
       card runs past the bottom of the screen and takes its footer with it. */
    max-height: min(820px, calc(100dvh - 44px - env(safe-area-inset-bottom, 0px)));
    border: 1px solid var(--survai-border-soft);
    border-radius: 18px;
    background: var(--survai-card);
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.28);
}

.output-image-editor-form {
    --output-image-editor-pad: 20px;
    display: grid;
    gap: 16px;
    padding: var(--output-image-editor-pad);
}

.output-image-editor-modal__head,
.output-image-editor-foot {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

/* The header (with its ×) and the footer (Close / Save) stay on screen while
   the card scrolls: they bleed over the form's padding so the fields pass
   underneath them. Without this the card had no visible way to save or close
   once its content was taller than the screen (surveyor, 27 Sep 2026). */
.output-image-editor-modal__head {
    position: sticky;
    top: 0;
    z-index: 3;
    margin: calc(-1 * var(--output-image-editor-pad)) calc(-1 * var(--output-image-editor-pad)) 0;
    padding: 16px var(--output-image-editor-pad) 12px;
    background: var(--survai-card);
    border-bottom: 1px solid var(--survai-border-soft);
}

.output-image-editor-foot {
    position: sticky;
    bottom: 0;
    z-index: 3;
    align-items: center;
    margin: 0 calc(-1 * var(--output-image-editor-pad)) calc(-1 * var(--output-image-editor-pad));
    padding: 12px var(--output-image-editor-pad) calc(12px + env(safe-area-inset-bottom, 0px));
    background: var(--survai-card);
    border-top: 1px solid var(--survai-border-soft);
}

.output-image-editor-foot .save-state {
    min-height: 1.2rem;
    color: var(--survai-secondary-slate);
    font-size: 0.86rem;
    font-weight: 800;
}

.output-image-editor-foot__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
    margin-left: auto;
}

.output-image-editor-modal__head h3 {
    margin: 0;
    color: var(--navy);
}

.output-image-editor-close {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border: 1px solid var(--survai-border-soft);
    border-radius: 10px;
    background: var(--survai-card);
    color: var(--survai-secondary-slate);
    cursor: pointer;
    font-size: 1.35rem;
    line-height: 1;
}

.output-image-editor-layout {
    display: grid;
    grid-template-columns: minmax(240px, 0.82fr) minmax(0, 1.18fr);
    gap: 16px;
}

.output-image-editor-preview {
    overflow: hidden;
    border-radius: 14px;
    background: var(--survai-bg);
    aspect-ratio: 4 / 3;
}

.output-image-editor-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.output-image-editor-fields,
.output-image-editor-fields label {
    display: grid;
    gap: 8px;
}

.output-image-editor-fields span {
    color: var(--survai-ink-3d4861);
    font-size: 0.82rem;
    font-weight: 850;
}

.output-image-editor-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

@media (max-width: 860px) {
    .output-image-display-grid,
    .output-image-editor-layout,
    .output-image-editor-grid {
        grid-template-columns: 1fr;
    }

    .output-image-editor-modal {
        align-items: end;
        padding: 12px;
    }

    .output-image-editor-modal__panel {
        max-height: calc(100vh - 24px);
        border-radius: 18px 18px 14px 14px;
    }
}

@media (max-width: 560px) {
    .output-image-select-control {
        opacity: 1;
        transform: none;
    }

    .output-image-display-panel details {
        padding: 10px;
    }

    .output-image-tip {
        right: 6px;
        bottom: 38px;
        max-width: calc(100% - 12px);
        padding: 9px;
    }

    .output-image-editor-form {
        --output-image-editor-pad: 16px;
    }
}

.output-translation-panel {
    display: grid;
    gap: 14px;
}

.is-output-translated .output-section-form button[type="submit"] {
    opacity: 0.5;
}

.section-photo-album-link {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin: 0 0 10px;
    color: var(--primary);
    font-weight: 800;
    text-decoration: none;
}

.section-photo-album-link:hover {
    text-decoration: underline;
}

.photo-album-group {
    display: grid;
    gap: 12px;
    padding: 16px 0;
    border-top: 1px solid var(--line);
}

.photo-album-group:first-child {
    border-top: 0;
    padding-top: 0;
}

.photo-album-group h3 {
    margin: 0;
    color: var(--navy);
}

.capture-live-sync-message {
    position: fixed;
    right: 16px;
    left: 16px;
    top: calc(env(safe-area-inset-top) + 68px);
    z-index: 90;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.84);
    color: #ffffff;
    font-size: 0.86rem;
    font-weight: 800;
    text-align: center;
    backdrop-filter: blur(12px);
    pointer-events: none;
}

.capture-live-thumb-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.capture-live-thumb-row img {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: cover;
    border: 0;
}

.capture-live-thumb-row small {
    align-self: center;
    color: var(--muted);
    font-weight: 700;
}

.output-room-table {
    min-width: 720px;
}

.output-room-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.output-room-heading strong {
    min-width: 0;
}

.output-room-controls {
    display: inline-flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.output-room-controls .btn {
    min-height: 38px;
}

.template-layout {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.template-list-card,
.template-editor-card {
    padding: 22px;
}

.template-list {
    display: grid;
    gap: 8px;
    margin: 14px 0 20px;
}

.template-list a {
    display: grid;
    gap: 3px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--navy);
    text-decoration: none;
}

.template-list a.active,
.template-list a:hover {
    border-color: #c8d8ec;
    background: var(--soft-blue);
}

.template-list span {
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 700;
}

.template-create-form,
.template-blocks {
    display: grid;
    gap: 14px;
}

.template-block {
    display: grid;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
    background: var(--survai-bg-soft);
}

.template-block[draggable="true"] {
    cursor: default;
}

.template-block.is-dragging {
    opacity: 0.58;
    outline: 2px solid var(--accent);
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.14);
}

.template-block-reorder-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: -4px 0 2px;
}

.template-block-drag-handle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    border: 1px solid #dbe4f0;
    border-radius: 999px;
    padding: 0 12px;
    color: var(--navy);
    background: var(--survai-tint-edf4ff);
    cursor: grab;
    font-size: 0.78rem;
    font-weight: 850;
}

.template-block-drag-handle:active {
    cursor: grabbing;
}

.template-block-drag-handle span {
    color: var(--accent-dark);
    font-size: 1rem;
    line-height: 1;
    letter-spacing: -2px;
}

.template-block-mobile-order {
    display: none;
    align-items: center;
    gap: 6px;
}

.template-order-toast {
    position: fixed;
    top: max(16px, env(safe-area-inset-top));
    right: max(16px, env(safe-area-inset-right));
    z-index: 10000;
    max-width: min(340px, calc(100vw - 32px));
    border: 1px solid rgba(22, 112, 74, 0.28);
    border-radius: 12px;
    padding: 11px 14px;
    color: var(--survai-ink-0f3d2d);
    background: var(--survai-tint-ecfdf3);
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.16);
    font-size: 0.88rem;
    font-weight: 850;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity 160ms ease, transform 160ms ease;
}

.template-order-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.template-order-toast.is-error {
    border-color: rgba(180, 35, 24, 0.28);
    color: var(--survai-ink-7a271a);
    background: var(--survai-tint-fef3f2);
}

@media (max-width: 760px) {
    .template-block-reorder-bar {
        align-items: stretch;
        flex-direction: column;
    }

    .template-block-drag-handle,
    .template-block-mobile-order {
        width: 100%;
    }

    .template-block-drag-handle {
        justify-content: center;
    }

    .template-block-mobile-order {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .template-block-mobile-order .btn {
        width: 100%;
    }
}

.template-block-new {
    background: var(--survai-card);
}

.template-text {
    min-height: 150px;
    line-height: 1.5;
}

.check-row {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0;
}
.check-row, .account-check, label.form-note { font-weight: 400; }

.check-row input {
    width: auto;
}

.inline-check {
    align-self: end;
    min-height: 42px;
}

.danger-check {
    color: var(--danger);
}

.slim-grid {
    grid-template-columns: 160px minmax(0, 1fr);
}

.client-name-grid {
    display: grid;
    grid-template-columns: 160px minmax(0, 1fr) minmax(0, 1fr);
    gap: 18px;
}

.client-details-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
        "primary"
        "secondary"
        "agent"
        "solicitor";
    gap: 18px;
    align-items: start;
}

.client-card-primary {
    grid-area: primary;
}

.client-card-secondary {
    grid-area: secondary;
}

.client-card-agent {
    grid-area: agent;
}

.client-card-solicitor {
    grid-area: solicitor;
}

.client-contact-card {
    display: grid;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--survai-bg-soft);
    overflow: hidden;
}

.client-contact-card__summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px;
    color: var(--navy);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 850;
    list-style: none;
}

.client-contact-card__summary::-webkit-details-marker {
    display: none;
}

.client-contact-card__summary::after {
    display: inline-flex;
    width: 28px;
    height: 28px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(148, 163, 184, 0.36);
    border-radius: 999px;
    color: var(--survai-secondary-slate);
    content: "+";
    font-size: 1.1rem;
    font-weight: 750;
    line-height: 1;
}

.client-contact-card[open] > .client-contact-card__summary {
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.client-contact-card[open] > .client-contact-card__summary::after {
    content: "–";
}

.client-contact-card__summary:focus-visible {
    outline: 3px solid rgba(27, 90, 249, 0.22);
    outline-offset: -3px;
}

.client-contact-card__body {
    display: grid;
    gap: 14px;
    padding: 16px;
}

.client-contact-card h3 {
    margin: 0;
    color: var(--navy);
}

.lookup-inline-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.lookup-inline-status .spinner {
    width: 20px;
    height: 20px;
}

.template-delete-form {
    margin-top: 14px;
}

.section-card {
    padding: 20px;
}

.section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
    min-width: 0;
}

.section-head > div {
    min-width: 0;
}

.section-head h2 {
    margin-bottom: 0;
}

.section-head-actions {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex: 0 0 auto;
}

.collapsible-card > .section-head,
.collapsible-card > .workflow-nav-heading,
.collapsible-card > .processing-head,
.section-card > .section-head,
.output-section > header,
.po-card-head,
.page-header,
.workflow-page-header,
.report-heading {
    width: var(--survai-white-header-width);
    min-height: var(--survai-white-header-min-height);
    align-items: center;
    gap: var(--survai-white-header-gap);
    border: var(--survai-white-header-border);
    border-radius: var(--survai-white-header-radius);
    padding: var(--survai-white-header-padding);
    background: var(--survai-white-header-background);
    color: var(--survai-white-header-color);
    box-shadow: var(--survai-white-header-shadow);
}

.collapsible-card > .section-head .section-head-actions,
.collapsible-card > .workflow-nav-heading .section-head-actions,
.collapsible-card > .processing-head .section-head-actions,
.section-card > .section-head .section-head-actions,
.output-section > header .section-head-actions,
.po-card-head .section-head-actions,
.page-header .header-actions,
.workflow-page-header .header-actions,
.report-heading .header-actions {
    align-self: center;
    margin-left: auto;
}

.collapsible-card > .section-head h2,
.collapsible-card > .workflow-nav-heading h2,
.collapsible-card > .processing-head h2,
.section-card > .section-head h2,
.output-section > header h3,
.po-card-head h2,
.po-card-head h3 {
    font-size: var(--survai-white-header-title-size);
    font-weight: var(--survai-white-header-title-weight);
    line-height: var(--survai-white-header-title-line-height);
}

.collapse-toggle {
    position: relative;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: var(--survai-card);
    cursor: pointer;
}

.collapse-toggle::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    border-right: 2px solid var(--navy);
    border-bottom: 2px solid var(--navy);
    transform: translate(-50%, -65%) rotate(45deg);
    transition: transform 150ms ease;
}

.section-card.is-collapsed .collapse-toggle::before {
    transform: translate(-65%, -50%) rotate(-45deg);
}

.output-section.is-collapsed .collapse-toggle::before {
    transform: translate(-65%, -50%) rotate(-45deg);
}

.collapsible-card.is-collapsed .collapse-toggle::before {
    transform: translate(-65%, -50%) rotate(-45deg);
}

.section-collapsible[hidden] {
    display: none;
}

[data-card-collapsible][hidden] {
    display: none;
}

.section-order {
    margin-bottom: 4px;
    font-size: 0.8rem;
    font-weight: 900;
    text-transform: uppercase;
}

.section-text {
    min-height: 220px;
    line-height: 1.55;
}

/* Karaoke highlight for text-to-speech on plain-text targets (textareas use the
   native selection instead). Brand-blue wash on the word currently being read. */
.is-speaking-word {
    background: #cfe0ff;
    border-radius: 3px;
    box-shadow: 0 0 0 1px #cfe0ff;
}

/* Make the read-aloud word selection in section textareas feel on-brand and
   clearly visible while listening. */
.section-text::selection,
.room-text::selection {
    background: #cfe0ff;
    color: #0f2540;
}

.section-text.workflow-autosize-textarea {
    min-height: 0;
    overflow-y: hidden;
    resize: none;
}

.progress-page .section-text.workflow-autosize-textarea,
.survey-workflow-surface .sections-list .section-text.workflow-autosize-textarea {
    min-height: 0;
}

.section-regenerate-status {
    display: none;
    align-items: center;
    gap: 10px;
    margin: 0 0 10px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid rgba(27, 90, 249, 0.18);
    background: rgba(27, 90, 249, 0.06);
    color: var(--survai-ink-1e3a8a);
    font-size: 0.92rem;
    font-weight: 600;
}

.section-card.is-section-regenerating .section-regenerate-status,
.output-section.is-section-regenerating .section-regenerate-status {
    display: flex;
}

.section-regenerate-status__spinner {
    display: inline-flex;
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
}

.section-regenerate-status__spinner img {
    display: block;
    width: 18px;
    height: 18px;
}

.section-card.is-section-regenerating [data-regenerate-section],
.output-section.is-section-regenerating [data-regenerate-section] {
    pointer-events: none;
}

.section-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 12px;
}

.section-actions--qc {
    align-items: center;
    justify-content: flex-start;
    column-gap: 12px;
    row-gap: 10px;
}

.section-actions--qc .section-actions-main {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 9px;
    flex: 1 1 auto;
    min-width: 0;
}

.section-regeneration-guidance {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: end;
    margin-top: 12px;
}

.section-regeneration-guidance label {
    display: grid;
    gap: 7px;
    margin: 0;
}

.section-regeneration-guidance label span {
    color: var(--navy);
    font-size: 0.92rem;
    font-weight: 850;
}

.section-regeneration-guidance textarea {
    min-height: 58px;
    resize: vertical;
}

.report-builder-notice {
    position: fixed;
    top: calc(18px + env(safe-area-inset-top, 0px));
    right: calc(18px + env(safe-area-inset-right, 0px));
    z-index: 100000;
    max-width: min(320px, calc(100vw - 36px));
    border: 1px solid rgba(27, 90, 249, 0.38);
    border-radius: 12px;
    padding: 12px 14px;
    color: #ffffff;
    background: #1b5af9;
    box-shadow: 0 18px 50px rgba(7, 17, 31, 0.2);
    font-size: 0.92rem;
    font-weight: 850;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
    transition: opacity 160ms ease, transform 160ms ease;
}

.report-builder-notice.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.report-builder-notice.is-error {
    color: #ffffff;
    border-color: rgba(220, 38, 38, 0.4);
    background: #b42318;
}

.output-workspace-status-toast {
    position: fixed;
    right: calc(18px + env(safe-area-inset-right, 0px));
    z-index: 890;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: min(360px, calc(100vw - 36px));
    border: 1px solid rgba(27, 90, 249, 0.22);
    border-radius: 14px;
    padding: 12px 16px;
    color: var(--survai-ink-1e3a8a);
    background: color-mix(in srgb, var(--survai-card) 98%, transparent);
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.14);
    font-size: 0.92rem;
    font-weight: 750;
    line-height: 1.35;
    white-space: normal;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px);
    transition: opacity 160ms ease, transform 160ms ease;
}

.output-workspace-status-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.output-workspace-status-toast.is-loading {
    color: var(--survai-ink-1e3a8a);
    border-color: rgba(27, 90, 249, 0.24);
    background: color-mix(in srgb, var(--survai-tint-eff6ff) 98%, transparent);
}

.output-workspace-status-toast.is-success {
    color: var(--survai-ink-166534);
    border-color: rgba(22, 101, 52, 0.22);
    background: color-mix(in srgb, var(--survai-tint-f0fdf4) 98%, transparent);
}

.output-workspace-status-toast.is-error {
    color: var(--survai-ink-991b1b);
    border-color: rgba(220, 38, 38, 0.24);
    background: color-mix(in srgb, var(--survai-tint-fef2f2) 98%, transparent);
}

.output-workspace-status-toast__spinner {
    display: block;
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    background: url('../icons/survai-queue-spinner.svg') center / contain no-repeat;
}

.output-workspace-status-toast__text {
    min-width: 0;
}

.output-accommodation-actions .save-state:empty {
    display: none;
}

.section-actions--qc .section-qc-approval {
    margin: 0;
    margin-left: auto;
    padding: 0;
    background: transparent;
    flex: 0 0 auto;
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
}

.section-actions .btn {
    flex: 0 1 auto;
}

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

.text-danger {
    color: var(--survai-ink-b42318);
}

.regenerate-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.regenerate-actions .inline-action-form {
    display: inline-flex;
}

.regenerate-actions .btn {
    white-space: nowrap;
}

.speech-rate-control {
    width: 38px;
    height: 38px;
    min-width: 38px;
    padding-right: 0;
    padding-left: 0;
}

.speech-rate-value {
    display: inline-flex;
    min-height: 38px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0 10px;
    color: var(--muted);
    background: var(--survai-bg);
    font-size: 0.82rem;
    font-weight: 900;
    line-height: 1;
}

.condition-rating-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    border-radius: 50%;
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 950;
    line-height: 1;
    box-shadow: none;
}

[data-condition-rating-badge] {
    cursor: pointer;
}

[data-condition-rating-badge]:focus-visible {
    outline: 3px solid rgba(27, 90, 249, 0.28);
    outline-offset: 3px;
}

.condition-rating-badge.rating-cr3 {
    background: #d92d20;
}

.condition-rating-badge.rating-cr2 {
    background: #f59e0b;
}

.condition-rating-badge.rating-cr1 {
    background: #16a34a;
}

.condition-rating-badge.rating-ni,
.condition-rating-badge.rating-na {
    background: #6b7280;
}

.condition-rating-badge.rating-cr3,
.condition-rating-badge.rating-cr2,
.condition-rating-badge.rating-cr1,
.condition-rating-badge.rating-ni,
.condition-rating-badge.rating-na {
    border-color: transparent;
    color: #ffffff;
    box-shadow: none;
}

.condition-rating-control {
    display: grid;
    gap: 10px;
    margin-bottom: 14px;
}

.condition-rating-control > span {
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 900;
    text-transform: uppercase;
}

.condition-rating-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.condition-rating-option {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 48px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 7px 10px 7px 7px;
    background: var(--survai-card);
    color: var(--navy);
    cursor: pointer;
}

.condition-rating-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.condition-rating-option .condition-rating-badge {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
    font-size: 0.72rem;
}

.condition-rating-option strong {
    font-size: 0.86rem;
    white-space: nowrap;
}

.condition-rating-option:has(input:checked) {
    border-color: var(--accent);
    background: var(--soft-blue);
    box-shadow: 0 0 0 3px rgba(11, 18, 32, 0.1);
}

.condition-rating-picker {
    position: fixed;
    z-index: 10000;
    display: grid;
    gap: 6px;
    width: 236px;
    padding: 8px;
    border: 1px solid var(--survai-border-ink);
    border-radius: 16px;
    background: var(--survai-card);
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.18);
}

.condition-rating-picker__option {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 46px;
    border: 0;
    border-radius: 12px;
    padding: 6px 8px;
    background: transparent;
    color: var(--navy);
    cursor: pointer;
    text-align: left;
}

.condition-rating-picker__option:hover,
.condition-rating-picker__option:focus-visible {
    background: var(--survai-bg-tint);
    outline: none;
}

.condition-rating-picker__option .condition-rating-badge {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
    font-size: 0.72rem;
}

.condition-rating-picker__label {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.condition-rating-picker__label strong {
    font-size: 0.86rem;
    font-weight: 900;
    line-height: 1.1;
}

.condition-rating-picker__label small {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 750;
    line-height: 1.1;
}

.add-room-form {
    margin: 14px 0 18px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--survai-bg);
}

.room-area-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.room-area-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 8px 14px;
    background: var(--survai-card);
    color: var(--navy);
    cursor: pointer;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
    transition: background 150ms ease, border-color 150ms ease, color 150ms ease;
}

.room-area-pill:hover:not(:disabled),
.room-area-pill:focus-visible:not(:disabled) {
    border-color: #c8d8ec;
    background: var(--soft-blue);
}

.room-area-pill.is-added,
.room-area-pill:disabled {
    border-color: var(--accent);
    background: var(--accent);
    color: #ffffff;
    opacity: 0.72;
}

.room-area-pill.is-added {
    cursor: pointer;
}

.room-area-pill.is-added::after {
    content: "×";
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    margin-left: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    color: #ffffff;
    font-size: 0.9rem;
    line-height: 1;
}

.room-area-pill.is-added:hover,
.room-area-pill.is-added:focus-visible {
    opacity: 1;
    background: #0b1220;
    border-color: #0b1220;
}

.room-area-pill:disabled {
    cursor: default;
}

.room-area-pill.is-recent-highlight {
    opacity: 1;
    box-shadow: 0 0 0 3px rgba(11, 18, 32, 0.18);
}

.room-area-status {
    margin: -6px 0 14px;
}

.room-area-status.is-success {
    color: var(--survai-ink-166534);
}

.room-area-status.is-error {
    color: var(--survai-ink-b42318);
}

.add-room-grid {
    align-items: end;
}

@media (max-width: 560px) {
    .add-room-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 12px;
    }

    .add-custom-room-action {
        width: 100%;
        justify-self: stretch;
    }

    .add-custom-room-action .btn {
        width: 100%;
        justify-content: center;
    }
}

.add-custom-room-action {
    align-self: end;
}

.add-room-actions {
    margin-top: 12px;
}

.room-empty-note {
    padding: 14px 0 0;
}

.room-table-wrap {
    width: 100%;
    overflow-x: auto;
}

.room-table {
    width: 100%;
    min-width: 920px;
    border-collapse: collapse;
    table-layout: fixed;
}

.room-table th,
.room-table td {
    border-top: 1px solid var(--line);
    padding: 14px;
    text-align: left;
    vertical-align: top;
    overflow-wrap: anywhere;
}

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

.room-table th:first-child,
.room-table td:first-child {
    width: 150px;
}

.room-table th:last-child,
.room-table td:last-child {
    width: 350px;
}

.room-text {
    min-height: 150px;
    line-height: 1.5;
}

.room-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 0;
}

.save-state {
    min-width: 88px;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 800;
    text-align: right;
}

.save-state.success {
    color: var(--success);
}

.btn.is-copy-success,
.output-icon-action.is-copy-success,
.output-accommodation-icon-btn.is-copy-success {
    border-color: rgba(22, 101, 52, 0.28);
    color: var(--survai-ink-166534);
    background: var(--survai-tint-f0fdf4);
}

.save-state.error {
    color: var(--danger);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.capture-mode-body {
    background: #eef3f8;
}

.capture-mode-body .app-shell {
    min-height: 100vh;
}

.capture-mode-body .app-shell .main-panel {
    min-width: 0;
}

.wizard-progress {
    display: grid;
    grid-template-columns: repeat(var(--wizard-progress-count, 5), minmax(0, 1fr));
    gap: 8px;
    margin-bottom: var(--workflow-progress-bottom-gap, 1.5rem);
}

.wizard-progress button,
.wizard-progress a {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    min-height: 54px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px;
    color: var(--navy);
    background: var(--survai-bg-soft);
    cursor: pointer;
    text-align: left;
    text-decoration: none;
}

.wizard-progress button:hover,
.wizard-progress button:focus-visible,
.wizard-progress button.active,
.wizard-progress a:hover,
.wizard-progress a:focus-visible,
.wizard-progress a.active {
    border-color: #c8d8ec;
    background: var(--soft-blue);
    outline: none;
}

.wizard-progress button.complete,
.wizard-progress a.complete {
    border-color: #bbf7d0;
    background: var(--success-soft);
}

.wizard-progress button span,
.wizard-progress a span {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    border-radius: 999px;
    color: #ffffff;
    background: var(--survai-navy-surface);
    font-size: 0.84rem;
    font-weight: 900;
}

.wizard-progress button.complete span,
.wizard-progress a.complete span {
    background: var(--success);
}

.wizard-progress button strong,
.wizard-progress a strong {
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: 0.88rem;
    line-height: 1.15;
}

.new-report-template-form {
    display: grid;
    gap: 18px;
    width: 100%;
    max-width: 1180px;
    min-width: 0;
}

.new-report-template-card {
    display: grid;
    gap: 16px;
    min-width: 0;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 18px;
    padding: 18px;
    background: var(--survai-card);
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.05);
}

.new-report-template-card h2 {
    margin: 0;
    color: var(--navy);
    font-size: 1.06rem;
    font-weight: 900;
}

.new-report-primary-levels,
.new-report-other-type-grid,
.new-report-address-lookup,
.new-report-client-grid {
    display: grid;
    gap: 12px;
}

.new-report-primary-levels {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); /* M331: four levels, or three where a firm unticks Level 1 */
}

.new-report-level-option {
    display: flex;
    gap: 10px;
    align-items: center;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    min-height: 52px;
    box-sizing: border-box;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 12px;
    padding: 12px 14px;
    background: var(--survai-bg-hover);
    color: var(--survai-ink-3d4861);
    cursor: pointer;
    font-weight: 850;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.new-report-level-option:has(input:checked) {
    border-color: rgba(11, 31, 58, 0.42);
    background: var(--survai-card);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.new-report-level-option input[type="radio"] {
    flex: 0 0 auto;
    width: 16px;
    min-width: 16px;
    max-width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--navy);
}

.new-report-level-option span {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: anywhere;
    overflow: hidden;
    white-space: normal;
    word-break: normal;
    line-height: 1.25;
    text-overflow: clip;
}

.new-report-level-option--compact {
    min-height: 44px;
    padding: 10px 12px;
}

.new-report-other-types {
    border-top: 1px solid rgba(148, 163, 184, 0.18);
    padding-top: 12px;
}

.new-report-other-types summary {
    width: fit-content;
    color: var(--survai-ink-3d4861);
    cursor: pointer;
    font-weight: 850;
}

.new-report-other-type-grid {
    margin-top: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.new-report-address-lookup {
    grid-template-columns: minmax(130px, 0.34fr) minmax(0, 1fr);
}

.new-report-address-lookup[hidden] {
    display: none;
}

.new-report-selected-address {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 14px;
    padding: 14px;
    background: var(--survai-bg-hover);
    color: var(--navy);
    font-weight: 850;
}

.new-report-selected-address[hidden] {
    display: none;
}

.new-report-selected-address span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.new-report-address-status {
    min-height: 1.1rem;
    margin: 0;
    color: var(--survai-secondary-slate);
    font-size: 0.88rem;
    font-weight: 700;
}

.new-report-address-mode {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.new-report-address-mode__option {
    display: flex;
    gap: 10px;
    align-items: center;
    min-height: 48px;
    box-sizing: border-box;
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 12px;
    padding: 10px 14px;
    background: var(--survai-bg-hover);
    color: var(--survai-ink-3d4861);
    cursor: pointer;
    font-weight: 850;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.new-report-address-mode__option:has(input:checked) {
    border-color: rgba(11, 31, 58, 0.42);
    background: var(--survai-card);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.new-report-address-mode__option input[type="radio"] {
    flex: 0 0 16px;
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--navy);
}

.new-report-address-manual {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.new-report-address-manual label {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.new-report-address-manual > label:nth-child(1),
.new-report-address-manual > label:nth-child(2),
.new-report-address-manual > label:nth-child(5),
.new-report-address-manual > .new-report-address-hint {
    grid-column: 1 / -1;
}

.new-report-address-manual[hidden],
[data-address-mode-panel][hidden] {
    display: none;
}

.new-report-optional {
    color: var(--survai-muted-cool);
    font-weight: 700;
}

.new-report-address-hint {
    margin: 2px 0 0;
    color: var(--survai-secondary-slate);
    font-size: 0.84rem;
    font-weight: 600;
}

.new-report-client-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.new-report-template-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    align-items: center;
}

@media (max-width: 760px) {
    .new-report-primary-levels,
    .new-report-other-type-grid,
    .new-report-address-lookup,
    .new-report-client-grid {
        grid-template-columns: 1fr;
    }

    .new-report-template-card {
        padding: 14px;
    }

    .new-report-level-option {
        align-items: center;
        gap: 9px;
        min-height: 48px;
        padding: 11px 12px;
        font-size: 0.92rem;
    }

    .new-report-level-option input[type="radio"] {
        align-self: center;
    }

    .new-report-level-option span {
        align-self: center;
    }

    .new-report-template-actions {
        align-items: stretch;
        flex-direction: column-reverse;
    }
}

.wizard-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.wizard-toolbar {
    justify-content: flex-start;
}

.pre-survey-setup-card {
    margin-bottom: 18px;
}

.document-master-dropzone {
    display: grid;
    gap: 6px;
    border: 2px dashed #c8d8ec;
    border-radius: 12px;
    padding: 28px;
    color: var(--navy);
    background: var(--survai-tint-f8fbff);
    text-align: center;
    cursor: pointer;
}

.document-master-dropzone span {
    font-size: 1.05rem;
    font-weight: 900;
}

.document-master-dropzone em {
    color: var(--muted);
    font-style: normal;
    font-weight: 700;
}

.document-master-dropzone input {
    margin: 12px auto 0;
}

.report-site-media-metrics {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 18px;
    margin: 0 0 18px;
    padding: 14px 18px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(7, 20, 33, 0.03);
    font-size: 14px;
}

.report-site-media-metrics > div {
    display: grid;
    gap: 2px;
    min-width: 90px;
}

.report-site-media-metrics strong {
    color: var(--navy);
    font-size: 22px;
    line-height: 1;
}

.report-site-media-metrics span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.report-site-media-metrics-links {
    flex: 1 1 auto;
    text-align: right;
    min-width: 0;
}

.report-site-media-metrics-links a {
    font-weight: 700;
}

.site-media-processing-banner {
    font-weight: 600;
}

.site-media-processing-banner__row {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
}

.site-media-processing-banner__pulse {
    flex-shrink: 0;
    width: 10px;
    height: 10px;
    margin-top: 0.35em;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.85;
    animation: site-media-processing-pulse 1.2s ease-in-out infinite;
}

@keyframes site-media-processing-pulse {
    0%,
    100% {
        opacity: 0.35;
        transform: scale(0.9);
    }

    50% {
        opacity: 1;
        transform: scale(1);
    }
}

.site-media-processing-banner__text {
    margin: 0;
    flex: 1;
    font-weight: 700;
}

.site-media-processing-banner__meta {
    margin: 0.4rem 0 0;
    padding-left: calc(10px + 0.65rem);
    font-weight: 500;
    opacity: 0.88;
}

/* progress.php: momentary branded toast for background media processing */
.progress-page {
    --progress-sticky-top-offset: 124px;
}

.site-media-processing-toast-wrap {
    position: fixed;
    top: max(calc(var(--progress-sticky-top-offset, 124px) + 12px), calc(env(safe-area-inset-top, 0px) + 72px));
    right: max(18px, calc(env(safe-area-inset-right, 0px) + 18px));
    z-index: 900;
    width: min(420px, calc(100vw - 36px));
    max-width: calc(100vw - 36px);
    margin: 0;
    padding: 0;
    pointer-events: none;
    opacity: 0;
    transform: translate3d(10px, -8px, 0);
    transition: opacity 180ms ease, transform 180ms ease;
}

.site-media-processing-toast-wrap.is-visible {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

.site-media-processing-toast-wrap[hidden] {
    display: none !important;
}

.site-media-processing-toast-wrap .site-media-processing-toast {
    width: 100%;
    margin: 0;
    border-radius: 8px;
    padding: 12px 16px;
    text-align: left;
    border: none;
    color: #ffffff !important;
    background: #165ffa;
    box-shadow: 0 20px 54px rgba(15, 23, 42, 0.16);
}

.site-media-processing-toast-wrap .site-media-processing-banner__row {
    align-items: flex-start;
}

/* Force white text over the blue toast — beats the progress page's dark body
   text colour, which otherwise leaves the toast unreadable. */
.site-media-processing-toast-wrap .site-media-processing-toast,
.site-media-processing-toast-wrap .site-media-processing-banner__text {
    color: #ffffff !important;
}

.site-media-processing-toast-wrap .site-media-processing-banner__meta {
    padding-left: calc(10px + 0.65rem);
    text-align: left;
    color: rgba(255, 255, 255, 0.9) !important;
}

.site-media-processing-toast-wrap .site-media-processing-banner__pulse {
    background: var(--survai-card);
}

.report-site-media-main {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.report-site-media-primary {
    flex: 0 0 auto;
}

.report-site-media-secondary {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.report-site-media-page-header.workflow-page-header {
    margin-bottom: 0;
}

.report-site-media-page-title {
    display: inline-flex;
    align-items: center;
    gap: clamp(18px, 4vw, 34px);
}

.report-site-media-page-title img {
    width: clamp(34px, 8vw, 54px);
    height: auto;
    object-fit: contain;
}

.report-site-media-page-header h1 {
    margin-bottom: 0.2rem;
}

.report-site-media-page-lede {
    margin-bottom: 0.35rem;
    font-size: 0.92rem;
    line-height: 1.38;
}

.report-site-media-upload-shell {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}

.report-site-media-unified-head {
    display: flex;
    align-items: flex-start;
    gap: 14px 16px;
    margin-bottom: 18px;
}

.report-site-media-unified-head__icon {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(27, 90, 249, 0.1);
    color: var(--survai-ink-1b5af9);
}

.report-site-media-unified-head__icon svg {
    width: 22px;
    height: 22px;
}

.report-site-media-unified-head__copy {
    flex: 1 1 220px;
    min-width: 0;
}

.report-site-media-unified-head__copy h2 {
    margin: 0 0 6px;
    font-size: clamp(1.05rem, 1.6vw, 1.28rem);
    font-weight: 850;
    line-height: 1.2;
    color: var(--navy);
}

.report-site-media-unified-head__formats.form-note,
.report-site-media-unified-head__note.form-note {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.4;
}

.report-site-media-unified-head__note.form-note {
    margin-top: 4px;
    color: var(--muted);
}

.report-site-media-upload-tips {
    position: relative;
    flex: 0 0 auto;
    margin-left: auto;
}

.report-site-media-upload-tips > summary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 999px;
    background: color-mix(in srgb, var(--survai-bg) 92%, transparent);
    color: var(--navy);
    font-size: 0.78rem;
    font-weight: 750;
    line-height: 1;
    list-style: none;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.report-site-media-upload-tips > summary::-webkit-details-marker {
    display: none;
}

.report-site-media-upload-tips > summary svg {
    width: 14px;
    height: 14px;
    color: var(--survai-secondary-slate);
}

.report-site-media-upload-tips[open] > summary {
    border-color: rgba(27, 90, 249, 0.24);
    background: rgba(27, 90, 249, 0.08);
}

.report-site-media-upload-tips__panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 4;
    width: min(320px, calc(100vw - 48px));
    padding: 12px 14px;
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 12px;
    background: var(--survai-card);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
}

.report-site-media-upload-tips__panel ul {
    margin: 0;
    padding-left: 18px;
    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1.45;
}

.report-site-media-upload-tips__panel li + li {
    margin-top: 6px;
}

.report-site-media-unified-head.section-head {
    margin-bottom: 10px;
}

.report-site-media-unified-head .form-note {
    margin-bottom: 0;
}

.report-site-media-upload-guard {
    margin-bottom: 0;
}

.report-site-media-footnote {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.35;
}

.report-site-media-admin-card .section-head {
    margin-bottom: 10px;
}

/* Upload site media: match survey-workflow card padding; flex stack uses gap not card margins */
.report-site-media-page.survey-workflow-surface .report-site-media-main {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.report-site-media-page.survey-workflow-surface .report-site-media-main > .card,
.report-site-media-page.survey-workflow-surface .report-site-media-main > section.card,
.report-site-media-page.survey-workflow-surface .report-site-media-main > .report-site-media-upload-shell {
    margin-bottom: 0;
    min-width: 0;
}

.report-site-media-page.survey-workflow-surface .report-site-media-main > .card,
.report-site-media-page.survey-workflow-surface .report-site-media-main > section.card,
.report-site-media-page.survey-workflow-surface .report-site-media-upload-shell > .report-site-media-unified-card {
    padding: clamp(18px, 2.2vw, 24px);
    display: flex;
    flex-direction: column;
    gap: 0;
}

.report-site-media-page.survey-workflow-surface .report-site-media-main > .alert {
    margin-bottom: 0;
}

.report-site-media-page .report-site-media-diag-head,
.internal-analytics-page .report-site-media-diag-head {
    margin-bottom: 14px;
    gap: 12px 18px;
    flex-wrap: wrap;
}

.report-site-media-page .report-site-media-diag-head > div:first-child,
.internal-analytics-page .report-site-media-diag-head > div:first-child {
    flex: 1 1 220px;
    min-width: 0;
}

.report-site-media-page .report-site-media-diag-head .form-note,
.internal-analytics-page .report-site-media-diag-head .form-note {
    margin-top: 0.35rem;
    margin-bottom: 0;
}

.report-site-media-page .report-site-media-diag-actions,
.internal-analytics-page .report-site-media-diag-actions {
    flex: 1 1 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    justify-content: flex-start;
    margin-left: 0;
}

@media (min-width: 768px) {
    .report-site-media-page .report-site-media-diag-actions,
    .internal-analytics-page .report-site-media-diag-actions {
        flex: 0 1 auto;
        margin-left: auto;
        justify-content: flex-end;
    }
}

.report-site-media-page .report-site-media-diag-status,
.internal-analytics-page .report-site-media-diag-status {
    margin: 0 0 12px;
}

.report-site-media-page .report-site-media-diag-empty,
.internal-analytics-page .report-site-media-diag-empty {
    margin: 0;
}

.report-site-media-page .report-site-media-admin-table-wrap,
.internal-analytics-page .report-site-media-admin-table-wrap {
    margin-top: 2px;
}

.report-site-media-page .report-site-media-unified-card .form-actions {
    margin-top: 16px;
    margin-bottom: 0;
}

.report-site-media-page .report-site-media-workflow {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
    margin: 0 0 14px;
    padding: 14px;
    border: 1px solid var(--theme-border);
    border-radius: 12px;
    background: color-mix(in srgb, var(--theme-panel) 88%, var(--theme-surface));
}

.report-site-media-page .report-site-media-workflow legend {
    padding: 0 6px;
    color: var(--theme-muted);
    font-size: 0.75rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.report-site-media-page .report-site-media-workflow .transcript-toggle-row {
    margin: 0;
}

.report-site-media-page .report-site-media-auto-warning {
    flex: 1 1 100%;
    color: var(--theme-warning-text, var(--theme-text));
}

.report-site-media-page .report-site-media-unified-card > .form-note[role="note"] {
    margin-top: 14px;
    margin-bottom: 0;
}

.report-site-media-page .transcription-debug-action-form {
    margin: 0;
    display: inline-flex;
}

.report-site-media-admin-table-wrap {
    overflow: auto;
    max-height: min(320px, 40vh);
}

.report-site-media-data-table-compact th,
.report-site-media-data-table-compact td {
    padding: 6px 10px;
    font-size: 12px;
    line-height: 1.25;
}

.report-site-media-unified-zone {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: clamp(280px, 42vh, 420px);
    padding: 36px 24px 28px;
    border: 2px dashed rgba(27, 90, 249, 0.34);
    border-radius: 14px;
    background:
        linear-gradient(180deg, rgba(27, 90, 249, 0.05) 0%, rgba(248, 250, 252, 0.2) 42%, rgba(248, 250, 252, 0.88) 100%),
        radial-gradient(ellipse 80% 55% at 50% 0%, rgba(27, 90, 249, 0.08), transparent 70%);
    text-align: center;
    cursor: pointer;
    touch-action: manipulation;
    overscroll-behavior: contain;
    transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.report-site-media-unified-zone__icon {
    display: grid;
    place-items: center;
    width: 72px;
    height: 72px;
    margin-bottom: 4px;
    border-radius: 999px;
    background: rgba(27, 90, 249, 0.1);
    color: var(--survai-ink-1b5af9);
}

.report-site-media-unified-zone__icon svg {
    width: 34px;
    height: 34px;
}

.report-site-media-unified-zone.is-dragging,
.report-site-media-unified-zone:focus-within {
    border-color: rgba(27, 90, 249, 0.72);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
    background:
        linear-gradient(180deg, rgba(27, 90, 249, 0.08) 0%, rgba(248, 250, 252, 0.24) 42%, rgba(248, 250, 252, 0.92) 100%),
        radial-gradient(ellipse 80% 55% at 50% 0%, rgba(27, 90, 249, 0.12), transparent 70%);
}

.report-site-media-unified-strong {
    font-size: clamp(1.35rem, 2.4vw, 1.75rem);
    font-weight: 850;
    color: var(--navy);
    line-height: 1.15;
}

.report-site-media-unified-hint {
    font-size: clamp(0.92rem, 1.2vw, 1rem);
    color: var(--muted);
    max-width: 36rem;
    line-height: 1.45;
}

.report-site-media-unified-browse {
    color: var(--survai-ink-1b5af9);
    font-weight: 800;
}

.report-site-media-unified-browse-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 6px;
    padding: 11px 18px;
    border-radius: 12px;
    background: #1b5af9;
    color: #fff !important;
    font-size: 0.92rem;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 10px 24px rgba(27, 90, 249, 0.24);
    pointer-events: none;
}

.report-site-media-unified-browse-btn svg {
    width: 18px;
    height: 18px;
    color: #fff;
}

.report-site-media-unified-zone__secure {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: auto;
    padding-top: 14px;
    color: var(--survai-muted-cool);
    font-size: 0.78rem;
    font-weight: 650;
    line-height: 1.3;
}

.report-site-media-unified-zone__secure svg {
    width: 14px;
    height: 14px;
    flex: 0 0 auto;
}

.report-site-media-unified-features {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    padding: 4px 0 0;
}

.report-site-media-unified-feature {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;
    padding: 0 16px;
}

.report-site-media-unified-feature + .report-site-media-unified-feature {
    border-left: 1px solid rgba(15, 23, 42, 0.08);
}

.report-site-media-unified-feature__icon {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: rgba(27, 90, 249, 0.1);
    color: var(--survai-ink-1b5af9);
}

.report-site-media-unified-feature__icon svg {
    width: 17px;
    height: 17px;
}

.report-site-media-unified-feature__copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.report-site-media-unified-feature__copy strong {
    color: var(--navy);
    font-size: 0.82rem;
    font-weight: 850;
    line-height: 1.2;
}

.report-site-media-unified-feature__copy span {
    color: var(--muted);
    font-size: 0.74rem;
    line-height: 1.35;
}

.report-site-media-unified-zone input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
}

.report-site-media-selection {
    display: grid;
    gap: 14px;
    margin-top: 16px;
    padding: 16px;
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 14px;
    background: color-mix(in srgb, var(--survai-bg) 84%, transparent);
}

.report-site-media-selection[hidden] {
    display: none !important;
}

.report-site-media-selection__summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.report-site-media-selection__summary > div {
    min-width: 0;
    padding: 12px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 10px;
    background: var(--survai-card);
}

.report-site-media-selection__summary strong {
    display: block;
    color: var(--navy);
    font-size: 1.15rem;
    font-weight: 900;
    line-height: 1.1;
}

.report-site-media-selection__summary span {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.report-site-media-selection__status {
    margin: 0;
}

.report-site-media-selection__preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 8px;
    contain: content;
}

.report-site-media-preview-item,
.report-site-media-preview-more {
    min-width: 0;
    min-height: 64px;
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-items: center;
    column-gap: 10px;
    padding: 8px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 10px;
    background: var(--survai-card);
}

.report-site-media-preview-item img,
.report-site-media-preview-icon {
    grid-row: 1 / span 2;
    width: 56px;
    height: 56px;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.06);
}

.report-site-media-preview-item img {
    object-fit: cover;
}

.report-site-media-preview-icon {
    display: grid;
    place-items: center;
    color: var(--navy);
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.report-site-media-preview-item span:not(.report-site-media-preview-icon) {
    min-width: 0;
    overflow: hidden;
    color: var(--navy);
    font-size: 0.86rem;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.report-site-media-preview-item small {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.report-site-media-preview-more {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--navy);
    font-weight: 900;
}

.report-site-media-selection-actions[hidden] {
    display: none !important;
}

.report-site-media-page .report-site-media-selection-actions .btn,
.report-site-media-page .report-site-media-unified-zone {
    touch-action: manipulation;
}

.report-site-media-device-tip {
    flex: 1 1 100%;
    width: 100%;
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 750;
    line-height: 1.4;
}

.report-site-media-unified-card {
    position: relative;
    box-shadow: 0 12px 34px rgba(15, 23, 42, 0.07);
}

.report-site-media-upload-summary {
    margin-top: 0;
}

html[data-theme="dark"] .report-site-media-metrics,
html[data-theme="dark"] .report-site-media-metrics {
    background: rgba(255, 255, 255, 0.04);
}

html[data-theme="dark"] .report-site-media-metrics strong,
html[data-theme="dark"] .report-site-media-metrics strong {
    color: var(--survai-text);
}

html[data-theme="dark"] .report-site-media-unified-zone,
html[data-theme="dark"] .report-site-media-unified-zone {
    background: var(--survai-bg-soft);
    border-color: var(--survai-border-mid);
}

html[data-theme="dark"] .report-site-media-unified-head__copy h2,
html[data-theme="dark"] .report-site-media-unified-head__copy h2,
html[data-theme="dark"] .report-site-media-unified-feature__copy strong,
html[data-theme="dark"] .report-site-media-unified-feature__copy strong {
    color: var(--survai-text);
}

html[data-theme="dark"] .report-site-media-upload-tips > summary,
html[data-theme="dark"] .report-site-media-upload-tips > summary,
html[data-theme="dark"] .report-site-media-upload-tips__panel,
html[data-theme="dark"] .report-site-media-upload-tips__panel {
    border-color: var(--survai-border);
    background: var(--survai-card);
    color: var(--survai-text);
}

html[data-theme="dark"] .report-site-media-unified-strong,
html[data-theme="dark"] .report-site-media-unified-strong {
    color: var(--survai-text);
}

html[data-theme="dark"] .report-site-media-unified-hint,
html[data-theme="dark"] .report-site-media-unified-hint {
    color: var(--muted);
}

html[data-theme="dark"] .report-site-media-selection,
html[data-theme="dark"] .report-site-media-selection {
    border-color: var(--survai-border);
    background: var(--survai-bg-soft);
}

html[data-theme="dark"] .report-site-media-selection__summary > div,
html[data-theme="dark"] .report-site-media-selection__summary > div,
html[data-theme="dark"] .report-site-media-preview-item,
html[data-theme="dark"] .report-site-media-preview-item,
html[data-theme="dark"] .report-site-media-preview-more,
html[data-theme="dark"] .report-site-media-preview-more {
    border-color: var(--survai-border-soft);
    background: rgba(255, 255, 255, 0.04);
}

html[data-theme="dark"] .report-site-media-selection__summary strong,
html[data-theme="dark"] .report-site-media-selection__summary strong,
html[data-theme="dark"] .report-site-media-preview-item span:not(.report-site-media-preview-icon),
html[data-theme="dark"] .report-site-media-preview-item span:not(.report-site-media-preview-icon),
html[data-theme="dark"] .report-site-media-preview-more,
html[data-theme="dark"] .report-site-media-preview-more {
    color: var(--survai-text);
}

@media (max-width: 720px) {
    .report-site-media-unified-head {
        flex-wrap: wrap;
    }

    .report-site-media-upload-tips {
        margin-left: 0;
        width: 100%;
    }

    .report-site-media-upload-tips__panel {
        right: auto;
        left: 0;
        width: 100%;
    }

    .report-site-media-unified-features {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px 10px;
    }

    .report-site-media-unified-feature {
        padding: 0;
    }

    .report-site-media-unified-feature + .report-site-media-unified-feature {
        border-left: 0;
    }

    .report-site-media-unified-feature:nth-child(odd) {
        padding-right: 8px;
    }

    .report-site-media-unified-feature:nth-child(even) {
        padding-left: 8px;
        border-left: 1px solid rgba(15, 23, 42, 0.08);
    }

    .report-site-media-unified-zone {
        min-height: min(360px, 46vh);
        padding: 30px 18px 24px;
    }

    .report-site-media-selection__summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .report-site-media-selection__preview {
        grid-template-columns: 1fr;
    }

    .report-site-media-page .report-site-media-selection-actions {
        position: sticky;
        bottom: calc(10px + env(safe-area-inset-bottom, 0px));
        z-index: 30;
        display: grid;
        grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
        gap: 8px;
        margin: 14px -6px 0;
        padding: 8px;
        border: 1px solid rgba(15, 23, 42, 0.1);
        border-radius: 14px;
        background: color-mix(in srgb, var(--survai-card) 94%, transparent);
        box-shadow: 0 18px 44px rgba(15, 23, 42, 0.16);
        backdrop-filter: blur(14px);
    }

    .report-site-media-page .report-site-media-selection-actions .report-site-media-device-tip {
        grid-column: 1 / -1;
        text-align: center;
    }

    html[data-theme="dark"] body.report-site-media-page .report-site-media-selection-actions,
    html[data-theme="dark"] body.report-site-media-page .report-site-media-selection-actions {
        border-color: var(--survai-border);
        background: var(--survai-card);
    }
}

.documents-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 16px;
}

.document-category-card {
    min-width: 0;
}

.wizard-disclosure {
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 0;
    background: var(--survai-bg-soft);
}

.wizard-disclosure summary {
    padding: 13px 14px;
    color: var(--navy);
    cursor: pointer;
    font-weight: 900;
}

.wizard-disclosure > *:not(summary) {
    margin: 0 14px 14px;
}

.wizard-disclosure.has-validation-error {
    border-color: #fecaca;
    background: var(--survai-tint-fff7f7);
}

.wizard-error {
    color: var(--danger);
    font-weight: 900;
}

.section-toggle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 8px;
}

.section-toggle .pill-label {
    min-height: 42px;
    justify-content: flex-start;
    text-align: left;
}

.capture-shell {
    width: min(100%, 980px);
    margin: 0 auto;
    padding: 14px 14px 96px;
}

.capture-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin: -14px -14px 14px;
    padding: 14px;
    color: #ffffff;
    background: var(--survai-navy-surface);
    box-shadow: 0 12px 30px rgba(11, 18, 32, 0.18);
}

.capture-topbar h1 {
    margin-bottom: 4px;
    color: #ffffff;
    font-size: clamp(1.15rem, 5vw, 1.8rem);
}

.capture-topbar .eyebrow,
.capture-topbar span {
    color: rgba(255, 255, 255, 0.74);
}

.capture-status-stack {
    display: grid;
    gap: 7px;
    justify-items: end;
    min-width: 130px;
}

.capture-network-status,
.capture-sync-status {
    display: inline-flex;
    border-radius: 999px;
    padding: 7px 10px;
    color: #ffffff;
    background: rgba(255, 255, 255, 0.12);
    font-size: 0.82rem;
    font-weight: 900;
    text-align: right;
}

.capture-network-status.offline {
    color: #7c2d12;
    background: #ffedd5;
}

.capture-tabs {
    position: sticky;
    top: 86px;
    z-index: 19;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 6px;
    margin-bottom: 14px;
    border-radius: 8px;
    padding: 6px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(11, 18, 32, 0.08);
}

.capture-tabs button {
    min-height: 44px;
    border: 0;
    border-radius: 6px;
    color: var(--muted);
    background: transparent;
    font-weight: 900;
}

.capture-tabs button.active {
    color: #ffffff;
    background: var(--survai-navy-surface);
}

.capture-panel {
    display: none;
}

.capture-panel.active {
    display: block;
}

.live-capture-panel.active {
    display: block;
}

.live-capture-stage {
    position: relative;
    min-height: calc(100vh - 160px);
    overflow: hidden;
    border-radius: 16px;
    background: var(--survai-navy-surface);
    color: #ffffff;
    box-shadow: 0 18px 50px rgba(11, 18, 32, 0.22);
}

.live-camera-preview {
    display: block;
    width: 100%;
    height: calc(100vh - 160px);
    min-height: 640px;
    object-fit: cover;
    background: var(--survai-navy-surface);
}

.live-camera-placeholder {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    gap: 10px;
    padding: 26px;
    background: linear-gradient(180deg, rgba(11, 18, 32, 0.6), rgba(11, 18, 32, 0.92));
    text-align: center;
}

.live-camera-placeholder[hidden] {
    display: none;
}

.live-camera-placeholder h2 {
    color: #ffffff;
    font-size: clamp(1.6rem, 7vw, 2.8rem);
}

.live-camera-placeholder p {
    max-width: 520px;
    margin: 0 auto;
    color: rgba(255, 255, 255, 0.82);
    font-weight: 800;
}

.live-capture-top-controls {
    position: absolute;
    top: 14px;
    left: 14px;
    right: 14px;
    z-index: 3;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr) minmax(0, 0.8fr);
    gap: 8px;
}

.live-capture-top-controls label {
    display: grid;
    gap: 4px;
    margin: 0;
    border-radius: 999px;
    padding: 8px 12px;
    background: color-mix(in srgb, var(--survai-card) 92%, transparent);
    color: var(--navy);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
}

.live-capture-top-controls span {
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 900;
    line-height: 1;
    text-transform: uppercase;
}

.live-capture-top-controls select {
    min-height: 24px;
    border: 0;
    padding: 0;
    background: transparent;
    font-size: 0.92rem;
    font-weight: 900;
}

.live-capture-hud {
    position: absolute;
    top: 92px;
    left: 18px;
    right: 18px;
    z-index: 3;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    pointer-events: none;
}

.live-hud-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 18px;
    padding: 12px 14px;
    background: rgba(15, 23, 42, 0.72);
    color: #ffffff;
    font-weight: 900;
    backdrop-filter: blur(14px);
}

.live-hud-pill strong {
    color: #ffffff;
    font-size: 1.15rem;
}

.live-capture-main-actions {
    position: absolute;
    right: 18px;
    bottom: 210px;
    left: 18px;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}

.live-photo-button {
    display: inline-grid;
    width: 126px;
    height: 126px;
    place-items: center;
    border: 6px solid rgba(255, 255, 255, 0.88);
    border-radius: 50%;
    color: var(--navy);
    background: var(--survai-card);
    font-size: 0.88rem;
    font-weight: 950;
    text-transform: uppercase;
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.26);
}

.live-photo-button:disabled {
    opacity: 0.45;
}

.live-capture-bottom-sheet {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 4;
    display: grid;
    gap: 12px;
    border-radius: 18px 18px 0 0;
    padding: 18px;
    background: rgba(12, 18, 30, 0.92);
    box-shadow: 0 -18px 50px rgba(0, 0, 0, 0.28);
    backdrop-filter: blur(16px);
}

.live-capture-bottom-sheet .capture-summary-grid div {
    border-color: rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.08);
}

.live-capture-bottom-sheet .capture-summary-grid span,
.live-capture-bottom-sheet .capture-summary-grid strong,
.live-capture-bottom-sheet .form-note {
    color: #ffffff;
}

.live-photo-strip {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.live-photo-strip figure {
    position: relative;
    flex: 0 0 92px;
    width: 92px;
    height: 78px;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.22);
    border-radius: 10px;
    margin: 0;
    background: rgba(255, 255, 255, 0.1);
}

.live-photo-strip img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.live-photo-strip figcaption {
    position: absolute;
    right: 5px;
    bottom: 5px;
    border-radius: 999px;
    padding: 2px 6px;
    color: #ffffff;
    background: rgba(0, 0, 0, 0.66);
    font-size: 0.72rem;
    font-weight: 900;
}

.live-session-icon {
    display: grid;
    width: 100%;
    min-height: 74px;
    place-items: center;
    border-radius: 8px;
    color: #ffffff;
    background: linear-gradient(135deg, #b42318, #ff2f87);
    font-weight: 950;
}

.capture-desktop-handoff {
    display: grid;
    gap: 18px;
    max-width: 680px;
    margin: 22px auto;
    padding: 24px;
}

.capture-desktop-handoff input[readonly] {
    background: #f8fbff;
}

.is-pwa-standalone .capture-install-hint,
.is-pwa-standalone [data-pwa-install-button],
.is-pwa-install-suppressed [data-pwa-install-button] {
    display: none !important;
}

.pwa-install-modal[hidden] {
    display: none;
}

.pwa-install-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: grid;
    place-items: center;
    padding: max(18px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom));
}

.pwa-install-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(7, 21, 40, 0.68);
}

.pwa-install-dialog {
    position: relative;
    width: min(92vw, 420px);
    max-height: min(78vh, 620px);
    overflow: auto;
    background: var(--survai-card);
    border-radius: 14px;
    box-shadow: 0 24px 70px rgba(7, 21, 40, 0.28);
    padding: 24px;
    color: var(--navy);
}

.pwa-install-dialog h2 {
    margin: 0 0 10px;
}

.pwa-install-dialog p {
    margin: 0 0 14px;
    color: var(--muted);
    font-weight: 800;
}

.pwa-install-dialog ol {
    margin: 0 0 18px;
    padding-left: 22px;
    color: var(--navy);
    font-weight: 900;
}

.pwa-install-dialog li + li {
    margin-top: 8px;
}

.pwa-install-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 999px;
    background: var(--survai-tint-eef4fb);
    color: var(--navy);
    font-size: 28px;
    line-height: 1;
    font-weight: 900;
    cursor: pointer;
}

.capture-screen {
    display: none;
}

@media (min-width: 921px) {
    .live-capture-panel .capture-screen {
        display: none;
    }
}

@media (max-width: 920px) {
    .capture-mode-body {
        min-height: 100dvh;
        min-height: -webkit-fill-available;
    }

    .capture-mode-body .capture-topbar,
.capture-mode-body .capture-tabs,
.capture-desktop-handoff {
        display: none;
    }

    .capture-panel.active.live-capture-panel {
        min-height: 100dvh;
        min-height: -webkit-fill-available;
    }

    .capture-screen {
        height: 100dvh;
    }

    .capture-header {
        grid-template-columns: 92px minmax(0, 1fr) 44px;
        min-height: calc(54px + env(safe-area-inset-top));
        padding: calc(8px + env(safe-area-inset-top)) 12px 8px;
    }

    .capture-more-button,
    .capture-filter-button {
        place-items: center;
    }

    .capture-tag-bar {
        grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr) minmax(0, 0.92fr) 48px;
    }

    .capture-tag-pill {
        grid-template-columns: 18px minmax(0, 1fr) 11px;
        min-width: 0;
    }

    .capture-preview-video {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        min-height: 0;
        object-fit: cover;
        background: #0b0f16;
    }

    .capture-overlay-top {
        grid-template-columns: 1fr auto 1fr;
    }

    .capture-recording-badge em {
        color: rgba(255, 255, 255, 0.7);
        font-size: 0.68rem;
        font-style: normal;
        font-weight: 800;
        line-height: 1.1;
        text-transform: none;
    }

    .capture-wave i:nth-child(2) { animation-delay: 90ms; }
    .capture-wave i:nth-child(3) { animation-delay: 180ms; }
    .capture-wave i:nth-child(4) { animation-delay: 270ms; }
    .capture-wave i:nth-child(5) { animation-delay: 360ms; }
    .capture-wave i:nth-child(6) { animation-delay: 450ms; }

    @keyframes capture-wave {
        0%, 100% { height: 8px; opacity: 0.45; }
        50% { height: 25px; opacity: 1; }
    }

    .capture-image-icon::before {
        position: absolute;
        right: 3px;
        top: 3px;
        width: 4px;
        height: 4px;
        content: "";
        border-radius: 999px;
        background: #ffffff;
    }

    .capture-image-icon::after {
        position: absolute;
        left: 3px;
        bottom: 3px;
        width: 12px;
        height: 8px;
        content: "";
        background: linear-gradient(135deg, transparent 48%, #ffffff 50%);
    }

    .capture-floating-action.active {
        color: #ffd60a;
    }

    .capture-flash-button span,
    .capture-flip-button span {
        position: relative;
        width: 22px;
        height: 22px;
    }

    .capture-flash-button span::before {
        position: absolute;
        inset: 0;
        content: "";
        clip-path: polygon(44% 0, 82% 0, 60% 38%, 82% 38%, 30% 100%, 42% 54%, 18% 54%);
        background: currentColor;
    }

    .capture-flip-button span::before,
    .capture-flip-button span::after {
        position: absolute;
        content: "";
        border: 3px solid currentColor;
        border-radius: 999px;
    }

    .capture-flip-button span::before {
        border-left-color: transparent;
    }

    .capture-flip-button span::after {
        right: 0;
        bottom: 1px;
        width: 7px;
        height: 7px;
        border-top-color: transparent;
        border-left-color: transparent;
        transform: rotate(-35deg);
    }

    .capture-photo-button:disabled,
    .capture-start-recording:disabled {
        opacity: 0.45;
    }

    .capture-photo-icon::before {
        position: absolute;
        left: 7px;
        top: -8px;
        width: 10px;
        height: 5px;
        content: "";
        border-radius: 3px 3px 0 0;
        background: #111827;
    }

    .capture-photo-icon::after {
        position: absolute;
        left: 50%;
        top: 50%;
        width: 8px;
        height: 8px;
        content: "";
        border: 2px solid #111827;
        border-radius: 999px;
        transform: translate(-50%, -50%);
    }

    .capture-pause-icon::before,
    .capture-pause-icon::after {
        position: absolute;
        top: 2px;
        bottom: 2px;
        width: 6px;
        content: "";
        border-radius: 2px;
        background: #ffffff;
    }

    .capture-pause-icon::before { left: 4px; }
    .capture-pause-icon::after { right: 4px; }

    .capture-stop-icon::before {
        position: absolute;
        inset: 4px;
        content: "";
        border-radius: 3px;
        background: #ffffff;
    }

    .capture-note-icon::before {
        position: absolute;
        inset: 2px 5px;
        content: "";
        border: 2px solid #ffffff;
        border-radius: 3px;
    }

    .capture-note-icon::after {
        position: absolute;
        right: 8px;
        bottom: 4px;
        width: 8px;
        height: 8px;
        content: "";
        border-right: 2px solid #ffffff;
        border-bottom: 2px solid #ffffff;
        transform: rotate(45deg);
    }

    .capture-status-row div {
        grid-template-columns: 26px minmax(0, 1fr);
    }

    .capture-status-row strong {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .capture-status-icon.success {
        background: #30d158;
    }

    .capture-status-icon.success::before {
        width: 10px;
        height: 6px;
        content: "";
        border-bottom: 2px solid #ffffff;
        border-left: 2px solid #ffffff;
        transform: rotate(-45deg);
    }

    .capture-status-icon.network::before {
        width: 18px;
        height: 12px;
        content: "";
        border-top: 4px solid rgba(255, 255, 255, 0.82);
        border-radius: 999px 999px 0 0;
    }

    .capture-gallery .form-note {
        align-self: center;
        color: rgba(255, 255, 255, 0.76);
        font-size: 0.78rem;
    }

    .capture-tabbar {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        min-height: calc(62px + env(safe-area-inset-bottom));
        padding: 6px 8px calc(7px + env(safe-area-inset-bottom));
    }

    .capture-tab-icon {
        position: relative;
        display: block;
        width: 24px;
        height: 22px;
    }

    .capture-tab-camera::before,
    .capture-tab-folder::before,
    .capture-tab-sync::before,
    .capture-tab-more::before {
        position: absolute;
        content: "";
        inset: 3px;
        border: 2px solid currentColor;
        border-radius: 4px;
    }

    .capture-tab-camera::after {
        position: absolute;
        left: 50%;
        top: 50%;
        width: 7px;
        height: 7px;
        content: "";
        border: 2px solid currentColor;
        border-radius: 999px;
        transform: translate(-50%, -50%);
    }

    .capture-tab-folder::before {
        border-radius: 3px;
        transform: skewX(-8deg);
    }

    .capture-tab-sync::before {
        border-left-color: transparent;
        border-radius: 999px;
    }

    .capture-tab-more::before {
        border: 0;
        box-shadow: 0 8px 0 currentColor, 8px 8px 0 currentColor, 16px 8px 0 currentColor;
        width: 4px;
        height: 4px;
        inset: 3px auto auto 2px;
        border-radius: 999px;
        background: currentColor;
    }
}

.capture-refresh-button span {
    position: relative;
    width: 18px !important;
    height: 18px !important;
    border: 2px solid currentColor;
    border-left-color: transparent;
    border-radius: 999px;
    background: transparent !important;
}

.capture-refresh-button span::after {
    position: absolute;
    top: -3px;
    right: -2px;
    width: 0;
    height: 0;
    content: "";
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 7px solid currentColor;
    transform: rotate(-28deg);
}

@media (max-width: 920px) and (orientation: landscape) {
    .capture-header {
        min-height: calc(44px + env(safe-area-inset-top));
        padding-top: calc(4px + env(safe-area-inset-top));
    }

    .capture-overlay-top {
        top: 14px;
    }

    .capture-control-tray {
        right: 76px;
        grid-template-columns: 1fr 1fr;
    }

    .capture-recorder-controls {
        grid-template-columns: repeat(3, minmax(68px, 1fr));
    }

    .capture-tray-button,
    .capture-stop-button {
        min-height: 64px;
    }

    .capture-status-row,
    .capture-gallery {
        min-height: 54px;
    }
}

.capture-card {
    display: grid;
    gap: 16px;
}

.capture-cover-card {
    margin-bottom: 14px;
}

.capture-cover-layout {
    display: grid;
    grid-template-columns: minmax(180px, 280px) minmax(0, 1fr) minmax(260px, 0.8fr);
    gap: 18px;
    align-items: start;
}

.capture-template-form {
    align-self: stretch;
}

.desk-pdf-template-grid-slot {
    min-width: 0;
}

.desk-pdf-template-selector-card {
    max-width: min(100%, 520px);
    margin-top: 2px;
    border: 1px solid var(--line, #e2e8f0);
    border-radius: 12px;
    padding: 1rem 1.15rem 1.05rem;
    background: var(--survai-card);
}

.desk-pdf-template-form-inner label > span {
    font-weight: 700;
    color: var(--navy, #0b1321);
}

.desk-pdf-template-form-inner .compact-form label,
.desk-pdf-template-form-inner label {
    margin-bottom: 0;
}

.desk-pdf-template-form-inner select {
    margin-top: 0.45rem;
}

.desk-pdf-template-actions {
    margin-top: 1.35rem;
    padding-top: 1.2rem;
    border-top: 1px solid var(--line, #e2e8f0);
}

.desk-pdf-template-action-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    justify-content: flex-start;
}

.desk-pdf-template-action-row .btn {
    min-height: 42px;
}

.capture-cover-preview {
    min-height: 180px;
}

.capture-cover-preview img {
    min-height: 180px;
}

.capture-file-button {
    display: grid;
    min-height: 92px;
    place-items: center;
    border: 2px dashed #b9c8db;
    border-radius: 8px;
    background: #f8fbff;
    color: var(--navy);
    font-size: 1.08rem;
    font-weight: 900;
    text-align: center;
}

.capture-file-button input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.capture-photo-preview {
    width: 100%;
    max-height: 420px;
    border-radius: 8px;
    object-fit: contain;
    background: var(--survai-navy-surface);
}

.capture-recorder-status {
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 16px;
    background: #ffffff;
}

.recording-dot.is-recording {
    background: var(--danger);
    box-shadow: 0 0 0 6px rgba(180, 35, 24, 0.14);
}

.sticky-capture-controls {
    position: sticky;
    bottom: 10px;
    z-index: 18;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px;
    background: color-mix(in srgb, var(--survai-card) 96%, transparent);
    box-shadow: 0 14px 36px rgba(11, 18, 32, 0.14);
}

.capture-summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.capture-summary-grid div {
    display: grid;
    gap: 5px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    background: #f8fafc;
}

.capture-summary-grid span {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.capture-summary-grid strong {
    color: var(--navy);
    font-size: 1.3rem;
}

.server-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.capture-action-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.capture-action-bar form {
    margin: 0;
}

.capture-list {
    display: grid;
    gap: 12px;
}

.capture-list-item {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
    border: 1px solid var(--line);
    border-left: 5px solid var(--warning);
    border-radius: 8px;
    padding: 12px;
    background: #ffffff;
}

.capture-list-item.status-synced {
    border-left-color: var(--success);
}

.capture-list-item.status-failed {
    border-left-color: var(--danger);
}

.capture-list-item.status-device_only {
    border-left-color: var(--muted);
}

.capture-list-item img,
.capture-list-item audio,
.capture-list-item video {
    width: 100%;
    max-height: 90px;
    border-radius: 6px;
    object-fit: cover;
}

.capture-list-item span,
.capture-list-item em,
.capture-list-item p {
    display: block;
    margin: 3px 0 0;
    color: var(--muted);
}

.capture-item-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.server-capture-list {
    border-top: 1px solid var(--line);
    padding-top: 10px;
}

.server-capture-list > div:not(.capture-photo-review-strip) {
    display: grid;
    gap: 3px;
    border-bottom: 1px solid var(--line);
    padding: 10px 0;
}

.capture-photo-review-strip {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.server-capture-list .capture-photo-review-strip > div {
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px;
    background: #ffffff;
}

.capture-photo-review-strip img {
    width: 100%;
    aspect-ratio: 4 / 3;
    border-radius: 6px;
    object-fit: cover;
    background: #f3f4f8;
}

.capture-photo-review-strip span {
    color: var(--muted);
    font-size: 0.84rem;
}

@media (min-width: 901px) {
    /* Expanded desktop rail: icon above label (matches collapsed / mobile chrome). */
    body:not(.sidebar-desktop-collapsed) .sidebar-nav a {
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        gap: 13px;
        min-height: auto;
        padding: 12px 10px;
        text-align: center;
    }

    body:not(.sidebar-desktop-collapsed) .sidebar-nav-icon {
        width: 38px;
        height: 38px;
        flex-basis: 38px;
        flex-shrink: 0;
    }

    body:not(.sidebar-desktop-collapsed) .sidebar-nav-icon svg {
        stroke-width: 2.25;
    }

    body:not(.sidebar-desktop-collapsed) .sidebar-nav-label {
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
        text-align: center;
        font-size: 0.82rem;
        font-weight: 400;
        line-height: 1.2;
        max-width: 100%;
    }

    .sidebar-desktop-header-row {
        display: flex;
        align-items: flex-start;
        justify-content: space-between;
        gap: 10px;
        min-width: 0;
    }

    .sidebar-desktop-header-row .sidebar-brand {
        flex: 1;
        min-width: 0;
    }

    .sidebar-desktop-collapse {
        display: inline-flex;
        flex-shrink: 0;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        margin-top: 2px;
        border: 1px solid rgba(255, 255, 255, 0.22);
        border-radius: 10px;
        padding: 0;
        color: #ffffff;
        background: rgba(255, 255, 255, 0.08);
        font-size: 1rem;
        font-weight: 400;
        line-height: 1;
        cursor: pointer;
    }

    body.sidebar-desktop-collapsed .app-shell {
        --sidebar-width: var(--survai-app-rail-width);
    }

    body.sidebar-desktop-collapsed .sidebar {
        gap: 15px;
        padding-right: 14px;
        padding-left: 14px;
    }

    body.sidebar-desktop-collapsed .sidebar-desktop-header-row {
        display: grid;
        justify-items: center;
        gap: 12px;
    }

    body.sidebar-desktop-collapsed .sidebar-brand {
        width: 100%;
        max-width: 100%;
        justify-content: center;
        overflow: visible;
    }

    body.sidebar-desktop-collapsed .sidebar-brand::before {
        content: "";
        display: block;
        width: 100%;
        height: 78px;
        flex-basis: auto;
        border-radius: 0;
        background-color: transparent;
        background-image: url("../icons/survai-wordmark-menu.png");
        background-size: contain;
        background-position: center;
        background-repeat: no-repeat;
        mix-blend-mode: normal;
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
    }

    body.sidebar-desktop-collapsed .brand-logo-sidebar {
        display: none;
    }

    body.sidebar-desktop-collapsed .sidebar-desktop-collapse {
        width: 44px;
        height: 44px;
        font-size: 1.12rem;
    }

    body.sidebar-desktop-collapsed .sidebar-nav a {
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        gap: 10px;
        padding: 10px 5px;
        min-height: auto;
    }

    body.sidebar-desktop-collapsed .sidebar-nav a::before {
        top: 6px;
        bottom: 6px;
    }

    body.sidebar-desktop-collapsed .sidebar-nav-icon {
        width: 28px;
        height: 28px;
        flex-basis: 28px;
    }

    body.sidebar-desktop-collapsed .sidebar-nav-icon svg {
        stroke-width: 1.15;
    }

    body.sidebar-desktop-collapsed .sidebar-nav-label {
        font-size: 0.76rem;
        line-height: 1.18;
        font-weight: 400;
    }

    body.sidebar-desktop-collapsed .user-pill {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    body.sidebar-desktop-collapsed .sidebar-footer {
        justify-items: center;
    }

    body.sidebar-desktop-collapsed .sidebar-footer .btn {
        width: 56px;
        height: 56px;
        min-height: 56px;
        padding: 0;
        border-radius: 16px;
        font-size: 0;
    }

    body.sidebar-desktop-collapsed .sidebar-footer .btn::before {
        display: inline-block;
        width: 24px;
        height: 24px;
        content: "";
        background:
            linear-gradient(currentColor, currentColor) 4px 10px / 14px 2px no-repeat,
            linear-gradient(currentColor, currentColor) 10px 4px / 2px 14px no-repeat;
        transform: rotate(45deg);
    }

    body.sidebar-desktop-collapsed .sidebar-footer .btn::after {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        content: "Logout";
        clip: rect(0, 0, 0, 0);
    }

}

@media (max-width: 900px) {
    .sidebar-desktop-header-row {
        display: contents;
    }

    .sidebar-desktop-collapse {
        display: none !important;
    }

    .app-shell {
        grid-template-columns: 1fr;
    }

    /*
     * Reports: desktop rule keeps a narrow icon rail + main. Below 900px the sidebar is a drawer
     * or stacked — keep a single grid track so .main-panel spans the full viewport width.
     */
    body.reports-page .app-shell {
        grid-template-columns: 1fr;
        min-width: 0;
    }

    /* Operational dashboard: desktop rule is 248px + main; single column when shell stacks */
    .ops-dashboard-page .app-shell {
        grid-template-columns: 1fr;
        min-width: 0;
    }

    body:not(.login-body):not(.capture-mode-body):not(.survaicam-page):not(.pdf-viewer-body):not(
            .sai-studio-app
        )
        .app-shell:has(> aside.sidebar:not(.sidebar--workspace)) {
        grid-template-columns: 1fr;
        min-width: 0;
    }

    /* Without JS drawer (.has-mobile-sidebar), stack sidebar in-flow as a fallback only. */
    body:not(.has-mobile-sidebar) .sidebar {
        position: static;
        height: auto;
        min-height: auto;
        padding: 16px;
    }

    body:not(.has-mobile-sidebar) .sidebar-brand {
        justify-content: flex-start;
    }

    body:not(.has-mobile-sidebar) .sidebar-nav {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body:not(.has-mobile-sidebar) .sidebar-nav a {
        text-align: center;
    }

    body:not(.has-mobile-sidebar) .sidebar-footer {
        grid-template-columns: 1fr auto;
        align-items: center;
    }

    .floating-report-toolbar {
        left: 16px;
        bottom: 16px;
        width: min(320px, calc(100vw - 32px));
    }

    .page-header,
    .report-heading {
        flex-direction: column;
        align-items: stretch;
    }

    .header-actions {
        justify-content: flex-start;
    }

    .processing-head {
        flex-direction: column;
    }

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

    .diagnostic-detail,
    .processing-log-entry {
        grid-template-columns: 1fr;
    }

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

    .wizard-progress {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .section-toggle-grid {
        grid-template-columns: 1fr;
    }

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

    .voice-recorder-meta,
    .voice-note-item,
    .supporting-document-layout {
        grid-template-columns: 1fr;
    }

    .supporting-document-item {
        grid-template-columns: 70px minmax(0, 1fr);
    }

    .supporting-document-actions {
        grid-column: 1 / -1;
        justify-content: stretch;
    }

    .supporting-document-actions .btn,
    .supporting-document-actions .inline-action-form {
        flex: 1 1 130px;
    }

    .voice-recorder-controls {
        top: 8px;
    }

    .file-input {
        max-width: none;
    }

    .pdf-settings-layout {
        grid-template-columns: 1fr;
    }

    .cover-preview,
    .cover-preview img {
        min-height: 220px;
    }

    .capture-cover-layout {
        grid-template-columns: 1fr;
    }

    .capture-cover-preview,
    .capture-cover-preview img {
        min-height: 190px;
    }

    .profile-image-grid {
        grid-template-columns: 1fr;
    }

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

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

    .client-name-grid {
        grid-template-columns: 1fr;
    }

    .client-details-layout {
        grid-template-columns: 1fr;
        grid-template-areas:
            "primary"
            "secondary"
            "agent"
            "solicitor";
    }

    .section-image-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

    .photo-grid-review {
        grid-template-columns: 1fr;
    }

    .photo-panel-actions {
        justify-content: flex-start;
    }

    .capture-topbar {
        flex-direction: column;
    }

    .capture-status-stack {
        width: 100%;
        grid-template-columns: 1fr 1fr;
        justify-items: stretch;
    }

    .capture-network-status,
    .capture-sync-status {
        justify-content: center;
        text-align: center;
    }

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

    .capture-tabs {
        top: 128px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .live-capture-stage {
        min-height: calc(100dvh - 112px);
        margin: 0 -14px;
        border-radius: 0;
    }

    .live-camera-preview {
        height: calc(100dvh - 112px);
        min-height: 620px;
    }

    .live-capture-top-controls {
        grid-template-columns: 1fr;
    }

    .live-capture-hud {
        top: 178px;
    }

    .live-capture-main-actions {
        bottom: 236px;
    }

    .live-capture-main-actions .btn {
        min-height: 52px;
    }

    .live-photo-button {
        width: 116px;
        height: 116px;
    }

    .live-capture-bottom-sheet {
        padding: 14px;
    }

    .live-capture-bottom-sheet .capture-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .capture-list-item {
        grid-template-columns: 88px minmax(0, 1fr);
    }

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

    .workflow-builder-layout {
        grid-template-columns: 1fr;
    }

    .capture-item-actions {
        grid-column: 1 / -1;
        justify-content: stretch;
    }

    .capture-item-actions .btn {
        flex: 1 1 140px;
    }

    body.has-mobile-sidebar {
        --survai-mobile-drawer-brand-height: 84px;
        /* Mobile white bar: hamburger brand mark (all pages using initMobileMenu + logo asset) */
        --survai-mobile-header-brand-logo-height: 45px;
        --survai-mobile-app-header-total: calc(110px + env(safe-area-inset-top, 0px));
    }

    body.has-mobile-sidebar:has(.mobile-menu-toggle--brand) {
        --survai-mobile-app-header-total: calc(
            var(--survai-mobile-header-brand-logo-height) + 40px + env(safe-area-inset-top, 0px)
        );
    }

    body.has-mobile-sidebar .main-panel {
        padding-top: calc(
            var(--survai-mobile-app-header-total)
            + var(--app-main-padding)
            + var(--survai-toolbar-content-gap)
        );
    }

    body.dashboard-body.has-mobile-sidebar .main-panel {
        padding-top: calc(
            var(--survai-mobile-app-header-total)
            + var(--app-main-padding)
            + var(--survai-toolbar-content-gap)
        );
    }

    body.has-mobile-sidebar .mobile-app-header {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 890;
        display: flex;
        justify-content: space-between;
        min-height: var(--survai-mobile-app-header-total);
        align-items: center;
        gap: 12px;
        padding-top: calc(env(safe-area-inset-top, 0px) + 16px);
        padding-right: max(14px, env(safe-area-inset-right, 0px));
        padding-bottom: 14px;
        padding-left: max(14px, env(safe-area-inset-left, 0px));
        border-bottom: 1px solid rgba(15, 23, 42, 0.1);
        background: var(--survai-card);
        box-sizing: border-box;
    }

    /*
     * Report workspace: fixed .workspace-topbar (z-index ~880) otherwise covers the mobile menu bar.
     * Stack the topbar under the injected mobile header and add matching scroll padding.
     */
    body.has-mobile-sidebar .workspace-topbar:not(.workspace-topbar--mobile-embedded) {
        top: var(--survai-mobile-app-header-total);
    }

    body.has-mobile-sidebar .sidebar.sidebar--workspace + .workspace-topbar + .main-panel {
        padding-top: calc(var(--app-main-padding) + 100px + var(--survai-toolbar-content-gap) + var(--survai-mobile-app-header-total));
    }

    body.workspace-expanded-mode.has-mobile-sidebar .sidebar.sidebar--workspace + .workspace-topbar + .main-panel {
        padding-top: calc(
            var(--app-main-padding)
            + var(--survai-mobile-app-header-total)
            + var(--survai-toolbar-content-gap)
        );
    }

    /*
     * Browser / workspace fullscreen: never slide the fixed mobile shell toolbar off-screen.
     * Keep .mobile-app-header + embedded workspace topbar visible with safe stacking.
     */
    html:-webkit-full-screen body.workspace-expanded-mode.has-mobile-sidebar .mobile-app-header,
    html:fullscreen body.workspace-expanded-mode.has-mobile-sidebar .mobile-app-header,
    body.workspace-expanded-mode.has-mobile-sidebar .mobile-app-header {
        position: fixed !important;
        top: 0 !important;
        right: 0 !important;
        left: 0 !important;
        z-index: 890 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        transform: none !important;
        box-sizing: border-box;
    }

    body.workspace-expanded-mode.has-mobile-sidebar .workspace-topbar.workspace-topbar--mobile-embedded {
        visibility: visible !important;
        pointer-events: auto !important;
        transform: none !important;
        position: static !important;
    }

    body.workspace-expanded-mode.has-mobile-sidebar .dashboard-body .main-panel,
    body.workspace-expanded-mode.has-mobile-sidebar .main-panel {
        padding-top: calc(
            var(--app-main-padding)
            + var(--survai-mobile-app-header-total)
            + var(--survai-toolbar-content-gap)
        ) !important;
    }

    body.has-mobile-sidebar img.survai-wordmark {
        display: block;
        height: 26px;
        width: auto;
        max-width: min(176px, 46vw);
        object-fit: contain;
        object-position: center;
    }

    body.has-mobile-sidebar .sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        z-index: 1010;
        height: 100dvh !important;
        min-height: 100vh !important;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding-top: calc(16px + env(safe-area-inset-top));
        transform: translateX(-105%) !important;
        transition: transform 180ms ease;
        box-shadow: 8px 0 22px rgba(11, 18, 32, 0.12);
        /* Same narrow rail as reports.php for every mobile drawer (ops, workspace, standard). */
        width: min(var(--survai-app-rail-width, 168px), calc(100vw - 24px));
        min-width: 0;
        max-width: min(var(--survai-app-rail-width, 168px), calc(100vw - 24px));
        gap: 15px;
        padding-left: 14px;
        padding-right: 14px;
        padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
        isolation: isolate;
        overflow-x: clip;
    }

    body.has-mobile-sidebar.mobile-menu-open .sidebar {
        /* `none`, not translateX(0): a transformed rail would be the containing block for the
           stage menus it fixes beside itself (report-overview.php), and clip them. The slide
           still animates, since none interpolates as the identity. */
        transform: none !important;
        /* Softer edge: large blur + scrim read as a muddy “oval” on iOS Safari */
        box-shadow: 6px 0 20px rgba(11, 18, 32, 0.14);
    }

    body.has-mobile-sidebar .sidebar-brand {
        justify-content: center;
        overflow: visible;
        isolation: isolate;
        width: 100%;
        max-width: 100%;
    }

    body.has-mobile-sidebar .sidebar .sidebar-brand img {
        display: none !important;
    }

    /* Mobile drawers: one wordmark treatment (reports-style rail). */
    body.has-mobile-sidebar .sidebar .sidebar-brand::before {
        display: block !important;
        width: 100%;
        height: var(--survai-mobile-drawer-brand-height, 84px);
        flex-basis: auto;
        border-radius: 0;
        background-color: transparent;
        background-image: url("../icons/survai-wordmark-menu.png");
        background-size: contain;
        background-position: center;
        background-repeat: no-repeat;
        mix-blend-mode: normal;
        content: "";
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
    }

    body.has-mobile-sidebar .sidebar .brand-logo-sidebar {
        display: none !important;
    }

    body.has-mobile-sidebar .sidebar .sidebar-nav {
        display: grid;
        grid-template-columns: 1fr;
        gap: 6px;
    }

    body.has-mobile-sidebar .sidebar .sidebar-nav a {
        flex-direction: column;
        align-items: center;
        justify-content: flex-start;
        gap: 12px;
        padding: 10px 5px;
        border-radius: 14px;
        font-size: 0.72rem;
        font-weight: 400;
        line-height: 1.2;
        text-align: center;
    }

    body.has-mobile-sidebar .sidebar .sidebar-nav a.active {
        background: transparent !important;
        border-color: transparent !important;
        box-shadow: none !important;
    }

    /*
     * Project / account Settings in the drawer duplicates the cog control in workspace-topbar--global or report topbar:
     * hide only on phones. Pages without that topbar (e.g. standalone admin, coverage map if no header) stay unchanged.
     */
    body.has-mobile-sidebar .sidebar.sidebar--workspace .sidebar-nav a[href*='report-settings'] {
        display: none !important;
    }

    body.has-mobile-sidebar:has(.workspace-topbar--global) .sidebar:not(.sidebar--workspace) .sidebar-nav a[href$='settings.php'] {
        display: none !important;
    }

    body.has-mobile-sidebar .sidebar .sidebar-nav-icon {
        width: 26px;
        height: 26px;
        flex: 0 0 26px;
        isolation: isolate;
    }

    body.has-mobile-sidebar .sidebar .sidebar-nav-icon svg {
        stroke-width: 1.35;
    }

    body.has-mobile-sidebar .sidebar .sidebar-nav-label {
        font-weight: 400;
        font-size: 0.74rem;
        line-height: 1.15;
    }

    body.has-mobile-sidebar .sidebar-footer {
        grid-template-columns: 1fr;
        justify-items: center;
    }

    body.has-mobile-sidebar .user-pill {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
        border: 0;
    }

    body.has-mobile-sidebar .sidebar-footer .btn {
        width: 44px;
        height: 44px;
        min-height: 44px;
        padding: 0;
        border-radius: 14px;
        font-size: 0;
    }

    body.has-mobile-sidebar .sidebar-footer .btn::before {
        display: inline-block;
        width: 24px;
        height: 24px;
        content: "";
        background:
            linear-gradient(currentColor, currentColor) 4px 10px / 14px 2px no-repeat,
            linear-gradient(currentColor, currentColor) 10px 4px / 2px 14px no-repeat;
        transform: rotate(45deg);
    }

    body.has-mobile-sidebar .mobile-menu-toggle {
        position: relative;
        top: auto;
        left: auto;
        z-index: 1;
        display: flex;
        width: 44px;
        height: 44px;
        flex-shrink: 0;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 5px;
        border: 1px solid rgba(15, 23, 42, 0.12);
        border-radius: 10px;
        background: color-mix(in srgb, var(--survai-bg-tint) 95%, transparent);
        box-shadow: none;
    }

    body.has-mobile-sidebar .mobile-menu-toggle--brand {
        width: auto;
        height: auto;
        min-width: 44px;
        min-height: 44px;
        max-width: min(420px, 58vw);
        flex-direction: row;
        gap: 0;
        padding: 6px 8px;
        margin: 0;
        border: none !important;
        background: transparent !important;
        box-shadow: none !important;
        -webkit-appearance: none;
        appearance: none;
        align-items: center;
        justify-content: flex-start;
    }

    body.has-mobile-sidebar .mobile-menu-toggle--brand:hover,
    body.has-mobile-sidebar .mobile-menu-toggle--brand:focus-visible {
        border: none !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    body.has-mobile-sidebar .mobile-menu-toggle--brand:focus-visible {
        outline: 2px solid rgba(27, 90, 249, 0.42);
        outline-offset: 3px;
        border-radius: 8px;
    }

    body.has-mobile-sidebar .mobile-menu-toggle--brand .mobile-menu-toggle__logo {
        display: block;
        width: auto;
        height: var(--survai-mobile-header-brand-logo-height);
        max-height: var(--survai-mobile-header-brand-logo-height);
        max-width: 100%;
        object-fit: contain;
        object-position: left center;
        pointer-events: none;
        -webkit-user-drag: none;
        user-select: none;
        mix-blend-mode: normal;
    }

    body.has-mobile-sidebar.mobile-menu-open .mobile-menu-toggle--brand {
        border: none !important;
        background: transparent !important;
        box-shadow: none !important;
        opacity: 0.92;
    }

    body.has-mobile-sidebar.mobile-menu-open .mobile-menu-toggle {
        left: auto;
    }

    body.has-mobile-sidebar .mobile-menu-toggle:not(.mobile-menu-toggle--brand):not(.mobile-menu-toggle--fallback) span {
        display: block;
        width: 20px;
        height: 2px;
        border-radius: 999px;
        background: var(--survai-ink-surface);
        transition: transform 160ms ease, opacity 160ms ease;
    }

    body.has-mobile-sidebar .mobile-menu-toggle:not(.mobile-menu-toggle--brand):not(.mobile-menu-toggle--fallback) span + span {
        margin-top: 0;
    }

    body.has-mobile-sidebar .mobile-menu-toggle:not(.mobile-menu-toggle--brand):not(.mobile-menu-toggle--fallback) span:nth-child(3) {
        margin-top: 0;
    }

    body.has-mobile-sidebar.mobile-menu-open .mobile-menu-toggle:not(.mobile-menu-toggle--brand):not(.mobile-menu-toggle--fallback) span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    body.has-mobile-sidebar.mobile-menu-open .mobile-menu-toggle:not(.mobile-menu-toggle--brand):not(.mobile-menu-toggle--fallback) span:nth-child(2) {
        opacity: 0;
    }

    body.has-mobile-sidebar.mobile-menu-open .mobile-menu-toggle:not(.mobile-menu-toggle--brand):not(.mobile-menu-toggle--fallback) span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    body.has-mobile-sidebar .mobile-menu-toggle--fallback .mobile-menu-toggle__fallback-icon {
        display: block;
        width: 22px;
        height: 22px;
        color: var(--survai-text-strong);
    }

    body.has-mobile-sidebar .mobile-menu-overlay {
        position: fixed;
        inset: 0;
        z-index: 1000;
        box-sizing: border-box;
        width: 100%;
        max-width: none;
        height: 100%;
        min-height: 100vh;
        min-height: 100dvh;
        margin: 0;
        padding: 0;
        border: 0;
        border-radius: 0 !important;
        -webkit-appearance: none;
        appearance: none;
        background: rgba(11, 18, 32, 0.42);
        display: none;
        cursor: pointer;
        -webkit-tap-highlight-color: transparent;
        pointer-events: none;
    }

    body.has-mobile-sidebar.mobile-menu-open .mobile-menu-overlay {
        display: block;
        pointer-events: auto;
    }

    body.mobile-menu-open {
        overflow: hidden;
    }

    body.capture-live-active.has-mobile-sidebar .mobile-app-header,
    body.capture-mode-body.has-mobile-sidebar .mobile-app-header,
    body.capture-live-active.has-mobile-sidebar .mobile-menu-toggle,
    body.capture-mode-body.has-mobile-sidebar .mobile-menu-toggle,
    body.capture-mode-body.has-mobile-sidebar .mobile-menu-overlay,
    body.capture-live-active.has-mobile-sidebar .mobile-menu-overlay {
        display: none !important;
        visibility: hidden !important;
        pointer-events: none !important;
    }
}

@media (max-width: 560px) {
    body {
        font-size: 15px;
    }

    .login-card {
        padding: 26px 20px;
    }

    body:not(.has-mobile-sidebar) .sidebar {
        gap: 14px;
        padding: 14px;
    }

    body:not(.has-mobile-sidebar) .sidebar-nav {
        grid-template-columns: 1fr;
    }

    body:not(.has-mobile-sidebar) .sidebar-footer {
        grid-template-columns: 1fr;
    }

    .page-header {
        gap: 14px;
        margin-bottom: 18px;
    }

    .page-header h1 {
        font-size: 1.65rem;
    }

    .wizard-progress {
        display: none;
    }

    .wizard-progress button,
    .wizard-progress a {
        grid-template-columns: 30px minmax(0, 1fr);
        min-height: 46px;
    }

    .wizard-progress button span,
    .wizard-progress a span {
        width: 28px;
        height: 28px;
    }

    .capture-shell {
        padding: 12px 10px 88px;
    }

    .capture-tabs {
        top: 126px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .capture-summary-grid,
    .server-summary {
        grid-template-columns: 1fr;
    }

    .capture-list-item {
        grid-template-columns: 1fr;
    }

    .capture-list-item img,
    .capture-list-item audio,
    .capture-list-item video {
        max-height: 220px;
    }

    .header-actions,
    .form-actions,
    .processing-actions,
    .section-actions,
    .media-actions,
    .photo-panel-actions,
    .voice-button-row,
    .voice-sync-actions,
    .voice-note-actions {
        width: 100%;
    }

    .page-header .btn,
    .header-actions .btn,
    .form-actions .btn,
    .processing-actions .btn,
    .section-actions .btn,
    .media-actions .btn,
    .photo-panel-actions .btn,
    .voice-button-row .btn,
    .voice-sync-actions .btn,
    .voice-note-actions .btn {
        width: 100%;
    }

    .section-actions--qc > .section-actions-main > .btn,
    .section-actions--qc > .section-qc-approval .btn {
        width: auto;
    }

    .section-actions--qc > .section-qc-approval {
        margin-left: auto;
        width: auto;
        max-width: 100%;
    }

    .transcription-progress-heading {
        display: grid;
    }

    .transcription-progress-heading span {
        text-align: left;
    }

    .report-form,
    .section-card,
    .processing-card,
    .processing-diagnostics-card,
    .processing-log-card,
    .photo-review-card,
    .template-list-card,
    .template-editor-card,
    .empty-state {
        padding: 18px;
    }

    .transcript-input {
        min-height: 320px;
    }

    .section-text {
        min-height: 260px;
    }

    .room-text {
        min-height: 180px;
    }

    .pill-grid {
        gap: 8px;
    }

    .pill-toggle {
        flex: 1 1 calc(50% - 8px);
    }

    .pill-toggle .pill-label {
        width: 100%;
        min-height: 40px;
        padding: 9px 10px;
        white-space: normal;
    }

    .queue-item {
        grid-template-columns: 1fr;
    }

    .queue-item strong {
        justify-self: start;
    }

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

    .section-head {
        flex-direction: column;
        gap: 8px;
    }

    .section-head-actions {
        width: 100%;
        justify-content: space-between;
    }

    .save-state {
        min-width: 0;
        text-align: left;
    }

    .upload-dropzone {
        min-height: 116px;
        padding: 16px;
    }

    .media-dropzone {
        min-height: 128px;
        padding: 16px;
    }

    .media-file-item {
        grid-template-columns: 1fr;
    }

    .photo-thumb-pair {
        grid-template-columns: 1fr;
    }

    .photo-dropzone {
        min-height: 118px;
        padding: 16px;
    }

    .photo-checks {
        display: grid;
    }

    .tool-checks,
    .tool-checkbox-grid {
        display: grid;
    }

    .media-diagnostics {
        display: grid;
    }

    .section-image-grid {
        grid-template-columns: 1fr;
    }

    .matched-photo-grid {
        grid-template-columns: 1fr;
    }

    .cover-preview,
    .cover-preview img {
        min-height: 190px;
    }

    .template-block {
        padding: 14px;
    }

    .workflow-nav-heading {
        flex-direction: row;
        align-items: center;
    }

    .progress-report-heading {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: start;
        gap: 12px;
    }

    .progress-report-heading .report-heading-right {
        align-items: flex-start;
        justify-self: end;
        margin-left: 0;
    }

    .output-summary-card,
    .output-preview-card,
    .workflow-page-card,
    .survey-workflow-surface .main-panel > .card:not(.desk-study-status-strip),
    .survey-workflow-surface .main-panel .desk-study-main-column > .card,
    .survey-workflow-surface .main-panel .desk-study-main-column > section.card,
    .survey-workflow-surface .main-panel form.desk-study-form > section.card,
    .survey-workflow-surface .main-panel form.desk-study-form > div.card,
    .survey-workflow-surface .main-panel > .desk-study-status-strip.card {
        padding: 18px;
    }
}

@media (max-width: 920px) {
    /*
     * Icon rail + main is for wide layouts; once we use stacked cards / full-bleed main,
     * a single grid column lets sections span the viewport (drawer sidebar is fixed off-canvas).
     */
    body.reports-page .app-shell {
        grid-template-columns: 1fr;
        min-width: 0;
    }

    body:not(.login-body):not(.capture-mode-body):not(.survaicam-page):not(.pdf-viewer-body):not(
            .sai-studio-app
        )
        .app-shell:has(> aside.sidebar:not(.sidebar--workspace)) {
        grid-template-columns: 1fr;
        min-width: 0;
    }

    /*
     * Desktop (min-width:901px) adds padding-left for the fixed sidebar. While the layout uses
     * a drawer / stacked nav (≤920px), clear that inset so content aligns to the viewport edges.
     */
    body.dashboard-body.reports-page.app-shell-has-main-sidebar .app-shell {
        padding-left: 0;
        padding-right: 0;
    }

    @supports selector(:has(.sidebar)) {
        body.dashboard-body.reports-page:not(.app-shell-has-main-sidebar)
            .app-shell:has(> .sidebar:not(.sidebar--workspace)) {
            padding-left: 0;
            padding-right: 0;
        }
    }

    /* Full-bleed content: drop main-panel side gutters so sections span the viewport (safe-area aware). */
    body.reports-page .main-panel {
        width: 100%;
        max-width: 100%;
        padding-left: env(safe-area-inset-left, 0px);
        padding-right: env(safe-area-inset-right, 0px);
        box-sizing: border-box;
    }

    body.reports-page .main-panel > .alert {
        margin-right: max(16px, env(safe-area-inset-right, 0px));
        margin-left: max(16px, env(safe-area-inset-left, 0px));
        box-sizing: border-box;
        max-width: none;
    }

    .reports-page .table-card {
        overflow: visible;
        width: 100%;
        max-width: none;
        align-self: stretch;
        box-sizing: border-box;
    }

    .reports-page .reports-filter-panel .search-field {
        flex: 1 1 100%;
        max-width: none;
    }

    .reports-page .table-card .empty-state {
        box-sizing: border-box;
        width: 100%;
        border: 1px solid var(--line);
        border-radius: 12px;
        background: var(--survai-card);
        box-shadow: 0 4px 16px rgba(11, 18, 32, 0.06);
    }
}

@media (max-width: 700px) {
    .dashboard-body .page-header {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        align-items: center;
        gap: 12px;
    }

    .dashboard-body .page-header .eyebrow {
        display: none;
    }

    .dashboard-body .page-header h1 {
        margin: 0;
        font-size: 1.45rem;
        line-height: 1.1;
    }

    .dashboard-body .toolbar {
        margin-bottom: 12px;
    }

    .table-card {
        overflow: visible;
    }

    .table-wrap {
        overflow: visible;
    }

    .room-table,
    .room-table thead,
    .room-table tbody,
    .room-table tr,
    .room-table th,
    .room-table td {
        display: block;
        width: 100%;
        min-width: 0;
    }

    .room-table thead {
        display: none;
    }

    .room-table tr {
        margin-bottom: 16px;
        border: 1px solid var(--line);
        border-radius: 8px;
        background: var(--survai-card);
        overflow: hidden;
    }

    .room-table td,
    .room-table th:first-child,
    .room-table td:first-child,
    .room-table th:last-child,
    .room-table td:last-child {
        width: 100%;
    }

    .room-table td {
        border-top: 0;
        border-bottom: 1px solid var(--line);
        padding: 12px;
    }

    .room-table td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 6px;
        color: var(--muted);
        font-size: 0.78rem;
        font-weight: 900;
        text-transform: uppercase;
    }

    .room-table td:last-child {
        border-bottom: 0;
    }

    .output-room-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .output-room-controls {
        width: 100%;
        justify-content: flex-start;
    }

    .output-room-controls .btn {
        flex: 1 1 auto;
        min-width: 84px;
        min-height: 42px;
    }
}

@media (max-width: 420px) {
    .login-shell {
        padding: 14px;
    }

    .brand-logo-sidebar {
        width: min(390px, 92vw);
        max-height: 96px;
        height: auto;
    }

    .sidebar-brand {
        font-size: 1.08rem;
    }

    .pill-toggle {
        flex-basis: 100%;
    }

    .status {
        max-width: 100%;
        white-space: normal;
    }
}

@media (max-width: 920px) {
    .capture-mode-body {
        width: 100%;
        min-height: 100dvh;
        min-height: -webkit-fill-available;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        background: #eef3f8;
        overscroll-behavior-y: contain;
    }

    .capture-mode-body .app-shell .main-panel {
        width: 100%;
        max-width: none;
        padding: var(--app-main-padding);
        padding-top: calc(var(--app-main-padding) + env(safe-area-inset-top));
        padding-right: calc(var(--app-main-padding) + env(safe-area-inset-right));
        padding-bottom: calc(var(--app-main-padding) + env(safe-area-inset-bottom));
        padding-left: calc(var(--app-main-padding) + env(safe-area-inset-left));
        box-sizing: border-box;
    }

    .capture-mode-body .main-panel > .alert {
        margin-bottom: 12px;
    }

    .capture-mode-body .capture-topbar,
.capture-mode-body .capture-tabs,
.live-capture-panel .capture-desktop-handoff {
        display: none !important;
    }

    .capture-shell {
        width: 100%;
        min-height: 0;
        height: auto;
        margin: 0;
        padding: 0;
        overflow: visible;
    }

    .capture-panel.active.live-capture-panel {
        display: flex;
        flex-direction: column;
        width: 100%;
        min-height: 100dvh;
        min-height: -webkit-fill-available;
        height: auto;
        margin: 0;
        padding: 0;
        overflow: visible;
    }

    .capture-screen {
        --capture-tabbar-h: calc(62px + env(safe-area-inset-bottom));
        --capture-tray-h: clamp(178px, 31dvh, 222px);
        position: relative;
        z-index: 1;
        display: flex;
        flex: 1 1 auto;
        width: 100%;
        max-width: 100%;
        min-height: 100dvh;
        min-height: -webkit-fill-available;
        height: auto;
        max-height: none;
        flex-direction: column;
        overflow: hidden;
        color: #ffffff;
        background: #000000;
        font-family: Arial, Helvetica, sans-serif;
        touch-action: manipulation;
    }

    /* Do not show the live camera block in the page scroll until the user engages Survai Cam. */
    .capture-mode-body:not(.capture-live-active) .live-capture-panel .capture-screen {
        display: none !important;
    }

    .capture-mode-body:not(.capture-live-active) .capture-panel.active.live-capture-panel {
        min-height: 0 !important;
        height: auto !important;
        flex: 0 0 auto;
    }

    .capture-mode-body.capture-live-active .live-capture-panel .capture-screen {
        position: fixed !important;
        inset: 0;
        z-index: 1000;
        width: 100vw;
        max-width: 100vw;
        flex: none !important;
        display: flex !important;
        min-height: 100dvh !important;
        min-height: -webkit-fill-available !important;
    }

    .capture-mode-body.capture-live-active {
        overflow: hidden;
    }

    .capture-header {
        position: relative;
        display: grid;
        height: calc(56px + env(safe-area-inset-top));
        min-height: calc(56px + env(safe-area-inset-top));
        flex: 0 0 calc(56px + env(safe-area-inset-top));
        grid-template-columns: 78px minmax(0, 1fr) 44px;
        align-items: center;
        gap: 6px;
        padding: calc(6px + env(safe-area-inset-top)) 10px 6px;
    }

    .capture-header h2 {
        margin: 0;
        overflow: hidden;
        font-size: 1rem;
        font-weight: 900;
        line-height: 1.1;
        text-align: center;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .capture-back-button {
        display: inline-flex;
        min-width: 0;
        min-height: 44px;
        align-items: center;
        gap: 5px;
        overflow: hidden;
        color: #0a7cff;
        font-size: 0.96rem;
        font-weight: 850;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .capture-back-button span {
        width: 12px;
        height: 12px;
        flex: 0 0 12px;
        border-bottom: 3px solid currentColor;
        border-left: 3px solid currentColor;
        transform: rotate(45deg);
    }

    button.capture-finish-button {
        border: 0;
        background: transparent;
        padding: 0;
        font: inherit;
        text-align: inherit;
        cursor: pointer;
        -webkit-appearance: none;
        appearance: none;
    }

    .capture-more-button,
    .capture-filter-button {
        display: inline-grid;
        width: 44px;
        min-width: 44px;
        height: 44px;
        min-height: 44px;
        grid-auto-flow: column;
        place-content: center;
        gap: 3px;
        border: 0;
        border-radius: 999px;
        color: #0a7cff;
        background: rgba(255, 255, 255, 0.92);
    }

    .capture-more-button {
        border: 2px solid #0a7cff;
        background: transparent;
    }

    .capture-more-button span,
    .capture-filter-button span {
        display: block;
        width: 4px;
        height: 4px;
        border-radius: 999px;
        background: currentColor;
    }

    .capture-tag-bar {
        position: relative;
        z-index: 19;
        display: flex;
        flex: 0 0 56px;
        gap: 8px;
        overflow-x: auto;
        overflow-y: hidden;
        background: rgba(246, 247, 250, 0.95);
        backdrop-filter: blur(14px);
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .capture-tag-bar::-webkit-scrollbar {
        display: none;
    }

    .capture-tag-pill {
        position: relative;
        display: grid;
        min-width: 132px;
        max-width: min(48vw, 210px);
        min-height: 44px;
        flex: 0 0 auto;
        grid-template-columns: 18px minmax(0, 1fr) 10px;
        align-items: center;
        gap: 7px;
        border: 0;
        border-radius: 999px;
        padding: 0 12px;
        background: #ffffff;
        box-shadow: 0 1px 3px rgba(15, 23, 42, 0.14);
    }

    .capture-tag-pill select {
        width: 100%;
        min-width: 0;
        min-height: 40px;
        border: 0;
        padding: 0 2px 0 0;
        overflow: hidden;
        color: #111827;
        background: transparent;
        font-size: 0.92rem;
        font-weight: 850;
        text-overflow: ellipsis;
        white-space: nowrap;
        appearance: none;
    }

    .capture-filter-button {
        flex: 0 0 44px;
        color: #111827;
        background: #ffffff;
        box-shadow: 0 1px 3px rgba(15, 23, 42, 0.14);
    }

    .capture-training-toggle {
        flex: 0 0 auto;
        border: 0;
        border-radius: 999px;
        color: #111827;
        background: #ffffff;
        box-shadow: 0 1px 3px rgba(15, 23, 42, 0.14);
        font-weight: 900;
    }

    .capture-training-toggle.active {
        color: var(--navy);
        background: #ffd60a;
        box-shadow: 0 0 0 3px rgba(255, 214, 10, 0.24), 0 8px 22px rgba(0, 0, 0, 0.2);
    }

    .capture-pill-icon {
        position: relative;
        display: inline-block;
        width: 18px;
        height: 18px;
        color: #0a7cff;
    }

    .capture-pill-room::before,
    .capture-pill-element::before,
    .capture-pill-defect::before {
        position: absolute;
        inset: 3px;
        content: "";
        border: 2px solid currentColor;
        border-radius: 4px;
    }

    .capture-pill-element::before {
        border-radius: 2px;
        transform: rotate(45deg);
    }

    .capture-pill-defect::before {
        border-color: #ff9f0a;
        border-radius: 999px;
        background: #ff9f0a;
    }

    .capture-pill-chevron {
        width: 9px;
        height: 9px;
        border-right: 2px solid #6b7280;
        border-bottom: 2px solid #6b7280;
        transform: rotate(45deg) translateY(-2px);
    }

    .capture-preview {
        position: relative;
        flex: 1 1 auto;
        min-height: 0;
        overflow: hidden;
        background: #000000;
    }

    .capture-screen .capture-preview-video.live-camera-preview,
    .capture-screen .capture-preview-video {
        position: absolute;
        inset: 0;
        display: block;
        width: 100%;
        height: 100%;
        min-height: 0;
        object-fit: cover;
        object-position: center center;
        background: #000000;
    }

    .capture-preview-shade {
        position: absolute;
        inset: 0;
        pointer-events: none;
        background:
            linear-gradient(180deg, rgba(0, 0, 0, 0.22), rgba(0, 0, 0, 0) 24%, rgba(0, 0, 0, 0) 62%, rgba(0, 0, 0, 0.48)),
            linear-gradient(90deg, rgba(0, 0, 0, 0.16), rgba(0, 0, 0, 0) 24%, rgba(0, 0, 0, 0) 76%, rgba(0, 0, 0, 0.16));
    }

    .capture-overlay {
        position: absolute;
        z-index: 5;
    }

    .capture-overlay-top {
        top: 10px;
        right: 10px;
        left: 10px;
        display: grid;
        grid-template-columns: minmax(82px, auto) minmax(72px, 1fr) minmax(70px, auto);
        align-items: start;
        gap: 8px;
        pointer-events: none;
    }

    .capture-recording-badge,
    .capture-audio-pill,
    .capture-photo-count,
    .capture-zoom-control,
    .capture-floating-action {
        border-radius: 18px;
        color: #ffffff;
        background: rgba(20, 20, 20, 0.66);
        box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
        backdrop-filter: blur(14px);
    }

    .capture-recording-badge,
    .capture-photo-count {
        display: inline-flex;
        min-width: 0;
        min-height: 46px;
        align-items: center;
        gap: 7px;
        padding: 7px 9px;
        justify-self: start;
        text-transform: uppercase;
    }

    .capture-photo-count {
        justify-self: end;
    }

    .capture-recording-badge strong,
    .capture-photo-count strong {
        display: block;
        color: #ffffff;
        font-size: 0.82rem;
        line-height: 1.05;
    }

    .capture-recording-badge span:not(.recording-dot),
    .capture-photo-count span {
        display: block;
        overflow: hidden;
        color: rgba(255, 255, 255, 0.9);
        font-size: 0.78rem;
        font-weight: 850;
        line-height: 1.05;
        text-overflow: ellipsis;
        text-transform: none;
        white-space: nowrap;
    }

    .capture-recording-badge em {
        display: none;
    }

    .capture-audio-pill {
        display: inline-flex;
        min-height: 46px;
        align-items: center;
        justify-content: center;
        gap: 9px;
        padding: 7px 10px;
        justify-self: center;
    }

    .capture-mic-icon {
        position: relative;
        width: 12px;
        height: 18px;
        border: 2px solid #ffffff;
        border-radius: 999px;
    }

    .capture-mic-icon::after {
        position: absolute;
        bottom: -7px;
        left: 50%;
        width: 12px;
        height: 7px;
        content: "";
        border-bottom: 2px solid #ffffff;
        border-left: 2px solid #ffffff;
        transform: translateX(-50%);
    }

    .capture-wave {
        height: 22px;
        align-items: center;
        gap: 3px;
    }

    .capture-wave i {
        display: block;
        width: 3px;
        height: 8px;
        border-radius: 999px;
        background: #ff7b7b;
        animation: capture-wave 980ms ease-in-out infinite;
    }

    .capture-image-icon {
        position: relative;
        width: 19px;
        height: 17px;
        border: 2px solid #ffffff;
        border-radius: 4px;
    }

    .capture-zoom-control {
        position: absolute;
        top: 45%;
        right: 9px;
        z-index: 6;
        display: grid;
        gap: 0;
        padding: 5px;
        transform: translateY(-50%);
    }

    .capture-zoom-control button {
        min-width: 42px;
        min-height: 42px;
        border: 0;
        border-radius: 999px;
        color: #ffffff;
        background: transparent;
        font-size: 0.84rem;
        font-weight: 900;
    }

    .capture-zoom-control button.active {
        color: #ffd60a;
        background: rgba(0, 0, 0, 0.24);
    }

    .capture-training-hint {
        position: absolute;
        right: 18px;
        bottom: calc(var(--capture-tabbar-h, 70px) + var(--capture-tray-h, 136px) + 26px);
        left: 18px;
        display: grid;
        max-width: min(420px, calc(100% - 36px));
        gap: 4px;
        margin: 0 auto;
        border: 1px solid rgba(255, 255, 255, 0.18);
        border-radius: 18px;
        padding: 12px 14px;
        color: #ffffff;
        background: rgba(11, 18, 32, 0.82);
        box-shadow: 0 14px 34px rgba(0, 0, 0, 0.34);
        text-align: center;
        backdrop-filter: blur(16px);
    }

    .capture-training-hint[hidden] {
        display: none;
    }

    .capture-training-hint strong {
        color: #ffffff;
        font-size: 1.08rem;
        line-height: 1.1;
    }

    .capture-training-hint span {
        color: rgba(255, 255, 255, 0.86);
        font-size: 0.82rem;
        line-height: 1.25;
    }

    .capture-training-hint.is-scanning {
        background: rgba(15, 23, 42, 0.74);
    }

    .capture-training-hint.is-error {
        background: rgba(127, 29, 29, 0.82);
    }

    .capture-floating-action {
        position: absolute;
        z-index: 7;
        display: grid;
        width: 52px;
        height: 52px;
        place-items: center;
        border: 0;
    }

    .capture-flash-button {
        bottom: calc(var(--capture-tabbar-h) + var(--capture-tray-h) + 30px);
        left: 16px;
    }

    .capture-flip-button {
        right: 16px;
        bottom: calc(var(--capture-tabbar-h) + var(--capture-tray-h) + 30px);
    }

    .capture-photo-button {
        bottom: calc(var(--capture-tabbar-h) + var(--capture-tray-h) + 12px);
        left: 50%;
        z-index: 8;
        text-align: center;
        text-transform: uppercase;
    }

    .capture-photo-icon {
        position: relative;
        border: 3px solid #111827;
        border-radius: 5px;
    }

    .capture-photo-button strong {
        color: #111827;
        font-size: 0.66rem;
        line-height: 1.05;
    }

    .capture-start-recording {
        position: absolute;
        bottom: calc(var(--capture-tabbar-h) + var(--capture-tray-h) + 112px);
        left: 50%;
        z-index: 9;
        min-height: 44px;
        border: 0;
        border-radius: 999px;
        padding: 0 16px;
        color: #ffffff;
        background: #d83a3a;
        font-size: 0.76rem;
        font-weight: 900;
        text-transform: uppercase;
        transform: translateX(-50%);
        box-shadow: 0 12px 24px rgba(0, 0, 0, 0.24);
    }

    .capture-start-recording:disabled {
        opacity: 0;
        pointer-events: none;
    }

    .capture-photo-button:disabled {
        opacity: 0.54;
    }

    .capture-camera-permission {
        z-index: 30;
        display: grid;
        place-content: center;
        gap: 14px;
        padding: 22px;
        background: linear-gradient(180deg, rgba(5, 10, 20, 0.24), rgba(5, 10, 20, 0.82));
        text-align: center;
    }

    .capture-camera-permission[hidden] {
        display: none;
    }

    .capture-camera-permission h2 {
        margin: 0;
        color: #ffffff;
        font-size: 1.55rem;
        line-height: 1.1;
    }

    .capture-camera-permission p {
        display: none;
    }

    .capture-camera-permission .capture-install-hint {
        display: block;
        max-width: 320px;
        margin: 0 auto;
        color: rgba(255, 255, 255, 0.82);
        font-size: 0.84rem;
        font-weight: 800;
        line-height: 1.35;
    }

    .capture-control-tray {
        position: absolute;
        right: 9px;
        left: 9px;
        z-index: 10;
        display: grid;
        max-height: 35dvh;
        grid-template-rows: minmax(0, 1fr) auto;
        border-radius: 20px 20px 0 0;
        color: #ffffff;
    }

    .capture-tray-button,
    .capture-stop-button {
        display: grid;
        min-width: 0;
        min-height: 62px;
        place-items: center;
        gap: 4px;
        border: 1px solid rgba(255, 255, 255, 0.11);
        border-radius: 999px;
        color: #ffffff;
        background: rgba(255, 255, 255, 0.08);
        font-size: 0.66rem;
        font-weight: 900;
        text-transform: uppercase;
    }

    .capture-stop-button {
        min-height: 76px;
        border: 2px solid rgba(255, 92, 92, 0.8);
        background: radial-gradient(circle at 50% 38%, #ed4c4c, #c72e2e);
        box-shadow: 0 0 0 6px rgba(255, 255, 255, 0.04);
    }

    .capture-stop-button:disabled,
    .capture-tray-button:disabled {
        opacity: 0.48;
    }

    .capture-pause-icon,
    .capture-stop-icon,
    .capture-note-icon {
        position: relative;
        width: 22px;
        height: 22px;
    }

    .capture-status-row {
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        border-top: 1px solid rgba(255, 255, 255, 0.12);
        padding-top: 8px;
    }

    .capture-status-row div {
        display: grid;
        min-width: 0;
        grid-template-columns: 22px minmax(0, 1fr);
        column-gap: 7px;
        align-items: center;
    }

    .capture-status-row strong,
    .capture-status-row small {
        display: block;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .capture-status-row strong {
        color: #ffffff;
        font-size: 0.76rem;
    }

    .capture-status-row small {
        color: rgba(255, 255, 255, 0.72);
        font-size: 0.66rem;
        font-weight: 700;
    }

    .capture-status-icon {
        display: grid;
        width: 22px;
        height: 22px;
        grid-row: span 2;
        place-items: center;
        border-radius: 999px;
    }

    .capture-gallery {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 0 0 2px;
        scroll-snap-type: x proximity;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .capture-gallery::-webkit-scrollbar {
        display: none;
    }

    .capture-gallery .form-note {
        display: none;
    }

    .capture-gallery figure {
        position: relative;
        flex: 0 0 68px;
        overflow: hidden;
        border: 2px solid rgba(255, 255, 255, 0.14);
        border-radius: 10px;
        margin: 0;
        background: rgba(255, 255, 255, 0.08);
        scroll-snap-align: start;
    }

    .capture-gallery figure:last-child {
        border-color: #ffd60a;
    }

    .capture-gallery img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .capture-gallery figcaption {
        position: absolute;
        right: 4px;
        bottom: 4px;
        border-radius: 999px;
        padding: 2px 6px;
        color: #ffffff;
        background: rgba(0, 0, 0, 0.66);
        font-size: 0.62rem;
        font-weight: 900;
    }

    .capture-tabbar {
        position: fixed;
        z-index: 20;
        display: grid;
        min-height: var(--capture-tabbar-h);
        grid-template-columns: repeat(4, minmax(0, 1fr));
        padding: 5px 8px calc(6px + env(safe-area-inset-bottom));
        background: rgba(6, 8, 12, 0.96);
        box-shadow: 0 -1px 0 rgba(255, 255, 255, 0.08);
        backdrop-filter: blur(16px);
    }

    .capture-tabbar.compact {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .capture-tabbar button {
        position: relative;
        display: grid;
        min-width: 0;
        min-height: 50px;
        place-items: center;
        gap: 2px;
        border: 0;
        border-radius: 8px;
        color: rgba(255, 255, 255, 0.58);
        background: transparent;
        font-size: 0.68rem;
        font-weight: 800;
    }

    .capture-tabbar button.active {
        color: #0a84ff;
    }

    .capture-live-info-panel {
        grid-template-columns: repeat(6, minmax(0, 1fr));
        gap: 6px;
        align-items: stretch;
    }

    .capture-live-info-item {
        display: grid;
        min-width: 0;
        min-height: 50px;
        align-content: center;
        gap: 2px;
        border-radius: 10px;
        padding: 6px 4px;
        color: rgba(255, 255, 255, 0.72);
        background: rgba(255, 255, 255, 0.055);
        text-align: center;
    }

    .capture-live-info-item span {
        overflow: hidden;
        font-size: 0.58rem;
        font-weight: 850;
        letter-spacing: 0.04em;
        text-overflow: ellipsis;
        text-transform: uppercase;
        white-space: nowrap;
    }

    .capture-live-info-item strong {
        color: #ffffff;
        font-size: 0.9rem;
        font-weight: 950;
        line-height: 1;
    }

    .capture-tabbar em {
        position: absolute;
        top: 2px;
        right: 28%;
        min-width: 18px;
        border-radius: 999px;
        padding: 2px 5px;
        color: #ffffff;
        background: #ff453a;
        font-size: 0.62rem;
        font-style: normal;
        line-height: 1;
    }
}

@media (max-width: 920px) and (max-height: 720px) {
    .capture-screen {
        --capture-tray-h: clamp(158px, 30dvh, 188px);
    }

    .capture-overlay-top {
        top: 7px;
    }

    .capture-recording-badge,
    .capture-photo-count,
    .capture-audio-pill {
        min-height: 40px;
        padding: 6px 8px;
    }

    .capture-audio-pill {
        min-width: 72px;
    }

    .capture-wave i:nth-child(n+5) {
        display: none;
    }

    .capture-tray-button,
    .capture-stop-button {
        min-height: 52px;
    }

    .capture-stop-button {
        min-height: 62px;
    }

    .capture-tray-button strong,
    .capture-stop-button strong {
        display: none;
    }

    .capture-status-row {
        padding-top: 6px;
    }

    .capture-status-row small {
        display: none;
    }

    .capture-photo-button {
        padding: 10px 7px;
    }

    .capture-photo-button strong {
        font-size: 0.6rem;
    }

    .capture-start-recording {
        bottom: calc(var(--capture-tabbar-h) + var(--capture-tray-h) + 100px);
    }
}

@media (max-width: 920px) and (orientation: landscape) {
    .capture-screen {
        --capture-tabbar-h: 56px;
        --capture-tray-h: clamp(112px, 34dvh, 150px);
    }

    .capture-header {
        height: calc(46px + env(safe-area-inset-top));
        min-height: calc(46px + env(safe-area-inset-top));
        flex-basis: calc(46px + env(safe-area-inset-top));
        padding-top: calc(3px + env(safe-area-inset-top));
        padding-bottom: 3px;
    }

    .capture-tag-bar {
        min-height: 50px;
        flex-basis: 50px;
        padding-top: 4px;
        padding-bottom: 4px;
    }

    .capture-tag-pill {
        min-height: 42px;
    }

    .capture-overlay-top {
        top: 7px;
        left: 76px;
    }

    .capture-control-tray {
        right: 74px;
        grid-template-columns: minmax(0, 1fr) minmax(120px, 0.8fr);
        grid-template-rows: auto minmax(46px, 1fr);
    }

    .capture-recorder-controls {
        flex-wrap: nowrap;
    }

    .capture-screen .capture-recorder-controls .capture-photo-button:not(.capture-video-record-button) {
        position: relative !important;
        bottom: auto !important;
        left: auto !important;
        transform: none !important;
    }

    .capture-status-row {
        border-top: 0;
        padding-top: 0;
    }

    .capture-photo-button {
        bottom: calc(var(--capture-tabbar-h) + var(--capture-tray-h) + 8px);
    }

    .capture-start-recording {
        bottom: calc(var(--capture-tabbar-h) + var(--capture-tray-h) + 86px);
    }

    .capture-flash-button,
    .capture-flip-button {
        bottom: calc(var(--capture-tabbar-h) + var(--capture-tray-h) + 18px);
    }
}

@media (max-width: 920px) {
    .capture-screen {
        --capture-tray-h: clamp(118px, 20dvh, 148px);
    }

    .capture-tag-bar {
        min-height: 0;
        flex-basis: 0;
        justify-content: center;
        overflow: hidden;
        padding: 0;
    }

    .capture-tag-pill {
        min-width: min(58vw, 210px);
        max-width: min(64vw, 240px);
    }

    .capture-hidden-tags {
        display: none !important;
    }

    .capture-tag-bar select[hidden],
    .capture-tag-bar .capture-filter-button {
        display: none !important;
    }

    .capture-audio-pill {
        min-width: 116px;
    }

    .capture-wave {
        display: none !important;
    }

    .capture-audio-meter {
        display: inline-flex;
        height: 24px;
        align-items: center;
        gap: 3px;
    }

    .capture-audio-meter i {
        display: block;
        width: 4px;
        height: 22px;
        border-radius: 999px;
        background: #30d158;
        transform: scaleY(0.1);
        transform-origin: center bottom;
        transition: transform 90ms linear;
    }

    .capture-photo-count {
        min-width: 72px;
    }

    .capture-flash-button,
    .capture-flip-button {
        bottom: calc(var(--capture-tabbar-h) + var(--capture-tray-h) + 18px);
        width: 48px;
        height: 48px;
    }

    .capture-start-recording {
        display: none !important;
    }

    .capture-control-tray {
        height: var(--capture-tray-h);
        max-height: 24dvh;
        bottom: calc(var(--capture-tabbar-h) - 18px);
        grid-template-rows: minmax(0, 1fr) auto;
        gap: 6px;
        padding: 8px 12px 10px;
    }

    .capture-recorder-controls {
        grid-row: 2;
        align-self: end;
    }

    .capture-screen .capture-recorder-controls .capture-photo-button:not(.capture-video-record-button) {
        position: relative !important;
        bottom: auto !important;
        left: auto !important;
        transform: none !important;
    }

    .capture-control-tray.is-capture-idle-survey .capture-pause-recording-button,
    .capture-control-tray.is-capture-idle-survey .capture-photo-button:not(.capture-video-record-button) {
        display: none !important;
    }

    .capture-tray-button {
        display: grid;
        width: 58px;
        height: 58px;
        min-height: 58px;
        place-items: center;
        gap: 3px;
        border: 1px solid rgba(255, 255, 255, 0.12);
        border-radius: 999px;
        color: #ffffff;
        background: rgba(255, 255, 255, 0.08);
        font-size: 0.6rem;
        font-weight: 900;
        text-transform: uppercase;
    }

    .capture-tray-button strong {
        color: #ffffff;
        font-size: 0.58rem;
        line-height: 1;
    }

    .capture-record-icon {
        position: relative;
        display: block;
    }

    .capture-photo-button {
        position: static;
        display: grid;
        place-items: center;
        border: 5px solid rgba(255, 255, 255, 0.78);
        border-radius: 999px;
        padding: 0;
        color: #111827;
        background: #ffffff;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.24);
        transform: none;
    }

    .capture-photo-button strong {
        display: none;
    }

    .capture-photo-icon {
        width: 27px;
        height: 22px;
    }

    .capture-status-row {
        display: none !important;
    }

    .capture-gallery {
        grid-row: 1;
        align-self: end;
        min-height: 48px;
    }

    .capture-gallery figure {
        width: 58px;
        height: 48px;
        flex-basis: 58px;
    }
}

@media (max-width: 920px) and (max-height: 720px) {
    .capture-screen {
        --capture-tray-h: clamp(104px, 19dvh, 130px);
    }

    .capture-control-tray {
        max-height: 23dvh;
        bottom: calc(var(--capture-tabbar-h) - 20px);
    }

    .capture-recorder-controls {
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        justify-content: space-between;
        gap: 8px;
        width: 100%;
    }

    .capture-tray-button {
        width: 50px;
        height: 50px;
        min-height: 50px;
    }

    .capture-photo-button {
        width: 68px;
        height: 68px;
        min-height: 68px;
    }

    .capture-gallery {
        min-height: 38px;
    }

    .capture-gallery figure {
        width: 50px;
        height: 38px;
        flex-basis: 50px;
    }
}

@media (max-width: 920px) and (orientation: landscape) {
    .capture-screen {
        --capture-tray-h: clamp(92px, 28dvh, 118px);
    }

    .capture-control-tray {
        grid-template-columns: minmax(0, 1fr) minmax(140px, 0.72fr);
        grid-template-rows: minmax(58px, auto);
    }

    .capture-gallery {
        grid-column: auto;
    }
}

@media (max-width: 920px) {
    .capture-header {
        color: #ffffff;
    }

    .capture-header h2 {
        color: #ffffff;
    }

    .capture-back-button,
    .capture-finish-button {
        color: #ffffff;
    }

    .capture-more-button {
        border-color: rgba(255, 255, 255, 0.68);
        color: #ffffff;
    }

    .capture-control-tray {
        background: transparent;
        box-shadow: none;
        backdrop-filter: none;
    }

    .capture-recorder-controls {
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        gap: 10px;
        width: 100%;
        min-height: 76px;
    }

    /* Keep record button absolutely centred on the tray; do not force static (breaks visibility/layout). */
    .capture-toolbar-button,
    .capture-photo-button {
        position: static !important;
    }

    .capture-toolbar-button {
        display: grid;
        width: 58px;
        height: 58px;
        min-height: 58px;
        place-items: center;
        border: 2px solid rgba(255, 255, 255, 0.72);
        border-radius: 999px;
        color: #ffffff;
        background: rgba(8, 12, 18, 0.56);
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
        backdrop-filter: blur(12px);
    }

    .capture-toolbar-button.active {
        color: #ffd60a;
        border-color: rgba(255, 214, 10, 0.8);
    }

    .capture-photo-button {
        width: 76px;
        height: 76px;
        min-height: 76px;
    }

    .capture-record-toggle {
        width: 68px;
        height: 68px;
        min-height: 68px;
    }

    .capture-tabbar {
        will-change: transform;
    }

    .capture-tabbar-handle {
        position: fixed;
        z-index: 25;
        display: grid;
        place-items: center;
        border-radius: 999px;
        background: rgba(6, 8, 12, 0.88);
        box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
    }

    .capture-tabbar-handle span {
        display: block;
    }

    .capture-screen.is-live-toolbar-collapsed .capture-tabbar {
        transform: translateY(calc(100% - 12px - env(safe-area-inset-bottom)));
    }

    .capture-screen.is-live-toolbar-collapsed .capture-tabbar-handle {
        bottom: calc(7px + env(safe-area-inset-bottom));
    }

    .capture-screen.is-live-toolbar-collapsed .capture-control-tray {
        bottom: calc(9px + env(safe-area-inset-bottom));
    }
}

@media (max-width: 920px) and (orientation: landscape) {
    .capture-control-tray {
        top: calc(56px + env(safe-area-inset-top));
        right: calc(12px + env(safe-area-inset-right));
    }

    .capture-pause-recording-button {
        order: 2;
    }

    .capture-gallery {
        right: calc(100px + env(safe-area-inset-right));
        left: calc(12px + env(safe-area-inset-left));
        z-index: 13;
        align-self: auto;
        border-radius: 10px;
    }

    .capture-overlay-top {
        top: calc(58px + env(safe-area-inset-top));
        left: calc(12px + env(safe-area-inset-left));
    }

    .capture-recording-badge {
        flex-direction: column;
        gap: 3px;
        text-align: center;
    }

    .capture-photo-count {
        flex-direction: column;
        gap: 3px;
        text-align: center;
    }

    .capture-zoom-control {
        right: calc(96px + env(safe-area-inset-right));
    }

    .capture-screen.is-live-toolbar-collapsed .capture-control-tray {
        bottom: calc(9px + env(safe-area-inset-bottom));
    }

    .capture-screen.is-live-toolbar-collapsed .capture-gallery {
        bottom: calc(10px + env(safe-area-inset-bottom));
    }
}

@media (max-width: 920px) {
    .capture-tabbar {
        right: auto;
        bottom: -5px;
        left: 50%;
        width: min(342px, calc(100vw - 28px));
        overflow: hidden;
        border-radius: 18px 18px 0 0;
        transform: translateX(-50%);
        transition: transform 190ms ease, opacity 190ms ease, visibility 190ms ease;
    }

    .capture-tabbar-handle {
        right: auto;
        bottom: calc(var(--capture-tabbar-h) + 4px);
        left: 50%;
        width: 54px;
        height: 30px;
        border: 1px solid rgba(255, 255, 255, 0.12);
        transform: translateX(-50%);
    }

    .capture-tabbar-handle span {
        width: 16px;
        height: 16px;
        border-right: 3px solid rgba(255, 255, 255, 0.78);
        border-bottom: 3px solid rgba(255, 255, 255, 0.78);
        border-radius: 0;
        background: transparent;
        transform: translateY(-3px) rotate(45deg);
    }

    .capture-screen.is-live-toolbar-collapsed .capture-tabbar {
        visibility: hidden;
        opacity: 0;
        pointer-events: none;
        transform: translate(-50%, calc(100% + 18px));
    }

    .capture-screen.is-live-toolbar-collapsed .capture-tabbar button {
        visibility: hidden;
    }

    .capture-screen.is-live-toolbar-collapsed .capture-tabbar-handle {
        bottom: calc(8px + env(safe-area-inset-bottom));
    }

    .capture-screen.is-live-toolbar-collapsed .capture-tabbar-handle span {
        transform: translateY(3px) rotate(225deg);
    }
}

@media (max-width: 920px) and (orientation: landscape) {
    .capture-tabbar {
        width: min(430px, calc(100vw - 190px));
        padding-bottom: calc(3px + env(safe-area-inset-bottom));
    }
}

@media (max-width: 920px) and (orientation: landscape) {
    .capture-header {
        grid-template-columns: 108px minmax(0, 1fr) 58px;
        padding-right: calc(18px + env(safe-area-inset-right));
        padding-left: calc(18px + env(safe-area-inset-left));
    }

    .capture-back-button,
    .capture-finish-button {
        justify-self: start;
        padding-left: 2px;
    }

    .capture-more-button,
    .capture-refresh-button {
        justify-self: end;
        margin-right: 2px;
    }

    .capture-control-tray {
        top: calc(60px + env(safe-area-inset-top));
        right: calc(16px + env(safe-area-inset-right));
    }

    .capture-overlay-top {
        top: calc(60px + env(safe-area-inset-top));
        left: calc(14px + env(safe-area-inset-left));
    }
}

@media (max-width: 920px) {
    .capture-header {
        grid-template-columns: 92px minmax(0, 1fr) 54px;
        padding-right: calc(16px + env(safe-area-inset-right));
        padding-left: calc(16px + env(safe-area-inset-left));
    }

    .capture-back-button,
    .capture-finish-button {
        justify-self: start;
        padding-left: 2px;
    }

    .capture-more-button,
    .capture-refresh-button {
        justify-self: end;
        margin-right: 2px;
    }

    .capture-control-tray {
        overflow: visible;
    }
}

@media (max-width: 920px) and (orientation: portrait) {
    .capture-control-tray {
        bottom: calc(var(--capture-tabbar-h) - 9px);
    }

    .capture-recorder-controls {
        transform: none;
    }
}

@media (max-width: 920px) and (orientation: landscape) {
    .capture-header {
        grid-template-columns: 118px minmax(0, 1fr) 62px;
        padding-right: calc(24px + env(safe-area-inset-right));
        padding-left: calc(24px + env(safe-area-inset-left));
    }

    .capture-control-tray {
        top: calc(58px + env(safe-area-inset-top));
        right: calc(18px + env(safe-area-inset-right));
    }

    .capture-recorder-controls {
        transform: none;
    }

    .capture-toolbar-button {
        width: 54px;
        height: 54px;
        min-height: 54px;
    }

    .capture-record-toggle {
        width: 60px;
        height: 60px;
        min-height: 60px;
    }

    .capture-photo-button {
        width: 68px;
        height: 68px;
        min-height: 68px;
        border-width: 4px;
    }

    .capture-overlay-top {
        top: calc(60px + env(safe-area-inset-top));
        left: calc(18px + env(safe-area-inset-left));
    }

    .capture-audio-pill {
        padding: 7px 6px;
    }

    .capture-zoom-control {
        right: calc(112px + env(safe-area-inset-right));
    }

    .capture-gallery {
        right: calc(112px + env(safe-area-inset-right));
    }

    .capture-screen.is-live-toolbar-collapsed .capture-tabbar-handle {
        bottom: calc(8px + env(safe-area-inset-bottom));
    }
}

@media (max-width: 920px) and (orientation: landscape) and (max-height: 390px) {
    .capture-control-tray {
        top: calc(54px + env(safe-area-inset-top));
        right: calc(16px + env(safe-area-inset-right));
        width: 82px;
        min-width: 82px;
    }

    .capture-recorder-controls {
        width: 82px;
        gap: 6px;
    }

    .capture-toolbar-button {
        width: 50px;
        height: 50px;
        min-height: 50px;
    }

    .capture-record-toggle {
        width: 56px;
        height: 56px;
        min-height: 56px;
    }

    .capture-photo-button {
        width: 62px;
        height: 62px;
        min-height: 62px;
    }
}

.report-renderer {
    display: grid;
    gap: 18px;
}

.report-render-block {
    border-color: rgba(15, 23, 42, 0.08);
}

.report-render-summary-grid {
    align-items: stretch;
}

.report-contents-list {
    display: grid;
}

.report-contents-list a {
    display: grid;
    grid-template-columns: minmax(42px, auto) 1fr;
    align-items: center;
    color: var(--survai-ink-0f1b2d);
    text-decoration: none;
}

.report-contents-list a:hover {
    border-color: rgba(45, 212, 111, 0.55);
}

.report-contents-list span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
}

.report-concern-list {
    display: grid;
}

.report-concern-item {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 7px 12px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    color: var(--survai-text-strong);
    text-decoration: none;
}

.report-concern-item:hover {
    border-color: rgba(15, 23, 42, 0.2);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.07);
}

.report-concern-item .condition-rating-badge {
    grid-row: span 3;
    align-self: start;
}

.report-concern-item small {
    line-height: 1.45;
}

.report-concern-item em {
    font-style: normal;
}

@media (max-width: 560px) {
    .report-concern-item {
        grid-template-columns: 1fr;
    }

    .report-concern-item .condition-rating-badge {
        grid-row: auto;
        justify-self: start;
    }
}

/* Report renderer premium presentation layer */
.report-renderer {
    --rr-navy: var(--survai-navy-ink);
    --rr-ink: #17202c;
    --rr-muted: #64748b;
    --rr-line: rgba(15, 23, 42, 0.1);
    --rr-soft: #f8fafc;
    --rr-green: #16a34a;
    --rr-blue: #1b5af9;
    --rr-amber: #f59e0b;
    --rr-red: #dc2626;
    --rr-shadow: 0 14px 40px rgba(15, 23, 42, 0.07), 0 1px 2px rgba(15, 23, 42, 0.04);
    color: var(--rr-ink);
    font-size: 15px;
    line-height: 1.62;
}

.report-renderer .output-summary-card,
.report-renderer .output-preview-card,
.report-renderer .report-render-report-body {
    border-color: var(--rr-line);
    border-radius: 14px;
    background: #ffffff;
    box-shadow: var(--rr-shadow);
}

.report-renderer .section-head {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--rr-line);
}

.report-renderer .section-head h2,
.report-renderer .output-summary-card h2 {
    color: var(--rr-navy);
    font-size: 1.18rem;
    font-weight: 750;
    letter-spacing: 0;
}

.report-renderer .eyebrow {
    color: var(--rr-green);
    font-size: 0.72rem;
    font-weight: 850;
    letter-spacing: 0;
}

.report-renderer .form-note {
    color: var(--rr-muted);
    font-size: 0.88rem;
}

.report-render-summary-grid {
    grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
}

.report-render-summary-grid .output-summary-card:first-child {
    border-left: 4px solid var(--rr-green);
}

.report-render-summary-grid .output-summary-card p[data-summary-output-text] {
    color: var(--rr-ink);
    font-size: 0.96rem;
    line-height: 1.7;
}

.report-contents {
    overflow: hidden;
}

.report-contents .section-head {
    margin-bottom: 0;
    border-bottom: 0;
}

.report-contents-list {
    gap: 0;
    overflow: hidden;
    border: 1px solid var(--rr-line);
    border-radius: 12px;
    background: var(--survai-card);
}

.report-contents-list a {
    grid-template-columns: 64px minmax(0, 1fr);
    gap: 14px;
    min-height: 46px;
    border: 0;
    border-bottom: 1px solid var(--rr-line);
    border-radius: 0;
    padding: 10px 14px;
    background: var(--survai-card);
}

.report-contents-list a:last-child {
    border-bottom: 0;
}

.report-contents-list a:hover {
    background: var(--survai-bg);
    box-shadow: none;
}

.report-contents-list span {
    min-width: 48px;
    min-height: 28px;
    border: 1px solid rgba(27, 90, 249, 0.16);
    background: rgba(27, 90, 249, 0.07);
    color: var(--survai-ink-1648d4);
    font-size: 0.74rem;
    font-weight: 850;
}

.report-contents-list strong {
    color: var(--rr-navy);
    font-size: 0.92rem;
    font-weight: 650;
}

.report-condition-summary {
    border-top: 4px solid var(--rr-navy);
}

.report-concerns {
    border-top: 4px solid var(--rr-red);
}

.report-concern-list {
    gap: 9px;
}

.report-concern-item {
    grid-template-columns: 54px minmax(0, 1fr);
    padding: 14px 16px;
    border-color: var(--rr-line);
    border-radius: 12px;
    background: var(--survai-card);
}

.report-concern-item .condition-rating-badge {
    width: 46px;
    height: 46px;
    flex-basis: 46px;
    box-shadow: none;
}

.report-concern-item strong {
    color: var(--rr-navy);
    font-size: 0.98rem;
    font-weight: 750;
}

.report-concern-item small {
    color: var(--survai-secondary-strong);
    font-size: 0.86rem;
}

.report-concern-item em {
    color: var(--survai-secondary-slate);
    font-size: 0.78rem;
}

.report-render-report-body {
    padding: 24px;
}

.report-render-report-body > [data-card-collapsible] {
    min-width: 0;
}

.report-renderer .output-section-list {
    gap: 0;
}

.report-renderer .output-section {
    gap: 14px;
    padding: 22px 0;
    border-top: 1px solid var(--rr-line);
}

.report-renderer .output-section:first-child {
    padding-top: 0;
}

.report-renderer .output-section > header {
    align-items: center;
    padding: 0;
}

.report-renderer .output-section h3 {
    color: var(--rr-navy);
    font-size: 1.08rem;
    font-weight: 750;
    line-height: 1.28;
    /* The workspace gradient heading must not leak into rendered/exported
       report documents. */
    background: none;
    -webkit-background-clip: initial;
    background-clip: initial;
    -webkit-text-fill-color: var(--rr-navy);
}

.report-renderer .section-order {
    display: inline-flex;
    min-height: 24px;
    align-items: center;
    margin: 0 0 6px;
    border-radius: 999px;
    padding: 3px 8px;
    color: #1648d4;
    background: rgba(27, 90, 249, 0.08);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0;
}

.report-renderer .section-body {
    max-width: 78ch;
    color: var(--rr-ink);
    font-size: 0.96rem;
    line-height: 1.72;
}

.report-renderer .output-section-text {
    min-height: 220px;
    border-color: rgba(15, 23, 42, 0.14);
    border-radius: 10px;
    color: var(--rr-ink);
    font-size: 0.96rem;
    line-height: 1.72;
}

.report-fixed-text-section {
    border-radius: 12px;
    padding: 18px;
    border: 1px solid rgba(15, 23, 42, 0.08) !important;
    background: var(--survai-bg-soft);
}

.report-fixed-text-section > header {
    margin-bottom: 4px;
}

.report-body-section {
    break-inside: avoid;
}

.report-section-photo-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    margin-top: 16px;
}

.report-section-photo-strip figure {
    min-width: 0;
    overflow: hidden;
    margin: 0;
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 10px;
    background: var(--survai-card);
}

.report-section-photo-strip img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.report-section-photo-strip figcaption {
    padding: 7px 8px;
    color: var(--survai-secondary-slate);
    font-size: 0.75rem;
    line-height: 1.32;
}

.report-back-page {
    overflow: hidden;
    padding: 0;
    border: 0;
    background: var(--rr-navy);
    color: #ffffff;
}

.report-back-page-inner {
    display: grid;
    min-height: 360px;
    place-items: center;
    padding: 48px 28px;
    text-align: center;
    background:
        radial-gradient(circle at 20% 10%, rgba(27, 90, 249, 0.16), transparent 30%),
        linear-gradient(135deg, #0b1321, #0b1321);
}

.report-back-kicker {
    margin: 0;
    color: var(--survai-ink-1b5af9);
    font-size: 0.78rem;
    font-weight: 850;
    letter-spacing: 0;
    text-transform: uppercase;
}

.report-back-page h2 {
    margin: 8px 0 6px;
    color: #ffffff;
    font-size: 1.55rem;
    font-weight: 800;
}

.report-back-address {
    margin: 0;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.92rem;
}

.report-back-rule {
    width: 72px;
    height: 3px;
    margin: 20px auto;
    border-radius: 999px;
    background: #1b5af9;
}

.report-back-copy {
    max-width: 560px;
    margin: 0 auto;
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.96rem;
}

.report-back-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 24px 0 0;
}

.report-back-meta div {
    min-width: 150px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 10px;
    padding: 9px 12px;
    background: rgba(255, 255, 255, 0.06);
}

.report-back-meta dt,
.report-back-meta dd {
    margin: 0;
}

.report-back-meta dt {
    color: rgba(255, 255, 255, 0.62);
    font-size: 0.68rem;
    font-weight: 750;
    text-transform: uppercase;
}

.report-back-meta dd {
    color: #ffffff;
    font-size: 0.86rem;
    font-weight: 650;
}

@media (max-width: 860px) {
    .report-render-summary-grid {
        grid-template-columns: 1fr;
    }

    .report-section-photo-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .report-render-report-body,
    .report-renderer .output-summary-card,
    .report-renderer .output-preview-card {
        padding: 16px;
    }

    .report-contents-list a {
        grid-template-columns: 52px minmax(0, 1fr);
        padding: 10px;
    }

    .report-renderer .output-section > header {
        align-items: flex-start;
        flex-wrap: wrap;
        gap: 12px;
    }

    .report-section-photo-strip {
        grid-template-columns: 1fr;
    }
}

@media print {
    .report-renderer {
        display: block;
        color: #0b1321;
        font-size: 10pt;
        line-height: 1.48;
    }

    .report-renderer .card,
    .report-renderer .output-preview-card,
    .report-renderer .output-summary-card,
    .report-render-report-body {
        box-shadow: none !important;
    }

    .report-render-block,
    .report-renderer .output-section,
    .condition-rating-summary-card,
    .report-concern-item,
    .report-section-photo-strip figure {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .report-contents,
    .report-condition-summary,
    .report-concerns {
        break-after: page;
        page-break-after: always;
    }

    .report-back-page {
        break-before: page;
        page-break-before: always;
    }

    .report-renderer .section-head,
    .report-renderer .output-section > header {
        break-after: avoid;
        page-break-after: avoid;
    }

    .report-section-photo-strip {
        display: table;
        width: 100%;
        table-layout: fixed;
        border-spacing: 4pt;
    }

    .report-section-photo-strip figure {
        display: table-cell;
        width: 25%;
        vertical-align: top;
    }
}

.template-composer {
    display: grid;
    gap: 14px;
    margin: 18px 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 16px;
    background: var(--survai-card);
}

.template-composer-list {
    display: grid;
    gap: 12px;
}

.template-composer-row {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 12px;
    border: 1px solid #dbe4f0;
    border-radius: 10px;
    padding: 12px;
    background: var(--survai-bg-soft);
}

.template-composer-row[draggable="true"] {
    cursor: grab;
}

.template-composer-row--new {
    border-style: dashed;
}

.template-composer-grip {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 999px;
    color: var(--navy);
    background: var(--survai-tint-edf4ff);
    font-weight: 900;
}

.template-composer-grid {
    grid-template-columns: 90px 110px minmax(180px, 1.2fr) minmax(150px, 0.8fr) minmax(190px, 1fr) 90px;
    gap: 10px;
}

.template-composer-flags {
    grid-column: 2;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    margin-top: -2px;
}

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

@media (max-width: 920px) {

    .capture-toolbar-button,
    .capture-photo-button,
    .capture-record-toggle {
        width: 64px;
        height: 64px;
        min-width: 64px;
        min-height: 64px;
        padding: 0;
    }

    .capture-photo-button {
        border-width: 4px;
    }

    .capture-record-toggle strong {
        display: none !important;
    }

    .capture-record-icon {
        width: 26px;
        height: 26px;
    }

    .capture-record-toggle .capture-record-icon::before {
        content: none;
        display: none;
    }

    .capture-record-toggle.is-recording .capture-record-icon::before {
        content: "";
        display: block;
        position: absolute;
        inset: auto;
        top: 50%;
        left: 50%;
        width: 18px;
        height: 18px;
        margin: 0;
        border: 0;
        border-radius: 4px;
        background: #ffffff;
        transform: translate(-50%, -50%);
    }

    .capture-flip-button span {
        position: relative;
        width: 28px;
        height: 18px;
        border: 2px solid currentColor;
        border-radius: 999px / 72%;
    }

    .capture-flip-button span::before {
        position: absolute;
        inset: auto;
        top: 50%;
        left: 50%;
        width: 8px;
        height: 8px;
        content: "";
        border: 0;
        border-radius: 999px;
        background: currentColor;
        transform: translate(-50%, -50%);
    }

    .capture-flip-button span::after {
        display: none;
    }
}

@media (max-width: 920px) and (orientation: landscape) {

    .capture-toolbar-button,
    .capture-photo-button,
    .capture-record-toggle {
        width: 58px;
        height: 58px;
        min-width: 58px;
        min-height: 58px;
    }
}

@media (max-width: 920px) and (orientation: landscape) and (max-height: 390px) {
    .capture-control-tray,
    .capture-recorder-controls {
        width: 74px;
        min-width: 74px;
    }

    .capture-toolbar-button,
    .capture-photo-button,
    .capture-record-toggle {
        width: 54px;
        height: 54px;
        min-width: 54px;
        min-height: 54px;
    }
}

@media (max-width: 920px) {
    audio[data-live-audio-preview]:not([hidden]) {
        position: fixed;
        right: auto;
        bottom: calc(var(--capture-tabbar-h) + 42px);
        left: 50%;
        z-index: 26;
        display: block;
        width: min(320px, calc(100vw - 32px));
        max-width: calc(100vw - 32px);
        height: 38px;
        transform: translateX(-50%);
    }

    .capture-screen.is-live-toolbar-collapsed audio[data-live-audio-preview]:not([hidden]) {
        bottom: calc(48px + env(safe-area-inset-bottom));
    }
}

@media (max-width: 920px) and (orientation: landscape) {
    audio[data-live-audio-preview]:not([hidden]) {
        width: min(360px, calc(100vw - 210px));
    }

    .capture-screen.is-live-toolbar-collapsed audio[data-live-audio-preview]:not([hidden]) {
        bottom: calc(28px + env(safe-area-inset-bottom));
    }
}

@media (max-width: 920px) {
    .capture-header {
        background: transparent !important;
        box-shadow: none !important;
        backdrop-filter: none !important;
    }

    .capture-header h2,
    .capture-back-button,
    .capture-finish-button,
    .capture-more-button,
    .capture-refresh-button {
        color: #ffffff;
        text-shadow: 0 1px 8px rgba(0, 0, 0, 0.55);
    }

    .capture-more-button,
    .capture-refresh-button {
        background: rgba(0, 0, 0, 0.18);
        border-color: rgba(255, 255, 255, 0.64);
    }

    .capture-training-toggle {
        min-height: 40px;
        padding: 0 12px;
        font-size: 0.82rem;
    }
}

@media (max-width: 920px) and (orientation: landscape) {
    .capture-training-hint {
        right: calc(104px + env(safe-area-inset-right));
        bottom: calc(var(--capture-tabbar-h, 54px) + 10px);
        left: calc(84px + env(safe-area-inset-left));
        max-width: none;
        padding: 8px 10px;
    }
}

/* Survai Cam: single record control and cleaner landscape action rail. */

/* Live Survey Capture final authoritative control positions. This block intentionally follows all older camera overrides. */

/* Live Survey Capture final positioning overrides: keep this block last. */
@media (max-width: 920px) {
    .capture-screen.is-main-camera .capture-control-tray {
        bottom: calc(24px + env(safe-area-inset-bottom)) !important;
    }

    .capture-screen.is-main-camera .capture-photo-button .capture-photo-icon {
        display: none !important;
    }
}

@media (max-width: 920px) and (orientation: landscape) {
    .capture-screen.is-main-camera .capture-control-tray {
        right: calc(6px + env(safe-area-inset-right)) !important;
    }
}

/* Live Survey Capture save/layout refinement: final override for official capture camera only. */
.capture-live-audio-playback {
    margin-top: 8px;
}

.capture-live-audio-playback audio {
    display: block;
    width: min(100%, 360px);
    max-width: 100%;
}

@media (max-width: 920px) {
    .capture-screen.is-main-camera .capture-control-tray {
        bottom: calc(24px + env(safe-area-inset-bottom)) !important;
    }

    .capture-screen.is-main-camera .capture-tabbar-handle {
        right: calc(14px + env(safe-area-inset-right)) !important;
        bottom: calc(14px + env(safe-area-inset-bottom)) !important;
    }

    .capture-screen.is-main-camera.is-live-toolbar-collapsed .capture-tabbar-handle {
        right: calc(14px + env(safe-area-inset-right)) !important;
        bottom: calc(14px + env(safe-area-inset-bottom)) !important;
        left: auto !important;
    }
}

@media (max-width: 920px) and (orientation: landscape) {

    .capture-screen.is-main-camera .capture-tabbar-handle,
    .capture-screen.is-main-camera.is-live-toolbar-collapsed .capture-tabbar-handle {
        bottom: calc(12px + env(safe-area-inset-bottom)) !important;
        left: calc(14px + env(safe-area-inset-left)) !important;
    }
}

@media (max-width: 920px) and (orientation: landscape) and (max-height: 390px) {
    .capture-screen.is-main-camera .capture-control-tray {
        right: calc(6px + env(safe-area-inset-right)) !important;
    }
}

/* Live Survey Capture authoritative mobile control positions. Keep this block last. */

/* Live Survey Capture final control alignment: compact top-left utilities and stable main controls. */
@media (max-width: 920px) {

    .capture-screen.is-main-camera .capture-record-toggle,
    .capture-screen.is-main-camera .capture-photo-button:not(.capture-video-record-button) {
        position: relative !important;
        inset: auto !important;
        display: grid !important;
        width: 64px !important;
        height: 64px !important;
        min-width: 64px !important;
        min-height: 64px !important;
        max-width: 64px !important;
        max-height: 64px !important;
        margin: 0 !important;
        padding: 0 !important;
        place-items: center !important;
        transform: none !important;
        pointer-events: auto;
    }

    .capture-screen.is-main-camera .capture-record-toggle.btn-record--idle,
    .capture-screen.is-main-camera .capture-record-toggle.btn-record--active {
        width: 64px !important;
        height: 64px !important;
        min-width: 64px !important;
        min-height: 64px !important;
    }
}

/* --- Survai Operational Dashboard --- */
.ops-dashboard-page {
    background: var(--survai-tint-f3f6fb);
}

.ops-dashboard-page .app-shell {
    --sidebar-width: var(--survai-app-rail-width);
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    min-width: 0;
}

@media (max-width: 1100px) {
    .ops-dashboard-page .app-shell {
        --sidebar-width: var(--survai-app-rail-width);
    }
}

.ops-dashboard {
    width: 100%;
    max-width: none;
    min-width: 0;
    padding: var(--app-main-padding);
    box-sizing: border-box;
}

/* Settings hub: vertical gap between cards matches Business Dashboard `.ops-grid` (22px) */
body.settings-page .main-panel.ops-dashboard {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.ops-dashboard.is-cards-compact .ops-grid--primary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ops-dashboard.is-cards-compact .ops-grid--secondary {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ops-dashboard.is-cards-compact .ops-grid--secondary:nth-of-type(4),
.ops-dashboard.is-cards-compact .ops-grid--secondary:nth-of-type(5) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ops-dashboard.is-cards-ultra .ops-grid--primary {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ops-dashboard.is-cards-ultra .ops-grid--secondary {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.ops-dashboard.is-cards-ultra .ops-grid--secondary:nth-of-type(4),
.ops-dashboard.is-cards-ultra .ops-grid--secondary:nth-of-type(5) {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (min-width: 901px) {
    .sidebar--ops,
    body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar:not(.sidebar--workspace) {
        gap: 16px;
        padding: 22px 10px;
    }

    .sidebar--ops .sidebar-brand,
    body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar:not(.sidebar--workspace) .sidebar-brand {
        width: 100%;
        justify-content: center;
    }

    /* Horizontal wordmark on desktop; compact mark is handled by collapsed / mobile drawers. */
    .sidebar--ops .sidebar-brand::before,
    body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar:not(.sidebar--workspace) .sidebar-brand::before {
        display: none;
    }

    .sidebar--ops .brand-logo-sidebar,
    body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar:not(.sidebar--workspace) .brand-logo-sidebar {
        display: block;
        width: min(420px, 100%);
        max-height: 108px;
        height: auto;
        margin: 0 auto;
        background-color: transparent !important;
        object-fit: contain;
        object-position: center;
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
    }

    .sidebar-nav--ops,
    body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar:not(.sidebar--workspace) .sidebar-nav {
        gap: 6px;
        overflow-y: auto;
        padding-right: 0;
    }

    .sidebar-nav--ops a,
    body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar:not(.sidebar--workspace) .sidebar-nav a {
        min-height: auto;
        border-radius: 14px;
        padding: 10px 4px;
        color: rgba(255, 255, 255, 0.76);
        font-size: 0.82rem;
        line-height: 1.16;
        text-align: center;
    }

    .sidebar-nav--ops .sidebar-nav-icon,
    body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar:not(.sidebar--workspace) .sidebar-nav .sidebar-nav-icon {
        width: 30px;
        height: 30px;
        flex-basis: 30px;
    }

    .sidebar-nav--ops .sidebar-nav-icon svg,
    body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar:not(.sidebar--workspace) .sidebar-nav .sidebar-nav-icon svg {
        stroke-width: 1.22;
    }

    .sidebar-nav--ops .sidebar-nav-label,
    body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar:not(.sidebar--workspace) .sidebar-nav .sidebar-nav-label {
        font-weight: 400;
        font-size: 0.82rem;
        line-height: 1.18;
    }
}

.sidebar-nav--ops a.active,
body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar:not(.sidebar--workspace) .sidebar-nav a.active {
    color: #ffffff;
    background: transparent;
}

.ops-line-icon {
    display: inline-grid;
    width: 18px;
    height: 18px;
    place-items: center;
    flex: 0 0 18px;
    color: currentColor;
}

.ops-line-icon svg,
.ops-quick-actions svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.ops-line-icon svg .sai-icon-accent,
.workspace-tool-button__icon svg .sai-icon-accent {
    color: var(--survai-menu-icon-blue);
    stroke: currentColor;
}

.status-dot--warning {
    background: #f59e0b;
}

.status-dot--urgent {
    background: #ef4444;
}

.ops-hero,
.ops-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.ops-hero {
    margin-bottom: 16px;
}

/* Business dashboard: on small screens the fixed white workspace topbar already shows title + actions */

.ops-hero h1 {
    margin-bottom: 2px;
    color: var(--navy);
    font-size: clamp(1.55rem, 2vw, 2rem);
}

.ops-subtitle {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 700;
}

.ops-hero-actions {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.ops-notification-wrap {
    position: relative;
}

.ops-notification {
    position: relative;
    display: inline-grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 0;
    border-radius: 12px;
    background: var(--survai-card);
    color: var(--navy);
    cursor: pointer;
}

.ops-notification:hover,
.ops-notification:focus-visible,
.ops-notification[aria-expanded="true"] {
    background: var(--survai-tint-edf5ff);
    color: var(--survai-navy-ink);
    outline: none;
}

.ops-notification-count {
    position: absolute;
    top: -7px;
    right: -7px;
    display: inline-grid;
    min-width: 21px;
    height: 21px;
    place-items: center;
    border: 2px solid var(--survai-card);
    border-radius: 999px;
    background: #ef4444;
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 900;
}

.ops-notification-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 80;
    width: min(390px, calc(100vw - 28px));
    overflow: hidden;
    border: 1px solid rgba(7, 26, 61, 0.1);
    border-radius: 18px;
    background: var(--survai-card);
    box-shadow: 0 18px 45px rgba(7, 26, 61, 0.16);
}

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

.ops-notification-panel__head,
.ops-notification-panel__foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 16px;
}

.ops-notification-panel__head {
    border-bottom: 1px solid rgba(7, 26, 61, 0.08);
    background: var(--survai-tint-f8fbff);
}

.ops-notification-panel__head strong {
    display: block;
    color: var(--survai-navy-ink);
    font-size: 0.94rem;
    line-height: 1.15;
}

.ops-notification-panel__head span {
    color: var(--survai-secondary-slate);
    font-size: 0.78rem;
    font-weight: 800;
}

.ops-notification-panel__head > span {
    display: inline-grid;
    min-width: 30px;
    height: 30px;
    place-items: center;
    border-radius: 999px;
    background: var(--survai-navy-surface);
    color: #ffffff;
    font-size: 0.8rem;
    font-weight: 700;
}

.ops-notification-list {
    max-height: min(520px, calc(100vh - 230px));
    overflow: auto;
    padding: 8px;
}

@media (max-width: 900px) {
    .ops-notification-panel:not([hidden]) {
        position: fixed !important;
        top: calc(var(--survai-mobile-app-header-total, calc(110px + env(safe-area-inset-top, 0px))) + 10px);
        right: max(14px, env(safe-area-inset-right, 0px));
        /* The mobile header's backdrop-filter makes it the containing block for
           this fixed panel, so a bottom offset was measured against the 85px
           header and the panel collapsed to its two borders (dashboard,
           3 Oct 2026). Cap the height instead; the list inside scrolls. */
        bottom: auto;
        max-height: calc(100dvh - var(--survai-mobile-app-header-total, calc(110px + env(safe-area-inset-top, 0px))) - 26px - env(safe-area-inset-bottom, 0px));
        left: max(14px, env(safe-area-inset-left, 0px));
        width: auto !important;
        max-width: none !important;
        display: flex;
        flex-direction: column;
        box-sizing: border-box;
        z-index: 1300 !important;
    }

    .ops-notification-panel .ops-notification-list {
        flex: 1 1 auto;
        min-height: 0;
        max-height: none !important;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }

    .ops-notification-panel > .ops-notification-empty {
        flex: 1 1 auto;
        min-height: 0;
        overflow-y: auto;
    }

    .ops-notification-panel:not([hidden]) .ops-notification-panel__head,
    .ops-notification-panel:not([hidden]) .ops-notification-panel__foot {
        flex-shrink: 0;
    }
}

/* ------------------------------------------------------------------
 * Workspace topbar filter dropdown (reports list search; dashboard date range)
 * ------------------------------------------------------------------ */
.reports-filter-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.reports-filter-toggle {
    position: relative;
    display: inline-grid;
    width: 38px;
    height: 38px;
    place-items: center;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--survai-secondary-slate);
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.reports-filter-toggle:hover,
.reports-filter-toggle:focus-visible,
.reports-filter-toggle[aria-expanded='true'] {
    color: var(--survai-secondary-strong);
    outline: none;
}

.reports-filter-toggle__icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Header listen/approve/cost duplicate the footer controls beneath the text
   box, so only surface them when the section is collapsed (footer hidden
   then). The selector must out-specify the .section-head-actions sizing rule
   below (0,3,1) which otherwise forces every header icon visible. (The header
   Copy button was retired on 30 Sep 2026.) */
.output-section:not(.is-collapsed) > header .section-head-actions .output-section-header-listen,
.output-section:not(.is-collapsed) > header .section-head-actions .output-section-header-proof,
.output-section:not(.is-collapsed) > header .section-head-actions .output-section-header-cost {
    display: none;
}

.output-section.is-collapsed .output-section-header-listen,
.output-section.is-collapsed .output-section-header-proof,
.output-section.is-collapsed .output-section-header-cost {
    display: inline-flex;
}

.output-section.is-collapsed .output-section-actions [data-listen-section]:not([data-listen-section-header]) {
    display: none;
}

/* The footer copy of Approve is inside the collapsed area anyway; hiding it
   explicitly keeps it symmetrical with Listen. */
.output-section.is-collapsed .output-section-actions [data-proof-section]:not([data-proof-section-header]) {
    display: none;
}

/* Keep collapsed section headers stable when ratings save (save-state pulse). */
.output-section > header {
    align-items: center;
    scroll-margin-top: var(--output-section-header-scroll-margin, 132px);
}

/* Read-only preview of a section the PDF generates (the Legal and Other
   Matters register merge): visibly not an editor, capped so a long register
   scrolls inside its card. */
.template-block-generated-preview {
    display: grid;
    gap: 8px;
    margin: 0 0 12px;
    padding: 12px 14px;
    border: 1px dashed var(--survai-border-mid);
    border-radius: 12px;
    background: var(--survai-bg);
}
.template-block-generated-preview__text {
    max-height: 320px;
    overflow-y: auto;
    color: var(--survai-ink-3d4861);
    font-size: 0.86rem;
    line-height: 1.5;
}

.template-block-variant-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 10px;
}

.template-block-variant-tab {
    border: 1px solid rgba(148, 163, 184, 0.4);
    background: var(--survai-card);
    color: var(--survai-secondary-strong);
    border-radius: 999px;
    padding: 5px 14px;
    font-size: 0.82rem;
    font-weight: 650;
    cursor: pointer;
}

.template-block-variant-tab:hover {
    border-color: rgba(99, 102, 241, 0.5);
}

.template-block-variant-tab.is-active {
    background: #4f46e5;
    border-color: #4f46e5;
    color: #fff;
}

body.output-report-page .output-section > header {
    scroll-margin-top: var(--output-section-header-scroll-margin, 132px);
}

.output-section > header > div:first-child {
    align-self: center;
    min-width: 0;
}

.output-section > header .section-head-actions {
    flex-wrap: nowrap;
    align-items: center;
    gap: 8px;
}

.output-section > header .save-state {
    flex: 0 0 88px;
    width: 88px;
    max-width: 88px;
    min-height: 1.35em;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.output-section > header .save-state.error {
    flex: 1 1 180px;
    width: auto;
    max-width: min(420px, 48vw);
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
}

.output-section.is-collapsed > header {
    min-height: 44px;
}

/* output.php: equal circular header controls (copy, listen, rating, collapse). */
.output-section > header .section-head-actions .output-icon-action,
.output-section > header .section-head-actions .collapse-toggle,
.output-section > header .section-head-actions .condition-rating-badge {
    box-sizing: border-box;
    display: inline-flex;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    flex: 0 0 44px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 0;
}

.output-section > header .section-head-actions .collapse-toggle {
    border: 1px solid rgba(148, 163, 184, 0.34);
    background: var(--survai-bg);
}

.output-section > header .section-head-actions .condition-rating-badge {
    font-size: 0.76rem;
    font-weight: 950;
    line-height: 1;
    letter-spacing: -0.02em;
}

.output-section > header .section-head-actions .output-icon-action .output-action-icon {
    width: 18px;
    height: 18px;
}

.copy-confirmation-modal[hidden] {
    display: none;
}

.copy-confirmation-modal {
    position: fixed;
    inset: 0;
    z-index: 10020;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(15, 23, 42, 0.18);
    backdrop-filter: blur(5px);
}

.reports-filter-toggle__icon svg {
    display: block;
    width: 24px;
    height: 24px;
}

.reports-filter-toggle__icon svg circle,
.reports-filter-toggle__icon svg path {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.reports-filter-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 80;
    /* Wide enough for the longest status/sort labels in two columns. */
    width: min(460px, calc(100vw - 28px));
    max-height: calc(100dvh - 150px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(7, 26, 61, 0.1);
    border-radius: 16px;
    background: var(--survai-card);
    box-shadow: 0 18px 45px rgba(7, 26, 61, 0.14);
}

.reports-filter-panel[hidden] {
    display: none !important;
}

.reports-filter-panel__head {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(7, 26, 61, 0.08);
    background: var(--survai-tint-f8fbff);
}

.reports-filter-panel__head strong {
    font-size: 0.9rem;
    font-weight: 850;
    color: var(--survai-navy-ink);
}

.reports-filter-panel__body {
    display: grid;
    gap: 12px;
    padding: 12px 14px 14px;
    min-height: 0;
    overflow-y: auto;
}

.reports-filter-panel__body .ops-range-form--in-panel {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 10px;
    margin: 0;
}

.reports-filter-panel__body .ops-range-form--in-panel label {
    display: grid;
    gap: 6px;
    width: 100%;
    margin: 0;
}

.reports-filter-panel__body .ops-range-form--in-panel .btn {
    width: 100%;
    justify-content: center;
}

.reports-filter-panel__body .ops-range-form--in-panel select,
.reports-filter-panel__body .ops-range-form--in-panel input {
    width: 100%;
    min-width: 0;
}

.reports-filter-panel__field.search-field span {
    font-size: 0.74rem;
}

.reports-filter-panel__field input,
.reports-filter-panel__field select {
    width: 100%;
}

/* Survey type + survey date: stacked on a phone, side by side once the panel
   is wide enough for both labels. Layout only; the fields keep their styling. */
.reports-filter-panel__row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
}

@media (min-width: 480px) {
    .reports-filter-panel__row {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Status filter — multi-select checkbox group (persists via localStorage) */
.reports-filter-status {
    display: grid;
    gap: 8px;
}

.reports-filter-status__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.reports-filter-status__label {
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--survai-text-soft);
}

.reports-filter-status__actions {
    display: inline-flex;
    gap: 10px;
}

.reports-filter-status__link {
    border: 0;
    background: none;
    padding: 0;
    color: var(--survai-ink-165ffa);
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
}

.reports-filter-status__link:hover {
    text-decoration: underline;
}

.reports-filter-status__group {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2px 10px;
    max-height: 300px;
    overflow-y: auto;
    padding: 8px;
    border: 1px solid rgba(148, 163, 184, 0.34);
    border-radius: 10px;
    background: var(--survai-card);
}

.reports-filter-status__option {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 0.82rem;
    color: var(--survai-text-slate);
    cursor: pointer;
}

.reports-filter-status__option:hover {
    background: rgba(22, 95, 250, 0.08);
}

.reports-filter-status__option span {
    /* Every option label stays fully readable — wrap instead of clipping. */
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.25;
}

.reports-filter-status .reports-filter-status__option input[type="checkbox"] {
    width: 16px;
    min-width: 16px;
    height: 16px;
    margin: 0;
    flex: 0 0 16px;
    accent-color: #165ffa;
    cursor: pointer;
}

.workspace-topbar--global .workspace-topbar-actions .reports-filter-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.workspace-topbar--global .workspace-topbar-actions .reports-filter-toggle {
    display: inline-flex;
    width: 44px;
    height: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: var(--survai-text);
}

.workspace-topbar--global .workspace-topbar-actions .reports-filter-panel {
    z-index: 1200;
}

@media (max-width: 900px) {
    .reports-filter-panel:not([hidden]) {
        position: fixed !important;
        top: calc(var(--survai-mobile-app-header-total, calc(110px + env(safe-area-inset-top, 0px))) + 10px);
        right: max(14px, env(safe-area-inset-right, 0px));
        left: max(14px, env(safe-area-inset-left, 0px));
        width: auto !important;
        max-width: none !important;
        bottom: auto;
        height: auto;
        z-index: 1300 !important;
    }
}

html[data-theme="dark"] .reports-filter-panel,
html[data-theme="dark"] .reports-filter-panel,
html[data-theme="dark"] .reports-filter-panel {
    border-color: rgba(255, 255, 255, 0.12);
    background: var(--survai-card);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.38);
}

html[data-theme="dark"] .reports-filter-panel__head,
html[data-theme="dark"] .reports-filter-panel__head,
html[data-theme="dark"] .reports-filter-panel__head {
    border-color: rgba(255, 255, 255, 0.1);
    background: var(--survai-bg-soft);
}

html[data-theme="dark"] .reports-filter-panel__head strong,
html[data-theme="dark"] .reports-filter-panel__head strong,
html[data-theme="dark"] .reports-filter-panel__head strong {
    color: var(--survai-text-strong);
}

.ops-notification-item {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 14px;
    color: var(--survai-navy-ink);
    text-decoration: none;
}

.ops-notification-item:hover,
.ops-notification-item:focus-visible {
    background: var(--survai-tint-f1f6fc);
    outline: none;
}

.ops-notification-item__icon {
    width: 36px;
    height: 36px;
    border-color: rgba(27, 90, 249, 0.18);
    background: var(--survai-tint-f5f9ff);
}

.ops-notification-item--high .ops-notification-item__icon {
    color: var(--survai-ink-b42318);
    background: var(--survai-tint-fff1f0);
}

.ops-notification-item--medium .ops-notification-item__icon,
.ops-notification-item--warning .ops-notification-item__icon {
    color: var(--survai-ink-b76b00);
    background: var(--survai-tint-fff8e7);
}

.ops-notification-item--info .ops-notification-item__icon {
    color: var(--survai-navy-ink);
    background: var(--survai-tint-edf5ff);
}

.ops-notification-item__body {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.ops-notification-item__body strong {
    overflow: hidden;
    color: var(--survai-navy-ink);
    font-size: 0.84rem;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ops-notification-item__body small,
.ops-notification-item__body em {
    overflow: hidden;
    color: var(--survai-secondary-slate);
    font-size: 0.75rem;
    font-style: normal;
    font-weight: 750;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ops-notification-item__body em {
    color: var(--survai-ink-7c8a9d);
}

.ops-notification-item__count {
    display: inline-grid;
    min-width: 26px;
    height: 26px;
    place-items: center;
    border-radius: 999px;
    background: var(--survai-navy-surface);
    color: #ffffff;
    font-size: 0.76rem;
    font-weight: 700;
}

.ops-notification-empty {
    margin: 0;
    padding: 20px 16px;
    color: var(--survai-secondary-slate);
    font-size: 0.84rem;
    font-weight: 800;
}

.ops-notification-panel__foot {
    border-top: 1px solid rgba(7, 26, 61, 0.08);
    background: var(--survai-tint-f8fbff);
}

.ops-notification-panel__foot a {
    color: var(--survai-ink-1b5af9);
    font-size: 0.8rem;
    font-weight: 900;
    text-decoration: none;
}

.ops-notification-sound-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--survai-secondary-slate);
    font-size: 0.78rem;
    font-weight: 700;
}

.ops-notification-sound-toggle input {
    width: 0.95rem;
    height: 0.95rem;
    accent-color: #1b5af9;
}

.ops-notification-sound-status {
    min-height: 1rem;
    color: var(--survai-secondary-slate);
    font-size: 0.75rem;
    font-weight: 700;
}

.settings-notification-sound-panel {
    display: grid;
    gap: 1rem;
    padding: 1.1rem;
    margin: 1rem 0 1.25rem;
    border: 1px solid rgba(148, 163, 184, 0.26);
    border-radius: 18px;
    background: linear-gradient(180deg, var(--survai-card), var(--survai-tint-f8fbff));
    box-shadow: 0 16px 42px rgba(15, 23, 42, 0.06);
}

.settings-notification-sound-panel h2 {
    margin: 0.2rem 0 0.25rem;
    font-size: 1.15rem;
}

.notification-sound-settings-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(180px, 0.55fr);
    gap: 1rem;
    align-items: end;
}

@media (max-width: 720px) {
    .notification-sound-settings-grid {
        grid-template-columns: 1fr;
    }
}

html[data-theme="dark"] .ops-notification,
html[data-theme="dark"] .ops-notification,
html[data-theme="dark"] .ops-notification {
    background: rgba(255, 255, 255, 0.08);
    color: var(--survai-text);
}

html[data-theme="dark"] .ops-notification:hover,
html[data-theme="dark"] .ops-notification:focus-visible,
html[data-theme="dark"] .ops-notification[aria-expanded="true"],
html[data-theme="dark"] .ops-notification:hover,
html[data-theme="dark"] .ops-notification:focus-visible,
html[data-theme="dark"] .ops-notification[aria-expanded="true"],
html[data-theme="dark"] .ops-notification:hover,
html[data-theme="dark"] .ops-notification:focus-visible,
html[data-theme="dark"] .ops-notification[aria-expanded="true"] {
    background: var(--survai-neutral-hover);
    color: var(--survai-text);
}

html[data-theme="dark"] .ops-notification-panel,
html[data-theme="dark"] .ops-notification-panel,
html[data-theme="dark"] .ops-notification-panel {
    border-color: rgba(255, 255, 255, 0.12);
    background: var(--survai-card);
    box-shadow: 0 20px 48px rgba(0, 0, 0, 0.42);
}

html[data-theme="dark"] .ops-notification-panel__head,
html[data-theme="dark"] .ops-notification-panel__foot,
html[data-theme="dark"] .ops-notification-panel__head,
html[data-theme="dark"] .ops-notification-panel__foot,
html[data-theme="dark"] .ops-notification-panel__head,
html[data-theme="dark"] .ops-notification-panel__foot {
    border-color: rgba(255, 255, 255, 0.1);
    background: var(--survai-bg-soft);
}

html[data-theme="dark"] .ops-notification-panel__head strong,
html[data-theme="dark"] .ops-notification-item__body strong,
html[data-theme="dark"] .ops-notification-panel__head strong,
html[data-theme="dark"] .ops-notification-item__body strong,
html[data-theme="dark"] .ops-notification-panel__head strong,
html[data-theme="dark"] .ops-notification-item__body strong {
    color: var(--survai-text-strong);
}

html[data-theme="dark"] .ops-notification-item,
html[data-theme="dark"] .ops-notification-item,
html[data-theme="dark"] .ops-notification-item {
    color: var(--survai-text);
}

html[data-theme="dark"] .ops-notification-panel__head > div span,
html[data-theme="dark"] .ops-notification-item__body small,
html[data-theme="dark"] .ops-notification-item__body em,
html[data-theme="dark"] .ops-notification-empty,
html[data-theme="dark"] .ops-notification-panel__head > div span,
html[data-theme="dark"] .ops-notification-item__body small,
html[data-theme="dark"] .ops-notification-item__body em,
html[data-theme="dark"] .ops-notification-empty,
html[data-theme="dark"] .ops-notification-panel__head > div span,
html[data-theme="dark"] .ops-notification-item__body small,
html[data-theme="dark"] .ops-notification-item__body em,
html[data-theme="dark"] .ops-notification-empty {
    color: var(--survai-text-muted);
}

html[data-theme="dark"] .ops-notification-panel__head > span,
html[data-theme="dark"] .ops-notification-item__count,
html[data-theme="dark"] .ops-notification-panel__head > span,
html[data-theme="dark"] .ops-notification-item__count,
html[data-theme="dark"] .ops-notification-panel__head > span,
html[data-theme="dark"] .ops-notification-item__count {
    color: var(--survai-text-strong);
}

html[data-theme="dark"] .ops-notification-item:hover,
html[data-theme="dark"] .ops-notification-item:focus-visible,
html[data-theme="dark"] .ops-notification-item:hover,
html[data-theme="dark"] .ops-notification-item:focus-visible,
html[data-theme="dark"] .ops-notification-item:hover,
html[data-theme="dark"] .ops-notification-item:focus-visible {
    background: rgba(255, 255, 255, 0.07);
}

.ops-range-form {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    flex-wrap: wrap;
}

.ops-range-form label {
    gap: 4px;
}

.ops-range-form label span {
    color: var(--muted);
    font-size: 0.74rem;
    text-transform: uppercase;
}

.ops-range-form select,
.ops-range-form input {
    min-height: 38px;
    border-radius: 8px;
    background-color: var(--survai-card);
    font-size: 0.84rem;
}

.ops-custom-date input {
    width: 145px;
}

.ops-range-form:not(.is-custom) .ops-custom-date {
    display: none;
}

.ops-kpi-grid {
    display: flex;
    width: 100%;
    min-width: 0;
    align-items: stretch;
    gap: clamp(14px, 1.75vw, 22px);
    overflow-x: auto;
    overflow-y: hidden;
    margin-bottom: 22px;
    padding-bottom: 2px;
    scroll-snap-type: x proximity;
    overscroll-behavior-x: contain;
}

.ops-kpi-grid > .ops-kpi-card {
    flex: 0 0 clamp(196px, 14vw, 236px);
    scroll-snap-align: start;
}

.ops-dashboard-customize {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin: 0;
}

.ops-dashboard-layout-toggle {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 34px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 999px;
    padding: 0 12px;
    background:
        linear-gradient(135deg, rgba(27, 90, 249, 0.055), rgba(27, 90, 249, 0.07)),
        var(--survai-card);
    color: var(--navy);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 22px rgba(15, 23, 42, 0.035);
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 900;
}

.ops-dashboard-layout-toggle svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

.ops-dashboard-layout-toggle:hover,
.ops-dashboard-customize.is-open .ops-dashboard-layout-toggle {
    border-color: rgba(27, 90, 249, 0.5);
    color: var(--survai-ink-16704a);
    background: rgba(27, 90, 249, 0.13);
}

.ops-dashboard-layout-panel {
    position: absolute;
    z-index: 30;
    left: 0;
    top: 100%;
    width: min(760px, calc(100vw - 380px));
    display: flex;
    align-items: end;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 8px;
    padding: 12px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 12px;
    background: var(--survai-card);
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.14);
}

@media (max-width: 1320px) {
    .ops-dashboard-layout-panel {
        width: min(720px, calc(100vw - 44px));
    }
}

.ops-dashboard-layout-panel[hidden] {
    display: none;
}

.ops-dashboard-layout-panel > div {
    min-width: min(100%, 280px);
    margin-right: auto;
}

.ops-dashboard-customize strong {
    display: block;
    color: var(--navy);
    font-size: 0.86rem;
    line-height: 1.2;
}

.ops-dashboard-customize span {
    display: block;
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 760;
    line-height: 1.35;
}

.ops-dashboard-customize label {
    display: grid;
    min-width: min(100%, 210px);
    gap: 4px;
}

.ops-dashboard-customize label span {
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 900;
    line-height: 1;
    text-transform: uppercase;
}

.ops-dashboard-customize select {
    min-height: 34px;
    border: 1px solid #dbe5f0;
    border-radius: 9px;
    padding: 0 9px;
    background: var(--survai-card);
    color: var(--navy);
    font-size: 0.78rem;
    font-weight: 800;
}

.ops-dashboard-customize-btn {
    min-height: 34px;
    border: 1px solid rgba(27, 90, 249, 0.22);
    border-radius: 9px;
    padding: 0 12px;
    background: var(--survai-card);
    color: var(--survai-ink-1b5af9);
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 900;
}

.ops-dashboard-customize-btn:hover:not(:disabled) {
    border-color: rgba(27, 90, 249, 0.5);
    color: var(--survai-ink-16704a);
    background: rgba(27, 90, 249, 0.1);
}

.ops-dashboard-customize-btn:disabled,
.ops-dashboard-customize select:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.ops-dashboard-dropzone {
    position: relative;
    border-radius: 14px;
    transition: background 160ms ease, box-shadow 160ms ease;
}

.ops-dashboard-dropzone.is-dashboard-drag-over {
    background: rgba(27, 90, 249, 0.055);
    box-shadow: inset 0 0 0 1px rgba(27, 90, 249, 0.28);
}

.ops-dashboard [data-dashboard-card][hidden] {
    display: none !important;
}

.ops-dashboard-draggable {
    position: relative;
    cursor: grab;
    transition:
        border-color 160ms ease,
        box-shadow 160ms ease,
        opacity 160ms ease;
}

.ops-dashboard-draggable:active {
    cursor: grabbing;
}

.ops-dashboard-draggable::after {
    content: "";
    position: absolute;
    top: 10px;
    right: 10px;
    width: 16px;
    height: 16px;
    border-radius: 6px;
    opacity: 0;
    background:
        radial-gradient(circle, rgba(100, 116, 139, 0.64) 1.5px, transparent 2px) 0 0 / 6px 6px;
    pointer-events: none;
    transition: opacity 160ms ease;
}

.ops-dashboard-draggable:hover {
    border-color: rgba(27, 90, 249, 0.22);
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.065);
}

.ops-dashboard-draggable:hover::after {
    opacity: 0.58;
}

.ops-dashboard-draggable.is-dashboard-dragging {
    opacity: 0.42;
}

.ops-dashboard-card-remove {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 4;
    display: grid;
    width: 24px;
    height: 24px;
    place-items: center;
    border: 1px solid rgba(100, 116, 139, 0.18);
    border-radius: 999px;
    background: color-mix(in srgb, var(--survai-card) 86%, transparent);
    color: var(--survai-secondary-slate);
    cursor: pointer;
    opacity: 0;
    transform: translateY(-2px);
    transition: opacity 160ms ease, transform 160ms ease, border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.ops-dashboard-card-remove svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
}

.ops-dashboard-draggable:hover .ops-dashboard-card-remove,
.ops-dashboard-card-remove:focus-visible {
    opacity: 1;
    transform: translateY(0);
}

.ops-dashboard-card-remove:hover,
.ops-dashboard-card-remove:focus-visible {
    border-color: rgba(255, 77, 109, 0.34);
    background: var(--survai-tint-fff5f7);
    color: var(--survai-ink-e11d48);
    outline: none;
}

/* Dashboard ops-grid tiles: symmetric padding vs border + shared rhythm under card heads */
.ops-dashboard .ops-grid > .ops-card {
    --dash-card-pad: clamp(12px, 2.8vw, 20px);
    box-sizing: border-box;
    padding: var(--dash-card-pad);
}

.ops-dashboard .ops-grid > .ops-card.ops-dashboard-draggable > .ops-card-head {
    padding-inline-end: 42px;
}

.ops-dashboard .ops-grid > .ops-card > .ops-donut-block,
.ops-dashboard .ops-grid > .ops-card > .ops-insight-list,
.ops-dashboard .ops-grid > .ops-card > .ops-team-table,
.ops-dashboard .ops-grid > .ops-card > .ops-action-list,
.ops-dashboard .ops-grid > .ops-card > .ops-today-list {
    margin-top: 14px;
}

.ops-dashboard .ops-grid > .ops-card > .ops-donut-block,
.ops-dashboard .ops-grid > .ops-card > .ops-team-table {
    border-width: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
}

.ops-dashboard .ops-grid > .ops-card > .ops-donut-block {
    margin-bottom: 0;
}

.ops-dashboard .ops-grid > .ops-card > .ops-team-table {
    margin-bottom: 0;
}

.ops-dashboard .ops-grid > .ops-card.ops-dashboard-draggable .ops-dashboard-card-remove {
    top: max(10px, calc(var(--dash-card-pad) - 4px));
    right: max(10px, calc(var(--dash-card-pad) - 4px));
}

.ops-dashboard .ops-grid > .ops-dashboard-draggable::after {
    top: calc(var(--dash-card-pad) + 0px);
    right: calc(var(--dash-card-pad) + 0px);
}

.ops-dashboard .ops-grid > .ops-card .ops-donut-block--chart:focus-visible {
    outline: 2px solid rgba(27, 90, 249, 0.45);
    outline-offset: 3px;
    border-radius: 12px;
}

.ops-kpi-card {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: clamp(10px, 2vw, 14px);
    min-width: 0;
    min-height: 104px;
    padding: 14px 13px;
    overflow: hidden;
}

.ops-kpi-grid > .ops-card {
    grid-column: span 1;
    position: relative;
    min-height: unset;
    overflow: visible;
    z-index: 1;
}

.ops-kpi-grid > .ops-card:has(.ops-donut-block--chart:focus-within),
.ops-kpi-grid > .ops-card:has(.ops-donut-block--chart:hover) {
    z-index: 50;
}

.ops-kpi-grid > .ops-card .ops-card-head {
    margin-bottom: 2px;
}

.ops-kpi-grid > .ops-card .ops-card-head h2 {
    font-size: clamp(0.88rem, 2.8vw, 1rem);
    line-height: 1.2;
}

.ops-kpi-grid > .ops-card .ops-card-link {
    font-size: 0.72rem;
}

.ops-grid > .ops-kpi-card {
    min-height: 104px;
}

.ops-kpi-card__value {
    flex: 0 0 auto;
    align-self: stretch;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: min(6.5rem, 42%);
    max-width: 46%;
    color: var(--navy);
    font-size: clamp(1.55rem, 3.1vw, 2.35rem);
    font-weight: 850;
    letter-spacing: -0.03em;
    line-height: 1.08;
    text-align: center;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.ops-kpi-card__body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    justify-content: center;
}

.ops-kpi-card__label {
    min-width: 0;
    color: var(--survai-secondary-strong);
    font-size: 0.73rem;
    font-weight: 800;
    line-height: 1.25;
    overflow-wrap: break-word;
    word-break: normal;
}

.ops-kpi-card .ops-trend {
    margin: 0;
}

.ops-trend {
    min-width: 0;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 800;
    line-height: 1.3;
    overflow-wrap: break-word;
    word-break: normal;
}

.ops-trend--positive {
    color: var(--survai-ink-16704a);
}

.ops-trend--negative {
    color: var(--survai-ink-b42318);
}

.ops-trend--warning {
    color: var(--survai-ink-b7791f);
}

.ops-grid {
    display: grid;
    grid-auto-flow: dense;
    grid-auto-rows: 8px;
    align-items: start;
    gap: 22px;
    margin-bottom: 18px;
}

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

.ops-grid--secondary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ops-grid--secondary:nth-of-type(4),
.ops-grid--secondary:nth-of-type(5) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.ops-grid > .ops-card {
    width: auto;
    margin: 0;
    grid-row-end: span var(--ops-card-row-span, 1);
}

.ops-grid > .ops-kpi-card {
    width: auto;
    margin: 0;
    grid-row-end: span var(--ops-card-row-span, 1);
}

.ops-card {
    min-width: 0;
    overflow: hidden;
    padding: 14px;
}

.ops-card h2 {
    margin-bottom: 0;
    color: var(--navy);
    font-size: 0.98rem;
    line-height: 1.2;
}

.ops-card-link {
    min-width: 0;
    max-width: 48%;
    overflow: hidden;
    font-size: 0.74rem;
    font-weight: 850;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ops-card-link {
    color: var(--survai-ink-1b5af9);
}

.ops-card-head > div {
    min-width: 0;
}

.ops-card-head h2 {
    overflow: hidden;
    text-overflow: ellipsis;
}

.ops-action-list,
.ops-diary-list,
.ops-activity-list,
.ops-today-list,
.ops-mini-metric-list,
.ops-insight-list,
.ops-quick-actions {
    display: grid;
    gap: 7px;
    margin-top: 12px;
}

.ops-activity-list {
    min-width: 0;
}

.ops-coverage-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ops-coverage-filters,
.ops-coverage-custom,
.ops-coverage-stats {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
}

.ops-coverage-filters {
    margin-top: 8px;
}

.ops-coverage-legend {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin: 0;
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 850;
}

.ops-coverage-legend span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.ops-coverage-legend-dot--flat {
    border-color: #ffb020;
    box-shadow: 0 0 0 3px rgba(255, 176, 32, 0.16);
}

.ops-coverage-filters button {
    min-height: 32px;
    border: 1px solid #dbe5f0;
    border-radius: 999px;
    padding: 0 11px;
    background: var(--survai-card);
    color: var(--survai-text-soft);
    font-size: 0.74rem;
    font-weight: 850;
    cursor: pointer;
}

.ops-coverage-filters button:hover,
.ops-coverage-filters button.is-active {
    border-color: #16704a;
    background: var(--survai-tint-ecfdf3);
    color: var(--survai-ink-16704a);
}

.ops-coverage-custom label {
    display: grid;
    gap: 4px;
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 850;
    text-transform: uppercase;
}

.ops-coverage-custom input {
    min-height: 34px;
    border-radius: 8px;
    font-size: 0.82rem;
}

@media (max-width: 640px) {
    .output-section-actions {
        gap: 7px;
    }

    .output-icon-action {
        width: 36px;
        height: 36px;
    }

    .output-action-icon {
        width: 17px;
        height: 17px;
    }

    .speech-rate-value {
        min-height: 36px;
        padding: 0 8px;
        font-size: 0.76rem;
    }
}

.ops-coverage-map {
    position: relative;
    z-index: 0;
    width: 100%;
    min-height: 286px;
    overflow: hidden;
    border: 1px solid #dbe5f0;
    border-radius: 12px;
    background: var(--survai-tint-eaf1f8);
}

.ops-coverage-map--full {
    min-height: 560px;
}

.ops-coverage-legend--status {
    margin-top: 4px;
}

.ops-coverage-legend-swatch {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    flex-shrink: 0;
}

.ops-coverage-legend-swatch--progress {
    background: #1b5af9;
    box-shadow: 0 0 0 3px rgba(27, 90, 249, 0.18);
}

.ops-coverage-legend-swatch--completed {
    background: #16a34a;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.18);
}

.ops-coverage-legend-swatch--draft {
    background: #cbd5e1;
    box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.22);
}

.ops-report-pin {
    background: transparent !important;
    border: none !important;
}

.ops-report-pin__circle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.22);
}

.ops-report-pin__circle--progress {
    background: #1b5af9;
}

.ops-report-pin__circle--completed {
    background: #16a34a;
}

.ops-report-pin__circle--draft {
    background: var(--survai-border-soft);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.14);
}

.ops-report-pin__glyph {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 15px;
    height: 15px;
}

.ops-report-pin-svg {
    display: block;
    width: 15px;
    height: 15px;
}

.ops-report-pin__circle--progress .ops-report-pin-svg,
.ops-report-pin__circle--completed .ops-report-pin-svg {
    color: #ffffff;
}

.ops-report-pin__circle--draft .ops-report-pin-svg {
    color: var(--survai-secondary-strong);
}

.ops-coverage-cluster-wrap {
    background: transparent !important;
    border: none !important;
}

.ops-coverage-cluster-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #1b5af9;
    color: #ffffff;
    font-weight: 800;
    font-size: 0.92rem;
    letter-spacing: -0.02em;
    box-shadow: 0 4px 14px rgba(27, 90, 249, 0.35);
    position: relative;
}

.ops-coverage-cluster-badge span {
    position: relative;
    z-index: 1;
}

.ops-coverage-cluster-badge--halo::before {
    content: "";
    position: absolute;
    inset: -14px;
    border-radius: 999px;
    background: rgba(27, 90, 249, 0.14);
    z-index: 0;
}

.ops-coverage-map .marker-cluster-small,
.ops-coverage-map .marker-cluster-medium,
.ops-coverage-map .marker-cluster-large {
    background: transparent !important;
}

.ops-coverage-map .marker-cluster-small div,
.ops-coverage-map .marker-cluster-medium div,
.ops-coverage-map .marker-cluster-large div {
    background: transparent !important;
}

.property-location-card {
    padding: clamp(16px, 2vw, 22px);
}

.property-location-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.property-location-card__head h2 {
    margin: 0;
    color: var(--sai-text, #0f172a);
    font-size: clamp(1.08rem, 1.4vw, 1.28rem);
    line-height: 1.18;
}

.property-location-map {
    position: relative;
    z-index: 0;
    width: 100%;
    min-height: 290px;
    height: 290px;
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, 0.10);
    border-radius: 14px;
    background:
        linear-gradient(135deg, rgba(27, 90, 249, 0.08), color-mix(in srgb, var(--survai-card) 78%, transparent)),
        var(--survai-tint-eaf1f8);
}

.property-location-map .leaflet-container {
    width: 100% !important;
    height: 100% !important;
    min-height: inherit;
    background: var(--survai-tint-eaf1f8);
}

.property-location-card--output .property-location-map {
    min-height: 260px;
}

.property-location-map.is-leaflet-ready .property-location-static-fallback {
    display: none;
}

.property-location-static-fallback {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.property-location-static-fallback img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.property-location-static-fallback.is-static-unavailable img {
    display: none;
}

.property-location-static-fallback__panel {
    display: none;
    position: absolute;
    inset: 0;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 6px;
    padding: 18px;
    text-align: center;
    color: var(--survai-text-soft);
    background:
        linear-gradient(135deg, rgba(27, 90, 249, 0.08), color-mix(in srgb, var(--survai-card) 88%, transparent)),
        var(--survai-tint-eaf1f8);
}

.property-location-static-fallback__panel p {
    margin: 0;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--survai-text-strong);
}

.property-location-static-fallback__panel span {
    font-size: 0.78rem;
    line-height: 1.4;
    color: var(--survai-secondary-slate);
}

.property-location-static-fallback.is-static-unavailable .property-location-static-fallback__panel {
    display: flex;
}

/* The brand pin: a pink teardrop with the property-type glyph in its head.
   No circle, no halo, no box — the SVG is the whole marker and its point
   sits on the property (the image is centred on it, so the point lands at
   50% / 50%). */
.property-location-static-marker {
    position: absolute;
    left: 50%;
    top: 50%;
    display: block;
    width: 36px;
    height: 48px;
    transform: translate(-50%, calc(-100% + 2px));
    border: 0;
    background: transparent;
    box-shadow: none;
    pointer-events: none;
    filter: drop-shadow(0 4px 5px rgba(4, 16, 24, 0.38));
}

.property-location-marker {
    display: block;
    width: 36px;
    height: 48px;
    border: 0;
    background: transparent;
    box-shadow: none;
    filter: drop-shadow(0 4px 5px rgba(4, 16, 24, 0.38));
}

.property-pin__svg {
    display: block;
    width: 100%;
    height: 100%;
}

.property-location-marker__svg {
    display: block;
    width: 18px;
    height: 18px;
}

/* The Google map replaces the fallback the same way the Leaflet map does. */
.property-location-map.is-google-ready .property-location-static-fallback {
    display: none;
}

.property-location-map .gm-style {
    font-family: inherit;
}

.property-location-leaflet-marker {
    border: 0 !important;
    background: transparent !important;
}

/* The subject's door number: a brand chip just right of the point, on the static
   fallback, the Leaflet map (a divIcon marker) and the Google map (a marker label
   with this class). Tokens only; the map itself stays light in dark mode. */
.property-location-door-chip {
    display: inline-block;
    padding: 2px 7px;
    border: 1.5px solid var(--survai-map-pin);
    border-radius: 7px;
    background: var(--survai-map-road); /* the map's own white: maps stay light in dark mode */
    color: var(--survai-map-pin);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 0.02em;
    white-space: nowrap;
    box-shadow: 0 2px 5px rgba(4, 16, 24, 0.22);
    pointer-events: none;
}

.property-location-door-chip--static {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(16px, -36px);
}

.property-location-leaflet-door {
    width: auto !important;
    height: auto !important;
}

/* A planning layer's pop-up (surveyor, 20 Oct 2026: the name was "very faint"). Google's
   info window is always white, so its ink is fixed; Leaflet's bubble follows the theme. */
.property-location-layer-popup {
    max-width: 240px;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 400;
    color: var(--survai-text-strong, #0f172a);
}

.property-location-layer-popup > div + div { margin-top: 2px; }

.property-location-layer-popup__title,
.property-location-layer-popup__ref {
    font-size: 12px;
    line-height: 1.3;
    color: var(--survai-text-soft, #475569);
}

.property-location-layer-popup__name {
    font-size: 14px;
    line-height: 1.35;
    color: var(--survai-text-strong, #0f172a);
}

.property-location-map .gm-style .gm-style-iw .property-location-layer-popup,
.property-location-map .gm-style .gm-style-iw .property-location-layer-popup__name {
    color: #0f172a;
}

.property-location-map .gm-style .gm-style-iw .property-location-layer-popup__title,
.property-location-map .gm-style .gm-style-iw .property-location-layer-popup__ref {
    color: #334155;
}

/* Google draws marker labels as its own element: keep the chip's box. */
.property-location-map .gm-style .property-location-door-chip--google {
    position: relative;
    display: inline-block;
}

/* The advanced marker anchors its content at the bottom centre of the point:
   shift the chip to the same place beside the pin's head. */
.property-location-door-chip-holder {
    transform: translate(calc(50% + 16px), -16px);
}

.property-location-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 14px;
    margin-top: 10px;
    color: var(--sai-muted, #64748b);
    font-size: 0.82rem;
}

.property-location-meta span:first-child {
    color: var(--sai-text, #0f172a);
    font-weight: 650;
}

.property-location-empty {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 132px;
    border: 1px dashed rgba(15, 23, 42, 0.16);
    border-radius: 14px;
    background: color-mix(in srgb, var(--survai-bg) 82%, transparent);
    color: var(--sai-muted, #64748b);
    padding: 18px;
}

.property-location-empty__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    border-radius: 14px;
    background: rgba(27, 90, 249, 0.10);
    color: var(--survai-ink-1b5af9);
}

.property-location-empty__icon .property-location-marker__svg {
    width: 22px;
    height: 22px;
}

.property-location-empty p {
    margin: 0;
    font-weight: 650;
}

.ops-coverage-beacon--flat {
    --ops-pin-ring: #ffb020;
    --ops-pin-ring-soft: rgba(255, 176, 32, 0.22);
    --ops-pin-ring-glow: rgba(255, 176, 32, 0.78);
    --ops-pin-pulse: rgba(255, 176, 32, 0.76);
    --ops-pin-pulse-outer: rgba(146, 98, 0, 0.34);
}

@keyframes opsCoverageBeaconPulse {
    0% {
        opacity: 0.84;
        transform: scale(0.28);
    }
    72% {
        opacity: 0;
        transform: scale(1.35);
    }
    100% {
        opacity: 0;
        transform: scale(1.35);
    }
}

@keyframes opsCoveragePinFlash {
    0%,
    100% {
        background: var(--ops-pin-core);
        box-shadow:
            0 0 0 5px var(--ops-pin-ring-soft),
            0 0 14px var(--ops-pin-ring-glow),
            0 6px 14px rgba(15, 23, 42, 0.28);
    }
    42% {
        background: var(--ops-pin-core-flash);
        box-shadow:
            0 0 0 8px var(--ops-pin-ring-soft),
            0 0 26px var(--ops-pin-ring-glow),
            0 8px 18px rgba(15, 23, 42, 0.32);
    }
}

.coverage-popup {
    display: grid;
    gap: 4px;
    min-width: 190px;
    color: var(--survai-text-strong);
    font-size: 0.78rem;
}

.coverage-popup strong {
    color: var(--survai-ink-071a3d);
    font-size: 0.86rem;
}

.coverage-popup span {
    color: var(--survai-secondary-strong);
}

.coverage-popup a {
    margin-top: 4px;
    color: var(--survai-ink-16704a);
    font-weight: 850;
}

.ops-coverage-stats {
    justify-content: space-between;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 850;
}

.ops-coverage-stats strong {
    color: var(--navy);
}

.coverage-table-card {
    margin-top: 12px;
}

.coverage-location-table {
    display: grid;
    margin-top: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.coverage-location-row {
    display: grid;
    grid-template-columns: minmax(220px, 2fr) minmax(110px, 0.8fr) minmax(140px, 1fr) minmax(100px, 0.8fr) minmax(82px, 0.5fr);
    gap: 12px;
    min-width: 760px;
    padding: 10px 0;
    border-bottom: 1px solid #e8eef6;
    color: var(--survai-text-soft);
    font-size: 0.82rem;
    font-weight: 800;
    text-decoration: none;
}

.coverage-location-row:hover {
    color: var(--survai-ink-16704a);
}

.coverage-location-row--head {
    color: var(--muted);
    font-size: 0.7rem;
    text-transform: uppercase;
}

.coverage-location-row span:first-child {
    color: var(--navy);
}

html[data-theme="dark"] .ops-coverage-filters button {
    border-color: var(--survai-border);
    background: var(--survai-bg-soft);
    color: var(--survai-text-secondary);
}

html[data-theme="dark"] .ops-coverage-filters button:hover,
html[data-theme="dark"] .ops-coverage-filters button.is-active {
    border-color: var(--survai-border-mid);
    background: var(--survai-neutral-hover);
    color: var(--survai-text);
}

html[data-theme="dark"] .ops-coverage-map {
    border-color: var(--survai-border);
    background: var(--survai-bg-soft);
}

html[data-theme="dark"] .ops-report-pin__circle--draft {
    background: rgba(255, 255, 255, 0.32);
}

html[data-theme="dark"] .ops-report-pin__circle--draft .ops-report-pin-svg {
    color: rgba(10, 10, 10, 0.92);
}

html[data-theme="dark"] .coverage-location-row {
    border-bottom-color: var(--survai-border-faint);
    color: var(--survai-text-secondary);
}

/* --- Property evidence media pages --- */
.evidence-media-main {
    width: 100%;
    min-width: 0;
}

.evidence-photos-page {
    overflow: visible;
}

.evidence-photo-grid {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
    gap: 18px;
}

.evidence-photo-card {
    position: relative;
    overflow: hidden;
    border-radius: 14px;
}

.evidence-photo-preview {
    display: block;
    overflow: hidden;
    border-radius: 12px;
    background: var(--survai-ink-surface);
    aspect-ratio: 4 / 3;
}

.evidence-photo-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 180ms ease;
}

.evidence-photo-preview:hover img {
    transform: scale(1.025);
}

.evidence-photo-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
}

.evidence-audio-card .transcript-section-title-row,
.evidence-media-uploads-card .transcript-section-title-row {
    align-items: flex-start;
}

.evidence-audio-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
}

.evidence-recording-list {
    gap: 10px;
}

.evidence-recording-card {
    grid-template-columns: minmax(88px, 0.45fr) minmax(180px, 1.15fr) minmax(190px, 1fr) minmax(260px, 1.2fr);
}

.evidence-recording-card audio,
.evidence-upload-item audio {
    width: 100%;
    min-width: 190px;
}

.evidence-upload-list {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.evidence-upload-item {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) minmax(240px, 1fr) auto;
    align-items: center;
    gap: 14px;
    padding: 12px;
    border: 1px solid var(--theme-border, #dce3ec);
    border-radius: 12px;
    background: var(--theme-panel-soft, #f8fafc);
}

.evidence-upload-item > div,
.evidence-video-copy {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.evidence-upload-item strong,
.evidence-video-copy strong {
    overflow: hidden;
    color: var(--theme-text, var(--navy));
    text-overflow: ellipsis;
    white-space: nowrap;
}

.evidence-upload-item span,
.evidence-upload-item em,
.evidence-video-copy span {
    color: var(--theme-muted, var(--muted));
    font-size: 0.82rem;
    font-style: normal;
    font-weight: 750;
}

.video-grid-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.video-grid-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 24px;
}

.video-grid-header h2 {
    margin: 0;
    color: var(--survai-ink-0b1736);
    font-size: 22px;
    font-weight: 700;
}

.video-grid-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.video-grid-actions .upload-btn,
.video-grid-actions .filter-btn {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    border: 1px solid #e6edf7;
    border-radius: 10px;
    padding: 8px 16px;
    background: var(--survai-card);
    color: var(--survai-ink-0b1736);
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
}

.video-grid-actions .upload-btn {
    border-color: #0b1736;
    background: #0b1736;
    color: #ffffff;
}

.video-grid-bulk-toolbar {
    margin-bottom: 16px;
}

.video-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    margin-top: 14px;
}

.video-card {
    position: relative;
    overflow: hidden;
    border: 1px solid #e6edf7;
    border-radius: 12px;
    background: var(--survai-card);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.video-card:hover {
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}

.video-card .media-select-check {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 4;
}

.video-thumbnail {
    position: relative;
    display: block;
    overflow: hidden;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #1a2a4a;
    color: #ffffff;
    text-decoration: none;
}

.video-card-preview-video,
.video-thumbnail img {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-placeholder {
    position: absolute;
    inset: 0;
    z-index: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1a2a4a;
    color: #ffffff;
}

.play-icon {
    font-size: 40px;
    line-height: 1;
    opacity: 0.68;
}

.video-duration {
    position: absolute;
    right: 8px;
    bottom: 8px;
    z-index: 2;
    border-radius: 4px;
    padding: 2px 8px;
    background: rgba(0, 0, 0, 0.8);
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
}

.video-info {
    display: grid;
    gap: 4px;
    padding: 12px 14px 8px;
}

.video-title {
    overflow: hidden;
    color: var(--survai-ink-0b1736);
    font-size: 14px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.video-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 8px;
    color: var(--survai-ink-60708f);
    font-size: 12px;
}

.video-meta span + span::before {
    content: "·";
    margin-right: 8px;
    color: #9aa8bd;
}

.video-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 4px 14px 12px;
}

.video-action-btn {
    display: inline-flex;
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
    border: 1px solid #e6edf7;
    border-radius: 999px;
    padding: 0;
    background: var(--survai-card);
    color: var(--survai-ink-0b1736);
    cursor: pointer;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.play-btn:hover,
.play-btn:focus-visible {
    border-color: #0b1736;
    background: #0b1736;
    color: #ffffff;
}

.delete-btn:hover,
.delete-btn:focus-visible {
    border-color: #dc2626;
    background: var(--survai-tint-fee2e2);
    color: var(--survai-ink-dc2626);
}

.video-grid-empty {
    border: 1px dashed #d8e2f0;
    border-radius: 16px;
    padding: 60px 20px;
    color: var(--survai-ink-60708f);
    text-align: center;
}

.video-grid-empty strong {
    display: block;
    color: var(--survai-ink-0b1736);
    font-size: 1rem;
}

.video-grid-empty p {
    margin: 8px 0 0;
}

@media (min-width: 640px) {
    .video-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .video-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1280px) {
    .video-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .video-grid-container {
        padding: 12px;
    }

    .video-grid-header {
        align-items: stretch;
        flex-direction: column;
    }

    .video-grid-actions {
        width: 100%;
    }

    .video-grid-actions .upload-btn,
    .video-grid-actions .filter-btn {
        flex: 1 1 0;
    }

    .video-title {
        font-size: 13px;
    }
}

@media (max-width: 920px) {
    .evidence-photo-grid {
        grid-template-columns: 1fr;
    }

    .evidence-recording-card,
    .evidence-upload-item {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .evidence-audio-actions {
        justify-content: stretch;
    }

    .evidence-audio-actions .btn,
    .evidence-video-actions .btn,
    .evidence-video-actions .inline-action-form,
    .evidence-video-actions .inline-action-form .btn,
    .evidence-photo-actions .btn {
        width: 100%;
    }

    .evidence-recording-card audio,
    .evidence-upload-item audio {
        min-width: 0;
    }
}

.ops-action-row {
    display: grid;
    grid-template-columns: 14px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    min-height: 32px;
    padding: 7px 9px;
    border-radius: 9px;
    background: var(--survai-bg);
    color: var(--survai-text-soft);
    font-size: 0.8rem;
    font-weight: 800;
}

.ops-action-row strong {
    color: var(--navy);
    font-size: 1rem;
}

.ops-action-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: #64748b;
}

.ops-action-row--high .ops-action-dot {
    background: #ef4444;
}

.ops-action-row--medium .ops-action-dot {
    background: #f59e0b;
}

.ops-action-row--low .ops-action-dot {
    background: #1b5af9;
}

.ops-donut-block {
    display: grid;
    grid-template-columns: 126px minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    min-width: 0;
    margin-top: 12px;
}

.ops-donut {
    position: relative;
    display: grid;
    width: 116px;
    height: 116px;
    place-items: center;
    border-radius: 999px;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.05);
}

.ops-donut::after {
    content: "";
    position: absolute;
    inset: 25%;
    border-radius: inherit;
    background: var(--survai-card);
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.06);
}

.ops-donut span {
    position: relative;
    z-index: 1;
    display: grid;
    justify-items: center;
    color: var(--navy);
    line-height: 1.05;
}

.ops-donut strong {
    font-size: 1.2rem;
}

.ops-donut small {
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 850;
}

.ops-donut-legend {
    display: grid;
    gap: 7px;
    min-width: 0;
}

.ops-donut-legend div {
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr) auto;
    align-items: center;
    gap: 7px;
    min-width: 0;
    color: var(--survai-text-soft);
    font-size: 0.75rem;
    font-weight: 850;
}

.ops-donut-legend i {
    display: block;
    width: 8px;
    height: 8px;
    border-radius: 999px;
}

.ops-donut-legend span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ops-donut-legend strong {
    color: var(--navy);
    font-size: 0.72rem;
    white-space: nowrap;
}

/* Donut charts moved into KPI strip (narrow tiles): shrink chart + show breakdown popover */
.ops-kpi-grid > .ops-card .ops-donut-block--chart {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    align-items: start;
    gap: 6px;
    margin-top: 8px;
}

.ops-kpi-grid > .ops-card .ops-donut-block--chart .ops-donut {
    width: clamp(76px, 78%, 108px);
    height: clamp(76px, 78%, 108px);
}

.ops-kpi-grid > .ops-card .ops-donut-block--chart .ops-donut span {
    max-width: 88%;
}

.ops-kpi-grid > .ops-card .ops-donut-block--chart .ops-donut strong {
    font-size: clamp(0.88rem, 3.8vw, 1.06rem);
}

.ops-kpi-grid > .ops-card .ops-donut-block--chart .ops-donut small {
    font-size: 0.61rem;
}

.ops-kpi-grid > .ops-card .ops-donut-block--chart .ops-donut-legend {
    position: absolute;
    left: 50%;
    top: calc(100% + 6px);
    transform: translateX(-50%);
    z-index: 80;
    display: grid;
    width: max-content;
    max-width: min(300px, calc(100vw - 48px));
    gap: 8px;
    padding: 12px;
    margin: 0;
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 12px;
    background: var(--survai-card);
    box-shadow:
        0 4px 6px rgba(15, 23, 42, 0.04),
        0 22px 50px rgba(7, 26, 61, 0.16);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
        opacity 160ms ease,
        visibility 160ms ease,
        transform 160ms ease;
}

.ops-kpi-grid > .ops-card .ops-donut-block--chart:hover .ops-donut-legend,
.ops-kpi-grid > .ops-card .ops-donut-block--chart:focus-within .ops-donut-legend {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.ops-kpi-grid > .ops-card .ops-donut-block--chart:focus-visible {
    outline: 2px solid rgba(27, 90, 249, 0.45);
    outline-offset: 3px;
    border-radius: 12px;
}

.ops-team-table {
    display: grid;
    gap: 0;
    margin-top: 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
}

.ops-team-row {
    display: grid;
    grid-template-columns: minmax(140px, 1.5fr) repeat(4, minmax(72px, 0.65fr));
    align-items: center;
    gap: 8px;
    min-width: 560px;
    padding: 7px 0;
    border-bottom: 1px solid #e8eef6;
    color: var(--survai-text-soft);
    font-size: 0.78rem;
    font-weight: 800;
}

.ops-team-row:last-child {
    border-bottom: 0;
}

.ops-team-row--head {
    color: var(--muted);
    font-size: 0.68rem;
    text-transform: uppercase;
}

.ops-team-person {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ops-team-person b {
    display: inline-grid;
    width: 24px;
    height: 24px;
    place-items: center;
    border-radius: 999px;
    background: var(--survai-tint-e9f7ef);
    color: var(--survai-ink-16704a);
    font-size: 0.68rem;
}

.ops-diary-row,
.ops-activity-row,
.ops-today-row {
    display: grid;
    gap: 3px;
    min-width: 0;
    padding: 7px 0;
    border-bottom: 1px solid #e8eef6;
}

.ops-diary-row:last-child,
.ops-activity-row:last-child,
.ops-today-row:last-child {
    border-bottom: 0;
}

.ops-diary-row strong,
.ops-activity-row strong,
.ops-today-row strong {
    color: var(--navy);
    font-size: 0.82rem;
    line-height: 1.2;
}

.ops-diary-row span,
.ops-diary-row small,
.ops-activity-row span,
.ops-activity-row small,
.ops-today-row span,
.ops-today-row small,
.ops-today-row em {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 750;
    line-height: 1.2;
}

.ops-today-row {
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 8px;
    text-decoration: none;
}

.ops-today-row strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ops-today-row small {
    grid-column: 2;
}

.ops-today-row em {
    grid-row: 1 / span 2;
    grid-column: 3;
    align-self: center;
    border-radius: 999px;
    padding: 4px 8px;
    background: var(--survai-bg-tint);
    color: var(--survai-text-soft);
    font-style: normal;
}

.ops-activity-row {
    grid-template-columns: minmax(22px, auto) minmax(0, 1fr) auto;
    align-items: start;
    column-gap: 8px;
}

.ops-activity-row > div {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.ops-activity-row > div > strong,
.ops-activity-row > div > span {
    max-width: 100%;
    overflow-wrap: break-word;
    word-break: normal;
}

.ops-activity-row > small {
    justify-self: end;
    align-self: start;
    white-space: nowrap;
    text-align: end;
}

.ops-activity-icon {
    width: 14px;
    height: 14px;
    margin-top: 4px;
    color: var(--survai-ink-1b5af9);
}

.ops-activity-row--success .ops-activity-icon {
    color: var(--survai-ink-16704a);
}

.ops-activity-row--warning .ops-activity-icon {
    color: #f59e0b;
}

.ops-activity-row--danger .ops-activity-icon {
    color: var(--survai-ink-ef4444);
}

.ops-empty {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 750;
}

.ops-mini-metric {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: clamp(8px, 1.8vw, 12px);
    padding: 10px;
    border-radius: 14px;
    background: var(--survai-bg);
}

.ops-mini-metric__value {
    flex: 0 0 auto;
    align-self: stretch;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: min(5.25rem, 36%);
    max-width: 42%;
    color: var(--navy);
    font-size: clamp(1.2rem, 2.2vw, 1.65rem);
    line-height: 1.1;
    font-weight: 850;
    letter-spacing: -0.02em;
    text-align: center;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.ops-mini-metric__body {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
}

.ops-mini-metric__label {
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 800;
    line-height: 1.25;
    overflow-wrap: break-word;
    word-break: normal;
}

.ops-insight-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px solid #e8eef6;
}

.ops-insight-row:last-child {
    border-bottom: 0;
}

.ops-insight-row span {
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 800;
    line-height: 1.25;
    overflow-wrap: break-word;
    word-break: normal;
}

.ops-insight-row strong {
    flex: 1 1 44%;
    min-width: 0;
    color: var(--navy);
    font-size: 1rem;
    line-height: 1.25;
    font-weight: 800;
    overflow: visible;
    text-overflow: unset;
    white-space: normal;
    text-align: right;
    overflow-wrap: anywhere;
    word-break: break-word;
}

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

.ops-quick-actions a {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    border: 1px solid #dbe5f0;
    border-radius: 12px;
    padding: 9px 10px;
    background: var(--survai-card);
    color: var(--navy);
    font-size: 0.78rem;
    font-weight: 850;
    text-decoration: none;
}

.ops-quick-actions svg {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    color: var(--survai-ink-16704a);
}

@media (max-width: 1320px) {
    .ops-grid--primary,
    .ops-grid--secondary,
    .ops-grid--secondary:nth-of-type(4),
    .ops-grid--secondary:nth-of-type(5) {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ops-dashboard.is-cards-compact .ops-grid--primary,
    .ops-dashboard.is-cards-compact .ops-grid--secondary,
    .ops-dashboard.is-cards-compact .ops-grid--secondary:nth-of-type(4),
    .ops-dashboard.is-cards-compact .ops-grid--secondary:nth-of-type(5) {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .ops-dashboard.is-cards-ultra .ops-grid--primary,
    .ops-dashboard.is-cards-ultra .ops-grid--secondary:nth-of-type(4),
    .ops-dashboard.is-cards-ultra .ops-grid--secondary:nth-of-type(5) {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .ops-dashboard.is-cards-ultra .ops-grid--secondary {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 920px) {
    .ops-dashboard-page {
        width: 100%;
        overflow-x: hidden;
    }

    .ops-dashboard-page .app-shell {
        display: block;
        width: 100%;
        max-width: none;
        min-width: 0;
        grid-template-columns: 1fr;
    }

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

    .ops-card-head {
        flex-wrap: wrap;
        gap: 10px;
    }

    .ops-card-link {
        max-width: 100%;
        white-space: normal;
    }

    .ops-hero-actions {
        justify-content: flex-start;
    }

    body.ops-dashboard-page .main-panel.ops-dashboard > section.ops-kpi-grid {
        display: none !important;
    }

    .ops-range-form {
        width: 100%;
    }

    .ops-range-form label:first-child {
        flex: 1 1 180px;
    }

    .ops-custom-date {
        flex: 1 1 130px;
    }

    .ops-custom-date input {
        width: 100%;
    }

    .ops-kpi-grid,
    .ops-grid--primary,
    .ops-grid--secondary,
    .ops-grid--secondary:nth-of-type(4),
    .ops-grid--secondary:nth-of-type(5) {
        width: 100%;
        min-width: 0;
    }

    .ops-grid,
    .ops-grid--primary,
    .ops-grid--secondary,
    .ops-grid--secondary:nth-of-type(4),
    .ops-grid--secondary:nth-of-type(5) {
        display: grid;
        grid-template-columns: 1fr;
    }

    .ops-kpi-grid > .ops-card {
        grid-column: 1;
    }

    .ops-grid > .ops-card,
    .ops-grid > .ops-kpi-card {
        display: block;
        margin-bottom: 0;
    }

    .ops-grid > .ops-kpi-card {
        display: flex;
    }

    .ops-kpi-card {
        min-height: 100px;
        padding: 12px 11px;
    }

    .ops-card,
.ops-kpi-card,
.ops-donut-block,
.ops-action-row,
.ops-diary-row,
.ops-activity-row,
.ops-team-table {
        max-width: 100%;
        min-width: 0;
    }

    .ops-coverage-map {
        min-height: 260px;
    }

    .ops-coverage-map--full {
        min-height: 440px;
    }

    .property-location-map {
        min-height: 250px;
    }

    .ops-coverage-filters button {
        flex: 1 1 auto;
        min-width: 92px;
    }

    .ops-donut-block {
        grid-template-columns: 110px minmax(0, 1fr);
    }

    .ops-donut {
        width: 100px;
        height: 100px;
    }

    .ops-donut::after {
        inset: 25px;
    }

    .ops-kpi-grid > .ops-card .ops-donut-block--chart .ops-donut::after {
        inset: 25%;
    }

    .sidebar-nav--ops a,
    body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar:not(.sidebar--workspace) .sidebar-nav a {
        min-height: auto;
    }
}

@media (max-width: 560px) {
    .ops-dashboard-page .app-shell {
        width: 100%;
    }

    .ops-donut-block {
        grid-template-columns: 1fr;
        justify-items: center;
    }

    .ops-donut-legend {
        width: 100%;
    }

    .ops-kpi-grid > .ops-card .ops-donut-block--chart .ops-donut-legend {
        width: max-content;
        max-width: min(300px, calc(100vw - 32px));
    }
    .ops-kpi-card {
        padding: 12px;
    }

    .ops-notification {
        width: 42px;
        height: 42px;
    }

    .ops-coverage-map {
        min-height: 235px;
    }

    .ops-coverage-map--full {
        min-height: 360px;
    }

    .property-location-card {
        padding: 14px;
    }

    .property-location-card__head {
        margin-bottom: 12px;
    }

    .property-location-map,
    .property-location-card--output .property-location-map {
        min-height: 220px;
    }

    .property-location-marker,
    .property-location-static-marker {
        width: 30px;
        height: 40px;
    }

    .property-location-meta {
        align-items: flex-start;
        flex-direction: column;
        font-size: 0.78rem;
    }

    .ops-coverage-stats {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* Camera architecture split: Main Capture keeps evidence controls; AI Training is identify-only. */
.capture-screen.is-main-camera .capture-training-toggle,
.capture-screen.is-main-camera .capture-tag-bar,
.capture-screen.is-main-camera .capture-audio-pill,
.capture-screen.is-main-camera .capture-photo-count,
.capture-screen.is-main-camera .capture-zoom-control,
.capture-screen.is-main-camera .capture-training-reticle,
.capture-screen.is-main-camera .capture-training-tap-chip,
.capture-screen.is-main-camera .capture-training-hint {
    display: none !important;
}

.capture-screen.is-main-camera .capture-preview-touch-layer {
    bottom: calc(var(--capture-tray-h, 168px) + var(--capture-tabbar-h, 74px));
}

.capture-screen.is-main-camera .capture-overlay-top {
    width: auto;
    max-width: none;
}

.capture-screen.is-main-camera .capture-recording-badge {
    width: auto;
    min-width: 92px;
    min-height: 42px;
    padding: 8px 12px;
}

.capture-screen.is-main-camera .capture-recording-badge em {
    display: none;
}

.capture-screen.is-main-camera .capture-top-camera-tools {
    gap: 10px;
}

.capture-screen.is-main-camera .capture-torch-auto-chip {
    display: none;
}

.capture-video-preview {
    display: block;
    width: 100%;
    max-height: 320px;
    border-radius: var(--radius-md);
    background: #09172d;
    object-fit: contain;
}

.capture-video-preview[hidden] {
    display: none;
}

.capture-screen.is-training-camera .capture-control-tray,
.capture-screen.is-training-camera .capture-tabbar,
.capture-screen.is-training-camera .capture-tabbar-handle,
.capture-screen.is-training-camera .capture-overlay-top,
.capture-screen.is-training-camera .capture-zoom-control,
.capture-screen.is-training-camera .capture-gallery {
    display: none !important;
}

.capture-screen.is-training-camera .capture-preview-touch-layer {
    bottom: 0;
}

.capture-screen.is-training-camera .capture-training-toggle {
    display: inline-flex;
}

.capture-screen.is-training-camera .capture-training-hint:not([hidden]) {
    display: none !important;
}

.capture-screen.is-training-camera .capture-training-reticle:not([hidden]) {
    pointer-events: auto;
    touch-action: none;
    cursor: grab;
}

.capture-screen.is-training-camera .capture-training-reticle.is-dragging {
    cursor: grabbing;
}

@media (max-width: 920px) {
    .capture-screen.is-training-camera .capture-preview {
        inset: 0;
    }

    .capture-screen.is-training-camera .capture-training-hint:not(.is-positioned) {
        right: calc(14px + env(safe-area-inset-right));
        bottom: calc(18px + env(safe-area-inset-bottom));
        left: auto;
        top: auto;
        width: min(330px, calc(100vw - 28px));
        max-width: min(330px, calc(100vw - 28px));
    }

    .capture-screen.is-training-camera .capture-training-tap-chip {
        right: calc(14px + env(safe-area-inset-right));
        bottom: calc(18px + env(safe-area-inset-bottom));
        width: min(360px, calc(100vw - 28px));
        max-width: min(360px, calc(100vw - 28px));
        padding: 12px 14px;
        font-size: 0.86rem;
    }
}

@media (max-width: 920px) and (orientation: landscape) {
    .capture-screen.is-training-camera .capture-training-hint:not(.is-positioned) {
        right: calc(18px + env(safe-area-inset-right));
        bottom: calc(18px + env(safe-area-inset-bottom));
        width: min(340px, 36vw);
        max-width: min(340px, 36vw);
    }

    .capture-screen.is-training-camera .capture-training-tap-chip {
        right: calc(18px + env(safe-area-inset-right));
        bottom: calc(18px + env(safe-area-inset-bottom));
        width: min(360px, 38vw);
        max-width: min(360px, 38vw);
    }
}

@media (max-width: 920px) and (hover: hover) and (pointer: fine) {
    .capture-mode-body {
        height: auto;
        min-height: 100vh;
        overflow: auto;
        background: var(--bg);
        overscroll-behavior: auto;
    }

    .capture-mode-body .capture-topbar {
        display: flex !important;
    }

    .capture-mode-body .capture-tabs {
        display: grid !important;
    }

    .capture-shell,
    .capture-panel.active.live-capture-panel {
        height: auto;
        min-height: 0;
        overflow: visible;
    }

    .live-capture-panel .capture-screen {
        display: none !important;
    }

    .live-capture-panel .capture-desktop-handoff {
        display: grid !important;
    }
}

.capture-screen .capture-header {
    background: transparent !important;
    background-color: transparent !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.capture-screen .capture-header::before,
.capture-screen .capture-header::after {
    display: none !important;
}

.capture-screen .capture-more-button,
.capture-screen .capture-refresh-button {
    background: transparent !important;
}

.capture-screen .capture-refresh-button svg {
    display: block;
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.35;
    stroke-linecap: round;
    stroke-linejoin: round;
}

@media (max-width: 920px) {
    .capture-header {
        grid-template-columns: minmax(56px, 74px) minmax(0, 1fr) auto !important;
    }

    .capture-header-actions {
        display: inline-flex;
        min-width: 0;
        align-items: center;
        justify-content: flex-end;
        gap: 6px;
    }

    .capture-header-actions .capture-training-toggle {
        display: inline-flex;
        height: 36px;
        min-height: 36px;
        align-items: center;
        justify-content: center;
        padding: 0 10px;
        border: 1px solid rgba(255, 255, 255, 0.58);
        color: #ffffff;
        background: rgba(0, 0, 0, 0.24);
        box-shadow: none;
        text-shadow: 0 1px 8px rgba(0, 0, 0, 0.45);
    }

    .capture-header-actions .capture-training-toggle.active {
        border-color: rgba(255, 214, 10, 0.92);
        color: var(--navy);
        background: #ffd60a;
        text-shadow: none;
    }

    .capture-header-actions .capture-refresh-button {
        width: 40px;
        min-width: 40px;
        height: 40px;
        min-height: 40px;
    }
}

@media (max-width: 380px) {
    .capture-header-actions .capture-training-toggle {
        width: 40px;
        padding: 0;
        overflow: hidden;
        font-size: 0;
    }

    .capture-header-actions .capture-training-toggle::before {
        content: "AI";
        font-size: 0.78rem;
        font-weight: 900;
    }
}

.smart-annotation-modal {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(2, 8, 23, 0.68);
}

.smart-annotation-modal[hidden] {
    display: none;
}

.smart-annotation-dialog {
    display: flex;
    flex-direction: column;
    width: min(1180px, 100%);
    height: min(880px, calc(100dvh - 36px));
    max-height: calc(100dvh - 36px);
    overflow: hidden;
    border-radius: 10px;
    background: var(--survai-card);
    box-shadow: 0 28px 80px rgba(2, 8, 23, 0.36);
}

.smart-annotation-head {
    flex: 0 0 auto;
    display: flex;
    gap: 16px;
    align-items: flex-start;
    justify-content: space-between;
    border-bottom: 1px solid var(--survai-border-soft);
    padding: 18px 20px;
}

.smart-annotation-head h2 {
    margin: 0;
}

.smart-annotation-body {
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.42fr);
    gap: 0;
    min-height: 0;
    overflow: hidden;
}

.smart-annotation-canvas {
    position: relative;
    display: grid;
    min-width: 0;
    min-height: 0;
    place-items: center;
    overflow: hidden;
    padding: 16px;
    background: var(--survai-navy-surface);
}

.smart-annotation-stage {
    position: relative;
    display: inline-grid;
    max-width: 100%;
    max-height: 100%;
    place-items: center;
}

.smart-annotation-stage img,
.smart-annotation-canvas img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.smart-annotation-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
    touch-action: none;
}

.smart-marker {
    position: absolute;
    display: grid;
    min-width: 32px;
    min-height: 32px;
    place-items: center;
    border: 3px solid #d92626;
    color: #ffffff;
    background: rgba(217, 38, 38, 0.12);
    font-size: 0.68rem;
    font-weight: 900;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
    transform: translate(-50%, -50%);
    pointer-events: auto;
    cursor: move;
    touch-action: none;
}

.smart-marker.type-circle {
    border-radius: 999px;
}

.smart-marker.type-arrow,
.smart-marker.type-line {
    height: 0 !important;
    min-height: 0;
}

.smart-marker.rating-cr2 {
    border-color: #d97706;
    background: rgba(217, 119, 6, 0.14);
}

.smart-marker.rating-cr1 {
    border-color: #16a34a;
    background: rgba(22, 163, 74, 0.14);
}

.smart-marker.rating-ni,
.smart-marker.rating-na {
    border-color: #6b7280;
    background: rgba(107, 114, 128, 0.16);
}

.smart-marker.active {
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.58), 0 0 0 7px rgba(255, 47, 135, 0.55);
}

.smart-marker-label {
    pointer-events: none;
}

.smart-resize-handle {
    position: absolute;
    right: -10px;
    bottom: -10px;
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--survai-card);
    border-radius: 999px;
    background: var(--primary);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.32);
    cursor: nwse-resize;
}

.smart-marker.active .smart-resize-handle {
    display: block;
}

.smart-annotation-panel {
    display: grid;
    grid-template-rows: auto minmax(110px, 0.35fr) minmax(0, 1fr);
    gap: 12px;
    min-height: 0;
    overflow: auto;
    padding: 16px;
}

.smart-annotation-actions,
.smart-annotation-form .section-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.smart-annotation-actions [data-smart-tool].active {
    color: #ffffff;
    border-color: var(--navy);
    background: var(--survai-navy-surface);
}

.smart-annotation-list {
    display: grid;
    gap: 8px;
    align-content: start;
    overflow: auto;
}

.smart-annotation-list-item {
    display: grid;
    gap: 2px;
    border: 1px solid var(--survai-border-soft);
    border-radius: 8px;
    padding: 10px;
    color: var(--survai-text);
    background: var(--survai-card);
    text-align: left;
}

.smart-annotation-list-item.active {
    border-color: var(--accent);
    background: var(--survai-tint-eef4ff);
}

.smart-annotation-list-item span {
    color: var(--muted);
    font-size: 0.82rem;
}

.smart-annotation-form {
    display: grid;
    gap: 10px;
}

.smart-annotation-form textarea {
    min-height: 88px;
}

/* While the photo editor is open, every floating dock/launcher gets out of
   the way — they sit at very high z-indexes and were stealing the editor's
   clicks. */
body.has-survai-photo-editor .survai-image-action-dock,
body.has-survai-photo-editor .floating-report-toolbar,
body.has-survai-photo-editor .svrpm,
body.has-survai-photo-editor .survai-voice-assistant,
body.has-survai-photo-editor .survai-find-replace__panel {
    display: none !important;
}

body.modal-open {
    overflow: hidden;
}

.survai-professional-notice {
    display: grid;
    gap: 8px;
    border: 1px solid rgba(27, 90, 249, 0.18);
    border-radius: 16px;
    padding: 16px 18px;
    color: var(--survai-ink-123053);
    background: linear-gradient(135deg, rgba(27, 90, 249, 0.1), color-mix(in srgb, var(--survai-card) 96%, transparent));
    box-shadow: 0 12px 34px rgba(15, 23, 42, 0.06);
}

.survai-professional-notice strong {
    color: var(--survai-navy-ink);
    font-size: 1rem;
}

.survai-professional-notice p {
    margin: 0;
    color: var(--survai-ink-475467);
    line-height: 1.55;
}

.survai-professional-notice__label {
    width: max-content;
    border-radius: 999px;
    padding: 5px 10px;
    color: var(--survai-ink-1648d4);
    background: rgba(27, 90, 249, 0.1);
    font-size: 0.76rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.survai-professional-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.survai-professional-badges span {
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 999px;
    padding: 6px 10px;
    color: var(--survai-ink-344054);
    background: var(--survai-card);
    font-size: 0.78rem;
    font-weight: 850;
}

.pwa-pull-refresh-indicator {
    position: fixed;
    top: calc(8px + env(safe-area-inset-top));
    left: 50%;
    z-index: 10000;
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    gap: 9px;
    border: 1px solid rgba(255, 255, 255, 0.26);
    border-radius: 999px;
    padding: 8px 14px;
    color: #ffffff;
    background: rgba(11, 18, 32, 0.92);
    box-shadow: 0 12px 28px rgba(11, 18, 32, 0.28);
    font-size: 0.84rem;
    font-weight: 900;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, calc(-120% + min(var(--pull-distance, 0px), 54px)));
    transition: opacity 140ms ease, transform 140ms ease, background 140ms ease;
}

.pwa-pull-refresh-indicator.is-visible {
    opacity: 1;
}

.pwa-pull-refresh-indicator.is-ready,
.pwa-pull-refresh-indicator.is-refreshing {
    background: rgba(27, 90, 249, 0.94);
}

.pwa-pull-refresh-indicator span {
    width: 12px;
    height: 12px;
    border-right: 3px solid currentColor;
    border-bottom: 3px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
}

.pwa-pull-refresh-indicator.is-ready span,
.pwa-pull-refresh-indicator.is-refreshing span {
    transform: rotate(225deg) translateY(-2px);
}

.capture-toolbar-button.capture-flash-button.active {
    color: var(--navy) !important;
    border-color: #fff7b8 !important;
    background: radial-gradient(circle at 50% 38%, #fff7b8 0%, #ffd60a 58%, #f5b700 100%) !important;
    box-shadow:
        0 0 0 4px rgba(255, 214, 10, 0.26),
        0 0 28px rgba(255, 214, 10, 0.86),
        0 10px 24px rgba(0, 0, 0, 0.28) !important;
}

.capture-toolbar-button.capture-flash-button.active span::before {
    background: var(--navy) !important;
}

@media (max-width: 820px) {

    .smart-annotation-modal {
        padding: 0;
    }

    .smart-annotation-dialog {
        width: 100%;
        height: 100dvh;
        max-height: none;
        border-radius: 0;
    }

    .smart-annotation-head {
        padding: 14px;
    }

    .smart-annotation-body {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(42dvh, 1fr) minmax(0, 48dvh);
        min-height: 0;
    }

    .smart-annotation-canvas {
        min-height: 0;
        padding: 8px;
    }

    .smart-annotation-panel {
        min-height: 0;
        max-height: 50dvh;
    }
}

@media (max-width: 760px) {
    html,
    body {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow-x: hidden;
        overscroll-behavior: none;
        overscroll-behavior-x: none;
        overscroll-behavior-y: none;
        touch-action: pan-y;
        -webkit-text-size-adjust: 100%;
    }

    body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .app-shell,
    body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .main-panel {
        overscroll-behavior-y: contain;
        -webkit-overflow-scrolling: touch;
    }

    :root {
        --field-font-size: 16px;
        --field-text-font-size: 16px;
    }

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

    body.has-mobile-sidebar .main-panel {
        padding-top: calc(
            var(--survai-mobile-app-header-total)
            + var(--app-main-padding)
            + var(--survai-toolbar-content-gap)
        );
    }

    .workflow-shortcuts {
        display: none !important;
    }

    .regenerate-actions {
        width: 100%;
    }

    .regenerate-actions .inline-action-form,
    .regenerate-actions .btn {
        width: 100%;
    }

    .workflow-nav-heading.section-head,
    .processing-head {
        flex-direction: row;
        align-items: center;
        gap: 10px;
    }

    .workflow-nav-heading > div,
    .processing-head > div:first-child {
        min-width: 0;
    }

    .progress-report-heading {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: start;
        gap: 12px;
    }

    .progress-report-heading .report-heading-right {
        align-items: flex-start;
        justify-self: end;
        margin-left: 0;
    }

    .workflow-nav-heading .section-head-actions,
    .processing-head .section-head-actions {
        align-items: center;
        gap: 8px;
        margin-left: auto;
    }

    .collapsible-card > .section-head,
    .collapsible-card > .workflow-nav-heading,
    .collapsible-card > .processing-head,
    .section-card > .section-head {
        flex-direction: row;
        align-items: center;
        gap: var(--survai-white-header-gap);
    }

    .collapsible-card > .section-head .section-head-actions,
    .collapsible-card > .workflow-nav-heading .section-head-actions,
    .collapsible-card > .processing-head .section-head-actions,
    .section-card > .section-head .section-head-actions {
        width: auto;
        justify-content: flex-end;
        align-items: center;
        margin-left: auto;
    }

    .output-section > header {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
        align-items: start;
    }

    .output-section > header > div:first-child {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .output-section > header h3 {
        overflow-wrap: anywhere;
        word-break: normal;
        white-space: normal;
        writing-mode: horizontal-tb;
        line-height: 1.3;
    }

    /* The buttons wrap onto a second right-aligned line rather than scroll:
       a sideways scroller in every section header caught the finger on a
       swipe, and with flex-end the buttons that overflowed sat on the
       unreachable left (surveyor, 7 Oct 2026: "when you swipe left and
       right the page can move around the screen"). */
    .output-section > header .section-head-actions {
        position: relative;
        width: 100%;
        margin-left: 0;
        justify-content: flex-end;
        flex-wrap: wrap;
        align-items: center;
        align-self: stretch;
        gap: 8px;
        overflow-x: visible;
    }

    .output-section > header .save-state:empty {
        display: none;
    }

    .output-section > header .save-state {
        position: absolute;
        right: 0;
        top: calc(100% + 4px);
        width: auto;
        max-width: min(260px, 100%);
        min-height: 0;
        pointer-events: none;
    }

    .output-main-section-content {
        padding-right: 0;
        padding-left: 0;
    }

    .output-section.is-collapsed > header {
        min-height: 0;
    }

    .workflow-nav-heading .status {
        max-width: 126px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .workflow-nav-heading h2,
    .processing-head h2 {
        font-size: 1.05rem;
        line-height: 1.2;
    }

    .processing-count {
        white-space: nowrap;
    }

    .collapsible-card > .section-head,
    .collapsible-card > .workflow-nav-heading,
    .collapsible-card > .processing-head {
        margin-bottom: 0;
    }

    .collapsible-card:not(.is-collapsed) > [data-card-collapsible] {
        margin-top: 12px;
    }

    .processing-log-card {
        margin-bottom: 0;
    }
}

.pdf-viewer-body {
    min-height: 100dvh;
    margin: 0;
    overflow: hidden;
    background: var(--survai-navy-surface);
}

.pdf-viewer-shell {
    position: fixed;
    inset: 0;
    display: grid;
    grid-template-rows: auto 1fr auto;
    width: 100%;
    height: 100dvh;
    overflow: hidden;
    background: #eef3f8;
}

.pdf-viewer-topbar {
    z-index: 3;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    min-height: 58px;
    padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
    border-bottom: 1px solid #d9e2ee;
    background: rgba(255, 255, 255, 0.96);
    color: #13233a;
}

.pdf-viewer-back,
.pdf-viewer-open {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    color: #13233a;
    font-weight: 800;
    text-decoration: none;
}

.pdf-viewer-back span {
    display: inline-block;
    margin-right: 4px;
    font-size: 2rem;
    line-height: 1;
}

.pdf-viewer-title {
    min-width: 0;
    text-align: center;
}

.pdf-viewer-title strong,
.pdf-viewer-title span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pdf-viewer-title strong {
    font-size: 1rem;
}

.pdf-viewer-title span {
    color: #607086;
    font-size: 0.82rem;
}

.pdf-viewer-frame-wrap {
    min-height: 0;
    overflow: hidden;
}

.pdf-viewer-frame {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: #ffffff;
}

.pdf-viewer-toolbar {
    z-index: 3;
    display: block;
    padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
    border-top: 1px solid #d9e2ee;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 -10px 24px rgba(15, 23, 42, 0.14);
}

.pdf-viewer-toolbar__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.pdf-viewer-toolbar .btn {
    width: auto;
    min-height: 44px;
    padding: 10px 16px;
    flex-shrink: 0;
}

.pdf-viewer-page-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: 1 1 auto;
    min-width: 0;
    flex-wrap: nowrap;
}

.pdf-viewer-page-nav .btn {
    min-width: 40px;
    min-height: 40px;
    padding: 8px 10px;
}

.pdf-viewer-toolbar__actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

@media (max-width: 720px) {
    /* Tighten toolbar padding on mobile */
    .pdf-viewer-toolbar {
        padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    }
}

@media (min-width: 900px) {
    .pdf-viewer-shell {
        inset: 18px;
        width: auto;
        height: auto;
        border-radius: 18px;
        box-shadow: 0 20px 60px rgba(15, 23, 42, 0.24);
    }
}

/* --- Survey workflow chrome (progress rail, page headers) --- */
.wizard-progress + .supporting-image-panel {
    margin-top: 0;
}

/* Process Data page (progress.php): collapsible interior + supporting docs layout */
.progress-page .progress-main {
    width: 100%;
    max-width: 100%;
    min-width: 0;
}

.progress-page .progress-main .workflow-page-card,
.progress-page .progress-main .processing-card,
.progress-page .progress-main .progress-output-list-card,
.progress-page .progress-main .progress-output-list-head,
.progress-page .progress-main .section-head,
.progress-page .progress-main .section-head > div,
.progress-page .progress-main .form-note,
.progress-page .progress-main .eyebrow,
.progress-page .progress-main .queue-item span,
.progress-page .progress-main .queue-item em,
.progress-page .progress-main .progress-output-list-title {
    overflow-wrap: break-word;
    word-break: normal;
    white-space: normal;
}

.progress-page .queue-item.queue-group-heading {
    font-weight: 600;
    background: transparent;
    border: 0;
    padding-top: 1rem;
    padding-bottom: 0.35rem;
}

.progress-page .queue-item.queue-group-heading span {
    font-size: 15px;
    color: var(--survai-ink-1f2937);
}

.progress-page .queue-item.queue-item--nested {
    padding-left: 1.25rem;
}

.progress-page .queue-item.queue-item--nested span {
    font-size: 14px;
}

.progress-page .progress-main [data-card-collapsible] {
    min-width: 0;
}

.progress-page .progress-generation-workspace {
    display: grid;
    gap: 14px;
    min-width: 0;
}

.progress-page .progress-sticky-generation-header-spacer {
    display: block;
    width: 100%;
    min-height: 104px;
    pointer-events: none;
}

.progress-page #progressStickyGenerationHeader {
    position: fixed;
    top: var(--progress-sticky-top-offset, 124px);
    left: var(--progress-fixed-panel-left, 0px);
    width: var(--progress-fixed-panel-width, 100%);
    z-index: 875;
    box-sizing: border-box;
    margin: 0;
    padding: 18px var(--app-main-padding, 18px) 12px;
    background: color-mix(in srgb, var(--survai-card) 97%, transparent);
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
    backdrop-filter: blur(10px);
}

.progress-page #progressStickyRoomHeader {
    position: sticky;
    top: calc(var(--progress-sticky-top-offset, 124px) + var(--progress-section-header-height, 104px));
    z-index: 74;
    margin-inline: calc(-1 * clamp(10px, 2vw, 22px));
    padding: 10px clamp(10px, 2vw, 22px) 12px;
    background: color-mix(in srgb, var(--survai-card) 97%, transparent);
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06);
    backdrop-filter: blur(10px);
}

.progress-page .progress-sticky-generation-header__panel {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.progress-page .progress-sticky-generation-header__head {
    align-items: center;
    gap: 10px;
}

.progress-page .progress-sticky-generation-header__copy {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
}

.progress-page .progress-sticky-generation-header__copy h2 {
    margin: 0;
    font-size: clamp(0.95rem, 2.8vw, 1.15rem);
    line-height: 1.25;
}

.progress-page .progress-sticky-generation-header__metrics {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.progress-page .progress-sticky-generation-header__percent {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 3.1rem;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid rgba(27, 90, 249, 0.16);
    background: rgba(27, 90, 249, 0.08);
    color: var(--survai-blue, #1b5af9);
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1;
}

.progress-page .progress-sticky-generation-header__status {
    margin: 0;
    font-size: 0.82rem;
    line-height: 1.35;
}

.progress-page .progress-sticky-generation-header__failures {
    margin: 0;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--danger, #dc2626);
}

.progress-page .progress-sticky-generation-header__error {
    margin: 0;
    padding: 8px 10px;
    font-size: 0.82rem;
}

.progress-page .progress-output-list-card {
    scroll-margin-top: calc(var(--progress-sticky-top-offset, 124px) + var(--progress-section-header-height, 104px) + 24px);
}

.progress-page .progress-output-list-head {
    margin-bottom: 12px;
}

.progress-page .progress-output-list-title {
    margin: 0 0 4px;
    font-size: 1.05rem;
}

.progress-page .progress-main:has(.progress-floating-dock),
.progress-page .progress-main:has(.survai-progress-action-dock),
.output-report-page .main-panel:has(.survai-progress-action-dock) {
    padding-bottom: clamp(72px, 12vw, 120px);
}

.main-panel:has(.progress-floating-dock),
.main-panel:has(.survai-progress-action-dock) {
    padding-bottom: clamp(72px, 12vw, 120px);
}

/* progress.php: floating processing dock (aligned with Media Manager .survai-image-action-dock) */
.progress-page .survai-progress-action-dock,
.output-report-page .survai-progress-action-dock {
    --progress-dock-height: 62px;
    position: fixed;
    left: 50%;
    bottom: calc(22px + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    align-items: stretch;
    overflow: visible;
    min-height: var(--progress-dock-height);
    max-width: calc(100vw - 28px);
    border-radius: 32px;
    background: linear-gradient(180deg, rgba(15, 25, 49, 0.98), rgba(8, 18, 38, 0.98));
    color: #fff;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.progress-page .survai-progress-action-dock[hidden],
.output-report-page .survai-progress-action-dock[hidden] {
    display: none !important;
}

.progress-page .survai-progress-action-dock__action,
.output-report-page .survai-progress-action-dock__action {
    width: 96px;
    min-height: 62px;
    display: inline-grid;
    place-items: center;
    border: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.12);
    background: transparent;
    color: #fff;
    cursor: pointer;
    padding: 0;
    margin: 0;
    font: inherit;
}

.progress-page .survai-progress-action-dock__action:first-child,
.output-report-page .survai-progress-action-dock__action:first-child {
    border-radius: 32px 0 0 32px;
}

.progress-page .survai-progress-action-dock__action:last-child,
.output-report-page .survai-progress-action-dock__action:last-child {
    border-right: 0;
    border-radius: 0 32px 32px 0;
}

.progress-page .survai-progress-action-dock__action:hover,
.output-report-page .survai-progress-action-dock__action:hover,
.progress-page .survai-progress-action-dock__action:focus-visible,
.output-report-page .survai-progress-action-dock__action:focus-visible {
    background: rgba(255, 255, 255, 0.06);
    outline: none;
}

.progress-page .survai-progress-action-dock__action[hidden],
.output-report-page .survai-progress-action-dock__action[hidden] {
    display: none !important;
}

.progress-page .survai-progress-action-dock__action--inactive,
.output-report-page .survai-progress-action-dock__action--inactive,
.progress-page .survai-progress-action-dock__action:disabled,
.output-report-page .survai-progress-action-dock__action:disabled {
    opacity: 0.42;
    cursor: not-allowed;
}

.progress-page .survai-progress-action-dock__action--inactive:hover,
.output-report-page .survai-progress-action-dock__action--inactive:hover,
.progress-page .survai-progress-action-dock__action--inactive:focus-visible,
.output-report-page .survai-progress-action-dock__action--inactive:focus-visible,
.progress-page .survai-progress-action-dock__action:disabled:hover,
.output-report-page .survai-progress-action-dock__action:disabled:hover,
.progress-page .survai-progress-action-dock__action:disabled:focus-visible,
.output-report-page .survai-progress-action-dock__action:disabled:focus-visible {
    background: transparent;
}

.progress-page .survai-progress-action-dock__icon,
.output-report-page .survai-progress-action-dock__icon {
    display: inline-grid;
    place-items: center;
    width: auto;
    height: auto;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #fff;
    font-size: 28px;
    line-height: 1;
    font-weight: 900;
    letter-spacing: -0.04em;
}

.progress-page .survai-progress-action-dock__action--danger .survai-progress-action-dock__icon,
.output-report-page .survai-progress-action-dock__action--danger .survai-progress-action-dock__icon {
    background: transparent;
    color: var(--survai-ink-ff3b4f);
}

.progress-page .survai-progress-action-dock__icon--stop,
.output-report-page .survai-progress-action-dock__icon--stop {
    border: 0;
    background: transparent;
    color: var(--survai-ink-ff3b4f);
    font-size: 0;
    line-height: 0;
    letter-spacing: 0;
    display: inline-grid;
    place-items: center;
}

.progress-page .survai-progress-action-dock__icon--stop::before,
.output-report-page .survai-progress-action-dock__icon--stop::before {
    content: "";
    display: block;
    width: 28px;
    height: 28px;
    background: currentColor;
    border-radius: 3px;
}

.progress-page .survai-progress-action-dock__icon--more,
.output-report-page .survai-progress-action-dock__icon--more {
    font-size: 28px;
    letter-spacing: 0.08em;
    font-weight: 700;
}

.progress-page .survai-progress-action-dock__more,
.output-report-page .survai-progress-action-dock__more {
    position: relative;
    display: flex;
    align-items: stretch;
    overflow: visible;
}

.progress-page .survai-progress-action-dock__more .survai-progress-action-dock__action,
.output-report-page .survai-progress-action-dock__more .survai-progress-action-dock__action {
    border-right: 0;
    border-radius: 0 32px 32px 0;
}

.progress-page .survai-progress-action-dock__more.is-open .survai-progress-action-dock__action,
.output-report-page .survai-progress-action-dock__more.is-open .survai-progress-action-dock__action {
    background: rgba(255, 255, 255, 0.08);
}

.progress-page .survai-progress-action-dock__menu,
.output-report-page .survai-progress-action-dock__menu {
    position: fixed;
    left: 50%;
    right: auto;
    bottom: calc(22px + env(safe-area-inset-bottom, 0px) + var(--progress-dock-height) + 12px);
    transform: translateX(-50%);
    width: min(306px, calc(100vw - 24px));
    max-width: calc(100vw - 24px);
    padding: 12px 14px;
    border-radius: 16px;
    background: linear-gradient(180deg, rgba(31, 41, 55, 0.98), rgba(17, 24, 39, 0.98));
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.38);
    z-index: 10050;
    pointer-events: auto;
}

.output-report-page .survai-progress-action-dock {
    bottom: calc(22px + env(safe-area-inset-bottom, 0px) + 62px + 14px);
    z-index: 10000;
}

.output-report-page .survai-progress-action-dock__menu {
    bottom: calc(22px + env(safe-area-inset-bottom, 0px) + 62px + 14px + var(--progress-dock-height) + 12px);
}

.output-report-page .survai-progress-action-dock__more:only-child,
.output-report-page .survai-progress-action-dock__more:first-child:last-child {
    border-radius: 32px;
}

.output-report-page .survai-progress-action-dock:not(:has(.survai-progress-action-dock__action:not([hidden]))) .survai-progress-action-dock__more .survai-progress-action-dock__action,
.progress-page .survai-progress-action-dock:not(:has(.survai-progress-action-dock__action:not([hidden]))) .survai-progress-action-dock__more .survai-progress-action-dock__action {
    border-radius: 32px;
    border-right: 0;
}

.progress-page .survai-progress-action-dock__menu[hidden],
.output-report-page .survai-progress-action-dock__menu[hidden] {
    display: none !important;
}

.progress-page .survai-progress-action-dock__menu-item,
.output-report-page .survai-progress-action-dock__menu-item {
    width: 100%;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
    align-items: center;
    padding: 10px 8px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: #fff;
    text-align: left;
    cursor: pointer;
    font: inherit;
}

.progress-page .survai-progress-action-dock__menu-item + .survai-progress-action-dock__menu-item,
.output-report-page .survai-progress-action-dock__menu-item + .survai-progress-action-dock__menu-item {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 0;
}

.progress-page .survai-progress-action-dock__menu-item:hover,
.output-report-page .survai-progress-action-dock__menu-item:hover,
.progress-page .survai-progress-action-dock__menu-item:focus-visible,
.output-report-page .survai-progress-action-dock__menu-item:focus-visible {
    background: rgba(255, 255, 255, 0.07);
    outline: none;
}

.progress-page .survai-progress-action-dock__menu-item--inactive,
.output-report-page .survai-progress-action-dock__menu-item--inactive,
.progress-page .survai-progress-action-dock__menu-item:disabled,
.output-report-page .survai-progress-action-dock__menu-item:disabled {
    opacity: 0.42;
    cursor: not-allowed;
}

.progress-page .survai-progress-action-dock__menu-item--inactive:hover,
.output-report-page .survai-progress-action-dock__menu-item--inactive:hover,
.progress-page .survai-progress-action-dock__menu-item:disabled:hover,
.output-report-page .survai-progress-action-dock__menu-item:disabled:hover {
    background: transparent;
}

.progress-page .survai-progress-action-dock__menu-copy strong,
.output-report-page .survai-progress-action-dock__menu-copy strong {
    display: block;
    font-size: 0.83rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.progress-page .survai-progress-action-dock__menu-copy small,
.output-report-page .survai-progress-action-dock__menu-copy small {
    display: block;
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.7rem;
    line-height: 1.32;
}

.progress-page .survai-progress-action-dock__menu-icon,
.output-report-page .survai-progress-action-dock__menu-icon {
    width: auto;
    min-width: 2rem;
    height: auto;
    border: 0;
    border-radius: 0;
    background: transparent;
    display: grid;
    place-items: center;
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.02em;
}

.progress-page .survai-progress-action-dock__menu-icon--warning,
.output-report-page .survai-progress-action-dock__menu-icon--warning {
    color: #fbbf24;
}

.progress-page .survai-progress-action-dock__menu-icon--regenerate,
.output-report-page .survai-progress-action-dock__menu-icon--regenerate {
    color: #60a5fa;
    font-size: 2.35rem;
}

@media (max-width: 760px) {
    .progress-page #progressStickyGenerationHeader,
    .progress-page #progressStickyRoomHeader {
        padding-block: 8px 10px;
    }

    .progress-page .progress-sticky-generation-header-spacer {
        min-height: 96px;
    }

    .progress-page .progress-sticky-generation-header__head {
        flex-direction: row;
        align-items: flex-start;
    }

    .progress-page .progress-sticky-generation-header__copy .eyebrow {
        margin-bottom: 2px;
        font-size: 0.62rem;
    }

    .progress-page .progress-sticky-generation-header__status,
    .progress-page .progress-sticky-generation-header__failures {
        font-size: 0.76rem;
    }

    .progress-page {
        --progress-sticky-top-offset: calc(130px + var(--survai-mobile-app-header-total, 0px));
    }

    .site-media-processing-toast-wrap {
        top: max(calc(var(--progress-sticky-top-offset, 130px) + 10px), calc(env(safe-area-inset-top, 0px) + 68px));
        right: max(12px, calc(env(safe-area-inset-right, 0px) + 12px));
        width: min(360px, calc(100vw - 24px));
        max-width: calc(100vw - 24px);
    }

    .progress-page .progress-output-list-card {
        scroll-margin-top: calc(var(--progress-sticky-top-offset, 130px) + var(--progress-section-header-height, 96px) + 20px);
    }
}

.progress-floating-dock {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    display: flex;
    justify-content: center;
    pointer-events: none;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0));
}

.progress-floating-dock__surface {
    pointer-events: auto;
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    justify-content: center;
    gap: 12px 20px;
    max-width: min(960px, 100%);
    padding: 12px 16px;
    border-radius: 20px;
    background: color-mix(in srgb, var(--survai-card) 94%, transparent);
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow:
        0 4px 24px rgba(15, 23, 42, 0.08),
        0 24px 48px rgba(15, 23, 42, 0.06);
    backdrop-filter: blur(10px);
}

body.progress-page .progress-floating-dock__surface {
    background: color-mix(in srgb, var(--survai-card) 96%, transparent);
}

.progress-floating-dock__group {
    display: flex;
    align-items: center;
    gap: 10px 14px;
    padding: 4px 8px;
    border-radius: 14px;
    background: color-mix(in srgb, var(--survai-bg-tint) 85%, transparent);
}

.progress-floating-dock__group--rooms {
    background: color-mix(in srgb, var(--survai-tint-eef2ff) 90%, transparent);
}

.progress-floating-dock__group-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-text-muted, #64748b);
    white-space: nowrap;
}

.progress-floating-dock__actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.progress-dock-control {
    position: relative;
    display: flex;
    align-items: center;
}

.progress-dock-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    padding: 0;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
    background: var(--survai-card);
    color: var(--survai-text-slate);
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.08);
}

.progress-dock-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.12);
}

.progress-dock-btn:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.progress-dock-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.progress-dock-btn--primary {
    background: var(--survai-blue);
    color: #fff;
}

.progress-dock-btn--retry {
    background: var(--survai-card);
    color: var(--survai-secondary-strong);
    border: 1px solid rgba(15, 23, 42, 0.1);
}

.progress-dock-btn--danger {
    background: #fb7185;
    color: var(--survai-ink-881337);
}

.progress-dock-icon-svg {
    display: block;
}

.progress-dock-popover {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(6px);
    width: min(260px, 70vw);
    padding: 12px 14px;
    border-radius: 12px;
    font-size: 0.8125rem;
    line-height: 1.45;
    color: var(--survai-text-strong);
    background: var(--survai-card);
    border: 1px solid rgba(15, 23, 42, 0.1);
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.14);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
        opacity 0.18s ease,
        transform 0.18s ease,
        visibility 0.18s ease;
    z-index: 2;
}

.progress-dock-popover strong {
    display: block;
    margin-bottom: 6px;
    font-size: 0.875rem;
}

.progress-dock-popover p {
    margin: 0;
    color: var(--survai-secondary-strong);
}

.progress-dock-control:hover .progress-dock-popover,
.progress-dock-control:focus-within .progress-dock-popover {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

@media (max-width: 540px) {
    .progress-floating-dock__surface {
        flex-direction: column;
        align-items: stretch;
    }

    .progress-floating-dock__group {
        justify-content: space-between;
    }
}

.progress-page .progress-wizard-card .wizard-progress {
    min-width: 0;
    margin-bottom: 0;
}

.progress-page .progress-wizard-card .wizard-progress a strong,
.progress-page .progress-wizard-card .wizard-progress button strong {
    overflow-wrap: break-word;
    word-break: normal;
    white-space: normal;
}

.progress-page .progress-files-card {
    display: grid;
    gap: 18px;
}

.progress-page .progress-file-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.035);
}

.progress-page .progress-file-tab {
    min-width: 0;
    min-height: 58px;
    border: 0;
    border-radius: 16px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    font: inherit;
    font-weight: 850;
    text-align: left;
    transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.progress-page .progress-file-tab span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.progress-page .progress-file-tab strong {
    min-width: 34px;
    height: 34px;
    border-radius: 999px;
    display: inline-grid;
    place-items: center;
    background: var(--survai-tint-eaf1f8);
    color: var(--ink);
    font-size: 0.95rem;
}

.progress-page .progress-file-tab:hover,
.progress-page .progress-file-tab.is-active {
    background: var(--panel);
    color: var(--ink);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
}

.progress-page .progress-file-tab.is-active strong {
    background: var(--accent);
    color: var(--theme-accent-ink);
}

.progress-page .progress-file-panel {
    min-width: 0;
}

.progress-page .progress-file-panel-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.progress-page .progress-file-panel-head h3 {
    margin: 0;
    color: var(--ink);
    font-size: 1.25rem;
}

.progress-page .progress-file-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.progress-page .progress-media-list {
    display: grid;
    gap: 10px;
    margin-top: 16px;
}

.progress-page .progress-media-item {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(240px, 380px);
    align-items: center;
    gap: 14px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--theme-panel-soft);
}

.progress-page .progress-media-item strong,
.progress-page .progress-video-item strong {
    display: block;
    color: var(--ink);
}

.progress-page .progress-media-item span,
.progress-page .progress-video-item span {
    display: block;
    color: var(--muted);
    font-weight: 750;
    font-size: 0.9rem;
}

.progress-page .progress-media-item audio {
    width: 100%;
}

.progress-page .progress-video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 14px;
}

.progress-page .progress-video-item {
    min-width: 0;
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--theme-panel-soft);
}

.progress-page .progress-video-item video {
    width: 100%;
    aspect-ratio: 16 / 10;
    border-radius: 14px;
    background: var(--survai-navy-surface);
    object-fit: cover;
}

.progress-page .progress-file-panel .supporting-image-panel {
    margin: 0;
    box-shadow: none;
}

/* Supporting documents: match other cards’ outer rhythm; keep inner inset panels */
.progress-page .supporting-image-panel.transcript-panel {
    padding: 22px;
    display: grid;
    gap: 18px;
    margin-bottom: 20px;
}

.progress-page .supporting-image-panel.transcript-panel .section-head {
    padding: 0 0 16px;
    margin: 0;
    border-bottom: 1px solid var(--line);
}

.progress-page .supporting-image-panel.transcript-panel [data-card-collapsible] {
    border-top: 0;
    min-width: 0;
}

.progress-page .supporting-image-panel .supporting-document-layout {
    border-top: 0;
    padding: 0;
    min-width: 0;
}

.progress-page .supporting-document-layout .supporting-document,
.progress-page .supporting-document-layout .report-form {
    min-width: 0;
}

.progress-page .supporting-document img {
    max-width: 100%;
}

.progress-page .supporting-document-list {
    margin: 0;
    padding: 16px 0 0;
    border-top: 1px solid var(--line);
}

.progress-page .supporting-document-item {
    grid-template-columns: 82px minmax(0, 1fr) auto;
}

.progress-page .supporting-document-item > div {
    min-width: 0;
}

.progress-page .section-head > div,
.progress-page .processing-head > div {
    min-width: 0;
}

.progress-page .processing-head h2,
.progress-page .progress-sticky-generation-header__copy h2,
.progress-page .progress-output-list-title {
    overflow-wrap: break-word;
    word-break: normal;
    white-space: normal;
    line-height: 1.3;
}

.progress-page .diagnostic-grid {
    min-width: 0;
    grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
}

.progress-page .diagnostic-stat {
    min-width: 0;
}

.progress-page .queue-item {
    min-width: 0;
}

.progress-page .queue-item {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
}

.progress-page .queue-item span {
    overflow-wrap: break-word;
    word-break: normal;
    white-space: normal;
    line-height: 1.35;
}

.progress-page .queue-item em {
    overflow-wrap: break-word;
    word-break: normal;
    white-space: normal;
}

.progress-page .queue-item .queue-item__status {
    justify-self: end;
    align-self: start;
    white-space: nowrap;
}

.progress-page .processing-card[data-spinner-src] {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(27, 90, 249, 0.14);
    border-radius: 18px;
    background:
        linear-gradient(155deg, color-mix(in srgb, var(--survai-card) 96%, transparent) 0%, rgba(246, 250, 255, 0.98) 42%, rgba(236, 244, 255, 0.94) 100%);
    box-shadow:
        0 14px 40px rgba(15, 23, 42, 0.07),
        0 0 0 1px rgba(184, 239, 63, 0.06);
}

.progress-page .processing-card[data-spinner-src]::before {
    position: absolute;
    inset: 0;
    pointer-events: none;
    content: "";
    border-radius: inherit;
    background: radial-gradient(ellipse 80% 55% at 18% 0%, rgba(27, 90, 249, 0.06), transparent 52%);
}

.progress-page .processing-card[data-spinner-src] > *,
.progress-page .progress-generation-workspace[data-spinner-src] > * {
    position: relative;
    z-index: 1;
}

.progress-page .processing-card[data-spinner-src] .processing-head .processing-count,
.progress-page .progress-sticky-generation-header .processing-count {
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(27, 90, 249, 0.14);
    background: color-mix(in srgb, var(--survai-card) 75%, transparent);
    color: var(--survai-navy-ink);
    font-weight: 800;
}

.progress-page .processing-card[data-spinner-src] .progress-track,
.progress-page .progress-generation-workspace[data-spinner-src] .progress-track {
    height: 12px;
    border: 1px solid rgba(27, 90, 249, 0.12);
    background: rgba(11, 19, 33, 0.06);
}

.progress-page .processing-card[data-spinner-src] .progress-track span,
.progress-page .progress-generation-workspace[data-spinner-src] .progress-track span {
    background: linear-gradient(90deg, #1b5af9 0%, #4f8bff 42%, #b8ef3f 100%);
    box-shadow: 0 0 18px rgba(27, 90, 249, 0.28);
    transition: width 280ms cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-page .processing-card[data-spinner-src] .queue-list,
.progress-page .progress-generation-workspace[data-spinner-src] .queue-list {
    gap: 10px;
}

.progress-page .processing-card[data-spinner-src] .queue-item,
.progress-page .progress-generation-workspace[data-spinner-src] .queue-item {
    border-radius: 14px;
    border: 1px solid rgba(27, 90, 249, 0.1);
    background: linear-gradient(180deg, var(--survai-card) 0%, var(--survai-tint-f9fbff) 100%);
    padding: 12px 14px;
    transition: border-color 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

.progress-page .processing-card[data-spinner-src] .queue-item.queue-pending,
.progress-page .progress-generation-workspace[data-spinner-src] .queue-item.queue-pending {
    border-color: rgba(27, 90, 249, 0.12);
}

.progress-page .processing-card[data-spinner-src] .queue-item.queue-processing,
.progress-page .progress-generation-workspace[data-spinner-src] .queue-item.queue-processing {
    border-color: rgba(184, 239, 63, 0.42);
    background: linear-gradient(135deg, var(--survai-card) 0%, rgba(184, 239, 63, 0.09) 100%);
    box-shadow:
        0 0 0 1px rgba(184, 239, 63, 0.14),
        0 12px 28px rgba(27, 90, 249, 0.08);
}

.progress-page .processing-card[data-spinner-src] .queue-item.queue-completed,
.progress-page .progress-generation-workspace[data-spinner-src] .queue-item.queue-completed {
    border-color: rgba(34, 197, 94, 0.28);
}

.progress-page .processing-card[data-spinner-src] .queue-item.queue-failed,
.progress-page .progress-generation-workspace[data-spinner-src] .queue-item.queue-failed {
    border-color: rgba(239, 68, 68, 0.28);
}

.progress-page .processing-card[data-spinner-src] .queue-item__status,
.progress-page .progress-generation-workspace[data-spinner-src] .queue-item__status {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 2rem;
    min-height: 1.5rem;
    margin: 0;
    font-weight: 800;
}

.progress-page .processing-card[data-spinner-src] .queue-item__status--processing:has(.queue-status-spinner),
.progress-page .progress-generation-workspace[data-spinner-src] .queue-item__status--processing:has(.queue-status-spinner) {
    color: transparent;
}

.progress-page .processing-card[data-spinner-src] .queue-status-spinner,
.progress-page .progress-generation-workspace[data-spinner-src] .queue-status-spinner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.progress-page .processing-card[data-spinner-src] .queue-status-spinner__img,
.progress-page .progress-generation-workspace[data-spinner-src] .queue-status-spinner__img {
    display: block;
    width: 22px;
    height: 22px;
}

.progress-page .processing-card[data-spinner-src] .queue-status-label,
.progress-page .progress-generation-workspace[data-spinner-src] .queue-status-label {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--survai-muted);
}

.progress-page .processing-card[data-spinner-src] .queue-pending .queue-status-label,
.progress-page .processing-card[data-spinner-src] .queue-item__status--pending .queue-status-label {
    color: var(--survai-muted);
}

.progress-page .processing-card[data-spinner-src] .queue-completed .queue-status-label {
    color: var(--success);
}

.progress-page .processing-card[data-spinner-src] .queue-processing .queue-status-label {
    color: var(--survai-blue);
}

.progress-page .processing-card[data-spinner-src] .queue-failed .queue-status-label {
    color: var(--danger);
}

.progress-page .workflow-unassigned-photos {
    margin-top: 1rem;
}

.progress-page .workflow-unassigned-photos-title {
    margin: 0;
}

.progress-page .workflow-unassigned-photos-actions {
    margin: 0;
}

.progress-page .workflow-unassigned-photos .matched-photo-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
    align-items: start;
}

.progress-page .workflow-unassigned-photos .matched-photo-grid figure {
    position: relative;
    display: block;
    min-width: 0;
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 8px;
    background: var(--survai-card);
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
}

.progress-page .workflow-photo-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.progress-page .workflow-photo-media {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--survai-tint-f3f6fb);
}

.progress-page .workflow-photo-media::before {
    content: "Preview unavailable";
    position: absolute;
    inset: 0;
    display: none;
    place-items: center;
    padding: 12px;
    color: var(--survai-secondary-slate);
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.25;
    text-align: center;
}

.progress-page .workflow-photo-media.is-broken::before {
    display: grid;
}

.progress-page .workflow-photo-media img {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 0;
    object-fit: cover;
    font-size: 0;
    color: transparent;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.progress-page .workflow-photo-link figcaption {
    display: -webkit-box;
    min-height: 58px;
    padding: 10px 12px 12px;
    overflow: hidden;
    color: var(--survai-secondary-strong);
    font-size: 0.82rem;
    line-height: 1.35;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.progress-page .workflow-photo-link:hover .workflow-photo-media img,
.progress-page .workflow-photo-link:focus-visible .workflow-photo-media img {
    transform: translateY(-1px);
}

.progress-page .workflow-photo-link:focus-visible {
    outline: 3px solid rgba(30, 64, 175, 0.22);
    outline-offset: 4px;
    border-radius: 8px;
}

.progress-page .workflow-unassigned-photos .matched-photo-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    gap: 6px;
}

.progress-page .workflow-photo-roll {
    margin-top: 1rem;
}

.progress-page .workflow-photo-roll .matched-photo-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

.progress-page .workflow-photo-roll a {
    display: block;
}

.progress-page .workflow-photo-roll-actions {
    margin-top: 1rem;
}

@media (max-width: 640px) {
    .progress-page .progress-sticky-generation-header__head.processing-head,
    .progress-page .progress-generation-workspace .processing-head {
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 10px;
    }

    .progress-page .progress-sticky-generation-header__copy {
        flex: 1 1 100%;
        min-width: min(100%, 12rem);
    }

    .progress-page .progress-sticky-generation-header__metrics,
    .progress-page .progress-generation-workspace .processing-head .section-head-actions {
        flex: 0 0 auto;
        width: auto;
        margin-left: 0;
        justify-content: flex-start;
    }

    .progress-page .progress-output-list-head .form-note,
    .progress-page .progress-sticky-generation-header__status,
    .progress-page .progress-sticky-generation-header__failures {
        overflow-wrap: break-word;
        word-break: normal;
        white-space: normal;
    }
}

@media (max-width: 560px) {
    body.progress-page .section-head {
        flex-direction: row;
        align-items: flex-start;
        flex-wrap: wrap;
        gap: 10px 12px;
    }

    body.progress-page .section-head-actions {
        width: auto;
        flex: 0 0 auto;
        justify-content: flex-start;
    }

    body.progress-page .queue-item {
        grid-template-columns: minmax(0, 1fr);
        gap: 8px 12px;
    }

    body.progress-page .queue-item .queue-item__status {
        justify-self: start;
    }

    body.progress-page .processing-actions .btn,
    body.progress-page .progress-file-actions .btn,
    body.progress-page .progress-file-panel-head .btn {
        width: auto;
        max-width: 100%;
    }

    .progress-page .progress-wizard-card .wizard-progress {
        display: grid;
        grid-template-columns: 1fr;
    }

    .progress-page .progress-file-tabs {
        grid-template-columns: 1fr 1fr;
        border-radius: 18px;
    }

    .progress-page .progress-file-tab {
        min-height: 52px;
        padding: 10px 12px;
    }

    .progress-page .progress-file-panel-head,
    .progress-page .progress-media-item {
        grid-template-columns: 1fr;
        display: grid;
    }

    .progress-page .progress-main .workflow-page-card,
    .progress-page .progress-main .processing-card.workflow-page-card,
    .progress-page .supporting-image-panel.transcript-panel,
    .survey-workflow-surface .main-panel > .card:not(.desk-study-status-strip),
    .survey-workflow-surface .main-panel .desk-study-main-column > .card,
    .survey-workflow-surface .main-panel .desk-study-main-column > section.card,
    .survey-workflow-surface .main-panel form.desk-study-form > section.card,
    .survey-workflow-surface .main-panel form.desk-study-form > div.card,
    .survey-workflow-surface .main-panel > .desk-study-status-strip.card {
        padding: 18px;
    }
}

.wizard-progress + .desk-study-status-strip {
    margin-top: 0;
}

.page-transcript-upload .page-header.workflow-page-header {
    margin-bottom: 2rem;
}

.page-transcript-upload .wizard-progress {
    margin-bottom: var(--workflow-progress-bottom-gap, 1.5rem);
}

.transcript-workspace-page {
    background: var(--theme-bg);
    color: var(--theme-text);
}

.transcript-workspace-page .app-shell,
.transcript-workspace-page .transcript-workspace-main {
    background: var(--theme-bg);
    color: var(--theme-text);
}

.transcript-workspace-main {
    width: 100%;
    max-width: none;
    min-height: 100vh;
    padding: var(--app-main-padding);
    color: var(--theme-text);
}

.transcript-workspace-header {
    width: 100%;
    max-width: none;
    min-width: 0;
    box-sizing: border-box;
}

.transcript-workspace-header > div:first-of-type {
    min-width: 0;
}

.transcript-workspace-header > .header-actions,
.transcript-workspace-header > .workflow-header-actions {
    min-width: 0;
}

.transcript-workspace-header h1 {
    color: var(--theme-text);
}

.transcript-workspace-header p {
    color: var(--theme-muted);
}

.transcript-workspace-header .workflow-title-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    color: var(--theme-text);
}

.transcript-workspace-status {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-self: start;
    justify-content: flex-end;
}

.transcript-workspace-status span {
    display: grid;
    gap: 4px;
    min-width: 0;
    flex: 1 1 104px;
    padding: 12px 14px;
    border: 1px solid var(--theme-border);
    border-radius: 12px;
    background: var(--theme-panel-soft);
    color: var(--theme-muted);
    font-size: 0.82rem;
}

.transcript-workspace-status strong {
    color: var(--theme-text);
    font-size: 1.2rem;
}

.transcript-workspace-form {
    display: grid;
    gap: 18px;
    width: 100%;
    min-width: 0;
    margin: 0;
    box-sizing: border-box;
}

.transcript-workspace-card {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--theme-panel);
    box-shadow: var(--shadow);
    color: var(--theme-text);
    min-width: 0;
    max-width: 100%;
}

.transcript-editor-card {
    padding: clamp(18px, 2.8vw, 30px);
}

.transcript-card-head,
.transcript-section-title-row,
.transcript-workspace-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.transcript-card-head {
    margin-bottom: 16px;
}

/* Row layout only (below 1100px the head stacks and the controls go full
   width). The three action controls are DIRECT flex children of a
   space-between row with default shrink, so the long intro paragraph squeezed
   them and their labels wrapped mid-word. Let the copy absorb the free space,
   hold the controls at their natural size, and wrap them as one right-aligned
   group instead of spreading them across the row. */
@media (min-width: 1101px) {
    .transcript-card-head {
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .transcript-card-head > div:first-child {
        flex: 1 1 360px;
        min-width: 0;
    }

    .transcript-card-head > div:first-child + .transcript-generate-btn {
        margin-left: auto;
    }

    .transcript-card-head .transcript-generate-btn,
    .transcript-workspace-actions .btn,
    .transcript-workspace-actions .transcript-mic-button {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    /* The live-status paragraphs may be empty; they must never claim width
       that squeezes the controls beside them. */
    .transcript-workspace-actions .transcript-workspace-message,
    .transcript-workspace-actions .transcript-mic-state {
        flex: 1 1 auto;
        min-width: 0;
    }
}

.transcript-card-head h2,
.transcript-section-title-row h2 {
    margin-bottom: 4px;
    color: var(--theme-text);
}

.transcript-card-head p,
.transcript-section-title-row p,
.transcript-recording-main p,
.transcript-empty {
    margin: 0;
    color: var(--theme-muted);
}

.transcript-workspace-editor {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    min-height: clamp(320px, 43vh, 560px);
    resize: vertical;
    border-color: var(--theme-border);
    border-radius: 12px;
    background: var(--theme-input);
    color: var(--theme-input-text);
    font-size: 1rem;
    line-height: 1.6;
}

.transcript-workspace-editor::placeholder {
    color: color-mix(in srgb, var(--theme-muted) 72%, transparent);
}

/* `display: block` above beats the hidden attribute's UA rule, so the derived
   flat transcript (kept in the form for legacy consumers on segment-truth
   reports) rendered BELOW the segment editor — showing the transcript twice.
   Honour the attribute. */
.transcript-workspace-editor[hidden] {
    display: none !important;
}

/* The works-category reasoning map in the Repair cost planning head, and the
   per-row reason on the job card. Compact and readable on small screens. */
.output-repair-reasoning-map {
    margin: 10px 0 0;
    max-width: 760px;
    font-size: 0.85rem;
    color: var(--survai-secondary-strong);
}

.output-repair-reasoning-map summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--survai-ink-1d4ed8);
}

.output-repair-reasoning-map ol {
    margin: 8px 0 0;
    padding-left: 20px;
    display: grid;
    gap: 6px;
}

/* Job card prev/next navigation — ON the card's left and right edges,
   vertically centred. The frame carries the card's width and the arrows
   are positioned against it (outside the scrolling panel, never clipped). */
.output-repair-modal__frame {
    position: relative;
    z-index: 1;
    width: min(1080px, 100%);
    max-width: 100%;
    display: flex;
    justify-content: center;
    min-width: 0;
}

.output-repair-modal__frame > .output-room-modal__panel {
    width: 100%;
}

.output-repair-modal__nav {
    position: absolute;
    top: 50%;
    z-index: 4;
    width: 46px;
    height: 46px;
    transform: translateY(-50%);
    border-radius: 50%;
    border: 1px solid var(--survai-border-soft);
    background: var(--survai-card);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18);
    color: var(--survai-ink-1d4ed8);
    font-size: 28px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0 4px;
    cursor: pointer;
}

.output-repair-modal__nav--prev { left: -23px; }
.output-repair-modal__nav--next { right: -23px; }

.output-repair-modal__nav:hover:not(:disabled) {
    background: var(--survai-tint-eff6ff);
}

.output-repair-modal__nav:disabled {
    opacity: 0.3;
    cursor: default;
}

/* Narrow screens: no room to straddle the edge — tuck them just inside. */
@media (max-width: 720px) {
    .output-repair-modal__nav { width: 38px; height: 38px; font-size: 24px; }
    .output-repair-modal__nav--prev { left: 6px; }
    .output-repair-modal__nav--next { right: 6px; }
}

/* Catalogue search: jobs already on this report show greyed-out, not hidden. */
.output-repair-catalog__option.is-already-added {
    opacity: 0.45;
    cursor: not-allowed;
}

/* Job card AI refine row under the works description. */
.output-repair-refine {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.output-repair-refine__undo {
    border: none;
    background: none;
    color: var(--survai-ink-1d4ed8);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}

.output-repair-refine .form-note {
    margin: 0;
    font-size: 0.78rem;
}

/* Further Investigations uses the same calm, full-powered card language as
   repair costing, while keeping the investigation register visually distinct. */
.output-fi-modal .output-room-modal__panel {
    width: min(780px, 100%);
}

.output-fi-modal__form {
    gap: 16px;
}

.output-fi-refine {
    padding-top: 2px;
}

.output-fi-trade-body {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    border: 1px solid rgba(37, 99, 235, 0.16);
    border-radius: 10px;
    padding: 10px 12px;
    background: var(--survai-tint-f8fbff);
    color: var(--survai-text-soft);
    font-size: 0.82rem;
}

.output-fi-trade-body[hidden] {
    display: none;
}

.output-fi-trade-body span {
    color: var(--survai-secondary-slate);
    font-weight: 600;
}

.output-fi-trade-body a {
    color: var(--survai-ink-1d4ed8);
    font-weight: 600;
    text-decoration: none;
}

.output-fi-trade-body a:hover,
.output-fi-trade-body a:focus-visible {
    text-decoration: underline;
}

@media (max-width: 720px) {
    .output-fi-add-launcher {
        align-items: stretch;
    }

    .output-fi-trade-body {
        align-items: flex-start;
        flex-direction: column;
        gap: 3px;
    }
}

/* Find & Replace: the pulse drawn over a found word so the match is
   unmistakable in the viewport, not just a faint textarea selection. */
.survai-find-flash {
    position: fixed;
    z-index: 3000;
    pointer-events: none;
    background: rgba(250, 204, 21, 0.5);
    border: 1.5px solid rgba(202, 138, 4, 0.85);
    border-radius: 4px;
    animation: survaiFindFlash 1.35s ease-out forwards;
}

@keyframes survaiFindFlash {
    0% { opacity: 0; transform: scale(1.25); }
    18% { opacity: 1; transform: scale(1); }
    70% { opacity: 1; }
    100% { opacity: 0; }
}

/* Report documents picker modal — the Download action's document family list. */
.report-documents-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.report-documents-modal[hidden] {
    display: none !important;
}

.report-documents-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
}

/* The panel owns no padding of its own: the sticky head and the sticky
   footer need edge-to-edge backgrounds inside the scroll container, so each
   region carries its own inline padding instead. */
.report-documents-modal__panel {
    position: relative;
    width: min(640px, 100%);
    /* The modal is mounted wherever the page put it; never inherit the
       ancestor's text colour (white on output.php's header cluster). */
    color: var(--survai-text-soft);
    text-align: left;
    background: var(--survai-card);
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.3);
    padding: 0;
    max-height: 88vh;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.report-documents-modal__head {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin: 0;
    padding: 18px 24px 14px;
    background: var(--survai-card);
    border-bottom: 1px solid var(--survai-border-soft);
}

.report-documents-modal__head .eyebrow { margin: 0 0 2px; }
.report-documents-modal__head h3 { margin: 0; font-size: 1.15rem; }

.report-documents-modal__close {
    border: none;
    background: none;
    font-size: 26px;
    line-height: 1;
    color: var(--survai-secondary-slate);
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 8px;
}
.report-documents-modal__close:hover { background: var(--survai-bg-tint); color: var(--survai-text-strong); }

.report-documents-modal__list {
    list-style: none;
    margin: 0;
    padding: 16px 24px 4px;
    display: grid;
    gap: 12px;
}

/* One row = one card. Title and its client-visibility toggle on the left,
   the Download tick pinned top-right; review checks and STALE explanations
   span the full width beneath. */
.report-documents-modal__row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 8px 16px;
    padding: 14px 16px;
    border: 1px solid var(--survai-border-soft);
    border-radius: 12px;
    background: var(--survai-bg-soft);
}

.report-documents-modal__info {
    display: grid;
    gap: 6px;
    min-width: 0;
}
.report-documents-modal__info strong { font-size: 0.95rem; color: var(--survai-text-strong); }

.report-documents-modal__always,
.report-documents-modal__offer {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--survai-secondary-slate);
    cursor: default;
}
.report-documents-modal__offer { cursor: pointer; }
.report-documents-modal__offer input { width: 16px; height: 16px; min-height: 16px; margin: 0; accent-color: #1d4ed8; }

.report-documents-modal__checks,
.report-documents-modal__stale-row {
    grid-column: 1 / -1;
}

/* Optional-document download in flight: the button reports progress. */
.report-documents-modal [data-report-document-download].is-busy {
    opacity: 0.75;
    cursor: progress;
    pointer-events: none;
    min-width: 9.5em;
    text-align: center;
}

/* Extension Feasibility workspace page. */
.output-extension-feasibility .ext-feasibility-context { margin: 14px 0 18px; padding: 14px 16px; border: 1px solid rgba(15, 23, 42, 0.08); border-radius: 12px; background: var(--survai-bg); }
.output-extension-feasibility .ext-feasibility-context h4,
.output-extension-feasibility .ext-feasibility-types h4 { margin: 0 0 6px; font-size: 0.95rem; font-weight: 750; color: var(--survai-text-strong); }
.ext-feasibility-context__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px 14px; margin-top: 10px; }
.ext-feasibility-context__item { display: grid; gap: 4px; min-width: 0; padding: 10px 12px; border: 1px solid rgba(15, 23, 42, 0.08); border-radius: 10px; background: var(--survai-card); }
.ext-feasibility-context__item.is-unconfirmed { border-color: rgba(217, 119, 6, 0.4); background: var(--survai-tint-fffbeb); }
.ext-feasibility-context__label { font-size: 0.68rem; font-weight: 750; letter-spacing: 0.06em; text-transform: uppercase; color: var(--survai-secondary-slate); }
.ext-feasibility-context__item strong { font-size: 0.9rem; color: var(--survai-text-strong); }
.ext-feasibility-context__item select { width: 100%; min-height: 36px; padding: 6px 8px; font-size: 0.86rem; border: 1px solid var(--survai-border-mid); border-radius: 8px; background: var(--survai-card); }
.ext-feasibility-context__source { font-size: 0.72rem; color: var(--survai-secondary-slate); }
.ext-feasibility-types { margin: 0 0 18px; }
.ext-feasibility-types__list { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 8px 16px; margin-top: 8px; }
.ext-feasibility-type { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid rgba(15, 23, 42, 0.08); border-radius: 10px; background: var(--survai-card); cursor: pointer; font-size: 0.9rem; }
.ext-feasibility-type input[type="checkbox"] { width: 18px; height: 18px; min-height: 18px; margin: 0; flex: 0 0 18px; }
.ext-feasibility-card { margin-top: 16px; }
.ext-feasibility-print-preview { margin: 6px 0 14px; padding: 12px 14px; border-left: 3px solid #1b5af9; background: #f8fafc; border-radius: 0 10px 10px 0; font-size: 0.86rem; color: #334155; }
.ext-feasibility-print-preview__label { margin: 0 0 4px; font-size: 0.68rem; font-weight: 750; letter-spacing: 0.06em; text-transform: uppercase; color: #64748b; }
.ext-feasibility-print-preview__label--warn { color: #b45309; }
.ext-feasibility-print-preview ul { margin: 0 0 10px; padding-left: 18px; display: grid; gap: 4px; }
.ext-feasibility-print-preview ul:last-child { margin-bottom: 0; }

/* Lifecycle plan surveyor-review flags inside the picker row. */
/* Reconciliation verdict banner + STALE badge in the download picker. */
.report-documents-modal__reconcile {
    display: grid;
    gap: 4px;
    margin: 16px 24px 0;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--survai-border-soft);
    background: var(--survai-bg);
    font-size: 0.85rem;
    color: var(--survai-text-soft);
    grid-template-columns: minmax(0, 1fr) auto;
}
.report-documents-modal__reconcile strong { color: var(--survai-text-strong); grid-column: 1; }
.report-documents-modal__reconcile > span { color: var(--survai-secondary-slate); grid-column: 1; }
.report-documents-modal__reconcile > details { grid-column: 1 / -1; }
.report-documents-modal__recheck {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
    justify-self: end;
    padding: 7px 14px;
    border: 1px solid var(--survai-border-mid);
    border-radius: 999px;
    background: var(--survai-card);
    color: var(--survai-text-soft);
    font: inherit;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}
.report-documents-modal__recheck:hover { border-color: var(--survai-border-mid); color: var(--survai-text-strong); }
.report-documents-modal__recheck:disabled { opacity: 0.6; cursor: default; }
.report-documents-modal__reconcile summary { cursor: pointer; font-weight: 700; color: var(--survai-text-strong); }
.report-documents-modal__reconcile--block strong,
.report-documents-modal__reconcile--block summary { color: var(--survai-ink-b91c1c); }
.report-documents-modal__reconcile--warn strong,
.report-documents-modal__reconcile--warn summary { color: var(--survai-ink-92400e); }
.report-documents-modal__reconcile--pass strong,
.report-documents-modal__reconcile--pass summary { color: var(--survai-ink-166534); }

.report-documents-modal__panel > .form-note {
    margin: 0;
    padding: 10px 24px 18px;
}

.report-documents-modal__reconcile--block {
    border-color: rgba(232, 76, 61, 0.4);
    background: var(--survai-tint-fdf2f1);
}
.report-documents-modal__reconcile--warn {
    border-color: rgba(245, 185, 66, 0.45);
    background: var(--survai-tint-fffaf0);
}
.report-documents-modal__reconcile--pass {
    border-color: rgba(22, 163, 74, 0.3);
    background: var(--survai-tint-f2fbf5);
}
.report-documents-modal__select {
    grid-column: 2;
    grid-row: 1;
    align-self: start;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    border: 1px solid var(--survai-border-mid);
    border-radius: 999px;
    background: var(--survai-card);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--survai-text-strong);
    cursor: pointer;
    white-space: nowrap;
}
.report-documents-modal__select:has(input:checked) {
    border-color: rgba(27, 90, 249, 0.45);
    background: var(--survai-tint-eff4ff);
    color: var(--survai-ink-1b5af9);
}
.report-documents-modal__select input { width: 16px; height: 16px; min-height: 16px; margin: 0; }
.report-documents-modal__select input:disabled + span { color: var(--survai-muted-cool); }

/* Sticky footer: the action never scrolls out of reach and never shares a
   cramped line with its explanation. */
.report-documents-modal__batch {
    position: sticky;
    bottom: 0;
    z-index: 2;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 8px 16px;
    margin: 12px 0 0;
    padding: 14px 24px;
    background: var(--survai-card);
    border-top: 1px solid var(--survai-border-soft);
}
.report-documents-modal__batch .btn { white-space: nowrap; }
.report-documents-modal__batch-status {
    grid-column: 1 / -1;
    min-height: 1.2em;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--survai-ink-1b5af9);
}
.report-documents-modal__batch-status:empty { display: none; }
.report-documents-modal__override {
    display: inline-flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.78rem;
    line-height: 1.4;
    color: var(--survai-secondary-slate);
    cursor: pointer;
}
.report-documents-modal__override input { width: 16px; height: 16px; min-height: 16px; margin-top: 1px; flex: 0 0 16px; }

.report-documents-modal__stale-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--survai-tint-fff9ec);
    border: 1px solid rgba(217, 119, 6, 0.25);
}
.report-documents-modal__stale-why {
    font-size: 0.8rem;
    line-height: 1.45;
    color: var(--survai-ink-7a5a12);
}
.report-documents-modal__findings {
    max-height: 220px;
    overflow-y: auto;
    margin: 8px 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0;
}
.report-documents-modal__findings li {
    padding: 8px 10px;
    font-size: 0.82rem;
    line-height: 1.45;
    border-top: 1px solid var(--survai-border-faint);
}
.report-documents-modal__findings li strong {
    display: inline-block;
    margin-right: 6px;
    font-size: 0.68rem;
    letter-spacing: 0.05em;
    padding: 1px 7px;
    border-radius: 999px;
}
.report-documents-modal__finding--block { color: var(--survai-ink-7f1d1d); }
.report-documents-modal__finding--block strong { background: rgba(232, 76, 61, 0.14); color: var(--survai-ink-b91c1c); }
.report-documents-modal__finding--warn { color: var(--survai-ink-6b5310); }
.report-documents-modal__finding--warn strong { background: rgba(245, 185, 66, 0.2); color: var(--survai-ink-b45309); }

/* Small screens: the dialog becomes a bottom sheet — full width, thumb-reach
   footer, nothing clipped. */
@media (max-width: 640px) {
    .report-documents-modal { padding: 0; align-items: flex-end; }
    .report-documents-modal__panel {
        width: 100%;
        max-height: 94vh;
        border-radius: 16px 16px 0 0;
    }
    .report-documents-modal__list { padding: 14px 16px 4px; }
    .report-documents-modal__reconcile { margin: 14px 16px 0; grid-template-columns: minmax(0, 1fr); }
    .report-documents-modal__recheck { grid-column: 1; grid-row: auto; justify-self: start; }
    .report-documents-modal__head { padding: 16px 16px 12px; }
    .report-documents-modal__batch { grid-template-columns: 1fr; padding: 12px 16px; }
    .report-documents-modal__batch .btn { width: 100%; }
    .report-documents-modal__panel > .form-note { padding: 10px 16px 16px; }
    .report-documents-modal__row { grid-template-columns: minmax(0, 1fr); }
    .report-documents-modal__select { grid-column: 1; grid-row: auto; justify-self: start; }
}
.report-documents-modal__stale {
    align-self: center;
    border-radius: 999px;
    padding: 3px 10px;
    background: rgba(232, 76, 61, 0.12);
    color: var(--survai-ink-b91c1c);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
}

.report-documents-modal__checks { margin: 6px 0 0; font-size: 0.8rem; color: var(--survai-secondary-strong); }
.report-documents-modal__checks summary { cursor: pointer; font-weight: 700; color: var(--survai-ink-b45309); }
.report-documents-modal__checks ul { margin: 6px 0 0; padding-left: 16px; display: grid; gap: 5px; }
.report-documents-modal__checks li strong { color: var(--survai-text-strong); }
.report-documents-modal__checks li span { color: var(--survai-secondary-slate); }

/* (The earlier flex layout for __row/__info/__offer/__always lived here; the
   modal's grid layout above is now the single definition.) */

/* Repair cost planning head: the show-costs-in-report switch sits beside the
   Generate button and wraps cleanly on small screens. */
.output-repair-head__controls {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.output-repair-visibility-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--survai-text-soft);
    cursor: pointer;
    white-space: nowrap;
}

/* Optional purchase price for the lifecycle plan's financial snapshot — a
   compact inline field, sized explicitly so the global input rule cannot
   stretch it across the toolbar. */
.output-repair-purchase-price {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--survai-text-soft);
    white-space: nowrap;
}

.output-repair-purchase-price input[type="number"] {
    width: 120px;
    min-width: 0;
    padding: 6px 8px;
    font-size: 0.85rem;
    border: 1px solid var(--survai-border-mid);
    border-radius: 6px;
}

/* M199: the AI mapping card (Map transcript to all sections) has nothing to do on the Fixed Text tab. */
body.output-report-page:has(#outputPanelTemplateBlocks:not([hidden])) [data-output-ai-mapping-card] {
    display: none;
}

/* M199: a Fixed Text card's Listen and approval toggle sit after its Save and Reset buttons. */
body.output-report-page #outputPanelTemplateBlocks .output-section-form-actions > .output-section-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* Section photo-album picker: attach album photos without leaving the page.
   Styled to read as the main photo album — white cards, photo, meta lines,
   selection checkbox — inside a picker modal. All rules are scoped under the
   modal class so page-level button/input rules cannot restyle the cards (the
   global pill-button radius turned the first version's tiles into arcs). */
.section-image-uploader {
    display: grid;
    gap: 10px;
}

.section-image-uploader .section-album-open {
    justify-self: start;
    margin-top: 0;
}

/* The section photo strip (surveyor, 28 Sep 2026): one row of square tiles, the "Add photos"
   tile first, a "+N more" tile when the row is full. Tokens only; the tiles are the shared
   photo tile. */
/* The strip's tiles are six-tenths of the page's chosen photo size (the Photo size control
   sets --image-manager-card-min), so the row holds several photos at any setting. */
.survai-photo-tile-grid.section-photo-strip {
    grid-template-columns: repeat(auto-fill, minmax(clamp(96px, calc(var(--image-manager-card-min, 220px) * 0.6), 220px), 1fr));
    gap: 10px;
    align-items: stretch;
    margin-top: 12px;
}

.section-photo-strip > * {
    min-width: 0;
}

/* Folded by the strip (the "+N more" tile stands in for them). The page's photo filters use
   the hidden attribute; the strip keeps its own class so the two never fight. */
.section-photo-strip .section-photo-strip__folded {
    display: none !important;
}

@media (max-width: 640px) {
    .survai-photo-tile-grid.section-photo-strip {
        grid-template-columns: repeat(auto-fill, minmax(clamp(84px, calc(var(--image-manager-card-min, 220px) * 0.45), 150px), 1fr));
    }
}

.section-photo-strip .section-photo-add,
.section-photo-strip .section-photo-more {
    display: grid;
    align-content: center;
    justify-items: center;
    gap: 3px;
    aspect-ratio: 1;
    padding: 8px;
    /* The site rounds every button into a pill (!important); these are square tiles. */
    border-radius: 10px !important;
    font: inherit;
    text-align: center;
    cursor: pointer;
    transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.section-photo-add {
    border: 1.5px dashed color-mix(in srgb, var(--survai-blue) 45%, transparent);
    background: color-mix(in srgb, var(--survai-blue) 6%, var(--survai-card));
    color: var(--survai-blue);
    font-weight: 700;
    font-size: 0.82rem;
}

.section-photo-add:hover,
.section-photo-add:focus-visible {
    border-color: var(--survai-blue);
    background: color-mix(in srgb, var(--survai-blue) 11%, var(--survai-card));
}

.section-photo-add__plus {
    font-size: 1.5rem;
    line-height: 1;
}

.section-photo-add__hint {
    color: var(--survai-secondary-slate);
    font-size: 0.66rem;
    font-weight: 600;
}

.section-photo-more {
    position: relative;
    overflow: hidden;
    border: 0;
    background: var(--survai-navy-ink) center / cover no-repeat;
    color: #ffffff;
    font-weight: 800;
    font-size: 0.9rem;
}

.section-photo-more::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.62);
}

.section-photo-more span {
    position: relative;
}

.section-photo-more.is-expanded {
    background-image: none !important;
    background-color: var(--survai-bg-tint);
    color: var(--survai-text);
}

.section-photo-more.is-expanded::before {
    display: none;
}

.section-photo-more:hover::before {
    background: rgba(15, 23, 42, 0.5);
}

/* The "Add photos to <section>" dialog (surveyor, 29 Sep 2026): one padded column, head /
   toolbar / scrolling grid / foot. The room-modal head is built to bleed over a padded form
   (negative margins); this dialog has no form, so the head is put back inside the panel and
   every band carries the panel's own gutter (22px, 16px on phones). Only the grid scrolls.
   The panel is wider than the room modal so the tiles can be the Media Manager's size
   (surveyor, 30 Sep 2026: "a size which is viewable comfortably, such as in the media
   manager"). */
.section-album-modal__panel {
    --section-album-gutter: 22px;
    width: min(1240px, 100%);
    max-height: min(860px, calc(100dvh - 44px - env(safe-area-inset-bottom, 0px)));
    display: flex;
    flex-direction: column;
    padding: 0;
}

.section-album-modal .output-room-modal__head {
    position: static;
    flex: 0 0 auto;
    flex-direction: row;
    align-items: flex-start;
    margin: 0;
    padding: 18px var(--section-album-gutter) 14px;
}

.section-album-modal .output-room-modal__head h3 {
    font-size: 1.15rem;
    line-height: 1.25;
}

.section-album-modal .output-room-modal__close {
    flex: 0 0 auto;
}

.section-album-toolbar {
    display: grid;
    gap: 8px;
    flex: 0 0 auto;
    margin: 0;
    padding: 14px var(--section-album-gutter) 0;
}

.section-album-modal .section-album-toolbar input[type="search"] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--survai-border-mid);
    border-radius: 10px;
    font-size: 0.92rem;
}

.section-album-toolbar .form-note {
    margin: 0;
}

/* Higher specificity than the Media Manager's grid rules (.image-manager-grid margin and
   card size), which this grid otherwise inherits: the picker sizes its own tiles — the
   Media Manager's 200px and up, so a photo can be judged without opening it.
   grid-auto-rows is the fix for the cascade (surveyor, 30 Sep 2026: "cascaded and
   overlapping each other, and they're very thin"). The grid scrolls, so its height is
   fixed by the panel; its rows are `auto`, and an auto row's base size comes from its
   items' minimum size, which is 0 for a tile that clips its overflow. With more tiles than
   fit, the panel's height was shared out between the rows — 35px each for 12 rows —
   while every tile kept its 176px square, so each row of photos lay over the next. Rows
   sized to their content take the tile's height whatever the count. */
.section-album-modal .section-album-grid {
    flex: 1 1 auto;
    min-height: 140px;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    grid-auto-rows: max-content;
    align-content: start;
    align-items: start;
    gap: 14px;
    margin: 0;
    padding: 14px var(--section-album-gutter) 18px;
    overscroll-behavior: contain;
}

/* The tiles themselves carry the Media Manager's own classes inside a
   media-manager-panel-classed dialog, so their entire look and behaviour
   (blue select ring, AI chip, eye popover, square frame) come from the
   manager's stylesheet rules — nothing here to drift out of sync. Only the
   picker-specific states live below. */
.section-album-modal .section-album-card {
    cursor: pointer;
    /* The aspect ratio lives on the CARD, not just the frame: inside the
       modal's flex/scroll context, grid row sizing ignored the frame's
       aspect-ratio-derived height and collapsed every card to its 2px of
       border (measured live). A card that owns its ratio always has height. */
    aspect-ratio: 1 / 1;
}

.section-album-modal .image-manager-card__frame {
    height: 100%;
    aspect-ratio: auto;
}

.section-album-modal .section-album-card.is-selected {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
}

.section-album-modal .section-album-card.is-current {
    opacity: 0.5;
    cursor: default;
}

.section-album-foot {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 14px var(--section-album-gutter) calc(18px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--survai-border-soft);
    background: var(--survai-card);
}

.section-album-foot .save-state {
    flex: 1 1 auto;
    min-width: 0;
    text-align: left;
}

.section-album-foot .btn {
    flex: 0 0 auto;
    min-width: 132px;
}

.section-album-empty {
    grid-column: 1 / -1;
    padding: 24px 12px;
    text-align: center;
    color: var(--survai-secondary-slate);
    font-size: 0.9rem;
}

@media (max-width: 1024px) {
    .section-album-modal .section-album-grid {
        grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    }
}

@media (max-width: 720px) {
    .section-album-modal__panel {
        --section-album-gutter: 16px;
        width: 100%;
        max-height: calc(100dvh - 24px - env(safe-area-inset-bottom, 0px));
    }

    .section-album-modal .output-room-modal__head {
        padding: 14px var(--section-album-gutter) 12px;
    }

    .section-album-modal .output-room-modal__head h3 {
        font-size: 1.05rem;
    }

    .section-album-toolbar {
        padding-top: 12px;
    }

    /* Two comfortable tiles across a phone (three from about 480px), not three thumbnails. The
       extra class outweighs the Media Manager's own phone gap rule, which comes later at the
       same specificity. */
    .section-album-modal .section-album-grid.image-manager-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 10px;
        padding: 12px var(--section-album-gutter) 16px;
    }

    .section-album-foot {
        flex-wrap: wrap;
        padding: 12px var(--section-album-gutter) calc(14px + env(safe-area-inset-bottom, 0px));
    }

    .section-album-foot .btn {
        flex: 1 1 100%;
        min-width: 0;
    }
}

/* Condition Ratings guidance card: standard-vs-edited badge. */
.output-guidance-badge {
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.18);
    color: var(--survai-secondary-strong);
    font-size: 0.72rem;
    white-space: nowrap;
}

.output-guidance-badge--custom {
    background: rgba(255, 48, 136, 0.12);
    color: var(--survai-ink-c2185b);
}

/* Front-elevation quick-set on the Orientation section card — sized
   explicitly so the global input rule cannot stretch the select. */
.output-orientation-facing {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 12px;
    padding: 10px 12px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 10px;
    background: var(--survai-bg);
}

.output-orientation-facing label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--survai-text-soft);
    white-space: nowrap;
}

.output-orientation-facing select {
    width: auto;
    min-width: 0;
    padding: 6px 8px;
    font-size: 0.85rem;
    border: 1px solid var(--survai-border-mid);
    border-radius: 6px;
    background: var(--survai-card);
}

.output-orientation-facing .form-note {
    margin: 0;
}

.output-repair-visibility-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: #1d4ed8;
    cursor: pointer;
}

/* Full works description of the saved job chosen in the Add Repair dropdown,
   shown directly under the select so the surveyor reads the job before adding. */
.output-repair-modal__job-preview {
    display: block;
    margin-top: 6px;
    padding: 8px 10px;
    background: var(--survai-bg);
    border: 1px solid var(--survai-border-soft);
    border-radius: 8px;
    font-size: 0.82rem;
    /* A span inside a label picks up the caption weight; the preview is the
       job's own wording and reads at normal weight, grey, like the text box. */
    font-weight: 400;
    line-height: 1.5;
    color: var(--survai-secondary-strong);
    white-space: pre-wrap;
    max-height: 140px;
    overflow-y: auto;
}

/* Segment-truth transcript editor: one editable block per machine segment.
   Amber = low transcription confidence (the surveyor's attention goes where
   errors actually are); green edge = surveyor-corrected. */
.transcript-segment-editor {
    display: grid;
    gap: 10px;
    width: 100%;
    max-width: 100%;
}

.transcript-segment-editor__intro {
    margin: 0;
}

.transcript-segment {
    border: 1px solid var(--theme-border, #e2e8f0);
    border-left: 4px solid rgba(148, 163, 184, 0.55);
    border-radius: 12px;
    background: var(--theme-input, #ffffff);
    padding: 10px 14px;
}

/* Marked, not washed: the amber edge plus the "Weakest word" pill are enough
   to draw the eye, and the per-word underline says exactly which word. A full
   background tint made a page of flagged segments unreadable. */
.transcript-segment--low-confidence {
    border-left-color: #f59e0b;
}

.transcript-segment--corrected {
    border-left-color: #16a34a;
}

.transcript-segment__label {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    color: var(--theme-muted, #64748b);
}

.transcript-segment__confidence {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--survai-tint-fef3c7);
    color: var(--survai-ink-92400e);
}

/* Reads as a real control, not unstyled text. */

.transcript-segment__state {
    margin-left: auto;
    font-size: 0.72rem;
    color: var(--theme-muted, #64748b);
}

.transcript-segment__state.is-error {
    color: var(--survai-ink-dc2626);
    font-weight: 700;
}

/* Jump-target flash from the dropped-corrections banner. */
.transcript-segment--flash {
    animation: transcript-segment-flash 2.4s ease-out;
}

@keyframes transcript-segment-flash {
    0%, 40% { box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.65); }
    100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}

/* Dropped-corrections banner: visible where the surveyor works. */

.transcript-workspace-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
    margin-top: 14px;
}

.transcript-site-upload-retry-actions {
    margin-top: 10px;
    margin-bottom: 4px;
    align-items: flex-start;
}

.transcript-site-upload-retry-actions .form-note {
    flex: 1 1 min(520px, 100%);
    margin: 0;
    line-height: 1.45;
}

.transcript-bulk-transcription-retry {
    margin-bottom: 14px;
}

.transcript-site-uploads-scroll {
    max-height: min(560px, 72vh);
    min-height: 200px;
    overflow: auto;
    border: 1px solid var(--theme-border);
    border-radius: 10px;
    background: var(--theme-panel);
    -webkit-overflow-scrolling: touch;
}

.transcript-site-uploads-table {
    width: 100%;
    min-width: 1480px;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.8125rem;
    line-height: 1.35;
}

.transcript-site-uploads-table thead th {
    position: sticky;
    top: 0;
    z-index: 12;
    background: linear-gradient(to bottom, var(--theme-panel), var(--theme-panel));
    box-shadow: 0 1px 0 var(--theme-border);
    text-align: left;
    padding: 8px 10px;
    font-weight: 800;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--theme-muted);
    white-space: nowrap;
}

.transcript-site-uploads-table tbody td {
    padding: 6px 10px;
    border-bottom: 1px solid var(--theme-border);
    vertical-align: top;
}

.transcript-site-upload-row:last-child td {
    border-bottom: none;
}

.transcript-site-upload-filename {
    display: block;
    max-width: min(260px, 28vw);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.transcript-site-upload-table-ta {
    width: 100%;
    min-width: 140px;
    resize: vertical;
    min-height: 44px;
    max-height: 200px;
    font-size: 0.8125rem;
    line-height: 1.4;
    box-sizing: border-box;
}

.transcript-su-table-cell-label {
    display: block;
    margin: 0;
    min-width: 0;
}

.transcript-site-upload-status {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 3px 8px;
    font-weight: 800;
    font-size: 0.74rem;
    /* Light: readable ink on a pale tint (7 Oct 2026; the old pale-on-pale colours were made for
       the retired dark theme). Carbon dark keeps its own twins near the end of this file. */
    background: rgba(37, 99, 235, 0.1);
    color: #1d4ed8;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

.transcript-site-upload-row.status-failed .transcript-site-upload-status,
.transcript-site-upload-row.status-failed_terminal .transcript-site-upload-status,
.transcript-site-upload-row.status-failed_retryable .transcript-site-upload-status {
    background: rgba(220, 38, 38, 0.1);
    color: #b91c1c;
}

.transcript-site-upload-row.status-completed .transcript-site-upload-status {
    background: rgba(22, 163, 74, 0.12);
    color: #15803d;
}

.transcript-site-upload-row.status-transcribing .transcript-site-upload-status,
.transcript-site-upload-row.status-pending_cloud_transcription .transcript-site-upload-status,
.transcript-site-upload-row.status-aws_transcribe_processing .transcript-site-upload-status {
    background: rgba(37, 99, 235, 0.1);
    color: #1d4ed8;
}

.transcript-site-upload-row.status-pending .transcript-site-upload-status,
.transcript-site-upload-row.status-pending_audio_extraction .transcript-site-upload-status,
.transcript-site-upload-row.status-extracting_audio .transcript-site-upload-status,
.transcript-site-upload-row.status-queued .transcript-site-upload-status,
.transcript-site-upload-row.status-processing .transcript-site-upload-status,
.transcript-site-upload-row.status-uploaded .transcript-site-upload-status {
    background: rgba(100, 116, 139, 0.14);
    color: #475569;
}

.transcript-site-upload-actions-stack {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-start;
    min-width: 128px;
}

.transcript-site-upload-row-hint {
    font-size: 0.72rem;
    color: var(--theme-muted);
    line-height: 1.35;
}

/* Light ink (7 Oct 2026; the old pale colours were made for the retired dark theme). Carbon
   dark has its own twins beside the status pills' near the end of this file. */
.transcript-site-upload-row-hint--ok {
    color: #15803d;
}

.transcript-site-upload-row-hint--error {
    color: #b91c1c;
}

.transcript-su-col-transcript,
.transcript-su-col-notes {
    min-width: 200px;
}

.transcript-mic-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 46px;
    border: 1px solid rgba(27, 90, 249, 0.36);
    border-radius: 999px;
    padding: 0 16px;
    background: rgba(27, 90, 249, 0.1);
    color: var(--theme-text);
    cursor: pointer;
    font-weight: 800;
}

.transcript-mic-button svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: #1b5af9;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.transcript-mic-button.is-active {
    background: #1b5af9;
    color: #ffffff;
}

.transcript-mic-button.is-active svg {
    stroke: #ffffff;
}

.transcript-mic-state,
.transcript-workspace-message {
    margin: 0;
    color: var(--theme-muted);
    font-size: 0.92rem;
    font-weight: 700;
}

.documents-carousel-card,
.recordings-card {
    padding: 18px;
}

.transcript-toggle-row,
.transcript-recording-check {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--theme-text);
    font-weight: 800;
}

.transcript-toggle-row input,
.transcript-recording-check input,
.transcript-document-card input {
    width: 18px;
    height: 18px;
    min-height: 18px;
    accent-color: #1b5af9;
}

.transcript-document-carousel {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 14px 2px 4px;
    scroll-snap-type: x proximity;
}

.transcript-document-card {
    display: grid;
    grid-template-columns: auto auto minmax(170px, 1fr);
    align-items: center;
    gap: 10px;
    flex: 0 0 min(320px, 82vw);
    scroll-snap-align: start;
    border: 1px solid var(--theme-border);
    border-radius: 12px;
    padding: 12px;
    background: var(--theme-panel-soft);
    cursor: pointer;
}

.transcript-document-card.is-selected {
    border-color: rgba(27, 90, 249, 0.64);
    background: rgba(27, 90, 249, 0.12);
}

.transcript-document-icon {
    display: inline-grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 10px;
    background: #1b5af9;
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 900;
}

.transcript-document-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.transcript-document-copy strong,
.transcript-recording-main strong {
    overflow: hidden;
    color: var(--theme-text);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.transcript-document-copy em {
    overflow: hidden;
    color: var(--theme-muted);
    font-size: 0.82rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.transcript-recording-list {
    display: grid;
    gap: 12px;
    margin-top: 14px;
}

.transcript-exif-panel {
    margin-top: 0.75rem;
    padding: 12px 14px;
    border: 1px solid var(--theme-border);
    border-radius: 10px;
    background: var(--theme-panel-soft);
}

.transcript-exif-title {
    margin: 0 0 8px;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--theme-text-muted, #6b7280);
}

.transcript-exif-list {
    display: grid;
    gap: 6px;
    margin: 0;
}

.transcript-exif-item {
    display: grid;
    grid-template-columns: minmax(120px, 38%) 1fr;
    gap: 8px 12px;
    font-size: 0.9rem;
}

.transcript-exif-item dt {
    margin: 0;
    font-weight: 600;
    color: var(--theme-text-muted, #6b7280);
}

.transcript-exif-item dd {
    margin: 0;
    word-break: break-word;
}

.transcript-exif-empty {
    margin: 0;
}

.transcript-combined-exif-panel {
    margin-bottom: 1rem;
}

.transcript-combined-exif-list {
    margin: 0.75rem 0 0;
    padding-left: 1.25rem;
    display: grid;
    gap: 14px;
}

.transcript-combined-exif-item {
    display: grid;
    gap: 6px;
}

.transcript-combined-exif-meta {
    font-size: 0.88rem;
    color: var(--theme-text-muted, #6b7280);
}

.transcript-recording-card {
    display: grid;
    grid-template-columns: auto minmax(190px, 0.9fr) minmax(210px, 1fr) minmax(260px, 0.95fr);
    gap: 14px;
    align-items: center;
    border: 1px solid var(--theme-border);
    border-radius: 12px;
    padding: 14px;
    background: var(--theme-panel-soft);
}

.transcript-recording-main {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.transcript-recording-main audio {
    width: 100%;
}

.transcript-recording-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
}

.transcript-recording-summary span {
    border: 1px solid var(--theme-border);
    border-radius: 999px;
    padding: 5px 9px;
    color: var(--theme-muted);
    background: color-mix(in srgb, var(--theme-panel) 84%, transparent);
    font-size: 0.82rem;
    font-weight: 800;
}

.transcript-recording-actions {
    display: grid;
    justify-items: end;
    gap: 8px;
    min-width: 0;
}

.transcript-recording-actions audio {
    width: min(100%, 320px);
}

.transcript-recording-status {
    flex: 0 0 auto;
    border-radius: 999px;
    padding: 4px 9px;
    background: rgba(27, 90, 249, 0.12);
    color: var(--survai-ink-1b5af9);
    font-size: 0.78rem;
    font-weight: 900;
}

.transcript-recording-card.status-error .transcript-recording-status,
.transcript-recording-card.status-failed .transcript-recording-status {
    background: rgba(248, 113, 113, 0.14);
    color: #fecaca;
}

.transcript-recording-card.status-transcribing .transcript-recording-status {
    background: rgba(96, 165, 250, 0.16);
    color: #bfdbfe;
}

.transcript-empty {
    padding: 14px 0 4px;
}

@media (max-width: 1100px) {
    .transcript-workspace-header,
    .transcript-card-head,
    .transcript-section-title-row {
        align-items: stretch;
        flex-direction: column;
    }

    .transcript-workspace-status {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 10px;
        width: 100%;
        max-width: 100%;
        justify-content: stretch;
        align-self: stretch;
        justify-items: stretch;
    }

    .transcript-workspace-status span {
        flex: unset;
        min-width: 0;
    }

    .transcript-recording-card {
        grid-template-columns: 1fr;
        align-items: stretch;
        min-width: 0;
    }

    .transcript-recording-check {
        justify-content: space-between;
    }

    .transcript-recording-actions {
        justify-items: stretch;
    }

    .transcript-recording-actions audio {
        width: 100%;
        max-width: 100%;
    }
}

@media (max-width: 640px) {
    .transcript-workspace-page {
        overflow-x: hidden;
    }

    .transcript-workspace-page .app-shell {
        width: 100%;
        min-width: 0;
    }

    .transcript-workspace-main {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
        padding-left: max(12px, env(safe-area-inset-left, 0px));
        padding-right: max(12px, env(safe-area-inset-right, 0px));
        padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px));
        padding-top: calc(12px + env(safe-area-inset-top, 0px));
    }

    body.has-mobile-sidebar .transcript-workspace-page .transcript-workspace-main {
        padding-top: var(--survai-mobile-app-header-total, calc(110px + env(safe-area-inset-top, 0px)));
    }

    .transcript-workspace-header {
        gap: 14px;
        margin-bottom: 16px;
    }

    .transcript-workspace-header h1 {
        font-size: clamp(1.8rem, 10vw, 2.4rem);
        line-height: 1.05;
    }

    .transcript-workspace-header p {
        font-size: 0.95rem;
    }

    .transcript-workspace-header .workflow-title-meta {
        display: grid;
        gap: 8px;
        align-items: start;
        border: 1px solid var(--theme-border);
        border-radius: 14px;
        padding: 12px;
        background: var(--theme-panel);
    }

    .transcript-workspace-header .workflow-title-meta strong {
        color: var(--theme-text);
        overflow-wrap: anywhere;
    }

    .transcript-workspace-status {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
        width: 100%;
    }

    .transcript-workspace-status span {
        min-width: 0;
        padding: 10px;
        font-size: 0.72rem;
    }

    .transcript-workspace-status strong {
        font-size: 1rem;
    }

    .transcript-editor-card,
    .documents-carousel-card,
    .recordings-card {
        padding: 14px;
        border-radius: 14px;
    }

    .transcript-workspace-editor {
        min-height: 44vh;
        font-size: 0.95rem;
    }

    .transcript-toggle-row {
        justify-content: space-between;
        width: 100%;
    }

    .transcript-workspace-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .transcript-workspace-actions .btn,
    .transcript-mic-button,
    .transcript-generate-btn {
        width: 100%;
        justify-content: center;
    }

    .transcript-document-card {
        grid-template-columns: auto auto minmax(0, 1fr);
        flex-basis: min(84vw, 320px);
        max-width: 84vw;
    }

    .transcript-recording-card {
        gap: 10px;
        padding: 12px;
    }

    .transcript-recording-check {
        align-items: center;
        justify-content: flex-start;
    }

    .transcript-recording-main strong {
        white-space: normal;
    }

    .transcript-recording-summary {
        gap: 6px;
    }

    .transcript-recording-summary span {
        max-width: 100%;
        overflow-wrap: anywhere;
    }

    .transcript-recording-status {
        justify-self: start;
    }
}

.workflow-page-header h1 {
    margin-bottom: 0.35rem;
}

.workflow-page-guidance {
    margin: 0;
    max-width: 52rem;
    color: var(--survai-ink-5c6b82);
    font-size: 0.98rem;
    line-height: 1.45;
}

/**
 * Desk study, Process Data, Quality Control: one rhythm for main padding and card stacks.
 * Matches .workflow-page-card (22px / 18px / 20px).
 */
.survey-workflow-surface .main-panel {
    box-sizing: border-box;
    padding: var(--app-main-padding);
}

.survey-workflow-surface .main-panel > .alert {
    margin-bottom: 1.25rem;
}

.survey-workflow-surface .main-panel > .card:not(.desk-study-status-strip),
.survey-workflow-surface .main-panel .desk-study-main-column > .card,
.survey-workflow-surface .main-panel .desk-study-main-column > section.card,
.survey-workflow-surface .main-panel form.desk-study-form > section.card,
.survey-workflow-surface .main-panel form.desk-study-form > div.card {
    min-width: 0;
    padding: 22px;
    gap: 18px;
    margin-bottom: 20px;
    display: grid;
}

.survey-workflow-surface .main-panel > .desk-study-status-strip.card {
    margin-bottom: 20px;
    padding: 22px;
    gap: 12px;
}

@media (max-width: 900px) {
    body:has(.sidebar--workspace) .main-panel > section.card:first-of-type,
    body:has(.sidebar--workspace) .main-panel > div.card:first-of-type,
    body:has(.sidebar--workspace) .main-panel > div.report-overview-grid:first-child,
    body:has(.sidebar--workspace) .main-panel > section.output-workspace-shell:first-of-type,
    body:has(.sidebar--workspace) .main-panel > form.transcript-workspace-form:first-of-type,
    body:has(.sidebar--workspace) .main-panel > div.progress-generation-workspace:first-of-type {
        margin-top: var(--survai-workspace-mobile-first-card-offset);
    }
}

.section-qc-approval {
    margin: 0 0 0.75rem;
    padding: 0.5rem 0.65rem;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.04);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
}

.floating-tool-button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.workflow-processing-status-card .diagnostic-grid {
    margin-top: 0.25rem;
}

.workflow-header-actions {
    flex-wrap: wrap;
    gap: 8px;
    align-items: flex-start;
    justify-content: flex-end;
}

/* --- Report workspace: replaces main sidebar when a report file is open --- */
.sidebar--workspace .sidebar-brand {
    justify-content: center;
    width: 100%;
}

@media (min-width: 901px) {
    body:not(.sidebar-desktop-collapsed) .sidebar--workspace .sidebar-brand::before {
        display: none;
    }
}

.sidebar--workspace .brand-logo-sidebar {
    display: block;
    width: min(420px, 100%);
    max-height: 108px;
    height: auto;
    margin: 0 auto;
    background-color: transparent !important;
    object-fit: contain;
    object-position: center;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.sidebar--workspace .sidebar-nav-label {
    font-size: 0.82rem;
    font-weight: 400;
    line-height: 1.18;
}

/* Tenant admin shortcuts must not appear in report-file workspace nav */
.sidebar--workspace .sidebar-nav a[href^="templates.php"],
.sidebar--workspace .sidebar-nav a[href^="cost_database.php"],
.sidebar--workspace .sidebar-nav a[href^="surveyor-profiles.php"],
.sidebar--workspace .sidebar-nav a[href^="settings.php"] {
    display: none !important;
}

@media (min-width: 901px) {
    .sidebar.sidebar--workspace {
        position: fixed;
        top: 0;
        left: 0;
        z-index: 900;
        height: 100dvh;
        overflow-y: auto;
        gap: 16px;
        box-sizing: border-box;
        width: var(--sidebar-width, var(--survai-app-rail-width));
        min-width: var(--sidebar-width, var(--survai-app-rail-width));
        max-width: var(--sidebar-width, var(--survai-app-rail-width));
        padding: 22px 10px;
        transition: none;
    }

    .sidebar.sidebar--workspace + .workspace-topbar {
        left: var(--sidebar-width);
    }

    .sidebar.sidebar--workspace + .workspace-topbar + .main-panel {
        grid-column: 2;
        grid-row: 1;
        padding-top: calc(var(--app-main-padding) + 100px + var(--survai-toolbar-content-gap));
    }

    .sidebar.sidebar--workspace + .workspace-topbar.report-workspace-header + .main-panel {
        padding-top: calc(var(--app-main-padding) + var(--survai-report-workspace-header-offset) + var(--survai-toolbar-content-gap));
    }

    html.workspace-expanded-mode,
    body.workspace-expanded-mode {
        --workspace-expanded-sidebar-offset: 0px;
    }

    body.workspace-expanded-mode .app-shell {
        grid-template-columns: minmax(0, 1fr);
    }

    body.workspace-expanded-mode .sidebar.sidebar--workspace + .workspace-topbar,
    body.workspace-expanded-mode .sidebar:not(.sidebar--workspace) + .workspace-topbar--global {
        left: 0;
        visibility: visible;
        pointer-events: auto;
        transform: none;
    }

    body.workspace-expanded-mode .sidebar.sidebar--workspace + .workspace-topbar + .main-panel {
        /* The one column expanded mode leaves. Without this the report pages' own placement
           (grid-column: 2, beside the rail) wins on specificity, the grid grows an implicit
           second column for the panel, and the panel lands part-way across the screen with an
           empty band on the left: wide on the Property Overview, narrower on other pages
           (surveyor, 3 Oct 2026: "the expand button when clicked is producing glitches"). */
        grid-column: 1;
        padding-top: calc(var(--app-main-padding) + 100px + var(--survai-toolbar-content-gap));
    }

    body.workspace-expanded-mode .sidebar.sidebar--workspace + .workspace-topbar.report-workspace-header + .main-panel {
        padding-top: calc(var(--app-main-padding) + var(--survai-report-workspace-header-offset) + var(--survai-toolbar-content-gap));
    }

    body.workspace-expanded-mode .sidebar:not(.sidebar--workspace) + .workspace-topbar--global + .main-panel {
        padding-top: calc(var(--app-main-padding) + 100px + var(--survai-toolbar-content-gap));
    }

    body.workspace-expanded-mode .sidebar {
        transition: transform 180ms ease, visibility 180ms ease;
    }

    /* Opened by the hamburger's click only, never by hovering or focusing it (surveyor,
       20 Oct 2026: on hover the menu flickered open and shut as the pointer crossed to it). */
    body.workspace-expanded-mode:not(.workspace-sidebar-pinned) .sidebar {
        visibility: hidden;
        pointer-events: none;
        transform: translateX(-105%);
    }

    body.workspace-expanded-mode.workspace-sidebar-pinned .sidebar {
        visibility: visible;
        pointer-events: auto;
        /* `none`, not translateX(0): the open rail must not be the containing block for the
           stage menus it fixes beside itself (report-overview.php). */
        transform: none;
        z-index: 920;
    }

    body.workspace-expanded-mode .main-panel {
        grid-column: 1;
    }

    /* Expanded mode: the sidebar's way back is a menu icon beside the address (surveyor,
       3 Oct 2026: "the hamburger menu ... instead of the smaller version of the Survai logo"). */
    body.workspace-expanded-mode .workspace-expanded-brand {
        display: inline-flex;
        flex: 0 0 auto;
        align-items: center;
        justify-content: center;
        width: 44px;
        min-width: 44px;
        height: 44px;
        margin-right: var(--survai-white-header-gap);
        border-radius: 12px;
        color: var(--survai-text);
        text-decoration: none;
        transition: background-color 140ms ease;
    }

    body.workspace-expanded-mode .workspace-expanded-brand:hover,
    body.workspace-expanded-mode .workspace-expanded-brand:focus-visible,
    body.workspace-expanded-mode .workspace-expanded-brand[aria-expanded="true"] {
        background-color: var(--survai-bg-tint);
    }

    body.workspace-expanded-mode .workspace-expanded-brand__icon {
        display: block;
        width: 24px;
        height: 24px;
        fill: none;
        /* The text token, not currentColor: the pin is a link, and the global link rules
           (blue, light blue in dark mode) would otherwise colour it. */
        stroke: var(--survai-text);
        stroke-width: 2;
        stroke-linecap: round;
    }

    body.workspace-expanded-mode .report-workspace-header__context {
        align-items: center;
    }

    body.workspace-expanded-mode .report-workspace-header__toolbar {
        display: flex;
        align-items: center;
        gap: 10px;
    }
}

.workspace-expanded-brand {
    display: none;
}

.workspace-topbar {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 880;
    display: flex;
    min-height: 100px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px clamp(16px, 2vw, 28px);
    color: var(--survai-text-deep);
    background: color-mix(in srgb, var(--survai-card) 96%, transparent);
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(16px);
    transition: left 180ms ease, transform 180ms ease, visibility 180ms ease;
}

.report-workspace-header {
    display: flex;
    min-height: var(--survai-report-workspace-header-offset);
    flex-direction: column;
    align-items: stretch;
    justify-content: stretch;
    gap: 0;
    padding: 0;
    background: var(--survai-card);
    /* The header's bottom edge is the same line as the one between its rows, in both themes
       (surveyor, 4 Oct 2026: on the Property Overview the band under the header ran straight
       into the photo panel, which shares the header's surface, so it had no border and the photo
       looked misaligned; on the Report page the menu row reads as framed). The faint navy line
       it replaces was invisible in dark mode. */
    border-bottom-color: var(--survai-border);
    box-shadow: var(--survai-white-header-shadow);
}

.report-workspace-header__row {
    display: flex;
    align-items: center;
    min-width: 0;
    padding-inline: clamp(16px, 2vw, 30px);
}

.report-workspace-header__context {
    min-height: var(--survai-white-header-min-height);
    justify-content: space-between;
    gap: var(--survai-white-header-gap);
    padding-top: 14px;
    padding-bottom: 6px;
    color: var(--survai-white-header-color);
    background: var(--survai-white-header-background);
    box-shadow: var(--survai-white-header-shadow);
}

.report-workspace-header__title {
    display: flex;
    min-width: 0;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 3px;
}

.report-workspace-header__eyebrow {
    margin: 0;
    color: var(--survai-text-muted);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    line-height: 1.2;
    text-transform: uppercase;
}

.report-workspace-header__identity {
    min-width: 0;
    color: var(--survai-ink-657188);
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.2;
}

.report-workspace-header__identity strong,
.report-workspace-header__address-line--primary,
.report-workspace-header__address-line--secondary,
.report-workspace-header__address-tail {
    overflow: hidden;
    max-width: min(42vw, 680px);
    color: var(--survai-text-strong);
    font-size: clamp(1rem, 1.35vw, 1.25rem);
    font-weight: 750;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.report-workspace-header__address-line--primary {
    font-size: var(--survai-white-header-title-size);
    font-weight: var(--survai-white-header-title-weight);
    line-height: var(--survai-white-header-title-line-height);
}

.report-workspace-header__address {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
}

.report-workspace-header__address-line--secondary {
    display: inline-flex;
    min-width: 0;
    max-width: min(42vw, 680px);
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.45rem 0.55rem;
    overflow: visible;
    text-overflow: unset;
    white-space: normal;
}

.report-workspace-header__address-tail {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.report-workspace-header__address-line--status-only {
    gap: 0;
}

/* A dot on a line of its own (no town or postcode): no -7px pull, so the 24px circle clears the street line (M44). */
.report-workspace-header__address-line--status-only .report-status-pill.report-status-pill--workspace-dot { margin-block: 0; }

.report-status-pill-wrap--workspace-dot {
    flex-direction: row;
    align-items: center;
    gap: 0;
}

.report-workspace-header__address .report-status-pill-wrap--workspace-dot {
    flex: 0 0 auto;
    overflow: visible;
}

.report-workspace-header .report-status-pill--workspace-dot,
.mobile-app-header .report-status-pill.report-status-pill--workspace-dot,
.report-workspace-header__context--mobile-embedded .report-status-pill.report-status-pill--workspace-dot {
    flex: 0 0 24px;
}

.report-workspace-header__identity > span {
    position: relative;
    display: inline-flex;
    min-width: 0;
    align-items: center;
    color: var(--survai-ink-717d93);
    white-space: nowrap;
}

.report-workspace-header__identity > span + span::before {
    content: "";
    display: inline-block;
    width: 4px;
    height: 4px;
    margin-right: 10px;
    border-radius: 999px;
    background: rgba(113, 125, 147, 0.45);
}

.report-workspace-header__actions,
.report-workspace-header__primary-action,
.report-workspace-header__toolbar {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    min-width: 0;
}

.report-workspace-header__actions .header-actions,
.report-workspace-header__actions .workflow-header-actions,
.report-workspace-header__primary-action .header-actions,
.report-workspace-header__primary-action .workflow-header-actions,
.report-workspace-primary-action {
    display: flex;
    margin: 0;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 8px;
}

.report-workspace-nav {
    min-height: 54px;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    overflow-x: auto;
    overflow-y: hidden;
    scroll-padding-inline: clamp(16px, 2vw, 30px);
    -webkit-overflow-scrolling: touch;
}

.report-workspace-nav::-webkit-scrollbar {
    height: 0;
}

.report-workspace-nav__link {
    position: relative;
    display: inline-flex;
    min-height: 54px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    padding: 0 18px;
    color: var(--survai-text) !important;
    font-size: 0.86rem;
    font-weight: 560;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    transition: color 140ms ease, background-color 140ms ease;
}

.report-workspace-nav__link + .report-workspace-nav__link {
    border-left: 1px solid rgba(15, 23, 42, 0.06);
}

.report-workspace-nav__link::after {
    content: "";
    display: none;
    position: absolute;
    right: 16px;
    bottom: 0;
    left: 16px;
    height: 2px;
    border-radius: 999px 999px 0 0;
    background: transparent;
}

.report-workspace-nav__link:hover,
.report-workspace-nav__link:focus-visible {
    color: var(--survai-text) !important;
    background: rgba(27, 90, 249, 0.035);
    outline: none;
}

.report-workspace-nav__link.is-active {
    color: var(--survai-text) !important;
    font-weight: 700;
}

.report-workspace-nav__link.is-active::after {
    background: transparent;
}

.report-workspace-header .report-workspace-nav__link,
.report-workspace-header .report-workspace-nav__link:hover,
.report-workspace-header .report-workspace-nav__link:focus-visible,
.report-workspace-header .report-workspace-nav__link.is-active,
.report-workspace-header .workspace-stage-subnav__link,
.report-workspace-header .workspace-stage-subnav__link:hover,
.report-workspace-header .workspace-stage-subnav__link:focus-visible,
.report-workspace-header .workspace-stage-subnav__link.is-active {
    color: var(--survai-text) !important;
    text-decoration: none !important;
}

.report-workspace-header .report-workspace-nav__link.is-active::after,
.report-workspace-header .workspace-stage-subnav__link.is-active::after {
    display: none !important;
    background: transparent !important;
}

.workspace-topbar-title {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    min-width: 0;
}

.page-header-title,
.workspace-topbar-title strong {
    margin: 0;
    overflow: hidden;
    max-width: min(72vw, 920px);
    font-size: 0.96rem;
    font-weight: 850;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Ops/reports/settings strip — larger title than report-workspace strip; desktop bumps +25% below */
.workspace-topbar--global .workspace-topbar-title .page-header-title,
.workspace-topbar--global .workspace-topbar-title strong {
    font-size: 1.32rem;
}

@media (min-width: 901px) {
    .sidebar:not(.sidebar--workspace) + .workspace-topbar--global {
        left: var(--sidebar-width, 280px);
    }

    .sidebar:not(.sidebar--workspace) + .workspace-topbar--global + .main-panel {
        padding-top: calc(var(--app-main-padding) + 100px + var(--survai-toolbar-content-gap));
    }

    body.sidebar-desktop-collapsed .sidebar:not(.sidebar--workspace) + .workspace-topbar--global {
        left: var(--survai-app-rail-width);
    }

    /* Primary heading in fixed white strip (<strong> in .workspace-topbar-title): +25% vs mobile/base tier */
    .workspace-topbar--global .workspace-topbar-title .page-header-title,
    .workspace-topbar--global .workspace-topbar-title strong {
        font-size: calc(1.32rem * 1.25);
    }

    .workspace-topbar:not(.workspace-topbar--global) .workspace-topbar-title .page-header-title,
    .workspace-topbar:not(.workspace-topbar--global) .workspace-topbar-title strong {
        font-size: calc(0.96rem * 1.25);
    }
}

@media (max-width: 900px) {
    /* Drawer / report nav already carry Settings — hide duplicate cog in top bar */
    .workspace-topbar .workspace-tool-button[href$='settings.php'],
    .workspace-topbar .workspace-tool-button[href*='report-settings.php'] {
        display: none !important;
    }

    /* Camera / new survey shortcut is available in the drawer and report nav */
    .workspace-topbar-actions .workspace-tool-button.workspace-mobile-camera-button {
        display: none !important;
    }

    .workspace-topbar--global:not(.workspace-topbar--mobile-embedded) {
        top: var(--survai-mobile-app-header-total, 0px);
        min-height: 82px;
        padding-block: 14px;
    }

    .sidebar:not(.sidebar--workspace) + .workspace-topbar--global + .main-panel {
        padding-top: calc(var(--app-main-padding) + 92px + var(--survai-toolbar-content-gap) + var(--survai-mobile-app-header-total, 0px));
    }

    /*
     * Primary workspace top bar (global ops or report file) is moved beside the drawer toggle (see initMobileMenu / app.js).
     * Single white strip + correct scroll inset for main content.
     */
    body.survai-global-topbar-mobile-embedded.has-mobile-sidebar .mobile-app-header {
        flex-wrap: nowrap;
        align-items: center;
        gap: max(10px, 2.2vw);
    }

    body.survai-global-topbar-mobile-embedded.has-mobile-sidebar .mobile-app-header > .mobile-menu-toggle {
        flex-shrink: 0;
    }

    body.survai-global-topbar-mobile-embedded.has-mobile-sidebar .mobile-app-header > .workspace-topbar.workspace-topbar--mobile-embedded {
        position: static !important;
        top: auto !important;
        right: auto !important;
        bottom: auto !important;
        left: auto !important;
        inset: auto !important;
        z-index: 1 !important;
        flex: 1 1 auto;
        min-width: 0;
        width: auto;
        min-height: 0 !important;
        align-items: center;
        justify-content: space-between !important;
        gap: clamp(6px, 1.8vw, 12px);
        padding: 0 !important;
        margin: 0;
        border: 0 !important;
        border-radius: 0;
        background: transparent !important;
        box-shadow: none !important;
        backdrop-filter: none !important;
    }

    body.survai-global-topbar-mobile-embedded.has-mobile-sidebar
        .mobile-app-header
        > .workspace-topbar.workspace-topbar--mobile-embedded
        .workspace-topbar-title {
        flex: 1 1 auto;
        min-width: 0;
    }

    body.survai-global-topbar-mobile-embedded.has-mobile-sidebar
        .mobile-app-header
        > .workspace-topbar.workspace-topbar--mobile-embedded
        .workspace-topbar-title
        strong {
        max-width: 100%;
    }

    /*
     * White mobile shell: workspace title is 2× the default narrow topbar label (0.88rem → ~1.76rem).
     * Applies globally wherever the workspace strip is .workspace-topbar--mobile-embedded.
     */
    .workspace-topbar.workspace-topbar--mobile-embedded .workspace-topbar-title strong {
        font-size: calc(0.88rem * 2);
        line-height: 1.2;
    }

    .workspace-topbar--global.workspace-topbar--mobile-embedded .workspace-topbar-title strong {
        font-size: calc(1rem * 2.25);
        line-height: 1.18;
    }

    body.survai-global-topbar-mobile-embedded.has-mobile-sidebar
        .mobile-app-header
        > .workspace-topbar.workspace-topbar--mobile-embedded
        .workspace-topbar-actions {
        flex-shrink: 0;
        margin-left: 0;
        gap: 4px;
    }

    body.survai-global-topbar-mobile-embedded.has-mobile-sidebar .app-shell > .main-panel {
        padding-top: calc(
            var(--app-main-padding, 24px)
            + var(--survai-mobile-app-header-total)
            + var(--survai-toolbar-content-gap)
        ) !important;
    }

    body.survai-report-workspace-context-mobile-embedded.has-mobile-sidebar .mobile-app-header {
        align-items: flex-start;
        gap: max(8px, 2vw);
        padding-top: max(10px, env(safe-area-inset-top, 0px));
        padding-bottom: 10px;
    }

    body.survai-report-workspace-context-mobile-embedded.has-mobile-sidebar
        .mobile-app-header
        > .report-workspace-header__context--mobile-embedded {
        flex: 1 1 auto;
        min-width: 0;
        min-height: 0;
        margin: 0;
        padding: 0;
        background: transparent;
        align-items: flex-start;
        gap: 8px;
    }

    body.survai-report-workspace-context-mobile-embedded.has-mobile-sidebar
        .mobile-app-header
        > .report-workspace-header__context--mobile-embedded
        .report-workspace-header__title {
        flex: 1 1 auto;
        min-width: 0;
        gap: 4px;
    }

    body.survai-report-workspace-context-mobile-embedded.has-mobile-sidebar
        .mobile-app-header
        > .report-workspace-header__context--mobile-embedded
        .report-workspace-header__identity {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 4px 8px;
        font-size: 0.68rem;
    }

    body.survai-report-workspace-context-mobile-embedded.has-mobile-sidebar
        .mobile-app-header
        > .report-workspace-header__context--mobile-embedded
        .report-workspace-header__identity
        strong,
    body.survai-report-workspace-context-mobile-embedded.has-mobile-sidebar
        .mobile-app-header
        > .report-workspace-header__context--mobile-embedded
        .report-workspace-header__address-line--primary {
        flex: 1 1 100%;
        overflow: visible;
        max-width: none;
        font-size: 0.82rem;
        line-height: 1.25;
        text-overflow: unset;
        white-space: normal;
    }

    body.survai-report-workspace-context-mobile-embedded.has-mobile-sidebar
        .mobile-app-header
        > .report-workspace-header__context--mobile-embedded
        .report-workspace-header__address-line--secondary {
        display: inline-flex;
        flex: 1 1 100%;
        flex-wrap: nowrap;
        align-items: center;
        gap: 0.45rem;
        overflow: visible;
        max-width: none;
        font-size: 0.82rem;
        line-height: 1.25;
        text-overflow: unset;
        white-space: normal;
    }

    body.survai-report-workspace-context-mobile-embedded.has-mobile-sidebar
        .mobile-app-header
        > .report-workspace-header__context--mobile-embedded
        .report-workspace-header__address-tail {
        flex: 0 1 auto;
        min-width: 0;
        overflow: hidden;
        max-width: none;
        font-size: 0.82rem;
        line-height: 1.25;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    body.survai-report-workspace-context-mobile-embedded.has-mobile-sidebar
        .mobile-app-header
        .report-status-pill.report-status-pill--workspace-dot {
        flex: 0 0 24px;
        width: 24px;
        height: 24px;
        min-width: 24px;
        min-height: 24px;
        max-width: 24px;
        max-height: 24px;
        padding: 0 !important;
        font-size: 0 !important;
        line-height: 0 !important;
        color: transparent !important;
        overflow: visible;
        white-space: nowrap;
        text-indent: 100%;
    }

    body.survai-report-workspace-context-mobile-embedded.has-mobile-sidebar
        .mobile-app-header
        .report-status-pill-wrap--workspace-dot {
        flex: 0 0 auto;
        align-items: center;
    }

    body.survai-report-workspace-context-mobile-embedded.has-mobile-sidebar
        .mobile-app-header
        > .report-workspace-header__context--mobile-embedded
        .report-workspace-header__actions,
    body.survai-report-workspace-context-mobile-embedded.has-mobile-sidebar
        .mobile-app-header
        > .report-workspace-header__context--mobile-embedded
        .report-workspace-header__toolbar {
        flex: 0 0 auto;
        align-self: flex-start;
    }

    body.survai-report-workspace-context-mobile-embedded .report-workspace-header.report-workspace-header--context-embedded {
        display: flex !important;
        flex-direction: column;
        min-height: var(--survai-report-workspace-mobile-subnav-offset);
        height: auto;
        padding: 0;
        top: var(--survai-mobile-app-header-total, 0px);
        overflow: visible;
        box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
    }

    body.survai-report-workspace-context-mobile-embedded.has-mobile-sidebar
        .sidebar.sidebar--workspace
        + .workspace-topbar.report-workspace-header.report-workspace-header--context-embedded
        .report-workspace-nav,
    body.survai-report-workspace-context-mobile-embedded.has-mobile-sidebar
        .sidebar.sidebar--workspace
        + .workspace-topbar.report-workspace-header.report-workspace-header--context-embedded
        .workspace-stage-subnav {
        flex: 1 1 auto;
        width: 100%;
        min-height: var(--survai-report-workspace-mobile-subnav-offset);
        border-top: none;
    }

    body.survai-report-workspace-context-mobile-embedded.has-mobile-sidebar
        .sidebar.sidebar--workspace
        + .workspace-topbar.report-workspace-header
        + .main-panel {
        padding-top: calc(
            var(--app-main-padding)
            + var(--survai-report-workspace-mobile-subnav-offset)
            + var(--survai-toolbar-content-gap)
            + var(--survai-mobile-app-header-total, 0px)
        ) !important;
    }

    body.survai-report-workspace-context-mobile-embedded.has-mobile-sidebar
        .mobile-app-header
        .workspace-fullscreen-toggle,
    body.survai-report-workspace-context-mobile-embedded.has-mobile-sidebar
        .mobile-app-header
        .report-workspace-header__context--mobile-embedded
        .workspace-fullscreen-toggle {
        display: none !important;
    }
}

@media (min-width: 901px) {
    /* Reports: “New survey” is the grey + in aux HTML; hide duplicate camera shortcut in the strip */
    body.reports-page .workspace-topbar--global .workspace-tool-button.workspace-mobile-camera-button {
        display: none !important;
    }
}

.workspace-topbar-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin-left: auto;
    min-width: 0;
    flex-shrink: 0;
}

/* Operational notifications bell lives in the global white topbar (dashboard) */
.workspace-topbar--global .workspace-topbar-actions .ops-notification-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.workspace-topbar--global .workspace-topbar-actions .ops-notification {
    display: inline-flex;
    width: 44px;
    height: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: var(--survai-text);
    background: transparent;
}

.workspace-topbar--global .workspace-topbar-actions .ops-notification-count {
    border-color: rgba(255, 255, 255, 0.98);
}

.workspace-topbar--global .workspace-topbar-actions .ops-notification-panel {
    z-index: 1200;
}

.workspace-tool-button,
.workspace-topbar .workspace-fullscreen-toggle {
    position: relative;
    display: inline-flex;
    width: 42px;
    height: 42px;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    padding: 0;
    color: var(--survai-text-secondary);
    background: transparent;
    box-shadow: none;
    cursor: pointer;
    text-decoration: none;
    backdrop-filter: none;
    transition: color 140ms ease, transform 140ms ease;
}

.workspace-topbar .workspace-fullscreen-toggle {
    width: 42px;
    height: 42px;
    padding: 0;
}

.workspace-tool-button:hover,
.workspace-tool-button:focus-visible,
.workspace-tool-button.is-active,
.workspace-topbar .workspace-fullscreen-toggle:hover,
.workspace-topbar .workspace-fullscreen-toggle:focus-visible {
    color: var(--survai-text-secondary);
    background: transparent;
    outline: none;
    transform: translateY(-1px);
    /* Same trap as .output-icon-action: the transform makes this a stacking
       context, so the tooltip's z-index is confined to it. These labels drop
       DOWNWARD into the page, so without lifting the button they slide
       behind whatever the canvas layers below the bar. */
    z-index: 1201;
}

.workspace-tool-button.is-active {
    color: var(--survai-text-secondary);
}

.workspace-mobile-camera-button {
    display: none;
}

.workspace-tool-button:hover::after,
.workspace-tool-button:focus-visible::after,
.workspace-topbar .workspace-fullscreen-toggle:hover::after,
.workspace-topbar .workspace-fullscreen-toggle:focus-visible::after {
    content: attr(data-tooltip);
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    z-index: 1200;
    width: max-content;
    max-width: 220px;
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 999px;
    padding: 6px 10px;
    color: #ffffff;
    background: var(--survai-navy-surface);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
    font-size: 0.72rem;
    font-weight: 850;
    line-height: 1;
    white-space: nowrap;
    transform: translateX(-50%);
    pointer-events: none;
}

/* The expand toggle is the last button at the header's right edge: its label ("Exit expanded
   workspace") hangs leftwards from the button's right edge instead of centring, which ran it off
   the screen (surveyor, 3 Oct 2026). */
.workspace-topbar .workspace-fullscreen-toggle:hover::after,
.workspace-topbar .workspace-fullscreen-toggle:focus-visible::after {
    left: auto;
    right: 0;
    transform: none;
}

/*
 * White global workspace strip: toolbar glyphs are static, in the ink colour of output.php's header
 * (M134) — no lift, colour shift, transition, or tooltip(:after) on hover/focus.
 */
.workspace-topbar--global .workspace-topbar-actions .reports-filter-toggle,
.workspace-topbar--global .workspace-topbar-actions .reports-filter-toggle:hover,
.workspace-topbar--global .workspace-topbar-actions .reports-filter-toggle:focus-visible,
.workspace-topbar--global .workspace-topbar-actions .reports-filter-toggle[aria-expanded='true'],
.workspace-topbar--global .workspace-topbar-actions .ops-notification,
.workspace-topbar--global .workspace-topbar-actions .ops-notification:hover,
.workspace-topbar--global .workspace-topbar-actions .ops-notification:focus-visible,
.workspace-topbar--global .workspace-topbar-actions .ops-notification[aria-expanded='true'] {
    color: var(--survai-text);
    background: transparent;
    outline: none;
    box-shadow: none;
    transform: none;
    transition: none;
}

.workspace-topbar--global .workspace-topbar-actions .workspace-tool-button,
.workspace-topbar--global .workspace-topbar-actions .workspace-tool-button:hover,
.workspace-topbar--global .workspace-topbar-actions .workspace-tool-button:focus-visible,
.workspace-topbar--global .workspace-topbar-actions .workspace-tool-button.is-active,
.workspace-topbar--global .workspace-topbar-actions .workspace-fullscreen-toggle,
.workspace-topbar--global .workspace-topbar-actions .workspace-fullscreen-toggle:hover,
.workspace-topbar--global .workspace-topbar-actions .workspace-fullscreen-toggle:focus-visible {
    color: var(--survai-text) !important;
    background: transparent !important;
    outline: none;
    box-shadow: none !important;
    transform: none !important;
    transition: none;
}

.workspace-topbar--global .workspace-topbar-actions .workspace-topbar-new-survey-link.workspace-tool-button,
.workspace-topbar--global .workspace-topbar-actions .workspace-topbar-new-survey-link.workspace-tool-button:hover,
.workspace-topbar--global .workspace-topbar-actions .workspace-topbar-new-survey-link.workspace-tool-button:focus-visible {
    color: var(--survai-text) !important;
    transform: none !important;
    transition: none;
}

.workspace-topbar--global .workspace-topbar-actions .workspace-tool-button:hover::after,
.workspace-topbar--global .workspace-topbar-actions .workspace-tool-button:focus-visible::after,
.workspace-topbar--global .workspace-topbar-actions .workspace-fullscreen-toggle:hover::after,
.workspace-topbar--global .workspace-topbar-actions .workspace-fullscreen-toggle:focus-visible::after {
    content: none !important;
    display: none !important;
}

.workspace-tool-button__icon,
.workspace-tool-button__icon svg {
    display: block;
    width: 24px;
    height: 24px;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

.workspace-fullscreen-toggle {
    position: relative;
    top: auto;
    right: auto;
    left: auto;
    flex: 0 0 auto;
    display: inline-grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 999px;
    color: var(--survai-text-deep);
    background: color-mix(in srgb, var(--survai-card) 90%, transparent);
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.14);
    cursor: pointer;
    backdrop-filter: blur(14px);
}

/* Fullscreen control lives inside white workspace topbars — never viewport-fixed. */
.workspace-topbar .workspace-fullscreen-toggle,
.report-workspace-header__actions .workspace-fullscreen-toggle,
.report-workspace-header__toolbar .workspace-fullscreen-toggle,
.workspace-topbar-actions .workspace-fullscreen-toggle {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    left: auto !important;
    bottom: auto !important;
    transform: none !important;
    flex: 0 0 auto;
}

.workspace-fullscreen-toggle:hover,
.workspace-fullscreen-toggle:focus-visible {
    border-color: transparent;
    background: transparent;
    outline: none;
}

.workspace-fullscreen-icon {
    display: block;
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.workspace-topbar-actions .workspace-tool-button,
.workspace-topbar-actions .workspace-fullscreen-toggle {
    position: relative !important;
    inset: auto !important;
    display: inline-grid !important;
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    max-width: 44px !important;
    max-height: 44px !important;
    place-items: center !important;
    align-items: center !important;
    justify-content: center !important;
    border: 0 !important;
    border-radius: 999px !important;
    padding: 0 !important;
    color: var(--survai-text) !important;
    background: transparent !important;
    box-shadow: none !important;
    transform: none !important;
    line-height: 1 !important;
    vertical-align: middle !important;
    backdrop-filter: none !important;
}

.workspace-topbar-actions .workspace-tool-button:hover,
.workspace-topbar-actions .workspace-tool-button:focus-visible,
.workspace-topbar-actions .workspace-fullscreen-toggle:hover,
.workspace-topbar-actions .workspace-fullscreen-toggle:focus-visible {
    color: var(--survai-text) !important;
    background: transparent !important;
    outline: none !important;
    transform: none !important;
}

.workspace-topbar-actions .workspace-tool-button.is-active {
    color: var(--survai-text) !important;
    background: transparent !important;
    outline: none !important;
    transform: none !important;
}

.workspace-topbar-actions .workspace-tool-button__icon,
.workspace-topbar-actions .workspace-tool-button__icon svg {
    display: block !important;
    width: 24px !important;
    height: 24px !important;
    margin: 0 !important;
    flex: 0 0 auto !important;
    stroke: currentColor !important;
    stroke-width: 1.9 !important;
}

/* Sizing only: do not force display — it breaks enter/exit icon visibility under .workspace-fullscreen-toggle. */
.workspace-topbar-actions .workspace-fullscreen-icon {
    width: 24px !important;
    height: 24px !important;
    margin: 0 !important;
    flex: 0 0 auto !important;
    stroke: currentColor !important;
    stroke-width: 1.9 !important;
}

/* Keep accent strokes the same colour as the rest of the icon (no brand-blue chip) */
.workspace-topbar-actions .workspace-tool-button__icon svg .sai-icon-accent {
    color: currentColor;
    stroke: currentColor;
}

.workspace-fullscreen-icon--exit,
body.workspace-expanded-mode .workspace-fullscreen-icon--enter {
    display: none;
}

body.workspace-expanded-mode .workspace-fullscreen-icon--exit {
    display: block;
}

.sidebar--workspace .sidebar-nav {
    flex: 1;
    display: grid;
    gap: 6px;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    align-content: start;
}

.sidebar--workspace .sidebar-nav a {
    gap: 12px;
    min-height: auto;
    border-radius: 14px;
    padding: 10px 4px;
    font-size: 0.82rem;
    line-height: 1.16;
    text-align: center;
}

.sidebar--workspace .sidebar-nav a::before {
    display: none;
}

.sidebar--workspace .sidebar-nav-icon {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
}

.sidebar--workspace .sidebar-nav-icon svg {
    stroke-width: 1.22;
}

@media (max-width: 899px) {
    .sidebar.sidebar--workspace + .workspace-topbar + .main-panel {
        padding-top: calc(var(--app-main-padding) + 100px + var(--survai-toolbar-content-gap));
    }

    .sidebar.sidebar--workspace + .workspace-topbar.report-workspace-header + .main-panel {
        padding-top: calc(var(--app-main-padding) + var(--survai-report-workspace-header-offset) + var(--survai-toolbar-content-gap) + var(--survai-mobile-app-header-total, 0px));
    }

    .workspace-topbar {
        left: 0;
        min-height: 100px;
        padding: 14px 12px;
    }

    .report-workspace-header {
        min-height: 130px;
        padding: 0;
    }

    .report-workspace-header__row {
        padding-inline: 14px;
    }

    .report-workspace-header__context {
        min-height: 76px;
        gap: 10px;
    }

    .report-workspace-header__eyebrow {
        font-size: 0.62rem;
    }

    .report-workspace-header__identity {
        display: grid;
        gap: 3px;
        font-size: 0.7rem;
    }

    .report-workspace-header__identity strong,
    .report-workspace-header__address-line--primary,
    .report-workspace-header__address-line--secondary,
    .report-workspace-header__address-tail {
        max-width: 100%;
        font-size: 0.96rem;
    }

    .report-workspace-header__address-line--secondary {
        display: inline-flex;
        flex-wrap: nowrap;
        align-items: center;
        gap: 0.45rem;
        overflow: visible;
    }

    .report-workspace-header__address-tail {
        flex: 0 1 auto;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .report-status-pill.report-status-pill--workspace-dot,
    .mobile-app-header .report-status-pill.report-status-pill--workspace-dot,
    .report-workspace-header__context--mobile-embedded .report-status-pill.report-status-pill--workspace-dot {
        width: 24px;
        height: 24px;
        min-width: 24px;
        min-height: 24px;
        max-width: 24px;
        max-height: 24px;
        padding: 0 !important;
        font-size: 0 !important;
        line-height: 0 !important;
        color: transparent !important;
        overflow: hidden;
        white-space: nowrap;
        text-indent: 100%;
    }

    .report-workspace-header__identity > span + span::before {
        content: none;
        display: none;
    }

    .report-workspace-header__primary-action .btn {
        min-height: 38px;
        padding-inline: 13px;
        font-size: 0.78rem;
        white-space: nowrap;
    }

    .report-workspace-nav {
        min-height: 54px;
        padding-inline: 0;
    }

    .report-workspace-nav__link {
        min-height: 54px;
        padding-inline: 14px;
        font-size: 0.8rem;
    }

    .workspace-topbar-title .page-header-title,
    .workspace-topbar-title strong {
        font-size: 0.88rem;
    }

    .workspace-tool-button {
        width: 38px;
        height: 38px;
        min-height: 38px;
        padding: 0;
    }

    a.workspace-tool-button[data-tooltip='Activity'] {
        display: none !important;
    }

    .workspace-topbar .workspace-fullscreen-toggle,
    .report-workspace-header__actions .workspace-fullscreen-toggle,
    .report-workspace-header__toolbar .workspace-fullscreen-toggle,
    .mobile-app-header .workspace-fullscreen-toggle {
        display: none !important;
    }

    .sidebar--workspace .sidebar-nav {
        grid-template-columns: 1fr;
    }

    .sidebar--workspace .sidebar-nav a {
        text-align: center;
    }
}

.report-overview-progress-meter {
    margin: 0.5rem 0 1rem;
}

.report-overview-progress-track {
    height: 8px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.1);
    overflow: hidden;
}

.report-overview-progress-track > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--navy, #0b1321);
}

.report-overview-shortcuts {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* --- Property Overview dashboard (report-overview.php) --- */
.property-overview-main {
    /* Four-step vertical spacing scale for the overview. Fallbacks are
       required: an undefined var makes `gap` compute to `normal` (0px). */
    --po-gap-xs: 8px;
    --po-gap-sm: 12px;
    --po-gap-md: 16px;
    --po-gap-lg: 20px;
    --po-navy: var(--survai-navy-ink);
    --po-blue: #1b5af9;
    --po-green: #16a34a;
    --po-amber: #ea580c;
    --po-red: #dc2626;
    --po-grey: #64748b;
    min-width: 0;
    overflow-x: clip;
}

.property-overview-main .report-overview-grid,
.property-overview-main .po-layout,
.property-overview-main .po-card,
.property-overview-main .sai-report-card,
.property-overview-main .po-overview-hero-location-row {
    min-width: 0;
    max-width: 100%;
}

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

.po-primary {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.po-rail {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.po-card {
    padding: 1rem 1.1rem;
}

.po-card-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.85rem;
}

.po-card-head-actions {
    margin-top: 0;
    margin-left: auto;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.po-card-head {
    width: var(--survai-white-header-width);
    min-height: var(--survai-white-header-min-height);
    gap: var(--survai-white-header-gap);
    border: var(--survai-white-header-border);
    border-radius: var(--survai-white-header-radius);
    padding: var(--survai-white-header-padding);
    background: var(--survai-white-header-background);
    color: var(--survai-white-header-color);
    box-shadow: var(--survai-white-header-shadow);
}

.po-card-head .po-card-head-actions,
.po-card-head .section-head-actions {
    align-self: center;
    margin-left: auto;
}

.po-card-head h3 {
    margin: 0;
    color: var(--po-navy);
}

.po-hero {
    display: grid;
    grid-template-columns: minmax(140px, 200px) minmax(0, 1fr);
}

.po-hero-media {
    overflow: hidden;
    background: rgba(15, 23, 42, 0.06);
    align-self: stretch;
}

.po-hero-img {
    width: 100%;
    height: 100%;
    min-height: 140px;
    object-fit: cover;
    display: block;
}

.po-hero-placeholder {
    min-height: 140px;
    background: linear-gradient(135deg, rgba(27, 90, 249, 0.12), rgba(15, 23, 42, 0.08));
}

.po-hero-body {
    min-width: 0;
}

.po-hero-top {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--po-gap-sm, 12px);
    margin-bottom: var(--po-gap-md, 16px);
}

.po-hero-ref {
    margin: 0.2rem 0 0;
    font-size: 0.86rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    color: var(--muted, #64748b);
}

.po-hero-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: var(--po-gap-sm, 12px) var(--po-gap-lg, 20px);
    margin: 0 0 var(--po-gap-md, 16px);
}

/* Grid cells must be allowed to shrink for the single-line ellipsis to work. */
.po-hero-grid > div {
    min-width: 0;
}

.po-hero-grid dt {
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted, #64748b);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.po-hero-grid dd {
    margin: 0.15rem 0 0;
    color: var(--po-navy);
    letter-spacing: -0.005em;
    line-height: 1.35;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.po-sprift-override-editor {
    display: grid;
    gap: 0.35rem;
}

.po-sprift-override-editor__view {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.5rem;
}

.po-sprift-override-editor__edit {
    border: 0;
    background: transparent;
    color: var(--po-navy, #0f172a);
    font-size: 0.72rem;
    font-weight: 700;
    text-decoration: underline;
    cursor: pointer;
    padding: 0;
}

.po-sprift-override-editor__form {
    display: grid;
    gap: 0.4rem;
}

.po-sprift-override-editor__input {
    width: 100%;
    max-width: 16rem;
    padding: 0.35rem 0.5rem;
    border: 1px solid rgba(15, 23, 42, 0.16);
    border-radius: 8px;
    font: inherit;
}

.po-sprift-override-editor__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.po-sprift-override-editor__status {
    margin: 0;
    font-size: 0.72rem;
}

.po-sprift-override-editor__status.is-error {
    color: var(--survai-ink-b91c1c);
}

.po-property-summary-item__value {
    font-weight: 600;
    color: var(--po-navy);
}

.po-property-summary-item__value .po-sprift-override-editor {
    margin-top: 0.15rem;
}

.po-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.po-metric-icon--photo::before {
    content: '';
    position: absolute;
    inset: 7px;
    border: 2px solid var(--po-blue);
    border-radius: 3px;
}

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

.po-wf-name {
    font-weight: 600;
    color: var(--po-navy);
}

.po-muted {
    margin: 0;
    font-size: 0.84rem;
    color: var(--muted, #64748b);
}

.po-workflow-action-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 10px;
}

.po-property-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: var(--po-gap-sm, 12px);
}

.po-property-summary-item {
    display: grid;
    gap: 5px;
    min-width: 0;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 12px;
    padding: 12px;
    background: var(--survai-bg-hover);
}

.po-property-summary-item span {
    color: var(--survai-secondary-slate);
    font-size: 0.7rem;
    font-weight: 750;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.po-property-summary-item strong {
    overflow: hidden;
    color: var(--po-navy);
    font-size: 0.9rem;
    font-weight: 650;
    line-height: 1.35;
    text-overflow: ellipsis;
}

.po-property-summary-item--muted strong {
    color: var(--survai-muted-cool);
}

.po-desk-highlight-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: var(--po-gap-sm, 12px);
}

.po-desk-highlight {
    /* Column flex rather than grid so the Review detail row can be pushed to
       the bottom: the cards hold different amounts of text, and letting that
       row float at the end of the copy left five different baselines across
       one row of cards. */
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 14px;
    padding: 14px;
    background: var(--survai-card);
}

.po-desk-highlight--warning {
    border-color: rgba(234, 88, 12, 0.24);
    background: linear-gradient(180deg, rgba(255, 247, 237, 0.88), var(--survai-card));
}

.po-desk-highlight--review {
    border-color: rgba(27, 90, 249, 0.18);
    background: linear-gradient(180deg, rgba(239, 246, 255, 0.72), var(--survai-card));
}

.po-desk-highlight--ok {
    border-color: rgba(22, 163, 74, 0.18);
}

.po-desk-highlight--muted {
    background: var(--survai-bg-hover);
}

.po-desk-highlight__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.po-desk-highlight h4 {
    margin: 0;
    min-width: 0;
    color: var(--po-navy);
    font-size: 0.9rem;
    font-weight: 720;
    line-height: 1.25;
    overflow-wrap: break-word;
}

.po-desk-highlight__top span {
    /* Shrinkable, not rigid: a tile that names a real source
       ("planning.data.gov.uk") once squeezed the heading into a one-word
       column and pushed the pill past the card edge. It may wrap and it may
       give up width, but it never crushes the title beside it. */
    flex: 0 1 auto;
    min-width: 0;
    max-width: 60%;
    border-radius: 999px;
    padding: 3px 8px;
    background: rgba(61, 72, 97, 0.07);
    color: var(--survai-secondary-slate);
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.35;
    text-align: right;
    overflow-wrap: anywhere;
}

.po-desk-highlight p {
    margin: 0;
    color: var(--survai-ink-3d4861);
    font-size: 0.82rem;
    line-height: 1.45;
    overflow-wrap: break-word;
}

.po-desk-highlight details {
    margin-top: auto;
    border-top: 1px solid rgba(148, 163, 184, 0.16);
    padding-top: 8px;
}

.po-desk-highlight summary {
    cursor: pointer;
    color: var(--survai-secondary-slate);
    font-size: 0.75rem;
    font-weight: 750;
}

.po-epc-overview {
    display: grid;
    gap: 14px;
}

.po-epc-warning {
    margin: 0;
    border: 1px solid rgba(234, 88, 12, 0.24);
    border-radius: 12px;
    padding: 10px 12px;
    background: linear-gradient(180deg, rgba(255, 247, 237, 0.88), var(--survai-card));
    color: var(--survai-ink-9a3412);
    font-size: 0.82rem;
    font-weight: 650;
    line-height: 1.4;
}

.po-epc-empty {
    margin: 0;
    color: var(--survai-secondary-slate);
    font-size: 0.86rem;
    line-height: 1.45;
}

.po-epc-summary {
    display: grid;
    gap: 12px;
}

.po-epc-ratings {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.po-epc-rating-block {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.po-epc-rating-block span {
    color: var(--survai-secondary-slate);
    font-size: 0.68rem;
    font-weight: 750;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.po-epc-rating-block em {
    color: var(--survai-secondary-slate);
    font-size: 0.74rem;
    font-style: normal;
    font-weight: 650;
}

.po-epc-rating-arrow {
    color: var(--survai-muted-cool);
    font-size: 1.1rem;
    font-weight: 700;
}

.po-epc-rating-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    min-height: 42px;
    border-radius: 10px;
    color: var(--survai-text-strong);
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1;
}

.po-epc-rating-badge--a { background: #008054; color: #ffffff; }
.po-epc-rating-badge--b { background: #19b459; color: #ffffff; }
.po-epc-rating-badge--c { background: #8dce46; color: var(--survai-text-strong); }

/* Compact EPC chip in the white report-workspace header. Reuses the band
   palette above; sized down to fit the header icon cluster. Hidden on
   narrow screens where the header has no spare width. */
.workspace-epc-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 999px;
    background: var(--survai-card);
    text-decoration: none;
    line-height: 1;
    flex: 0 0 auto;
}

.workspace-epc-chip:hover {
    border-color: rgba(27, 90, 249, 0.45);
}

.workspace-epc-chip__label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: rgba(61, 72, 97, 0.68);
}

.workspace-epc-chip__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 700;
}

.workspace-epc-chip__score {
    font-size: 11px;
    font-style: normal;
    font-weight: 600;
    color: rgba(61, 72, 97, 0.8);
}

.workspace-epc-chip__arrow {
    font-size: 12px;
    color: rgba(61, 72, 97, 0.55);
}

@media (max-width: 900px) {
    .workspace-epc-chip {
        display: none;
    }
}

/* Approval dot at the end of output.php section titles: red = unapproved,
   green = approved. Flipped instantly by section-proof-toggle.js. */
.output-proof-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-left: 8px;
    border-radius: 50%;
    background: #dc2626;
    vertical-align: middle;
    flex: 0 0 auto;
}

.output-proof-dot.is-proofed {
    background: #16a34a;
}

.floating-section-list .output-proof-dot {
    width: 8px;
    height: 8px;
    margin-left: 6px;
}
.po-epc-rating-badge--d { background: #ffd500; color: var(--survai-text-strong); }
.po-epc-rating-badge--e { background: #f0ad4e; color: var(--survai-text-strong); }
.po-epc-rating-badge--f { background: #ed6838; color: #ffffff; }
.po-epc-rating-badge--g { background: #e40027; color: #ffffff; }
.po-epc-rating-badge--unknown {
    background: rgba(148, 163, 184, 0.2);
    color: var(--survai-secondary-strong);
}

.po-epc-meta-grid,
.po-epc-detail-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 10px;
    margin: 0;
}

.po-epc-meta-grid > div,
.po-epc-detail-list > div {
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 12px;
    padding: 12px;
    background: var(--survai-bg-hover);
}

.po-epc-meta-grid dt,
.po-epc-detail-list dt {
    margin: 0 0 4px;
    color: var(--survai-secondary-slate);
    font-size: 0.68rem;
    font-weight: 750;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.po-epc-meta-grid dd,
.po-epc-detail-list dd {
    margin: 0;
    color: var(--po-navy);
    font-size: 0.84rem;
    font-weight: 650;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.po-epc-details {
    border-top: 1px solid rgba(148, 163, 184, 0.16);
    padding-top: 8px;
}

.po-epc-details summary {
    cursor: pointer;
    color: var(--survai-secondary-slate);
    font-size: 0.75rem;
    font-weight: 750;
}

.po-epc-details-body {
    padding-top: 10px;
}

.po-epc-recommendations {
    display: grid;
    gap: 10px;
    margin-top: 12px;
}

.po-epc-recommendations h4 {
    margin: 0;
    color: var(--po-navy);
    font-size: 0.82rem;
    font-weight: 720;
}

.po-epc-recommendation-list {
    display: grid;
    gap: 10px;
}

.po-epc-recommendation {
    display: grid;
    gap: 8px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 12px;
    padding: 12px;
    background: var(--survai-card);
}

.po-epc-recommendation__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.po-epc-recommendation__head strong {
    color: var(--po-navy);
    font-size: 0.84rem;
    font-weight: 700;
    line-height: 1.35;
}

.po-epc-recommendation__head span {
    flex: 0 0 auto;
    color: var(--survai-secondary-slate);
    font-size: 0.68rem;
    font-weight: 700;
}

.po-epc-recommendation p {
    margin: 0;
    color: var(--survai-ink-3d4861);
    font-size: 0.8rem;
    line-height: 1.45;
}

.po-epc-recommendation__meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 8px;
    margin: 0;
}

.po-epc-recommendation__meta > div {
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 10px;
    padding: 8px 10px;
    background: var(--survai-bg-hover);
}

.po-epc-recommendation__meta dt {
    margin: 0 0 3px;
    color: var(--survai-secondary-slate);
    font-size: 0.64rem;
    font-weight: 750;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.po-epc-recommendation__meta dd {
    margin: 0;
    color: var(--po-navy);
    font-size: 0.78rem;
    font-weight: 650;
}

.po-epc-recommendations-fallback {
    margin: 12px 0 0;
    color: var(--survai-secondary-slate);
    font-size: 0.8rem;
    line-height: 1.45;
}

.po-epc-admin {
    display: grid;
    gap: 10px;
    border-top: 1px solid rgba(148, 163, 184, 0.16);
    padding-top: 12px;
}

.po-epc-admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.po-epc-manual-cert {
    display: grid;
    gap: 6px;
}

.po-epc-manual-cert span {
    color: var(--survai-secondary-slate);
    font-size: 0.74rem;
    font-weight: 650;
}

.po-epc-manual-cert-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
}

.po-epc-manual-cert-row input {
    min-width: 0;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 0.84rem;
}

.po-epc-admin-status {
    margin: 0;
    color: var(--survai-secondary-strong);
    font-size: 0.78rem;
    line-height: 1.4;
    min-height: 1.2em;
}

.po-geology-overview,
.po-flood-overview,
.po-weather-overview,
.po-street-view-overview {
    display: grid;
    gap: 14px;
}

.po-weather-detail-grid dt {
    margin: 0;
    color: var(--survai-secondary-slate);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.po-weather-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 16px;
    margin: 0;
}

.po-weather-detail-grid dd {
    margin: 4px 0 0;
    color: var(--survai-text-strong);
    font-size: 0.95rem;
    font-weight: 750;
}

.po-weather-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.po-weather-empty,
.po-weather-disclaimer {
    margin: 0;
    color: var(--survai-secondary-slate);
    line-height: 1.5;
}

.po-weather-admin-status {
    margin: 0;
    color: var(--survai-secondary-slate);
    line-height: 1.5;
}

.po-street-view-preview {
    position: relative;
    overflow: hidden;
    border-radius: 14px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    background: rgba(15, 23, 42, 0.03);
    min-height: 160px;
}

.po-street-view-preview__image {
    display: block;
    width: 100%;
    height: auto;
    min-height: 160px;
    max-height: 220px;
    object-fit: cover;
}

.po-street-view-meta {
    display: grid;
    gap: 8px;
    margin: 0;
}

.po-street-view-meta dt {
    margin: 0;
    color: var(--survai-secondary-slate);
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.po-street-view-meta dd {
    margin: 0.15rem 0 0;
    color: var(--survai-text-strong);
    font-size: 0.9rem;
    font-weight: 650;
    line-height: 1.35;
}

.po-street-view-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.po-street-view-status-pill,
.po-street-view-source-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.7rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    background: rgba(15, 23, 42, 0.06);
    color: var(--survai-text-strong);
}

.po-street-view-overview--found .po-street-view-status-pill {
    background: rgba(22, 163, 74, 0.12);
    color: var(--survai-ink-15803d);
}

.po-street-view-overview--no_pano .po-street-view-status-pill,
.po-street-view-overview--unavailable .po-street-view-status-pill {
    background: rgba(100, 116, 139, 0.14);
    color: var(--survai-secondary-strong);
}

.po-street-view-empty,
.po-street-view-attribution,
.po-street-view-disclaimer {
    margin: 0;
    color: var(--survai-secondary-slate);
    font-size: 0.82rem;
    line-height: 1.45;
}

.po-street-view-json {
    margin: 0;
    max-height: 280px;
    overflow: auto;
    border-radius: 12px;
    padding: 10px 12px;
    background: rgba(15, 23, 42, 0.04);
    font-size: 0.74rem;
    line-height: 1.4;
}

.property-location-map-controls {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 8px;
}

.property-location-map-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    font-size: 0.82rem;
    color: var(--survai-text-soft);
    font-weight: 600;
}

.property-location-map-toggle input[type='checkbox'] {
    width: 16px;
    height: 16px;
    min-width: 16px;
    min-height: 16px;
    margin: 0;
    flex: 0 0 16px;
    accent-color: #1b5af9;
}

.po-flood-detail-grid {
    display: grid;
    gap: 10px 16px;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.po-flood-detail-grid dt {
    margin: 0;
    color: var(--survai-secondary-slate);
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.po-flood-detail-grid dd {
    margin: 0.15rem 0 0;
    color: var(--survai-text-strong);
    font-size: 0.92rem;
    font-weight: 650;
}

.po-flood-warning {
    margin: 0;
    border: 1px solid rgba(234, 88, 12, 0.24);
    border-radius: 12px;
    padding: 10px 12px;
    background: linear-gradient(180deg, rgba(255, 247, 237, 0.88), var(--survai-card));
    color: var(--survai-ink-9a3412);
    font-size: 0.82rem;
    font-weight: 650;
    line-height: 1.4;
}

.po-flood-empty {
    margin: 0;
    color: var(--survai-secondary-slate);
    font-size: 0.86rem;
    line-height: 1.45;
}

.po-geology-warning {
    margin: 0;
    border: 1px solid rgba(234, 88, 12, 0.24);
    border-radius: 12px;
    padding: 10px 12px;
    background: linear-gradient(180deg, rgba(255, 247, 237, 0.88), var(--survai-card));
    color: var(--survai-ink-9a3412);
    font-size: 0.82rem;
    font-weight: 650;
    line-height: 1.4;
}

.po-geology-empty {
    margin: 0;
    color: var(--survai-secondary-slate);
    font-size: 0.86rem;
    line-height: 1.45;
}

.po-geology-meta-note {
    margin: 0;
    color: var(--survai-muted-cool);
    font-size: 0.78rem;
    line-height: 1.4;
}

.po-geology-detail-list {
    display: grid;
    gap: 10px;
    margin: 0;
}

.po-geology-detail-list > div {
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 12px;
    padding: 10px 12px;
    background: var(--survai-bg-hover);
}

.po-geology-detail-list dt {
    margin: 0 0 4px;
    color: var(--survai-secondary-slate);
    font-size: 0.68rem;
    font-weight: 750;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.po-geology-detail-list dd {
    margin: 0;
    color: var(--po-navy);
    font-size: 0.84rem;
    line-height: 1.45;
    font-weight: 650;
}

.po-geology-admin {
    display: grid;
    gap: 10px;
    border-top: 1px solid rgba(148, 163, 184, 0.16);
    padding-top: 12px;
}

.po-geology-admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.po-geology-admin-status {
    margin: 0;
    color: var(--survai-secondary-strong);
    font-size: 0.78rem;
    line-height: 1.4;
    min-height: 1.2em;
}

.po-geology-admin-json {
    margin: 0;
    max-height: 280px;
    overflow: auto;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 12px;
    padding: 12px;
    background: var(--survai-ink-surface);
    color: #e2e8f0;
    font-size: 0.72rem;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
}

.po-heritage-overview {
    display: grid;
    gap: 14px;
}

.po-heritage-warning {
    margin: 0;
    border: 1px solid rgba(234, 88, 12, 0.24);
    border-radius: 12px;
    padding: 10px 12px;
    background: rgba(251, 146, 60, 0.08);
    color: var(--survai-ink-9a3412);
    font-size: 0.82rem;
    line-height: 1.45;
}

.po-heritage-empty {
    margin: 0;
    color: var(--survai-secondary-slate);
    font-size: 0.86rem;
    line-height: 1.5;
}

.po-heritage-summary {
    display: grid;
    gap: 16px;
}

@media (min-width: 720px) {
    .po-heritage-summary {
        grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.9fr);
        align-items: start;
        gap: 18px;
    }
}

.po-heritage-constraints {
    display: grid;
    gap: 10px;
}

.po-heritage-constraint {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 12px;
    padding: 10px 12px;
    background: color-mix(in srgb, var(--survai-bg) 72%, transparent);
}

.po-heritage-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1;
}

.po-heritage-indicator--yes {
    background: rgba(22, 163, 74, 0.12);
    color: var(--survai-ink-15803d);
}

.po-heritage-indicator--no {
    background: rgba(100, 116, 139, 0.12);
    color: var(--survai-secondary-slate);
}

.po-heritage-indicator--neutral {
    background: rgba(37, 99, 235, 0.1);
    color: var(--po-blue, #2563eb);
}

.po-heritage-constraint-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.po-heritage-constraint-copy strong {
    color: var(--po-navy);
    font-size: 0.84rem;
    line-height: 1.35;
}

.po-heritage-constraint-copy em,
.po-heritage-constraint-copy span {
    color: var(--survai-secondary-slate);
    font-size: 0.78rem;
    line-height: 1.4;
    font-style: normal;
}

.po-heritage-grade {
    display: inline-flex;
    align-self: start;
    border-radius: 999px;
    padding: 2px 8px;
    background: rgba(37, 99, 235, 0.1);
    color: var(--po-blue, #2563eb);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.po-heritage-meta-grid {
    display: grid;
    gap: 10px;
    margin: 0;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 12px;
    padding: 10px 12px;
    background: var(--survai-card);
}

.po-heritage-meta-grid > div {
    display: grid;
    gap: 2px;
}

.po-heritage-meta-grid dt {
    margin: 0;
    color: var(--survai-secondary-slate);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.po-heritage-meta-grid dd {
    margin: 0;
    color: var(--po-navy);
    font-size: 0.82rem;
    line-height: 1.4;
}

.po-heritage-details {
    border-top: 1px solid rgba(148, 163, 184, 0.14);
    padding-top: 8px;
}

.po-heritage-details > summary {
    cursor: pointer;
    color: var(--po-blue, #2563eb);
    font-size: 0.82rem;
    font-weight: 600;
    list-style: none;
}

.po-heritage-details > summary::-webkit-details-marker {
    display: none;
}

.po-heritage-details-body {
    display: grid;
    gap: 12px;
    padding-top: 10px;
}

.po-heritage-detail-list {
    display: grid;
    gap: 10px;
    margin: 0;
}

.po-heritage-detail-list > div {
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 12px;
    padding: 10px 12px;
    background: color-mix(in srgb, var(--survai-bg) 72%, transparent);
}

.po-heritage-detail-list dt {
    margin: 0 0 4px;
    color: var(--survai-secondary-slate);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.po-heritage-detail-list dd {
    margin: 0;
    color: var(--po-navy);
    font-size: 0.84rem;
    line-height: 1.45;
}

.po-heritage-admin {
    display: grid;
    gap: 10px;
    border-top: 1px solid rgba(148, 163, 184, 0.16);
    padding-top: 12px;
}

.po-heritage-admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.po-heritage-admin-status {
    margin: 0;
    color: var(--survai-secondary-strong);
    font-size: 0.78rem;
    line-height: 1.4;
    min-height: 1.2em;
}

.po-heritage-admin-json {
    margin: 0;
    max-height: 280px;
    overflow: auto;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 12px;
    padding: 12px;
    background: var(--survai-ink-surface);
    color: #e2e8f0;
    font-size: 0.72rem;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
}

.po-epc-admin-json {
    margin: 0;
    max-height: 280px;
    overflow: auto;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 12px;
    padding: 12px;
    background: var(--survai-ink-surface);
    color: #e2e8f0;
    font-size: 0.72rem;
    line-height: 1.45;
    white-space: pre-wrap;
    word-break: break-word;
}

@media (max-width: 640px) {
    .po-epc-ratings {
        gap: 10px;
    }

    .po-epc-manual-cert-row {
        grid-template-columns: 1fr;
    }
}

.po-missing-data-grid {
    display: grid;
    gap: var(--po-gap-sm, 12px);
}

.po-missing-data-item {
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 12px;
    padding: 12px;
    background: var(--survai-card);
}

.po-missing-data-item strong {
    display: block;
    color: var(--po-navy);
    font-size: 0.86rem;
    font-weight: 700;
    line-height: 1.3;
}

.po-missing-data-item p {
    margin: 5px 0 0;
    color: var(--survai-secondary-slate);
    font-size: 0.8rem;
    line-height: 1.42;
}

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

.po-missing-data-item--warning {
    border-color: rgba(234, 88, 12, 0.24);
    background: color-mix(in srgb, var(--survai-tint-fff7ed) 74%, transparent);
}

.po-missing-data-item--review {
    border-color: rgba(27, 90, 249, 0.2);
    background: color-mix(in srgb, var(--survai-tint-eff6ff) 72%, transparent);
}

.po-missing-data-item--muted {
    background: var(--survai-bg-hover);
}

.po-doc-drop-title {
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--po-navy);
}

.po-doc-cats {
    display: flex;
    flex-direction: column;
    gap: var(--po-gap-xs, 8px);
}

.po-doc-cat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.03);
    font-size: 0.78rem;
}

.po-doc-cat-name {
    font-weight: 600;
    color: var(--po-navy);
}

.po-doc-cat-stats {
    display: flex;
    gap: 0.5rem;
    color: var(--muted, #64748b);
    font-size: 0.72rem;
}

.po-doc-cat-stats em {
    font-style: normal;
    font-weight: 700;
    color: var(--po-navy);
    margin-right: 0.15rem;
    font-size: 0.62rem;
}

.po-stat-warn {
    color: var(--po-amber) !important;
    font-weight: 600;
}

.po-activity-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.po-activity-row {
    display: flex;
    gap: 0.55rem;
    padding: 0.45rem 0;
    border-bottom: 1px solid var(--po-border);
}

.po-activity-row:last-child {
    border-bottom: 0;
}

.po-act-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    flex-shrink: 0;
    position: relative;
}
.po-act-icon--ok::after {
    content: '✓';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--po-green);
}
.po-act-icon--warn::after {
    content: '!';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: var(--po-amber);
}
.po-act-icon--err::after {
    content: '×';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    color: var(--po-red);
}

.po-act-icon--ai::after,
.po-act-icon--doc::after,
.po-act-icon--pdf::after,
.po-act-icon--qc::after,
.po-act-icon--info::after {
    content: '';
    position: absolute;
    left: 7px;
    right: 7px;
    top: 9px;
    bottom: 9px;
    border: 2px solid var(--po-blue);
    border-radius: 3px;
    opacity: 0.85;
}

.po-activity-body {
    min-width: 0;
}

.po-activity-msg {
    margin: 0 0 0.15rem;
    font-size: 0.8rem;
    color: var(--po-navy);
    line-height: 1.35;
}

.po-activity-row time {
    font-size: 0.72rem;
    color: var(--muted, #64748b);
}

@media (max-width: 1100px) {

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

@media (max-width: 720px) {

    .po-hero-media {
        max-height: 180px;
    }

    .po-grid-2 {
        grid-template-columns: 1fr;
    }

    .po-doc-cat {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.35rem;
    }

    .po-cover-edit-panel {
        right: auto;
        left: 0;
        min-width: 0;
        width: min(240px, calc(100vw - 2rem));
        max-width: calc(100vw - 2rem);
        /* Never taller than the viewport on small phones — scroll inside. */
        max-height: min(70vh, 420px);
        overflow-y: auto;
    }

    .po-cover-edit-action {
        min-height: 44px;
    }

    .po-workflow-action-grid,
    .po-property-summary-grid,
    .po-desk-highlight-grid,
    .po-missing-data-grid {
        grid-template-columns: 1fr;
    }

    .po-rail {
        grid-template-columns: 1fr;
    }
}

/* Property Overview refinement layer */
.property-overview-main {
    --po-border: var(--survai-border-ink);
    --po-shadow: 0 10px 32px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
}

.po-card[draggable="true"] {
    cursor: grab;
}

.po-card.is-dragging {
    opacity: 0.62;
    cursor: grabbing;
}

.po-card-head h3 {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: var(--survai-white-header-title-size);
    font-weight: var(--survai-white-header-title-weight);
    line-height: var(--survai-white-header-title-line-height);
}

.po-inline-icon,
.po-act-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--survai-secondary-slate);
}

.po-inline-icon svg,
.po-act-icon svg {
    display: block;
    width: 17px;
    height: 17px;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.po-inline-icon {
    margin-right: 6px;
    vertical-align: -4px;
}

/* Job-sheet inline icons: +10% over the shared 17px overview glyph size. */
.po-inline-icon svg {
    width: 19px;
    height: 19px;
}

.po-layout {
    grid-template-columns: minmax(0, 1fr) 300px;
}

.property-overview-main .po-hero {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 1.25rem;
    border-radius: 14px;
}

.property-overview-main .po-hero-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.65rem 0.75rem;
    margin: 0 0 0.75rem;
}

.property-overview-main .po-hero-eyebrow {
    margin: 0;
}

.property-overview-main .po-hero-visual {
    margin: 0 -1.25rem;
    width: calc(100% + 2.5rem);
    max-width: none;
}

.property-overview-main .po-hero-body {
    padding-top: 1rem;
}

.po-hero {
    grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
    gap: 1.25rem;
    padding: 1.25rem;
    border-radius: 14px;
}

.po-hero-eyebrow {
    grid-column: 1 / -1;
    align-self: start;
    justify-self: start;
    margin: 0 0 -0.25rem;
}

.po-hero-media {
    position: relative;
    min-height: 0;
    border-radius: 12px;
}

.po-hero-img,
.po-hero-placeholder {
    min-height: 0;
}

.po-hero-placeholder {
    display: grid;
    place-items: center;
    color: var(--survai-secondary-slate);
    font-size: 0.88rem;
    font-weight: 650;
}

.property-overview-main .po-hero-media {
    position: relative;
    display: block;
    width: 39.375%;
    max-width: 39.375%;
    min-height: 0;
    aspect-ratio: 1 / 1;
    box-sizing: border-box;
    margin: 5px;
    padding: 0;
    border: 0;
    border-radius: 12px;
    overflow: hidden;
    background: var(--survai-ink-surface);
}

.property-overview-main .po-hero-img,
.property-overview-main .po-hero-placeholder {
    width: 100%;
    height: 100%;
    min-height: 100%;
    border-radius: 0;
}

.property-overview-main .po-hero-img {
    object-fit: cover;
}

.property-overview-main .po-hero-visual .po-hero-attribution {
    margin: 0;
    padding: 8px 1.25rem 0;
    color: var(--survai-secondary-slate);
    font-size: 0.75rem;
    line-height: 1.35;
}

.property-overview-main .po-hero-visual .po-hero-warning {
    margin: 0;
    padding: 6px 1.25rem 0;
}

.property-overview-main .po-hero-visual .po-hero-street-view-actions {
    margin: 0;
    padding: 8px 1.25rem 12px;
}

.property-overview-main .po-desk-study-regenerate {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
}

.property-overview-main .po-desk-study-regenerate__icon {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
}

.po-cover-picker-link {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    color: inherit;
    text-decoration: none;
    border: none;
    padding: 0;
    background: transparent;
    cursor: pointer;
    text-align: inherit;
    font: inherit;
}

.po-cover-picker-link .po-hero-placeholder {
    gap: 6px;
}

.po-cover-picker-link .po-hero-placeholder em {
    color: var(--survai-muted-cool);
    font-size: 0.78rem;
    font-style: normal;
    font-weight: 650;
}

.po-cover-picker-overlay {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: rgba(15, 23, 42, 0.18);
    color: #ffffff;
    font-size: 0.9rem;
    font-weight: 800;
    opacity: 0;
    transition: opacity 160ms ease;
}

.po-cover-picker-link:hover .po-cover-picker-overlay,
.po-cover-picker-link:focus-visible .po-cover-picker-overlay {
    opacity: 1;
}

.po-cover-form--hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.po-cover-edit-menu {
    position: absolute;
    right: clamp(12px, 1.2vw, 16px);
    bottom: clamp(12px, 1.2vw, 16px);
    z-index: 4;
}

.po-cover-edit-menu > summary {
    list-style: none;
    cursor: pointer;
}

.po-cover-edit-menu > summary::-webkit-details-marker {
    display: none;
}

.po-cover-edit-trigger {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 999px;
    background: rgba(11, 18, 32, 0.78);
    color: #ffffff;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.28);
    backdrop-filter: blur(10px);
    transition: background 160ms ease, transform 120ms ease;
}

.po-cover-edit-trigger:hover,
.po-cover-edit-menu[open] > .po-cover-edit-trigger {
    background: rgba(11, 18, 32, 0.92);
}

.po-cover-edit-trigger__icon {
    display: grid;
    place-items: center;
    width: 18px;
    height: 18px;
}

.po-cover-edit-trigger__icon svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.po-cover-edit-panel {
    position: absolute;
    right: 0;
    bottom: calc(100% + 8px);
    display: grid;
    gap: 4px;
    min-width: 196px;
    padding: 6px;
    border: 1px solid var(--survai-border-ink);
    border-radius: 12px;
    background: color-mix(in srgb, var(--survai-card) 98%, transparent);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
}

.po-cover-edit-action {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 38px;
    padding: 8px 12px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--survai-text-strong);
    font-size: 0.84rem;
    font-weight: 650;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.po-cover-edit-action:hover,
.po-cover-edit-action:focus-visible {
    background: var(--survai-bg-tint);
    outline: none;
}

.po-cover-edit-action--upload {
    position: relative;
    overflow: hidden;
}

.po-cover-edit-action--upload input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.po-cover-edit-remove-form {
    display: contents;
}

.po-cover-edit-action--danger {
    color: var(--survai-ink-dc2626);
}

.po-cover-edit-action--danger:hover,
.po-cover-edit-action--danger:focus-visible {
    background: var(--survai-tint-fef2f2);
}

/* The cover crop is now positioned with the draggable A4 frame modal
   (report-overview.php, .po-crop-modal); the old 3x3 dot picker was removed. */

.po-job-sheet {
    grid-template-columns: repeat(3, minmax(140px, 1fr));
}

.po-detail-wide {
    grid-column: 1 / -1;
}

.po-hero-grid dt {
    font-size: 0.72rem;
    font-weight: 650;
}

.po-hero-grid dd {
    font-size: 0.95rem;
    font-weight: 500;
}

.po-survey-date-cell {
    position: relative;
}

/* Cells that hold interactive controls must not clip them (hover shadow/focus ring). */
.po-hero-grid dd.po-survey-date-cell,
.po-hero-grid dd.po-surveyor-name-cell {
    overflow: visible;
    text-overflow: clip;
}

/* Survey date (7 Oct 2026): iPhone Safari and the app's web view open a date field's calendar
   only for a real tap on the field (showPicker() and a scripted click do nothing there), so the
   real <input type="date"> lies over the pill, invisible, and takes the tap. .po-date-field is the
   positioned host; the pill (.po-date-edit-button) or area 02's To do button under it is the picture.
   opacity, not display/visibility, so the field still receives the tap; 16px so iOS does not
   zoom the page when it gains focus. */
.po-date-field {
    position: relative;
    display: inline-flex;
    max-width: 100%;
    vertical-align: middle;
}

.po-date-native-picker {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: block;
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    max-width: none;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: inherit;
    background: transparent;
    color: transparent;
    font-size: 16px;
    opacity: 0;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.po-date-native-picker::-webkit-calendar-picker-indicator {
    position: absolute;
    inset: 0;
    width: auto;
    height: auto;
    margin: 0;
    padding: 0;
    cursor: pointer;
}

/* The field takes the pointer, so the pill shows its hover and focus through the host. */
.po-date-field:hover .po-date-edit-button {
    border-color: color-mix(in srgb, var(--field-focus-border) 45%, var(--survai-border));
    transform: translateY(-1px);
}

.po-date-field:focus-within .po-date-edit-button {
    border-color: var(--field-focus-border);
    box-shadow: var(--survai-focus);
}

.po-date-edit-button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    max-width: 100%;
    min-height: 30px;
    padding: 5px 9px;
    border: 1px solid rgba(61, 72, 97, 0.14);
    border-radius: 999px;
    background: var(--survai-card);
    color: var(--po-navy);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
    cursor: pointer;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 520;
    line-height: 1.2;
    text-align: left;
    transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.po-date-edit-button:hover,
.po-date-edit-button:focus-visible {
    border-color: rgba(27, 90, 249, 0.35);
    box-shadow: 0 10px 24px rgba(27, 90, 249, 0.11);
    transform: translateY(-1px);
    outline: none;
}

.po-date-edit-button .po-inline-icon {
    width: 18px;
    height: 18px;
    margin: 0;
    color: var(--survai-ink-3d4861);
}

.po-surveyor-name-cell {
    max-width: 100%;
}

.po-surveyor-name-input {
    display: block;
    width: 100%;
    max-width: 220px;
    min-height: 30px;
    padding: 5px 9px;
    border: 1px solid rgba(61, 72, 97, 0.14);
    border-radius: 999px;
    background: var(--survai-card);
    color: var(--po-navy);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 520;
    line-height: 1.2;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.po-surveyor-name-input::placeholder {
    color: var(--survai-muted-cool);
    font-weight: 450;
}

.po-surveyor-name-input:hover {
    border-color: rgba(27, 90, 249, 0.22);
}

.po-surveyor-name-input:focus-visible {
    border-color: rgba(27, 90, 249, 0.35);
    box-shadow: 0 10px 24px rgba(27, 90, 249, 0.11);
    outline: none;
}

.po-surveyor-name-input.is-saving {
    opacity: 0.72;
}

.po-condition {
    order: 0;
}

.po-rail .po-condition.condition-ratings-panel {
    gap: 12px;
    border-color: rgba(148, 163, 184, 0.2);
    border-radius: 14px;
    padding: 15px;
    background: linear-gradient(180deg, var(--survai-card) 0%, var(--survai-bg-soft) 100%);
    box-shadow: 0 12px 34px rgba(15, 23, 42, 0.06);
}

.po-rail .po-condition .condition-ratings-panel__head {
    gap: 4px;
}

.po-rail .po-condition .condition-ratings-panel__head h2 {
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1.2;
}

.po-rail .po-condition .condition-ratings-panel__head p {
    max-width: 24rem;
    color: var(--survai-secondary-slate);
    font-size: 0.76rem;
    line-height: 1.35;
}

.po-rail .po-condition .condition-rating-summary-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
}

.po-rail .po-condition .condition-rating-summary-card {
    min-height: 66px;
    gap: 4px;
    border-color: rgba(148, 163, 184, 0.2);
    border-radius: 10px;
    padding: 7px 4px 8px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.045);
}

.po-rail .po-condition .condition-rating-summary-card::after {
    height: 2px;
}

.po-rail .po-condition .condition-rating-summary-badge {
    width: 28px;
    height: 28px;
    font-size: 0.58rem;
    letter-spacing: 0;
}

.po-rail .po-condition .condition-rating-summary-label {
    max-width: 100%;
    color: var(--survai-secondary-slate);
    font-size: 0.47rem;
    font-weight: 800;
    letter-spacing: 0.01em;
    line-height: 1.08;
}

.po-rail .po-condition .condition-rating-summary-card strong {
    font-size: 1.08rem;
    font-weight: 850;
    letter-spacing: -0.03em;
    line-height: 1;
}

.po-rail .po-condition .condition-rating-summary-card:hover {
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}

@media (max-width: 899px) {
    .po-rail .po-condition .condition-rating-summary-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    .po-rail .po-condition .condition-rating-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .po-rail .po-condition .condition-rating-summary-card {
        min-height: 78px;
        padding: 9px 8px 10px;
    }

    .po-rail .po-condition .condition-rating-summary-badge {
        width: 34px;
        height: 34px;
        font-size: 0.68rem;
    }

    .po-rail .po-condition .condition-rating-summary-label {
        font-size: 0.58rem;
    }

    .po-rail .po-condition .condition-rating-summary-card strong {
        font-size: 1.28rem;
    }
}

.po-condition .po-card-head {
    margin-bottom: 14px;
}

.po-doc-cat {
    padding: 0.5rem 0.55rem;
}

.po-doc-cat-stats {
    flex-wrap: wrap;
    row-gap: 0.2rem;
    white-space: normal;
}

.po-act-icon {
    background: rgba(27, 90, 249, 0.08);
    color: var(--survai-ink-1b5af9);
}

.po-act-icon::after {
    content: none !important;
}

.po-act-icon--ok {
    color: var(--po-green);
    background: rgba(22, 163, 74, 0.1);
}

.po-act-icon--warn {
    color: var(--po-amber);
    background: rgba(234, 88, 12, 0.1);
}

.po-act-icon--err {
    color: var(--po-red);
    background: rgba(220, 38, 38, 0.1);
}

@media (max-width: 1100px) {
    .po-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .po-hero {
        grid-template-columns: 1fr;
    }

    .property-overview-main .po-overview-hero-location-row .po-hero-media,
    .property-overview-main .po-hero-media {
        width: calc(100% - 60px);
        max-width: calc(100% - 60px);
        margin: 5px auto;
    }

    .property-overview-main .po-hero-head {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 0.5rem;
    }

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

@media (max-width: 520px) {
    .po-job-sheet {
        grid-template-columns: 1fr;
    }
}

/* --- Client / Parties Profile workspace (client-profile.php) --- */
.client-profile-page {
    --cp-navy: var(--survai-navy-ink);
    --cp-border: rgba(15, 23, 42, 0.1);
    --cp-shadow: 0 10px 32px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
    --cp-green: #16a34a;
    --cp-blue: #1b5af9;
    --cp-amber: #ea580c;
    --cp-red: #dc2626;
}

.client-profile-header {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--cp-border);
}

.client-profile-reference {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 9px;
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 999px;
    color: var(--survai-secondary-strong);
    background: var(--survai-bg);
    font-size: 0.78rem;
    font-weight: 700;
}

.client-profile-form {
    display: grid;
    gap: 1rem;
}

.client-profile-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    align-items: start;
}

.client-profile-secondary-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr) minmax(280px, 0.9fr);
    gap: 1rem;
    align-items: start;
    margin-top: 1rem;
}

.client-profile-card {
    padding: 1rem 1.1rem;
    border-color: var(--cp-border);
    border-radius: 12px;
    box-shadow: var(--cp-shadow);
}

.client-profile-card.is-empty {
    background: linear-gradient(180deg, var(--survai-card), var(--survai-bg));
}

.client-profile-wide-card {
    margin-top: 1rem;
}

.client-profile-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.client-profile-card-head h2 {
    margin: 0;
    color: var(--cp-navy);
    font-size: 0.98rem;
    font-weight: 700;
    letter-spacing: 0;
}

.client-profile-card-head .form-note {
    max-width: 780px;
    margin: 0.3rem 0 0;
    font-size: 0.82rem;
}

.client-profile-toggle {
    display: inline-flex;
    grid-auto-flow: column;
    align-items: center;
    gap: 0.45rem;
    min-height: 32px;
    padding: 5px 8px;
    border: 1px solid rgba(27, 90, 249, 0.16);
    border-radius: 999px;
    background: rgba(27, 90, 249, 0.06);
    color: var(--cp-navy);
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
}

.client-profile-toggle input {
    width: 16px;
    min-height: 16px;
    accent-color: var(--cp-green);
}

.client-profile-detail-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
    margin: 0;
}

.client-profile-detail-row {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    gap: 0.65rem;
    min-width: 0;
    padding: 0.65rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 10px;
    background: var(--survai-bg);
}

.client-profile-detail-row dt {
    margin: 0 0 0.12rem;
    color: var(--survai-secondary-slate);
    font-size: 0.67rem;
    font-weight: 750;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.client-profile-detail-row dd {
    margin: 0;
    color: var(--cp-navy);
    font-size: 0.84rem;
    font-weight: 500;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.client-profile-row-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    color: var(--cp-blue);
    background: rgba(27, 90, 249, 0.08);
}

.client-profile-row-icon svg,
.client-profile-warning svg {
    display: block;
    width: 17px;
    height: 17px;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

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

.client-profile-name-row {
    grid-template-columns: minmax(76px, 0.5fr) minmax(0, 1fr) minmax(0, 1fr);
    margin-bottom: 0.8rem;
}

.client-profile-full {
    grid-column: 1 / -1;
}

.client-profile-card label {
    gap: 5px;
    font-weight: 650;
}

.client-profile-card label span {
    color: var(--survai-secondary-strong);
    font-size: 0.78rem;
}

.client-profile-card input,
.client-profile-card select,
.client-profile-card textarea {
    border-radius: 8px;
    font-size: 0.92rem;
}

.client-profile-card input,
.client-profile-card select {
    min-height: 42px;
}

.client-profile-alert-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.8rem;
    margin: 0 0 1rem;
}

.client-profile-warning {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 0.7rem;
    align-items: flex-start;
    padding: 0.85rem 0.95rem;
    border: 1px solid rgba(234, 88, 12, 0.24);
    border-radius: 12px;
    background: rgba(234, 88, 12, 0.08);
    color: var(--survai-ink-9a3412);
}

.client-profile-warning.is-high {
    border-color: rgba(220, 38, 38, 0.24);
    background: rgba(220, 38, 38, 0.08);
    color: var(--survai-ink-991b1b);
}

.client-profile-warning > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: color-mix(in srgb, var(--survai-card) 62%, transparent);
}

.client-profile-warning strong {
    display: block;
    color: currentColor;
    font-size: 0.88rem;
    line-height: 1.3;
}

.client-profile-warning p {
    margin: 0.18rem 0 0;
    color: currentColor;
    font-size: 0.8rem;
    opacity: 0.86;
}

.client-profile-party-list,
.client-profile-history-list,
.client-profile-change-list {
    display: grid;
    gap: 0.5rem;
}

.client-profile-party-row,
.client-profile-history-row,
.client-profile-change-list > div {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) minmax(120px, auto);
    gap: 0.65rem;
    align-items: center;
    padding: 0.65rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 10px;
    background: var(--survai-bg);
}

.client-profile-party-row strong,
.client-profile-history-row strong,
.client-profile-change-list strong {
    display: block;
    color: var(--cp-navy);
    font-size: 0.86rem;
    font-weight: 700;
    line-height: 1.25;
}

.client-profile-party-row span,
.client-profile-history-row span,
.client-profile-history-row em,
.client-profile-change-list span,
.client-profile-party-row a {
    color: var(--survai-secondary-slate);
    font-size: 0.78rem;
    font-style: normal;
    overflow-wrap: anywhere;
}

.client-profile-party-row a {
    color: var(--cp-blue);
    text-align: right;
}

.client-profile-additional-editor {
    display: grid;
    gap: 0.85rem;
}

.client-profile-additional-row {
    display: grid;
    grid-template-columns: 78px minmax(130px, 0.85fr) repeat(3, minmax(130px, 1fr));
    gap: 0.65rem;
    padding: 0.8rem;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 12px;
    background: var(--survai-bg);
}

.client-profile-additional-row input[type='checkbox'] {
    width: 18px;
    min-height: 18px;
    accent-color: var(--cp-green);
}

.client-profile-document-buckets {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.client-profile-document-buckets span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 30px;
    padding: 5px 8px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 999px;
    color: var(--survai-secondary-strong);
    background: var(--survai-bg);
    font-size: 0.78rem;
    font-weight: 600;
}

.client-profile-document-buckets strong {
    color: var(--cp-navy);
}

.client-profile-doc-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.85rem;
}

.client-profile-history-row {
    grid-template-columns: minmax(100px, 0.8fr) minmax(0, 1.4fr) minmax(110px, auto);
}

.client-profile-history-row:hover,
.client-profile-party-row:hover {
    border-color: rgba(27, 90, 249, 0.18);
    background: var(--survai-card);
}

.client-profile-change-list > div {
    grid-template-columns: minmax(0, 1fr);
}

@media (max-width: 1180px) {
    .client-profile-secondary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .client-profile-secondary-grid .client-profile-card:last-child {
        grid-column: 1 / -1;
    }

    .client-profile-additional-row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .client-profile-grid,
    .client-profile-secondary-grid,
    .client-profile-alert-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .client-profile-detail-list,
    .client-profile-form-grid,
    .client-profile-name-row,
    .client-profile-additional-row {
        grid-template-columns: 1fr;
    }

    .client-profile-card-head,
    .client-profile-header {
        align-items: flex-start;
    }

    .client-profile-party-row,
    .client-profile-history-row {
        grid-template-columns: 32px minmax(0, 1fr);
    }

    .client-profile-party-row a,
    .client-profile-history-row em {
        grid-column: 2;
        text-align: left;
    }
}

.desk-study-status-strip {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 16px;
    padding: 14px;
}

.desk-study-status-strip span {
    color: var(--muted);
    font-size: 0.86rem;
}

.desk-study-status-strip strong {
    display: block;
    color: var(--navy);
    font-size: 0.78rem;
    text-transform: uppercase;
}

.desk-study-main-column {
    min-width: 0;
}

/**
 * Desk Study: strip extra form inset so cards match cover width; card header typography.
 */
.desk-study-page .main-panel form.desk-study-form.report-form {
    padding: 0;
    gap: 0;
}

.desk-study-page .section-head {
    margin-top: 2px;
}

.desk-study-page .section-head .card-title {
    color: var(--survai-text-strong);
    margin: 0 0 8px;
    letter-spacing: -0.01em;
}

.desk-study-page .section-head .card-title:last-child {
    margin-bottom: 0;
}

.desk-study-page .section-head .card-subtitle {
    color: var(--survai-muted-grey);
    margin: 0;
    font-weight: 400;
}

.desk-study-page .section-head .card-subtitle + .card-subtitle {
    margin-top: 0.5rem;
}

.desk-study-page .section-head .card-title + .card-subtitle {
    margin-top: 0;
}

.field-source-badge {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    border-radius: 999px;
    padding: 3px 8px;
    font-size: 0.72rem;
    font-weight: 800;
}

.field-source-badge--sprift {
    color: var(--survai-ink-166534);
    background: var(--survai-tint-dcfce7);
}

.field-source-badge--manual {
    color: var(--survai-ink-92400e);
    background: var(--survai-tint-fef3c7);
}

.field-source-badge--unavailable {
    color: var(--survai-secondary-strong);
    background: var(--survai-border-soft);
}

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

@media (max-width: 980px) {
    .desk-study-status-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.workflow-file-drop {
    display: block;
    border: 1px dashed #94a3b8;
    border-radius: 12px;
    padding: 1rem 1rem 0.75rem;
    background: var(--survai-bg);
    cursor: pointer;
}

.workflow-file-drop input[type='file'] {
    margin-top: 0.5rem;
}

.desk-study-uploaded-maps {
    list-style: none;
    margin: 0.75rem 0 0;
    padding: 0;
}

.desk-study-uploaded-maps li {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 0.75rem;
    padding: 0.5rem 0;
    border-top: 1px solid #e5e7eb;
}

.desk-study-image-preview {
    margin: 0.75rem 0 1rem;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    overflow: hidden;
    background: var(--survai-bg);
}

.desk-study-image-preview img {
    display: block;
    max-width: 100%;
    height: auto;
}

.desk-study-map-grid {
    display: grid;
    gap: 1rem 1.25rem;
}

@media (min-width: 900px) {
    .desk-study-map-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.desk-study-thumb-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin: 0.5rem 0 1rem;
}

.desk-study-thumb {
    margin: 0;
    flex: 1 1 120px;
    max-width: 200px;
}

.desk-study-floorplan-list {
    margin: 0.35rem 0 1rem;
    padding-left: 1.25rem;
}

.desk-study-json-field {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.82rem;
}

body.desk-study-page {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    overscroll-behavior-x: none;
    touch-action: pan-y;
}

@supports selector(html:has(body.desk-study-page)) {
    html:has(body.desk-study-page) {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
        overscroll-behavior-x: none;
    }
}

.desk-study-page .app-shell,
.desk-study-page .main-panel,
.desk-study-page .workflow-page-header,
.desk-study-page .wizard-progress,
.desk-study-page .workflow-page-card,
.desk-study-page .desk-study-status-strip,
.desk-study-page .desk-study-main-column,
.desk-study-page .desk-study-form,
.desk-study-page .capture-cover-layout,
.desk-study-page .context-grid,
.desk-study-page .pill-grid,
.desk-study-page .room-area-picker,
.desk-study-page .workflow-footer-card {
    min-width: 0;
    max-width: 100%;
}

.desk-study-page .desk-study-floorplan-list,
.desk-study-page .desk-study-json-field,
.desk-study-page input,
.desk-study-page select,
.desk-study-page textarea {
    overflow-wrap: anywhere;
}

@media (max-width: 900px) {
    .desk-study-page .main-panel {
        width: 100%;
        max-width: 100vw;
        overflow-x: clip;
        overscroll-behavior-x: none;
    }

    .desk-study-page .workflow-page-header .header-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
        justify-content: stretch;
    }

    .desk-study-page .workflow-page-header .header-actions > *,
    .desk-study-page .workflow-page-header .inline-action-form,
    .desk-study-page .workflow-page-header .btn {
        width: 100%;
        min-width: 0;
    }

    .desk-study-page .wizard-progress {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .desk-study-page .capture-cover-layout,
    .desk-study-page .context-grid,
    .desk-study-page .desk-study-map-grid,
    .desk-study-page .workflow-dl {
        grid-template-columns: minmax(0, 1fr);
    }

    .desk-study-page .room-area-picker,
    .desk-study-page .pill-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr));
        align-items: stretch;
    }

    .desk-study-page .room-area-pill,
    .desk-study-page .pill-toggle,
    .desk-study-page .pill-toggle .pill-label {
        width: 100%;
        min-width: 0;
        max-width: 100%;
    }

    .desk-study-page .room-area-pill,
    .desk-study-page .pill-toggle .pill-label {
        white-space: normal;
        text-align: center;
        line-height: 1.2;
        overflow-wrap: anywhere;
    }

    .desk-study-page .desk-study-thumb-row {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr));
    }

    .desk-study-page .desk-study-thumb {
        max-width: none;
        width: 100%;
    }
}

@media (max-width: 560px) {
    .desk-study-page .workflow-page-header .header-actions,
    .desk-study-page .wizard-progress,
    .desk-study-page .desk-study-status-strip {
        grid-template-columns: minmax(0, 1fr);
    }

    .desk-study-page .workflow-footer-card {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
    }

    .desk-study-page .workflow-footer-card .btn {
        width: 100%;
    }
}

.workflow-dl {
    display: grid;
    grid-template-columns: minmax(8rem, 12rem) 1fr;
    gap: 0.35rem 1rem;
    margin: 0;
}

.workflow-dl dt {
    margin: 0;
    font-weight: 600;
    color: var(--survai-secondary-strong);
}

.workflow-dl dd {
    margin: 0;
}

.workflow-footer-card {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.capture-workflow-intro {
    margin-bottom: 12px;
}

.capture-method-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: 1fr;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 16px;
}

.capture-method-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0;
    padding: 16px 16px 14px;
    border-radius: 12px;
    border: 1px solid #d9e2ee;
    background: #ffffff;
    text-decoration: none;
    color: #0b1321;
    min-height: 11rem;
    height: 100%;
    box-sizing: border-box;
}

.capture-method-card .capture-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    margin-bottom: 10px;
    color: var(--navy, #0b1321);
}

.capture-method-card .capture-title {
    margin: 0 0 0.35rem;
    font-size: 1rem;
    font-weight: 600;
}

.capture-method-card span {
    font-size: 0.85rem;
    color: #5c6b82;
}

.capture-method-card.is-primary {
    border-color: #0b1321;
    box-shadow: 0 8px 22px rgba(11, 18, 32, 0.12);
}

.capture-intro-back {
    display: flex;
    justify-content: center;
    margin-top: 0.25rem;
    padding-bottom: 4px;
}

@media (min-width: 921px) {
    .capture-workflow-intro .capture-intro-back {
        display: none !important;
    }
}

@media (max-width: 900px) {
    .capture-method-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }
}

@media (max-width: 640px) {
    .capture-workflow-intro {
        margin-bottom: 16px;
        padding: 4px 0 2px;
        border-radius: 14px;
    }

    .capture-workflow-intro .workflow-page-header {
        margin-bottom: 1rem;
    }

    .capture-workflow-intro .workflow-page-guidance {
        font-size: 0.94rem;
        line-height: 1.45;
    }

    .capture-method-grid {
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
        gap: 10px;
    }

    .capture-method-card {
        min-height: 10.5rem;
        height: auto;
        padding: 16px 14px;
        border-radius: 12px;
    }

    .capture-intro-back .btn {
        width: 100%;
        max-width: 100%;
    }

    .capture-method-card .capture-icon {
        width: 24px;
        height: 24px;
        margin-bottom: 8px;
    }
}

@media (max-width: 639px) {
    .capture-mode-body .wizard-progress {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        margin-bottom: var(--workflow-progress-bottom-gap, 1.5rem);
    }
}

.capture-topbar-title {
    margin: 0.15rem 0 0;
    font-size: 1.05rem;
    line-height: 1.35;
}

.processing-log-list-page .processing-log-entry {
    margin-bottom: 0.65rem;
}

/* Costing Builder */
.cost-settings-form .costing-form-grid,
.cost-line-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
    gap: 0.85rem 1rem;
    margin-bottom: 1rem;
}

.cost-line-form-grid .cost-line-span-2 {
    grid-column: span 2;
}

@media (max-width: 640px) {
    .cost-line-form-grid .cost-line-span-2 {
        grid-column: span 1;
    }
}

.cost-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr));
    gap: 0.75rem;
}

.cost-summary-card {
    border: 1px solid #d9e2ee;
    border-radius: 6px;
    padding: 0.75rem 0.85rem;
    background: var(--survai-tint-fafbfc);
}

.cost-summary-card--essential {
    border-left: 4px solid #c0392b;
    background: var(--survai-tint-fdf5f4);
}

.cost-summary-card--improvement {
    border-left: 4px solid #2980b9;
    background: var(--survai-tint-f4f9fc);
}

.cost-summary-card--provisional {
    border-left: 4px solid #d68910;
    background: var(--survai-tint-fffbf4);
}

.cost-summary-card--communal {
    border-left: 4px solid #6c5ce7;
    background: var(--survai-tint-f7f6fd);
}

.cost-summary-card--contingency {
    border-left: 4px solid #1e3a5f;
    background: var(--survai-tint-f4f6f9);
}

.cost-summary-card--grand {
    border-left: 4px solid #0b1321;
    font-weight: 600;
}

.cost-summary-label {
    display: block;
    font-size: 0.78rem;
    color: var(--survai-ink-5c6b82);
    margin-bottom: 0.25rem;
}

.cost-summary-mid {
    font-size: 1.05rem;
}

.cost-summary-range {
    display: block;
    font-size: 0.8rem;
    color: var(--survai-ink-5c6b82);
    margin-top: 0.2rem;
}

.cost-inline-success {
    color: var(--survai-ink-1e6b3a);
}

.cost-badge {
    display: inline-block;
    padding: 0.12rem 0.45rem;
    border-radius: 4px;
    font-size: 0.72rem;
    margin-right: 0.35rem;
    font-weight: 600;
}

.cost-badge--essential {
    background: #fadbd8;
    color: var(--survai-ink-922b21);
}

.cost-badge--improvement {
    background: #d6eaf8;
    color: var(--survai-ink-1f618d);
}

.cost-badge--provisional {
    background: var(--survai-tint-fdebd0);
    color: var(--survai-ink-9a7b0a);
}

.cost-badge--communal {
    background: #e8daef;
    color: var(--survai-ink-512e5f);
}

.cost-badge--contingency {
    background: #d6dbdf;
    color: var(--survai-ink-1e3a5f);
}

.cost-ai-draft-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cost-ai-draft-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #edf1f5;
}

.costing-lines-stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.costing-line-card {
    border: 1px solid #d9e2ee;
    border-radius: 6px;
    padding: 1rem;
    background: var(--survai-card);
}

.cost-line-derived {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem 1rem;
    font-size: 0.85rem;
    color: var(--survai-ink-5c6b82);
}

.cost-source-pill {
    background: var(--survai-tint-eef1f5);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.75rem;
}

.cost-line-actions {
    grid-column: 1 / -1;
}

.cost-line-row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #edf1f5;
}

.cost-db-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-end;
}

/* --- Property lifecycle dashboard (report workspace) --- */
.lifecycle-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem 1.25rem;
    margin-bottom: 1rem;
}

.lifecycle-summary-value {
    margin: 0.25rem 0 0;
    font-size: 0.95rem;
}

.lifecycle-summary-stat {
    font-size: 1.35rem;
    font-weight: 700;
}

.lifecycle-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-subtle, #e5e7eb);
}

.lifecycle-cost-forecast {
    margin-top: 1rem;
}

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

.lifecycle-cost-head h2 {
    margin: 0.2rem 0 0.35rem;
    font-size: clamp(1.2rem, 1.8vw, 1.65rem);
}

.lifecycle-forecast-controls {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.45rem;
    border-radius: 999px;
    background: var(--surface-muted, #f8fafc);
}

.lifecycle-forecast-controls label {
    padding-left: 0.45rem;
    color: var(--text-muted, #64748b);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.lifecycle-forecast-controls select {
    min-height: 2.25rem;
    border: 0;
    border-radius: 999px;
    background: var(--survai-card);
    color: var(--text-main, #0f172a);
    font-weight: 800;
    padding: 0 0.8rem;
}

.lifecycle-cost-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.85rem;
    margin-bottom: 1rem;
}

.lifecycle-cost-summary div {
    min-width: 0;
    padding: 1rem;
    border: 1px solid var(--border-subtle, #e5e7eb);
    border-radius: 14px;
    background: linear-gradient(180deg, var(--survai-card), var(--survai-bg));
}

.lifecycle-cost-summary span {
    display: block;
    color: var(--text-muted, #64748b);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.lifecycle-cost-summary strong {
    display: block;
    margin-top: 0.28rem;
    color: var(--text-main, #0f172a);
    font-size: 1.25rem;
    line-height: 1.1;
}

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

.lifecycle-cost-chart {
    min-width: 0;
    padding: 1rem;
    border: 1px solid var(--border-subtle, #e5e7eb);
    border-radius: 18px;
    background: var(--survai-card);
}

.lifecycle-cost-chart--split {
    grid-column: 1 / -1;
}

.lifecycle-cost-chart-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.lifecycle-cost-chart-title h3,
.lifecycle-forecast-events h3 {
    margin: 0;
    font-size: 1rem;
}

.lifecycle-cost-chart-title span {
    color: var(--text-muted, #64748b);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.lifecycle-cost-svg {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
}

.lifecycle-cost-grid line,
.lifecycle-cost-axis {
    stroke: #e5e7eb;
    stroke-width: 1;
}

.lifecycle-cost-grid text,
.lifecycle-cost-xlabels text {
    fill: #64748b;
    font-size: 12px;
    font-weight: 700;
}

.lifecycle-cost-xlabels .x-label {
    text-anchor: middle;
}

.lifecycle-cost-line {
    fill: none;
    stroke: #0b1321;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.lifecycle-cost-bars rect {
    fill: #1b5af9;
    rx: 5;
}

.lifecycle-cost-donut-wrap {
    display: grid;
    grid-template-columns: minmax(160px, 240px) minmax(0, 1fr);
    gap: 1.25rem;
    align-items: center;
}

.lifecycle-cost-donut {
    width: min(220px, 100%);
    aspect-ratio: 1;
    border-radius: 50%;
    display: grid;
    place-items: center;
    position: relative;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.lifecycle-cost-donut::after {
    content: "";
    position: absolute;
    inset: 23%;
    border-radius: 50%;
    background: var(--survai-card);
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.08);
}

.lifecycle-cost-donut span {
    position: relative;
    z-index: 1;
    color: var(--text-main, #0f172a);
    font-size: 1.15rem;
    font-weight: 900;
}

.lifecycle-cost-legend {
    display: grid;
    gap: 0.55rem;
}

.lifecycle-cost-legend div {
    display: grid;
    grid-template-columns: 14px minmax(0, 1fr) auto;
    gap: 0.6rem;
    align-items: center;
    color: var(--text-main, #0f172a);
    font-weight: 750;
}

.lifecycle-cost-legend i {
    width: 14px;
    height: 14px;
    border-radius: 999px;
}

.lifecycle-cost-legend strong {
    font-weight: 900;
}

.lifecycle-forecast-events {
    margin-top: 1rem;
}

.lifecycle-forecast-event-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.lifecycle-forecast-event {
    padding: 0.85rem;
    border: 1px solid var(--border-subtle, #e5e7eb);
    border-radius: 14px;
    background: var(--surface-muted, #f8fafc);
}

.lifecycle-forecast-event span,
.lifecycle-forecast-event small {
    display: block;
    color: var(--text-muted, #64748b);
    font-size: 0.78rem;
    font-weight: 800;
}

.lifecycle-forecast-event strong,
.lifecycle-forecast-event em {
    display: block;
}

.lifecycle-forecast-event strong {
    margin-top: 0.2rem;
    color: var(--text-main, #0f172a);
}

.lifecycle-forecast-event em {
    margin: 0.25rem 0;
    color: var(--survai-navy-ink);
    font-style: normal;
    font-weight: 900;
}

.lifecycle-forecast-disclaimer {
    margin: 1rem 0 0;
    padding-top: 1rem;
    border-top: 1px solid var(--border-subtle, #e5e7eb);
    color: var(--text-muted, #64748b);
    font-size: 0.9rem;
    line-height: 1.55;
}

.lifecycle-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
    gap: 1.25rem;
    margin-top: 1rem;
}

@media (min-width: 768px) and (max-width: 1100px) {
    .lifecycle-card-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 900px) {
    .lifecycle-cost-head,
    .lifecycle-cost-donut-wrap {
        grid-template-columns: 1fr;
        display: grid;
    }

    .lifecycle-cost-summary,
    .lifecycle-cost-charts {
        grid-template-columns: 1fr;
    }

    .lifecycle-forecast-controls {
        align-items: stretch;
        border-radius: 18px;
        flex-wrap: wrap;
    }
}

.lifecycle-card {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.lifecycle-card-head {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.lifecycle-gauge-wrap {
    position: relative;
    flex: 0 0 120px;
    width: 120px;
}

.lifecycle-gauge-svg {
    display: block;
    width: 120px;
    height: auto;
}

.lifecycle-gauge-pct {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 0.9rem;
}

.lifecycle-card-titles h2 {
    font-size: 1.05rem;
    margin: 0 0 0.25rem;
}

.lifecycle-dl {
    margin: 0;
    display: grid;
    gap: 0.35rem 1rem;
    grid-template-columns: 1fr;
    font-size: 0.88rem;
}

.lifecycle-dl div {
    display: grid;
    grid-template-columns: minmax(120px, 40%) 1fr;
    gap: 0.5rem;
}

.lifecycle-dl dt {
    margin: 0;
    color: var(--text-muted, #64748b);
    font-weight: 500;
}

.lifecycle-dl dd {
    margin: 0;
}

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

.lifecycle-badge {
    display: inline-block;
    margin-left: 0.35rem;
    padding: 0.12rem 0.45rem;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.lifecycle-badge--suggested {
    background: var(--survai-tint-fef3c7);
    color: var(--survai-ink-92400e);
}

.lifecycle-badge--approved {
    background: var(--survai-tint-dcfce7);
    color: var(--survai-ink-166534);
}

.lifecycle-notes {
    margin: 0;
}

.lifecycle-update-panel {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-subtle, #e5e7eb);
}

.lifecycle-subhead {
    font-size: 0.95rem;
    margin: 0.75rem 0 0.5rem;
}

.lifecycle-mini-form {
    margin-bottom: 0.5rem;
}

.lifecycle-mini-form .span-2 {
    grid-column: 1 / -1;
}

@media (min-width: 560px) {
    .lifecycle-mini-form.form-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.lifecycle-history {
    margin-top: 0.5rem;
    font-size: 0.85rem;
}

.lifecycle-history-list {
    margin: 0.5rem 0 0;
    padding-left: 1.1rem;
}

.lifecycle-gauge--green .lifecycle-gauge-pct strong {
    color: var(--survai-ink-16a34a);
}

.lifecycle-gauge--amber .lifecycle-gauge-pct strong {
    color: var(--survai-ink-d97706);
}

.lifecycle-gauge--red .lifecycle-gauge-pct strong {
    color: var(--survai-ink-dc2626);
}

.lifecycle-gauge--grey .lifecycle-gauge-pct {
    color: var(--survai-muted-grey);
}

.lifecycle-disclaimer {
    margin-top: 1.25rem;
}

.lifecycle-disclaimer p {
    margin: 0;
    color: var(--text-muted, #64748b);
    font-size: 0.92rem;
    line-height: 1.55;
}

/* QC bulk approve modal (report builder) */

.qc-approve-all-dialog__title {
    font-size: 1.15rem;
    margin: 0 0 0.75rem;
}

.qc-approve-all-dialog__err {
    color: var(--survai-ink-b91c1c);
    margin: 0.75rem 0 0;
}

/* Desk study — correct survey address */
.desk-study-address-dialog {
    border: none;
    padding: 0;
    max-width: calc(100vw - 2rem);
    width: min(32rem, 100vw - 2rem);
    background: transparent;
}

.desk-study-address-dialog::backdrop {
    background: rgba(15, 23, 42, 0.45);
}

.desk-study-address-dialog__inner {
    margin: 0;
    padding: 1.25rem 1.35rem;
    max-height: calc(100vh - 2rem);
    overflow: auto;
}

.desk-study-address-dialog__title {
    font-size: 1.15rem;
    margin: 0 0 0.75rem;
}

.desk-study-address-dialog__warn {
    color: var(--survai-ink-b45309);
    font-weight: 600;
    margin: 0 0 1rem;
    line-height: 1.45;
}

.desk-study-address-dialog__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: flex-end;
    margin-top: 1rem;
}

.desk-study-address-dialog__actions--stack {
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
}

.desk-study-address-dialog__actions--stack .btn {
    width: 100%;
    justify-content: center;
}

.report-workspace-header__identity {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
    max-width: 100%;
}

.report-address-edit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    margin: 0;
    border: 1px solid rgba(15, 23, 42, 0.14);
    border-radius: 0.45rem;
    background: var(--survai-card);
    color: var(--survai-text-soft);
    cursor: pointer;
    flex-shrink: 0;
    vertical-align: middle;
}

.report-address-edit-btn:hover,
.report-address-edit-btn:focus-visible {
    border-color: rgba(15, 23, 42, 0.28);
    color: var(--survai-text-strong);
    background: var(--survai-bg);
}

.report-address-edit-btn svg {
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.overview-address-dialog .overview-address-editor {
    display: grid;
    gap: 0.85rem;
}

.overview-address-editor__field {
    display: grid;
    gap: 0.35rem;
}

.overview-address-editor__field span {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--survai-text-soft);
}

.overview-address-editor__actions--lookup {
    margin-top: -0.35rem;
}

.overview-address-editor__status.is-error {
    color: var(--survai-ink-b91c1c);
    font-weight: 600;
}

.overview-address-editor__overwrite {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.88rem;
    color: var(--survai-secondary-strong);
    line-height: 1.4;
}

.overview-address-editor__overwrite input {
    margin-top: 0.2rem;
}

/* KPI dashboard */
.main-panel.kpi-dashboard {
    display: flex;
    flex-direction: column;
    gap: clamp(1rem, 2.5vw, 1.5rem);
    width: 100%;
    max-width: none;
    min-width: 0;
    box-sizing: border-box;
}

.kpi-dashboard .page-header {
    margin-bottom: 0;
}

.kpi-dashboard .alert {
    margin: 0;
}

.kpi-dashboard .card {
    min-width: 0;
    box-sizing: border-box;
    padding: clamp(1rem, 2.5vw, 1.35rem) clamp(1rem, 3vw, 1.5rem);
}

.kpi-dashboard .kpi-header {
    flex-wrap: wrap;
    gap: 1rem;
    align-items: flex-start;
}

.kpi-header-actions {
    margin-left: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.kpi-export-form {
    display: inline-block;
    margin: 0;
}

.kpi-filters-card {
    margin-bottom: 0;
}

.kpi-filters {
    margin: 0;
}

.kpi-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
    gap: 1rem 1.25rem;
    margin-bottom: 1rem;
}

.kpi-filter-grid label span {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
    color: var(--survai-ink-374151);
}

.kpi-filter-grid select,
.kpi-filter-grid input[type="date"],
.kpi-filter-grid input[type="text"] {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    min-width: 0;
}

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

.kpi-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 10.5rem), 1fr));
    gap: clamp(0.85rem, 2vw, 1.25rem);
    margin-bottom: 0;
}

.kpi-metric-card {
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-soft, #e5e7eb);
    border-radius: 10px;
    padding: 1rem 1.15rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    min-width: 0;
    box-sizing: border-box;
}

.kpi-metric-card h3 {
    margin: 0 0 0.5rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--survai-muted-grey);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.kpi-metric-value {
    margin: 0;
    font-size: 1.65rem;
    font-weight: 700;
    color: var(--survai-text);
    font-variant-numeric: tabular-nums;
    line-height: 1.15;
    word-break: break-word;
}

.kpi-metric-hint {
    margin: 0.45rem 0 0;
    font-size: 0.8rem;
    color: var(--survai-muted-grey);
    line-height: 1.35;
}

.kpi-two-col {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: clamp(0.85rem, 2vw, 1.35rem);
    margin-bottom: 0;
    min-width: 0;
    align-items: start;
}

.kpi-panel {
    overflow-x: auto;
}

.kpi-panel h2 {
    margin: 0 0 0.65rem;
    font-size: 1.15rem;
    line-height: 1.25;
    padding-right: 0.25rem;
}

.kpi-panel > .form-note:first-of-type {
    margin: 0 0 1rem;
    line-height: 1.45;
}

.kpi-subhead {
    margin: 1rem 0 0.5rem;
    font-size: 0.95rem;
    line-height: 1.3;
}

.kpi-panel h2 + .kpi-subhead {
    margin-top: 0.25rem;
}

.kpi-bar-list {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.kpi-bar-row {
    display: grid;
    grid-template-columns: minmax(5rem, 1fr) 2fr auto;
    gap: 0.5rem 0.75rem;
    align-items: center;
    font-size: 0.92rem;
    padding: 0.15rem 0;
    min-width: 0;
}

.kpi-bar-label {
    color: var(--survai-ink-374151);
    word-break: break-word;
    hyphens: auto;
}

.kpi-bar-track {
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    min-width: 0;
}

.kpi-bar-fill {
    display: block;
    height: 100%;
    background: #1b5af9;
    border-radius: 4px;
}

.kpi-bar-count {
    font-weight: 600;
    color: var(--survai-text);
    text-align: right;
    min-width: 2.5rem;
    font-variant-numeric: tabular-nums;
}

.kpi-mini-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
    gap: 0.85rem 1.1rem;
}

.kpi-mini-metrics--wrap {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr));
}

.kpi-mini-metrics > div {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.75rem 0.95rem;
    background: var(--survai-tint-fafafa);
    min-width: 0;
    box-sizing: border-box;
}

.kpi-mini-metrics span {
    display: block;
    font-size: 0.8rem;
    color: var(--survai-muted-grey);
    line-height: 1.35;
}

.kpi-mini-metrics strong {
    display: block;
    margin-top: 0.35rem;
    font-size: 1.1rem;
    line-height: 1.25;
    font-variant-numeric: tabular-nums;
    word-break: break-word;
}

.kpi-mini-metrics em {
    display: block;
    font-size: 0.75rem;
    color: #9ca3af;
    font-style: normal;
    margin-top: 0.15rem;
}

.kpi-dashboard .table-wrap {
    margin-top: 0.75rem;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-wrap .kpi-table {
    width: 100%;
    min-width: 0;
}

.kpi-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
    min-width: 0;
}

.kpi-table th,
.kpi-table td {
    border-bottom: 1px solid #e5e7eb;
    padding: 0.55rem 0.75rem;
    text-align: left;
    vertical-align: top;
}

.kpi-table thead th {
    font-weight: 700;
    background: var(--survai-tint-f9fafb);
    color: var(--survai-ink-374151);
}

.kpi-table tbody tr:last-child th,
.kpi-table tbody tr:last-child td {
    border-bottom: none;
}

.kpi-table td:not(:first-child),
.kpi-table th:not(:first-child) {
    font-variant-numeric: tabular-nums;
}

.kpi-table th[scope="row"] {
    font-weight: 600;
    white-space: nowrap;
}

.kpi-table--wide {
    min-width: 36rem;
}

.kpi-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.kpi-list li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.75rem;
    padding: 0.45rem 0.15rem;
    border-bottom: 1px solid #f3f4f6;
    font-size: 0.9rem;
    min-width: 0;
}

.kpi-list li span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.kpi-list li strong {
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 768px) {
    .kpi-header-actions {
        margin-left: 0;
        width: 100%;
    }

    .kpi-export-form .btn {
        width: 100%;
    }

    .kpi-mini-metrics,
    .kpi-mini-metrics--wrap {
        grid-template-columns: 1fr;
    }

    .kpi-table--wide {
        min-width: 28rem;
    }
}

@media (max-width: 640px) {
    .kpi-bar-row {
        grid-template-columns: 1fr;
        gap: 0.35rem;
    }

    .kpi-bar-track {
        grid-column: 1 / -1;
    }

    .kpi-bar-count {
        text-align: left;
    }

    .kpi-dashboard .card {
        padding: 1rem 1rem;
    }

    .kpi-metric-value {
        font-size: 1.45rem;
    }
}

@media (max-width: 400px) {
    .kpi-card-grid {
        grid-template-columns: 1fr;
    }
}

/* Desk Study Output Controls (admin) */
.desk-output-controls-intro {
    max-width: 62rem;
}

.desk-output-section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.desk-output-section-toggle-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.65rem;
}

.desk-output-section-card--off .desk-output-fieldset,
.desk-output-section-card--off .desk-output-field-advanced {
    opacity: 0.58;
    pointer-events: none;
}

.desk-output-page fieldset.desk-output-fieldset {
    min-width: 0;
    border: 0;
    margin: 0;
    padding: 0;
}

.desk-output-select-all-row {
    margin: 0 0 0.85rem;
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 8px;
    background: var(--surface-muted, #f8fafc);
}

.desk-output-select-all {
    margin: 0;
    cursor: pointer;
}

.desk-output-mapping-select-all-label {
    display: flex;
    margin: 0 0 0.65rem;
    cursor: pointer;
    font-weight: 600;
}

.desk-output-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    cursor: pointer;
    user-select: none;
}

.desk-output-switch__text {
    font-size: 0.9rem;
    font-weight: 600;
}

.desk-output-switch__input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.desk-output-switch__slider {
    width: 2.5rem;
    height: 1.35rem;
    border-radius: 999px;
    background: var(--border, #cbd5e1);
    position: relative;
    transition: background 0.15s ease;
    flex-shrink: 0;
}

.desk-output-switch__slider::after {
    content: '';
    position: absolute;
    width: 1.05rem;
    height: 1.05rem;
    border-radius: 50%;
    background: var(--survai-card);
    top: 0.15rem;
    left: 0.15rem;
    transition: transform 0.15s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.desk-output-switch__input:checked + .desk-output-switch__slider {
    background: var(--accent, #1b5af9);
}

.desk-output-switch__input:checked + .desk-output-switch__slider::after {
    transform: translateX(1.1rem);
}

.desk-output-switch__input:focus-visible + .desk-output-switch__slider {
    outline: 2px solid var(--accent, #1b5af9);
    outline-offset: 2px;
}

/*
 * Global `input { width: 100%; min-height: 46px }` makes checkboxes enormous inside labels;
 * reset here and on .check-row for this admin page only.
 */
.desk-output-page .desk-output-field-check input[type='checkbox'],
.desk-output-page .check-row input[type='checkbox'] {
    width: 1.08rem;
    height: 1.08rem;
    min-height: 0;
    max-width: none;
    margin: 0;
    padding: 0;
    flex-shrink: 0;
    border-radius: 4px;
    border: 1px solid var(--line, #c8d8ec);
    background: var(--survai-card);
    box-shadow: none;
    appearance: auto;
    accent-color: var(--accent, #1b5af9);
    align-self: flex-start;
    margin-top: 0.12rem;
}

.desk-output-page .desk-output-field-check input[type='hidden'] {
    display: none;
}

.desk-output-field-list {
    list-style: none;
    margin: 0 0 1rem;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 8px;
    overflow: hidden;
    background: var(--survai-card);
}

.desk-output-field-list__item {
    margin: 0;
    padding: 0.5rem 0.75rem;
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(8.5rem, 32%);
    gap: 0.5rem 1rem;
    align-items: start;
    border-bottom: 1px solid var(--border, #e5e7eb);
    background: var(--survai-card);
    border-radius: 0;
}

.desk-output-field-list__item:last-child {
    border-bottom: none;
}

.desk-output-field-check {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-weight: 500;
    cursor: pointer;
    margin: 0;
    min-width: 0;
}

.desk-output-field-check span {
    min-width: 0;
    overflow-wrap: anywhere;
    line-height: 1.35;
    font-weight: 600;
    color: var(--ink, #0f172a);
}

.desk-output-field-key {
    display: block;
    margin: 0;
    padding: 0.05rem 0 0;
    font-size: 0.72rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
    color: var(--muted, #64748b);
    text-align: right;
    overflow-wrap: anywhere;
    word-break: break-word;
}

@media (max-width: 720px) {
    .desk-output-field-list__item {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }

    .desk-output-field-key {
        text-align: left;
        padding-top: 0;
    }
}

/* Survai Cam final override: keep the live action rail clean after all shared mobile rules. */

/* Survai Cam: scoped live camera layout refinements. */
@media (max-width: 920px) {
    .capture-preview {
        isolation: isolate;
    }

    .capture-screen .capture-preview-video.live-camera-preview,
    .capture-screen .capture-preview-video {
        z-index: 1;
    }

    .capture-preview-shade {
        z-index: 2;
    }

    .capture-preview-touch-layer {
        bottom: 0;
        z-index: 3;
    }

    .capture-training-reticle {
        z-index: 4;
        width: 68px;
        height: 68px;
        pointer-events: auto;
        cursor: grab;
        touch-action: none;
        -webkit-user-select: none;
        user-select: none;
    }

    .capture-training-reticle.is-dragging {
        cursor: grabbing;
    }

    .capture-training-reticle-ring {
        border-width: 1.5px;
        border-color: rgba(255, 214, 10, 0.9);
        background: rgba(0, 0, 0, 0.03);
    }

    .capture-training-reticle-cross::before {
        left: 24%;
        width: 52%;
        height: 1.5px;
    }

    .capture-training-reticle-cross::after {
        top: 24%;
        width: 1.5px;
        height: 52%;
    }

    .capture-training-hint {
        z-index: 5;
        pointer-events: auto;
        cursor: grab;
        touch-action: none;
        -webkit-user-select: none;
        user-select: none;
    }

    .capture-training-hint.is-dragging {
        cursor: grabbing;
    }

    .capture-training-hint.is-positioned {
        right: auto !important;
        bottom: auto !important;
        margin: 0;
    }

    .capture-training-reset {
        justify-self: center;
        min-height: 30px;
        margin-top: 4px;
        border: 1px solid rgba(255, 255, 255, 0.28);
        border-radius: 999px;
        padding: 0 12px;
        color: #ffffff;
        background: rgba(255, 255, 255, 0.1);
        font-size: 0.72rem;
        font-weight: 850;
    }

    .capture-overlay-top,
    .capture-top-camera-tools,
    .capture-zoom-control,
    .capture-control-tray,
    .capture-tabbar,
    .capture-tabbar-handle {
        z-index: 6;
    }

    .capture-header {
        z-index: 8;
    }

    .capture-live-sync-message {
        z-index: 9;
    }

    .capture-record-toggle {
        position: relative;
        overflow: visible;
    }

    .capture-record-toggle.is-recording .capture-record-icon,
    .capture-record-toggle.btn-record--active.is-recording .capture-record-icon {
        display: none !important;
    }

    .capture-record-toggle.is-recording .capture-record-icon::before,
    .capture-record-toggle.btn-record--active.is-recording .capture-record-icon::before {
        content: none !important;
        display: none !important;
        background: transparent !important;
    }

    .capture-record-toggle.is-recording::after,
    .capture-record-toggle.btn-record--active.is-recording::after {
        position: absolute;
        inset: -8px;
        border: 2px solid rgba(255, 59, 48, 0.42);
        border-radius: 999px;
        content: "";
        opacity: 0.75;
        animation: survai-record-pulse 1.35s ease-out infinite;
        pointer-events: none;
    }
}

@keyframes survai-record-pulse {
    0% {
        opacity: 0.72;
        transform: scale(0.92);
    }
    100% {
        opacity: 0;
        transform: scale(1.18);
    }
}

@media (max-width: 920px) and (orientation: landscape) {
    .capture-screen {
        --capture-tabbar-h: calc(48px + env(safe-area-inset-bottom));
    }

    .capture-header {
        position: absolute;
        top: 0;
        right: 0;
        left: 0;
        height: calc(54px + env(safe-area-inset-top));
        min-height: calc(54px + env(safe-area-inset-top));
        grid-template-columns: minmax(74px, 124px) minmax(0, 1fr) minmax(130px, auto) !important;
        padding: calc(7px + env(safe-area-inset-top)) calc(24px + env(safe-area-inset-right)) 7px calc(24px + env(safe-area-inset-left));
        pointer-events: auto;
    }

    .capture-header h2 {
        font-size: clamp(0.98rem, 3vw, 1.24rem);
    }

    .capture-header-actions {
        gap: 8px;
    }

    .capture-header-actions .capture-training-toggle {
        height: 38px;
        min-height: 38px;
        padding: 0 14px;
        font-size: 0.82rem;
    }

    .capture-header-actions .capture-refresh-button {
        width: 42px;
        min-width: 42px;
        height: 42px;
        min-height: 42px;
    }

    .capture-preview {
        position: absolute;
        inset: 0;
    }

    .capture-live-sync-message {
        top: calc(60px + env(safe-area-inset-top));
        right: calc(118px + env(safe-area-inset-right));
        left: calc(118px + env(safe-area-inset-left));
        padding: 8px 12px;
        border-radius: 14px;
        font-size: 0.76rem;
    }

    .capture-overlay-top {
        top: calc(68px + env(safe-area-inset-top));
        right: auto;
        left: calc(16px + env(safe-area-inset-left));
        display: flex;
        width: 88px;
        max-width: 88px;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        pointer-events: none;
    }

    .capture-recording-badge,
    .capture-audio-pill,
    .capture-photo-count {
        width: 88px;
        min-width: 88px;
        min-height: 48px;
        box-sizing: border-box;
        justify-content: center;
        overflow: hidden;
        border-radius: 16px;
        padding: 6px;
    }

    .capture-recording-badge,
    .capture-photo-count {
        flex-direction: column;
        gap: 3px;
        text-align: center;
    }

    .capture-recording-badge strong {
        display: none;
    }

    .capture-recording-badge .recording-dot {
        margin: 0;
    }

    .capture-audio-pill {
        min-height: 62px;
        flex-direction: column;
        gap: 5px;
    }

    .capture-audio-meter {
        width: 58px;
        max-width: 58px;
        height: 22px;
        justify-content: center;
        overflow: hidden;
        transform: none;
    }

    .capture-audio-meter i {
        width: 3px;
        height: 18px;
        flex: 0 0 3px;
    }

    .capture-photo-count .capture-image-icon {
        margin: 0 auto;
    }

    .capture-photo-count span {
        font-size: 0.56rem;
    }

    .capture-top-camera-tools {
        position: fixed;
        top: calc(70px + env(safe-area-inset-top));
        right: calc(20px + env(safe-area-inset-right));
        left: auto;
        display: block;
        max-width: none;
        height: calc(100dvh - 148px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
        pointer-events: none;
    }

    .capture-top-camera-tools[hidden] {
        display: none !important;
    }

    .capture-top-camera-tools .capture-flip-button,
    .capture-top-camera-tools .capture-torch-cluster {
        position: absolute !important;
        right: 0 !important;
        left: auto !important;
        pointer-events: auto;
    }

    .capture-top-camera-tools .capture-flip-button {
        top: 0 !important;
    }

    .capture-top-camera-tools .capture-torch-cluster {
        bottom: 0 !important;
    }

    .capture-top-camera-tools .capture-torch-auto-chip {
        display: none;
    }

    .capture-control-tray {
        position: fixed;
        top: calc(142px + env(safe-area-inset-top));
        right: calc(18px + env(safe-area-inset-right));
        bottom: calc(var(--capture-tabbar-h) + 74px);
        left: auto;
        display: flex;
        height: auto;
        max-height: none;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 10px;
        overflow: visible;
        padding: 0;
        background: transparent;
        box-shadow: none;
        backdrop-filter: none;
        pointer-events: none;
    }

    .capture-control-tray .live-capture-mode-row {
        position: fixed;
        top: 50%;
        right: calc(100px + env(safe-area-inset-right));
        display: flex;
        width: 82px;
        flex-direction: column;
        gap: 7px;
        margin: 0;
        transform: translateY(-50%);
        pointer-events: auto;
    }

    .capture-control-tray .live-capture-mode-btn {
        width: 82px;
        max-width: none;
        min-height: 42px;
        padding: 4px 7px;
        font-size: 0.66rem;
        line-height: 1.05;
    }

    .capture-recorder-controls {
        display: flex;
        min-height: 0;
        align-items: center;
        justify-content: center;
        overflow: visible;
        pointer-events: auto;
    }

    .capture-pause-recording-button {
        display: none !important;
    }

    .capture-toolbar-button,
    .capture-photo-button,
    .capture-record-toggle,
    .capture-control-tray.is-video-mode .capture-video-record-button {
        width: 60px !important;
        height: 60px !important;
        min-width: 60px !important;
        min-height: 60px !important;
        padding: 0 !important;
    }

    .capture-record-toggle {
        order: 1;
    }

    .capture-photo-button:not(.capture-video-record-button) {
        order: 2;
    }

    .capture-video-record-button {
        order: 3;
        font-size: 0.58rem !important;
    }

    .capture-zoom-control {
        top: 50%;
        right: calc(192px + env(safe-area-inset-right));
        padding: 4px;
        transform: translateY(-50%);
    }

    .capture-zoom-control button {
        min-width: 38px;
        min-height: 38px;
        font-size: 0.78rem;
    }

    .capture-gallery {
        position: fixed;
        right: calc(120px + env(safe-area-inset-right));
        bottom: calc(var(--capture-tabbar-h) + 8px);
        left: calc(16px + env(safe-area-inset-left));
        min-height: 46px;
        padding: 0;
    }

    .capture-gallery figure {
        width: 58px;
        height: 44px;
        flex-basis: 58px;
    }

    .capture-tabbar {
        bottom: -5px;
        width: min(430px, calc(100vw - 220px));
        min-height: var(--capture-tabbar-h);
        padding-top: 3px;
        padding-bottom: calc(3px + env(safe-area-inset-bottom));
    }

    .capture-tabbar button {
        min-height: 42px;
    }

    .capture-tabbar-handle {
        bottom: calc(var(--capture-tabbar-h) + 7px);
    }

    .capture-training-hint:not(.is-positioned) {
        top: calc(76px + env(safe-area-inset-top));
        right: auto;
        bottom: auto;
        left: 50%;
        width: min(360px, 44vw);
        max-width: min(360px, 44vw);
        padding: 8px 10px;
        transform: translateX(-50%);
    }

    .capture-training-hint strong {
        font-size: 0.9rem;
    }

    .capture-training-hint span {
        display: block;
        font-size: 0.7rem;
    }

    .capture-training-reset {
        min-height: 26px;
        font-size: 0.64rem;
    }

    audio[data-live-audio-preview]:not([hidden]) {
        bottom: calc(var(--capture-tabbar-h) + 24px);
        width: min(360px, calc(100vw - 250px));
        max-width: calc(100vw - 250px);
    }
}

@media (max-width: 920px) and (orientation: landscape) and (max-height: 390px) {
    .capture-header {
        height: calc(48px + env(safe-area-inset-top));
        min-height: calc(48px + env(safe-area-inset-top));
        padding-top: calc(5px + env(safe-area-inset-top));
        padding-bottom: 5px;
    }

    .capture-header h2 {
        font-size: 0.98rem;
    }

    .capture-header-actions .capture-training-toggle {
        height: 34px;
        min-height: 34px;
        padding: 0 10px;
        font-size: 0.72rem;
    }

    .capture-header-actions .capture-refresh-button {
        width: 38px;
        min-width: 38px;
        height: 38px;
        min-height: 38px;
    }

    .capture-live-sync-message {
        top: calc(52px + env(safe-area-inset-top));
        right: calc(104px + env(safe-area-inset-right));
        left: calc(104px + env(safe-area-inset-left));
        padding: 7px 10px;
    }

    .capture-overlay-top {
        top: calc(56px + env(safe-area-inset-top));
        width: 78px;
        max-width: 78px;
        gap: 6px;
    }

    .capture-recording-badge,
    .capture-audio-pill,
    .capture-photo-count {
        width: 78px;
        min-width: 78px;
        min-height: 42px;
    }

    .capture-audio-pill {
        min-height: 50px;
    }

    .capture-audio-meter {
        width: 50px;
    }

    .capture-top-camera-tools {
        top: calc(58px + env(safe-area-inset-top));
        height: calc(100dvh - 124px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    }

    .capture-control-tray {
        top: calc(116px + env(safe-area-inset-top));
        bottom: calc(var(--capture-tabbar-h) + 58px);
    }

    .capture-toolbar-button,
    .capture-photo-button,
    .capture-record-toggle,
    .capture-control-tray.is-video-mode .capture-video-record-button {
        width: 54px !important;
        height: 54px !important;
        min-width: 54px !important;
        min-height: 54px !important;
    }

    .capture-control-tray .live-capture-mode-row {
        right: calc(88px + env(safe-area-inset-right));
        width: 72px;
    }

    .capture-control-tray .live-capture-mode-btn {
        width: 72px;
        min-height: 36px;
        font-size: 0.6rem;
    }

    .capture-zoom-control {
        right: calc(170px + env(safe-area-inset-right));
    }

    .capture-gallery {
        right: calc(106px + env(safe-area-inset-right));
    }

    .capture-training-hint:not(.is-positioned) {
        top: calc(58px + env(safe-area-inset-top));
        width: min(330px, 42vw);
        max-width: min(330px, 42vw);
        padding: 7px 9px;
    }

    .capture-training-hint span {
        display: none;
    }
}

/* Survai Cam final override: keep the live action rail clean after all shared mobile rules. */
@media (max-width: 920px) {
    .capture-pause-recording-button,
    .capture-video-record-button,
    .capture-control-tray.is-video-mode .capture-video-record-button {
        display: none !important;
    }

    .capture-control-tray.is-video-mode .capture-record-toggle {
        position: relative;
        left: auto;
        transform: none;
    }

    .capture-control-tray.is-video-mode .capture-photo-button:not(.capture-video-record-button) {
        display: grid !important;
        margin-left: 0;
    }

    .capture-recorder-controls {
        grid-template-columns: repeat(2, 68px);
        justify-content: center;
        justify-items: center;
    }
}

@media (max-width: 920px) and (orientation: landscape) {
    .capture-top-camera-tools {
        right: calc(18px + env(safe-area-inset-right));
        width: 70px;
    }

    .capture-top-camera-tools .capture-torch-cluster {
        width: 70px;
    }

    .capture-control-tray {
        right: calc(18px + env(safe-area-inset-right));
        width: 70px;
        min-width: 70px;
    }

    .capture-recorder-controls {
        width: 70px;
        grid-template-columns: 1fr;
        flex-direction: column;
        gap: 11px;
    }

    .capture-record-toggle,
    .capture-photo-button:not(.capture-video-record-button),
    .capture-toolbar-button {
        width: 60px !important;
        height: 60px !important;
        min-width: 60px !important;
        min-height: 60px !important;
    }

    .capture-record-toggle .capture-record-icon,
    .capture-photo-button .capture-photo-icon,
    .capture-toolbar-button > span {
        transform: rotate(90deg);
        transform-origin: center;
    }
}

@media (max-width: 920px) and (orientation: landscape) and (max-height: 390px) {
    .capture-top-camera-tools,
    .capture-top-camera-tools .capture-torch-cluster,
    .capture-control-tray,
    .capture-recorder-controls {
        width: 64px;
        min-width: 64px;
    }

    .capture-record-toggle,
    .capture-photo-button:not(.capture-video-record-button),
    .capture-toolbar-button {
        width: 54px !important;
        height: 54px !important;
        min-width: 54px !important;
        min-height: 54px !important;
    }
}
/* Live Survey Capture final authoritative control positions. This block intentionally follows all older camera overrides. */
@media (max-width: 920px) {
    .capture-screen.is-main-camera .capture-top-camera-tools {
        top: calc(64px + env(safe-area-inset-top)) !important;
        left: calc(12px + env(safe-area-inset-left)) !important;
        min-width: 0 !important;
        height: auto !important;
    }

    .capture-screen.is-main-camera .capture-refresh-button,
    .capture-screen.is-main-camera .capture-flash-button {
        position: relative !important;
        inset: auto !important;
        display: grid !important;
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
        min-height: 44px !important;
        place-items: center !important;
        border: 1px solid rgba(255, 255, 255, 0.32) !important;
        border-radius: 999px !important;
        padding: 0 !important;
        color: #ffffff !important;
        background: rgba(0, 0, 0, 0.34) !important;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22) !important;
        pointer-events: auto;
    }

    .capture-screen.is-main-camera .capture-refresh-button svg,
    .capture-screen.is-main-camera .capture-flash-button span {
        width: 18px !important;
        height: 18px !important;
    }

    .capture-screen.is-main-camera .capture-torch-cluster {
        inset: auto !important;
    }

    .capture-screen.is-main-camera .capture-torch-auto-chip,
    .capture-screen.is-main-camera .capture-flip-button,
    .capture-screen.is-main-camera .live-capture-mode-row,
    .capture-screen.is-main-camera audio[data-live-audio-preview] {
        display: none !important;
    }

    .capture-screen.is-main-camera .capture-overlay-top {
        top: calc(64px + env(safe-area-inset-top)) !important;
        right: calc(12px + env(safe-area-inset-right)) !important;
        display: block !important;
    }

    .capture-screen.is-main-camera .capture-recording-badge {
        width: auto !important;
        min-height: 38px !important;
    }

    .capture-screen.is-main-camera .capture-recording-badge .recording-dot:not(.is-recording) {
        opacity: 0.45;
        background: rgba(255, 255, 255, 0.75);
    }

    .capture-screen.is-main-camera .capture-control-tray {
        bottom: calc(76px + env(safe-area-inset-bottom)) !important;
        backdrop-filter: none !important;
    }

    .capture-screen.is-main-camera .capture-photo-button:not(.capture-video-record-button) {
        border-width: 4px !important;
    }

    .capture-screen.is-main-camera .capture-tabbar-handle {
        right: calc(14px + env(safe-area-inset-right)) !important;
        bottom: calc(74px + env(safe-area-inset-bottom)) !important;
    }
}

@media (max-width: 920px) and (orientation: landscape) {
    .capture-screen.is-main-camera .capture-top-camera-tools {
        top: calc(62px + env(safe-area-inset-top)) !important;
        left: calc(14px + env(safe-area-inset-left)) !important;
        width: auto !important;
        height: auto !important;
        flex-direction: row !important;
    }

    .capture-screen.is-main-camera .capture-overlay-top {
        top: calc(62px + env(safe-area-inset-top)) !important;
        right: auto !important;
        left: calc(14px + env(safe-area-inset-left)) !important;
    }

    .capture-screen.is-main-camera .capture-control-tray {
        right: calc(18px + env(safe-area-inset-right)) !important;
    }

    .capture-screen.is-main-camera .capture-photo-button .capture-photo-icon {
        transform: rotate(-45deg) !important;
        transform-origin: center !important;
    }

    .capture-screen.is-main-camera .capture-record-toggle .capture-record-icon,
    .capture-screen.is-main-camera .capture-toolbar-button > span {
        transform: none !important;
    }

    .capture-screen.is-main-camera .capture-tabbar-handle {
        right: auto !important;
        left: calc(14px + env(safe-area-inset-left)) !important;
        bottom: calc(64px + env(safe-area-inset-bottom)) !important;
    }
}

/* Live Survey Capture request override. This block must remain at physical EOF. */
@media (max-width: 920px) {
    .capture-screen.is-main-camera .capture-control-tray {
        bottom: calc(24px + env(safe-area-inset-bottom)) !important;
        height: auto !important;
        place-items: center !important;
    }

    .capture-screen.is-main-camera .capture-recorder-controls {
        width: auto !important;
    }

    .capture-screen.is-main-camera .capture-record-toggle,
    .capture-screen.is-main-camera .capture-photo-button:not(.capture-video-record-button),
    .capture-screen.is-main-camera .capture-record-toggle.btn-record--idle,
    .capture-screen.is-main-camera .capture-record-toggle.btn-record--active {
        position: relative !important;
        inset: auto !important;
        display: grid !important;
        width: 96px !important;
        height: 96px !important;
        min-width: 96px !important;
        min-height: 96px !important;
        max-width: 96px !important;
        max-height: 96px !important;
        margin: 0 !important;
        padding: 0 !important;
        place-items: center !important;
        transform: none !important;
        pointer-events: auto !important;
    }

    .capture-screen.is-main-camera .capture-tabbar-handle {
        right: calc(14px + env(safe-area-inset-right)) !important;
        bottom: calc(14px + env(safe-area-inset-bottom)) !important;
        left: auto !important;
        transform: none !important;
        z-index: 74 !important;
    }

    .capture-screen.is-main-camera.is-live-toolbar-collapsed .capture-tabbar button {
        display: none !important;
        visibility: hidden !important;
    }
}

@media (max-width: 920px) and (orientation: landscape) {
    .capture-screen.is-main-camera .capture-control-tray {
        right: calc(6px + env(safe-area-inset-right)) !important;
    }

    .capture-screen.is-main-camera .capture-record-toggle,
    .capture-screen.is-main-camera .capture-photo-button:not(.capture-video-record-button),
    .capture-screen.is-main-camera .capture-record-toggle.btn-record--idle,
    .capture-screen.is-main-camera .capture-record-toggle.btn-record--active {
        width: 90px !important;
        height: 90px !important;
        min-width: 90px !important;
        min-height: 90px !important;
        max-width: 90px !important;
        max-height: 90px !important;
    }

    .capture-screen.is-main-camera .capture-photo-button:not(.capture-video-record-button) {
        order: 1 !important;
    }

    .capture-screen.is-main-camera .capture-record-toggle {
        order: 2 !important;
    }

    .capture-screen.is-main-camera .capture-tabbar-handle,
    .capture-screen.is-main-camera.is-live-toolbar-collapsed .capture-tabbar-handle {
        bottom: calc(14px + env(safe-area-inset-bottom)) !important;
        left: calc(14px + env(safe-area-inset-left)) !important;
    }
}

@media (max-width: 920px) and (orientation: landscape) and (max-height: 390px) {

    .capture-screen.is-main-camera .capture-record-toggle,
    .capture-screen.is-main-camera .capture-photo-button:not(.capture-video-record-button),
    .capture-screen.is-main-camera .capture-record-toggle.btn-record--idle,
    .capture-screen.is-main-camera .capture-record-toggle.btn-record--active {
        width: 78px !important;
        height: 78px !important;
        min-width: 78px !important;
        min-height: 78px !important;
        max-width: 78px !important;
        max-height: 78px !important;
    }
}

/* Survai Main Capture Camera - mobile operational camera layer. Keep at EOF. */
@media (max-width: 920px) {
    .capture-screen.is-main-camera {
        --camera-safe-top: env(safe-area-inset-top, 0px);
        --camera-safe-right: env(safe-area-inset-right, 0px);
        --camera-safe-bottom: env(safe-area-inset-bottom, 0px);
        --camera-safe-left: env(safe-area-inset-left, 0px);
        --camera-lime: #c8f34a;
        --camera-red: #ff3b30;
        --camera-glass: rgba(7, 12, 22, 0.58);
        overflow: hidden !important;
        background: #000 !important;
    }

    .capture-screen.is-main-camera .capture-header,
    .capture-screen.is-main-camera .capture-tag-bar,
    .capture-screen.is-main-camera .capture-training-toggle,
    .capture-screen.is-main-camera .capture-training-reticle,
    .capture-screen.is-main-camera .capture-training-tap-chip,
    .capture-screen.is-main-camera .capture-training-hint,
    .capture-screen.is-main-camera .capture-audio-pill,
    .capture-screen.is-main-camera .capture-photo-count,
    .capture-screen.is-main-camera audio[data-live-audio-preview] {
        display: none !important;
    }

    .capture-screen.is-main-camera .capture-preview {
        position: fixed !important;
        inset: 0 !important;
        width: 100vw !important;
        height: 100dvh !important;
        min-height: 100dvh !important;
        overflow: hidden !important;
        border-radius: 0 !important;
        background: #000 !important;
    }

    .capture-screen.is-main-camera .capture-preview-video {
        position: absolute !important;
        inset: 0 !important;
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        transform-origin: center !important;
    }

    .capture-screen.is-main-camera .capture-preview-shade {
        position: absolute !important;
        inset: 0 !important;
        pointer-events: none !important;
        background:
            linear-gradient(180deg, rgba(0, 0, 0, 0.62), rgba(0, 0, 0, 0.08) 22%, rgba(0, 0, 0, 0.08) 62%, rgba(0, 0, 0, 0.78)) !important;
    }

    .capture-screen.is-main-camera .survai-camera-tech-pill,
    .capture-screen.is-main-camera .capture-top-camera-tools,
    .capture-screen.is-main-camera .survai-camera-settings-panel,
    .capture-screen.is-main-camera .survai-camera-flash-panel,
    .capture-screen.is-main-camera .capture-overlay-top,
    .capture-screen.is-main-camera .capture-zoom-control,
    .capture-screen.is-main-camera .capture-control-tray,
    .capture-screen.is-main-camera .capture-tabbar-handle {
        z-index: 90 !important;
    }

    .capture-screen.is-main-camera .survai-camera-tech-pill {
        position: fixed !important;
        top: calc(14px + var(--camera-safe-top)) !important;
        left: calc(14px + var(--camera-safe-left)) !important;
        display: inline-flex !important;
        align-items: center !important;
        gap: 6px !important;
        height: 34px !important;
        padding: 0 10px !important;
        border: 1px solid rgba(255, 255, 255, 0.18) !important;
        border-radius: 999px !important;
        color: #fff !important;
        background: var(--camera-glass) !important;
        font-size: 0.72rem !important;
        font-weight: 800 !important;
        letter-spacing: 0 !important;
        line-height: 1 !important;
        backdrop-filter: blur(16px) saturate(130%) !important;
        box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22) !important;
    }

    .capture-screen.is-main-camera .survai-camera-tech-pill[hidden] {
        display: none !important;
    }

    .capture-screen.is-main-camera .survai-camera-tech-pill span + span {
        padding-left: 7px !important;
        border-left: 1px solid rgba(255, 255, 255, 0.18) !important;
    }

    .capture-screen.is-main-camera .capture-top-camera-tools {
        position: fixed !important;
        top: calc(12px + var(--camera-safe-top)) !important;
        right: calc(12px + var(--camera-safe-right)) !important;
        bottom: auto !important;
        left: auto !important;
        display: inline-flex !important;
        width: auto !important;
        max-width: calc(100vw - 28px) !important;
        align-items: center !important;
        justify-content: flex-end !important;
        gap: 8px !important;
        pointer-events: none !important;
    }

    .capture-screen.is-main-camera .capture-top-camera-tools[hidden] {
        display: none !important;
    }

    .capture-screen.is-main-camera .capture-torch-cluster {
        position: relative !important;
        display: inline-grid !important;
        width: 42px !important;
        min-width: 42px !important;
        pointer-events: auto !important;
    }

    .capture-screen.is-main-camera .capture-refresh-button,
    .capture-screen.is-main-camera .capture-flash-button,
    .capture-screen.is-main-camera .survai-camera-settings-button {
        position: relative !important;
        inset: auto !important;
        display: grid !important;
        width: 42px !important;
        height: 42px !important;
        min-width: 42px !important;
        min-height: 42px !important;
        place-items: center !important;
        border: 1px solid rgba(255, 255, 255, 0.18) !important;
        border-radius: 999px !important;
        padding: 0 !important;
        color: #fff !important;
        background: var(--camera-glass) !important;
        box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22) !important;
        backdrop-filter: blur(16px) saturate(130%) !important;
        pointer-events: auto !important;
    }

    .capture-screen.is-main-camera .capture-refresh-button svg,
    .capture-screen.is-main-camera .capture-flash-button svg,
    .capture-screen.is-main-camera .survai-camera-settings-button svg,
    .capture-screen.is-main-camera .capture-pause-recording-button svg,
    .capture-screen.is-main-camera .capture-flip-button svg,
    .capture-screen.is-main-camera .capture-thumbnail-button svg {
        width: 19px !important;
        height: 19px !important;
        fill: none !important;
        stroke: currentColor !important;
        stroke-width: 2 !important;
        stroke-linecap: round !important;
        stroke-linejoin: round !important;
    }

    .capture-screen.is-main-camera .capture-flash-button.active {
        color: var(--camera-lime) !important;
    }

    .capture-screen.is-main-camera .survai-camera-settings-panel,
    .capture-screen.is-main-camera .survai-camera-flash-panel {
        position: fixed !important;
        top: calc(62px + var(--camera-safe-top)) !important;
        right: calc(12px + var(--camera-safe-right)) !important;
        left: auto !important;
        display: grid !important;
        gap: 8px !important;
        width: min(310px, calc(100vw - 24px)) !important;
        padding: 10px !important;
        border: 1px solid rgba(255, 255, 255, 0.14) !important;
        border-radius: 20px !important;
        color: #fff !important;
        background: rgba(8, 12, 22, 0.78) !important;
        box-shadow: 0 18px 44px rgba(0, 0, 0, 0.34) !important;
        backdrop-filter: blur(20px) saturate(140%) !important;
        pointer-events: auto !important;
    }

    .capture-screen.is-main-camera .survai-camera-flash-panel {
        right: calc(58px + var(--camera-safe-right)) !important;
        width: auto !important;
        grid-template-columns: repeat(3, minmax(54px, auto)) !important;
        border-radius: 999px !important;
    }

    .capture-screen.is-main-camera .survai-camera-settings-panel[hidden],
    .capture-screen.is-main-camera .survai-camera-flash-panel[hidden] {
        display: none !important;
    }

    .capture-screen.is-main-camera .survai-camera-settings-panel > div {
        display: grid !important;
        grid-template-columns: minmax(86px, 1fr) repeat(3, auto) !important;
        align-items: center !important;
        gap: 6px !important;
    }

    .capture-screen.is-main-camera .survai-camera-settings-panel > div:first-child {
        grid-template-columns: minmax(86px, 1fr) repeat(2, auto) !important;
    }

    .capture-screen.is-main-camera .survai-camera-settings-panel span {
        color: rgba(255, 255, 255, 0.7) !important;
        font-size: 0.68rem !important;
        font-weight: 800 !important;
        letter-spacing: 0 !important;
    }

    .capture-screen.is-main-camera .survai-camera-settings-panel button,
    .capture-screen.is-main-camera .survai-camera-flash-panel button {
        min-width: 44px !important;
        height: 34px !important;
        border: 0 !important;
        border-radius: 999px !important;
        padding: 0 10px !important;
        color: rgba(255, 255, 255, 0.86) !important;
        background: transparent !important;
        font-size: 0.78rem !important;
        font-weight: 800 !important;
    }

    .capture-screen.is-main-camera .survai-camera-settings-panel button.active,
    .capture-screen.is-main-camera .survai-camera-flash-panel button.active {
        color: #0b1321 !important;
        background: var(--camera-lime) !important;
    }

    .capture-screen.is-main-camera .capture-overlay-top {
        position: fixed !important;
        top: calc(12px + var(--camera-safe-top)) !important;
        right: auto !important;
        left: 50% !important;
        width: auto !important;
        max-width: none !important;
        transform: translateX(-50%) !important;
        pointer-events: none !important;
    }

    .capture-screen.is-main-camera:not(.is-live-recording) .capture-recording-badge {
        visibility: hidden !important;
        opacity: 0 !important;
        transform: translateY(-8px) !important;
    }

    .capture-screen.is-main-camera .capture-recording-badge {
        display: inline-flex !important;
        min-width: 104px !important;
        height: 36px !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 7px !important;
        border: 0 !important;
        border-radius: 999px !important;
        padding: 0 12px !important;
        color: #fff !important;
        background: rgba(225, 37, 31, 0.96) !important;
        box-shadow: 0 14px 34px rgba(0, 0, 0, 0.32) !important;
        transition: opacity 0.18s ease, transform 0.18s ease !important;
    }

    .capture-screen.is-main-camera .capture-recording-badge > div {
        display: contents !important;
    }

    .capture-screen.is-main-camera .capture-recording-badge strong,
    .capture-screen.is-main-camera .capture-recording-badge em {
        display: none !important;
    }

    .capture-screen.is-main-camera .capture-recording-badge span:not(.recording-dot) {
        color: #fff !important;
        font-size: 0.86rem !important;
        font-weight: 900 !important;
        line-height: 1 !important;
    }

    .capture-screen.is-main-camera .capture-recording-badge .recording-dot {
        width: 8px !important;
        height: 8px !important;
        background: #fff !important;
        box-shadow: none !important;
    }

    .capture-screen.is-main-camera .capture-zoom-control {
        position: fixed !important;
        right: auto !important;
        bottom: calc(154px + var(--camera-safe-bottom)) !important;
        left: 50% !important;
        display: inline-flex !important;
        min-width: 0 !important;
        width: auto !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 6px !important;
        border: 0 !important;
        border-radius: 999px !important;
        padding: 4px !important;
        background: rgba(0, 0, 0, 0.32) !important;
        box-shadow: 0 12px 34px rgba(0, 0, 0, 0.28) !important;
        transform: translateX(-50%) !important;
        backdrop-filter: blur(16px) saturate(130%) !important;
        pointer-events: auto !important;
    }

    .capture-screen.is-main-camera .capture-zoom-control button {
        display: grid !important;
        width: 34px !important;
        height: 34px !important;
        min-width: 34px !important;
        place-items: center !important;
        border: 0 !important;
        border-radius: 999px !important;
        padding: 0 !important;
        color: rgba(255, 255, 255, 0.9) !important;
        background: transparent !important;
        font-size: 0.78rem !important;
        font-weight: 900 !important;
        line-height: 1 !important;
    }

    .capture-screen.is-main-camera .capture-zoom-control button.active {
        color: #0b1321 !important;
        background: var(--camera-lime) !important;
    }

    .capture-screen.is-main-camera .capture-control-tray {
        position: fixed !important;
        right: 0 !important;
        bottom: calc(16px + var(--camera-safe-bottom)) !important;
        left: 0 !important;
        display: flex !important;
        width: 100% !important;
        min-width: 0 !important;
        min-height: 0 !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: flex-end !important;
        gap: 14px !important;
        padding: 0 calc(18px + var(--camera-safe-right)) 0 calc(18px + var(--camera-safe-left)) !important;
        background: transparent !important;
        box-shadow: none !important;
        pointer-events: none !important;
    }

    .capture-screen.is-main-camera .capture-recorder-controls {
        display: grid !important;
        width: min(360px, calc(100vw - 36px)) !important;
        min-width: 0 !important;
        grid-template-columns: 76px 96px 76px !important;
        grid-template-areas: "left center right" !important;
        align-items: center !important;
        justify-content: center !important;
        justify-items: center !important;
        gap: 22px !important;
        pointer-events: auto !important;
    }

    .capture-screen.is-main-camera .capture-thumbnail-button,
    .capture-screen.is-main-camera .capture-pause-recording-button,
    .capture-screen.is-main-camera .capture-flip-button {
        position: relative !important;
        inset: auto !important;
        display: grid !important;
        width: 56px !important;
        height: 56px !important;
        min-width: 56px !important;
        min-height: 56px !important;
        place-items: center !important;
        border: 1px solid rgba(255, 255, 255, 0.18) !important;
        border-radius: 999px !important;
        padding: 0 !important;
        color: #fff !important;
        background: rgba(7, 12, 22, 0.56) !important;
        box-shadow: 0 10px 26px rgba(0, 0, 0, 0.28) !important;
        backdrop-filter: blur(14px) saturate(130%) !important;
        pointer-events: auto !important;
    }

    .capture-screen.is-main-camera .capture-thumbnail-button {
        grid-area: left !important;
        overflow: hidden !important;
    }

    .capture-screen.is-main-camera .capture-thumbnail-button img {
        width: 100% !important;
        height: 100% !important;
        display: block !important;
        object-fit: cover !important;
    }

    .capture-screen.is-main-camera .capture-pause-recording-button {
        grid-area: left !important;
    }

    .capture-screen.is-main-camera .capture-flip-button {
        grid-area: right !important;
    }

    .capture-screen.is-main-camera .capture-photo-button:not(.capture-video-record-button) {
        grid-area: right !important;
    }

    .capture-screen.is-main-camera .capture-record-toggle,
    .capture-screen.is-main-camera .capture-record-toggle.btn-record--idle,
    .capture-screen.is-main-camera .capture-record-toggle.btn-record--active {
        grid-area: center !important;
        position: relative !important;
        inset: auto !important;
        display: grid !important;
        width: 92px !important;
        height: 92px !important;
        min-width: 92px !important;
        min-height: 92px !important;
        max-width: 92px !important;
        max-height: 92px !important;
        place-items: center !important;
        border: 5px solid rgba(255, 255, 255, 0.92) !important;
        border-radius: 999px !important;
        padding: 0 !important;
        background: rgba(0, 0, 0, 0.2) !important;
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.32) !important;
        transform: none !important;
        pointer-events: auto !important;
    }

    .capture-screen.is-main-camera .capture-record-toggle .capture-record-icon {
        display: block !important;
        width: 70px !important;
        height: 70px !important;
        border-radius: 999px !important;
        background: var(--camera-red) !important;
        box-shadow: none !important;
    }

    .capture-screen.is-main-camera .capture-record-toggle .capture-record-icon::before,
    .capture-screen.is-main-camera .capture-record-toggle .capture-record-icon::after {
        display: none !important;
        content: none !important;
    }

    .capture-screen.is-main-camera .capture-record-toggle.is-recording .capture-record-icon,
    .capture-screen.is-main-camera .capture-record-toggle.btn-record--active .capture-record-icon {
        width: 36px !important;
        height: 36px !important;
        border-radius: 10px !important;
        background: var(--camera-red) !important;
    }

    .capture-screen.is-main-camera .capture-record-toggle.is-photo-shutter {
        border-color: rgba(255, 255, 255, 0.94) !important;
        background: rgba(0, 0, 0, 0.18) !important;
    }

    .capture-screen.is-main-camera .capture-record-toggle.is-photo-shutter .capture-record-icon {
        width: 72px !important;
        height: 72px !important;
        border-radius: 999px !important;
        background: #fff !important;
        box-shadow:
            inset 0 0 0 3px rgba(8, 12, 18, 0.1),
            0 8px 18px rgba(0, 0, 0, 0.22) !important;
    }

    .capture-screen.is-main-camera .capture-photo-button:not(.capture-video-record-button) {
        position: relative !important;
        inset: auto !important;
        display: grid !important;
        width: 72px !important;
        height: 72px !important;
        min-width: 72px !important;
        min-height: 72px !important;
        max-width: 72px !important;
        max-height: 72px !important;
        place-items: center !important;
        border: 5px solid rgba(255, 255, 255, 0.94) !important;
        border-radius: 999px !important;
        padding: 0 !important;
        background: #fff !important;
        box-shadow:
            inset 0 0 0 5px rgba(255, 255, 255, 0.94),
            inset 0 0 0 8px rgba(8, 12, 18, 0.12),
            0 10px 24px rgba(0, 0, 0, 0.28) !important;
        transform: none !important;
        pointer-events: auto !important;
    }

    .capture-screen.is-main-camera .capture-photo-button[hidden],
    .capture-screen.is-main-camera .capture-pause-recording-button[hidden] {
        display: none !important;
    }

    .capture-screen.is-main-camera .capture-photo-icon,
    .capture-screen.is-main-camera .capture-photo-button .capture-photo-icon {
        display: none !important;
    }

    .capture-screen.is-main-camera .capture-control-tray.is-survey-recording .capture-thumbnail-button,
    .capture-screen.is-main-camera .capture-control-tray.is-survey-recording .capture-flip-button {
        display: none !important;
    }

    .capture-screen.is-main-camera .live-capture-mode-row {
        position: relative !important;
        display: inline-flex !important;
        width: auto !important;
        min-width: 0 !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 4px !important;
        border: 1px solid rgba(255, 255, 255, 0.14) !important;
        border-radius: 999px !important;
        padding: 4px !important;
        background: rgba(0, 0, 0, 0.46) !important;
        box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24) !important;
        backdrop-filter: blur(16px) saturate(130%) !important;
        pointer-events: auto !important;
    }

    .capture-screen.is-main-camera .live-capture-mode-row[hidden] {
        display: inline-flex !important;
    }

    .capture-screen.is-main-camera .live-capture-mode-btn {
        height: 32px !important;
        min-width: 70px !important;
        border: 0 !important;
        border-radius: 999px !important;
        padding: 0 12px !important;
        color: rgba(255, 255, 255, 0.9) !important;
        background: transparent !important;
        font-size: 0.76rem !important;
        font-weight: 900 !important;
        letter-spacing: 0 !important;
    }

    .capture-screen.is-main-camera .live-capture-mode-btn.active {
        color: #0b1321 !important;
        background: var(--camera-lime) !important;
    }

    .capture-screen.is-main-camera.is-live-recording .live-capture-mode-row,
    .capture-screen.is-main-camera.is-live-recording .capture-zoom-control {
        opacity: 0.96 !important;
    }

    .capture-screen.is-main-camera .capture-focus-square {
        width: 82px !important;
        height: 82px !important;
        border: 2px solid var(--camera-lime) !important;
        border-radius: 8px !important;
        box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.18), 0 0 18px rgba(200, 243, 74, 0.26) !important;
    }

    .capture-screen.is-main-camera .capture-exposure-overlay {
        border: 1px solid rgba(200, 243, 74, 0.28) !important;
        border-radius: 999px !important;
        color: #fff !important;
        background: rgba(0, 0, 0, 0.54) !important;
        box-shadow: 0 12px 30px rgba(0, 0, 0, 0.26) !important;
        backdrop-filter: blur(14px) saturate(130%) !important;
    }

    .capture-screen.is-main-camera .capture-tabbar-handle,
    .capture-screen.is-main-camera.is-live-toolbar-collapsed .capture-tabbar-handle {
        position: fixed !important;
        right: calc(14px + var(--camera-safe-right)) !important;
        bottom: calc(14px + var(--camera-safe-bottom)) !important;
        left: auto !important;
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
        min-height: 44px !important;
        border-radius: 999px !important;
        background: rgba(7, 12, 22, 0.62) !important;
        transform: none !important;
        backdrop-filter: blur(14px) saturate(130%) !important;
        pointer-events: auto !important;
    }

    .capture-screen.is-main-camera .capture-live-info-panel {
        display: grid !important;
        grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
        gap: 6px !important;
        align-items: stretch !important;
        padding-right: 8px !important;
        padding-left: 8px !important;
        pointer-events: none !important;
    }

    .capture-screen.is-main-camera .capture-live-info-item {
        display: grid !important;
        min-width: 0 !important;
        min-height: 46px !important;
        align-content: center !important;
        gap: 2px !important;
        border-radius: 10px !important;
        padding: 6px 4px !important;
        color: rgba(255, 255, 255, 0.74) !important;
        background: rgba(255, 255, 255, 0.07) !important;
        text-align: center !important;
    }

    .capture-screen.is-main-camera .capture-live-info-item span {
        overflow: hidden !important;
        font-size: 0.56rem !important;
        font-weight: 850 !important;
        letter-spacing: 0.04em !important;
        text-overflow: ellipsis !important;
        text-transform: uppercase !important;
        white-space: nowrap !important;
    }

    .capture-screen.is-main-camera .capture-live-info-item strong {
        color: #ffffff !important;
        font-size: 0.84rem !important;
        font-weight: 950 !important;
        line-height: 1 !important;
    }

    .capture-screen.is-main-camera.is-live-toolbar-collapsed .capture-tabbar {
        max-height: 0 !important;
        min-height: 0 !important;
        padding: 0 !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
        transform: translate(-50%, calc(100% + 22px)) !important;
    }
}

@media (max-width: 920px) and (orientation: landscape) {
    .capture-screen.is-main-camera .survai-camera-tech-pill {
        top: calc(12px + var(--camera-safe-top)) !important;
        left: calc(12px + var(--camera-safe-left)) !important;
    }

    .capture-screen.is-main-camera .capture-top-camera-tools {
        top: calc(12px + var(--camera-safe-top)) !important;
        right: calc(12px + var(--camera-safe-right)) !important;
    }

    .capture-screen.is-main-camera .capture-overlay-top {
        top: calc(12px + var(--camera-safe-top)) !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
    }

    .capture-screen.is-main-camera .capture-control-tray {
        top: 50% !important;
        right: calc(14px + var(--camera-safe-right)) !important;
        bottom: auto !important;
        left: auto !important;
        width: 104px !important;
        min-width: 104px !important;
        padding: 0 !important;
        transform: translateY(-50%) !important;
    }

    .capture-screen.is-main-camera .capture-recorder-controls {
        width: 94px !important;
        grid-template-columns: 1fr !important;
        grid-template-rows: 58px 84px 58px !important;
        grid-template-areas:
            "left"
            "center"
            "right" !important;
        gap: 26px !important;
    }

    .capture-screen.is-main-camera .capture-record-toggle,
    .capture-screen.is-main-camera .capture-record-toggle.btn-record--idle,
    .capture-screen.is-main-camera .capture-record-toggle.btn-record--active {
        width: 84px !important;
        height: 84px !important;
        min-width: 84px !important;
        min-height: 84px !important;
        max-width: 84px !important;
        max-height: 84px !important;
    }

    .capture-screen.is-main-camera .capture-record-toggle .capture-record-icon {
        width: 64px !important;
        height: 64px !important;
    }

    .capture-screen.is-main-camera .capture-record-toggle.is-recording .capture-record-icon,
    .capture-screen.is-main-camera .capture-record-toggle.btn-record--active .capture-record-icon {
        width: 32px !important;
        height: 32px !important;
    }

    .capture-screen.is-main-camera .capture-record-toggle.is-photo-shutter .capture-record-icon {
        width: 64px !important;
        height: 64px !important;
    }

    .capture-screen.is-main-camera .capture-photo-button:not(.capture-video-record-button) {
        width: 66px !important;
        height: 66px !important;
        min-width: 66px !important;
        min-height: 66px !important;
        max-width: 66px !important;
        max-height: 66px !important;
    }

    .capture-screen.is-main-camera .capture-thumbnail-button,
    .capture-screen.is-main-camera .capture-pause-recording-button,
    .capture-screen.is-main-camera .capture-flip-button {
        width: 52px !important;
        height: 52px !important;
        min-width: 52px !important;
        min-height: 52px !important;
    }

    .capture-screen.is-main-camera .capture-zoom-control {
        bottom: calc(66px + var(--camera-safe-bottom)) !important;
        transform: none !important;
    }

    .capture-screen.is-main-camera .survai-camera-settings-panel {
        top: calc(58px + var(--camera-safe-top)) !important;
        right: calc(12px + var(--camera-safe-right)) !important;
    }

    .capture-screen.is-main-camera .survai-camera-flash-panel {
        top: calc(58px + var(--camera-safe-top)) !important;
        right: calc(58px + var(--camera-safe-right)) !important;
    }

    .capture-screen.is-main-camera .capture-tabbar-handle,
    .capture-screen.is-main-camera.is-live-toolbar-collapsed .capture-tabbar-handle {
        right: auto !important;
        bottom: calc(14px + var(--camera-safe-bottom)) !important;
        left: calc(14px + var(--camera-safe-left)) !important;
        transform: none !important;
    }
}

@media (max-width: 920px) and (orientation: landscape) and (max-height: 390px) {
    .capture-screen.is-main-camera .capture-control-tray {
        right: calc(8px + var(--camera-safe-right)) !important;
        width: 92px !important;
        min-width: 92px !important;
    }

    .capture-screen.is-main-camera .capture-recorder-controls {
        width: 82px !important;
        grid-template-rows: 46px 74px 46px !important;
        gap: 16px !important;
    }

    .capture-screen.is-main-camera .capture-record-toggle,
    .capture-screen.is-main-camera .capture-record-toggle.btn-record--idle,
    .capture-screen.is-main-camera .capture-record-toggle.btn-record--active {
        width: 74px !important;
        height: 74px !important;
        min-width: 74px !important;
        min-height: 74px !important;
        max-width: 74px !important;
        max-height: 74px !important;
    }

    .capture-screen.is-main-camera .capture-record-toggle .capture-record-icon,
    .capture-screen.is-main-camera .capture-record-toggle.is-photo-shutter .capture-record-icon {
        width: 56px !important;
        height: 56px !important;
    }

    .capture-screen.is-main-camera .capture-photo-button:not(.capture-video-record-button) {
        width: 58px !important;
        height: 58px !important;
        min-width: 58px !important;
        min-height: 58px !important;
        max-width: 58px !important;
        max-height: 58px !important;
    }

    .capture-screen.is-main-camera .capture-thumbnail-button,
    .capture-screen.is-main-camera .capture-pause-recording-button,
    .capture-screen.is-main-camera .capture-flip-button {
        width: 44px !important;
        height: 44px !important;
        min-width: 44px !important;
        min-height: 44px !important;
    }

    .capture-screen.is-main-camera .capture-zoom-control {
        right: calc(102px + var(--camera-safe-right)) !important;
        bottom: calc(58px + var(--camera-safe-bottom)) !important;
    }
}

/* Final camera-first app-mode overrides. Keep these last so older responsive camera rules cannot reveal URL handoff panels. */
.capture-mode-body.is-camera-first-launch {
    min-height: 100dvh !important;
    overflow: hidden !important;
    background: #000 !important;
}

.capture-mode-body.is-camera-first-launch .sidebar,
.capture-mode-body.is-camera-first-launch .capture-workflow-intro,
.capture-mode-body.is-camera-first-launch .capture-desktop-handoff,
.capture-mode-body.is-camera-first-launch .mobile-capture-link-field,
.capture-mode-body.is-camera-first-launch .mobile-capture-copy-link {
    display: none !important;
}

.capture-mode-body.is-camera-first-launch .app-shell {
    display: block !important;
    min-height: 100dvh !important;
    background: #000 !important;
}

.capture-mode-body.is-camera-first-launch .main-panel {
    width: 100vw !important;
    max-width: none !important;
    min-height: 100dvh !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #000 !important;
}

.capture-mode-body.is-camera-first-launch .capture-shell {
    display: block !important;
    position: fixed !important;
    inset: 0 !important;
    z-index: 999 !important;
    width: 100vw !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    background: #000 !important;
}

.capture-mode-body.is-camera-first-launch .capture-panel.active.live-capture-panel,
.capture-mode-body.is-camera-first-launch .live-capture-panel .capture-screen {
    display: flex !important;
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100dvh !important;
    min-height: 100dvh !important;
    max-width: 100vw !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
}

@media (max-width: 920px), (pointer: coarse) {
    .capture-desktop-handoff .mobile-capture-link-field,
    .capture-desktop-handoff .mobile-capture-copy-link {
        display: none !important;
    }

}
/* Final Survai Camera zoom rail placement. This must stay at the end of the stylesheet. */
@media (max-width: 920px), (pointer: coarse) {
    .capture-screen.is-main-camera .capture-filter-button svg {
        width: 22px !important;
        height: 22px !important;
        display: block !important;
        fill: none !important;
        stroke: currentColor !important;
        stroke-width: 2 !important;
        stroke-linecap: round !important;
        stroke-linejoin: round !important;
    }

    .capture-screen.is-main-camera .capture-filter-button span {
        display: none !important;
    }

    .capture-screen.is-main-camera .capture-zoom-control {
        position: fixed !important;
        top: 50% !important;
        bottom: auto !important;
        left: auto !important;
        right: calc(8px + var(--camera-safe-right)) !important;
        width: 46px !important;
        min-width: 46px !important;
        max-width: 46px !important;
        min-height: 188px !important;
        display: grid !important;
        grid-template-columns: 1fr !important;
        grid-auto-rows: 38px !important;
        align-items: center !important;
        justify-items: center !important;
        gap: 5px !important;
        border: 1px solid rgba(255, 255, 255, 0.1) !important;
        border-radius: 999px !important;
        padding: 6px 4px !important;
        background: rgba(6, 12, 20, 0.34) !important;
        box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22) !important;
        transform: translateY(-50%) !important;
        backdrop-filter: blur(12px) saturate(125%) !important;
        pointer-events: auto !important;
    }

    .capture-screen.is-main-camera .capture-zoom-control button {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        min-height: 36px !important;
        border: 0 !important;
        border-radius: 999px !important;
        padding: 0 !important;
        background: transparent !important;
        color: rgba(255, 255, 255, 0.88) !important;
        font-size: 0.76rem !important;
        font-weight: 850 !important;
        line-height: 1 !important;
    }

    .capture-screen.is-main-camera .capture-zoom-control button.active {
        color: #0b1321 !important;
        background: var(--camera-lime) !important;
        box-shadow: 0 4px 12px rgba(200, 243, 74, 0.22) !important;
    }
}

@media (max-width: 920px) and (orientation: landscape) {
    .capture-screen.is-main-camera .capture-zoom-control {
        right: auto !important;
        left: calc(8px + var(--camera-safe-left)) !important;
    }
}

@media (max-width: 920px) and (orientation: landscape) and (max-height: 390px) {
    .capture-screen.is-main-camera .capture-zoom-control {
        width: 42px !important;
        min-width: 42px !important;
        max-width: 42px !important;
        min-height: 164px !important;
        grid-auto-rows: 32px !important;
        gap: 4px !important;
        padding: 5px 3px !important;
    }

    .capture-screen.is-main-camera .capture-zoom-control button {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        min-height: 32px !important;
        font-size: 0.7rem !important;
    }
}
/* Final Survai Camera landscape mode selector placement. */

/* Final correction: in landscape keep the portrait mode selector shape and let it sit sideways on the right edge. */
/* Final override: keep VIDEO/PHOTO in the same bottom-centre position in landscape as portrait. */

@media (max-width: 920px) and (orientation: landscape) and (max-height: 390px) {
    .capture-screen.is-main-camera .live-capture-mode-row {
        bottom: calc(10px + var(--camera-safe-bottom)) !important;
        left: 50% !important;
        width: auto !important;
        min-width: 0 !important;
        padding: 4px !important;
        transform: translateX(-50%) !important;
    }

    .capture-screen.is-main-camera .live-capture-mode-btn {
        width: auto !important;
    }
}
/* Absolute final correction: landscape keeps the portrait selector shape, sideways on the right edge. */
@media (max-width: 920px) and (orientation: landscape) {
    .capture-screen.is-main-camera .live-capture-mode-row {
        position: fixed !important;
        top: 50% !important;
        right: calc(-48px + var(--camera-safe-right) - 120px) !important;
        bottom: auto !important;
        left: auto !important;
        display: inline-flex !important;
        width: auto !important;
        min-width: 0 !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 4px !important;
        padding: 4px !important;
        transform: translateY(-50%) rotate(90deg) !important;
        transform-origin: center !important;
        z-index: 56 !important;
    }

    .capture-screen.is-main-camera .live-capture-mode-btn {
        width: auto !important;
        min-width: 70px !important;
        height: 32px !important;
        min-height: 32px !important;
        padding: 0 12px !important;
        writing-mode: horizontal-tb !important;
        text-orientation: mixed !important;
        transform: none !important;
    }
}

@media (max-width: 920px) and (orientation: landscape) and (max-height: 390px) {
    .capture-screen.is-main-camera .live-capture-mode-row {
        right: calc(-43px + var(--camera-safe-right) - 120px) !important;
    }

    .capture-screen.is-main-camera .live-capture-mode-btn {
        min-width: 64px !important;
        height: 30px !important;
        min-height: 30px !important;
        padding: 0 10px !important;
    }
}

/* Absolute final capture navigation override. Keep after camera layout rules. */
.capture-mode-body .sidebar-brand,
.capture-mode-body .sidebar-brand:hover,
.capture-mode-body .sidebar-brand:focus-visible {
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.capture-mode-body .brand-logo-sidebar {
    display: block;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    object-fit: contain;
}

.capture-dashboard-link {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 95;
    display: inline-flex;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    color: var(--theme-text, #0f1b2f);
    background: transparent;
    text-decoration: none;
    cursor: pointer;
    transition: color 160ms ease, transform 160ms ease, background 160ms ease;
}

.capture-dashboard-link svg,
.capture-mobile-survey-shortcut svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.capture-dashboard-link:hover,
.capture-dashboard-link:focus-visible {
    color: var(--theme-accent, #1b5af9);
    background: rgba(27, 90, 249, 0.1);
    outline: none;
    transform: translateY(-1px);
}

.capture-mobile-survey-shortcut {
    position: fixed;
    right: calc(14px + env(safe-area-inset-right, 0px));
    bottom: calc(118px + env(safe-area-inset-bottom, 0px));
    z-index: 1200;
    display: none;
    align-items: center;
    gap: 8px;
    min-height: 46px;
    border: 1px solid rgba(27, 90, 249, 0.32);
    border-radius: 999px;
    padding: 0 14px;
    color: #ffffff;
    background: rgba(7, 17, 31, 0.86);
    box-shadow: 0 18px 40px rgba(7, 17, 31, 0.28);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 800;
    line-height: 1;
    backdrop-filter: blur(16px) saturate(130%);
    transition: transform 160ms ease, border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.capture-mobile-survey-shortcut:hover,
.capture-mobile-survey-shortcut:focus-visible {
    color: #0b1321;
    border-color: var(--theme-accent, #1b5af9);
    background: var(--theme-accent, #1b5af9);
    outline: none;
    transform: translateY(-2px);
}

html[data-theme="light"] .capture-mobile-survey-shortcut {
    color: #0b1321;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 16px 36px rgba(7, 17, 31, 0.18);
}

@media (max-width: 920px), (pointer: coarse) {
    .capture-dashboard-link {
        position: fixed;
        top: calc(12px + env(safe-area-inset-top, 0px));
        right: calc(12px + env(safe-area-inset-right, 0px));
        color: #ffffff;
        background: rgba(7, 12, 22, 0.42);
        backdrop-filter: blur(14px) saturate(130%);
    }

    .capture-mobile-survey-shortcut {
        display: inline-flex;
    }

    .capture-mode-body.capture-live-active .capture-mobile-survey-shortcut,
    .capture-mode-body.is-camera-first-launch .capture-mobile-survey-shortcut {
        right: calc(10px + env(safe-area-inset-right, 0px));
        bottom: calc(96px + env(safe-area-inset-bottom, 0px));
        min-height: 42px;
        padding: 0 12px;
        font-size: 0.8rem;
    }
}

/* Report workspace scroll containment: keep fixed toolbars anchored and remove page bounce. */
html:has(body .sidebar--workspace),
body:has(.sidebar--workspace) {
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
}

body:has(.sidebar--workspace) .app-shell {
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
    --sidebar-width: var(--survai-workspace-sidebar-width);
}

body:has(.sidebar--workspace) .main-panel {
    height: 100dvh;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

body:has(.sidebar--workspace) .sidebar--workspace,
body:has(.sidebar--workspace) .sidebar--workspace .sidebar-nav {
    overscroll-behavior: contain;
}

/* Grey band under the report (surveyor, 11 and 25 Sep 2026): the locked
   document must have no height of its own. .sr-only labels inside the panel
   are position:absolute and most have no positioned ancestor, so at their
   default (static) position they sat far down the panel's content and gave
   the ROOT tens of thousands of px of phantom scroll height. The keyboard's
   caret reveal, and focusing a hidden pill checkbox, then scrolled that root,
   lifting main.main-panel off the top of the screen with bare body showing
   beneath, a little more with every box. Pinning them to the top-left of
   their containing block leaves the root nothing to scroll; they stay 1px and
   clipped, so screen readers are unaffected. */
body:has(.sidebar--workspace) .sr-only {
    top: 0;
    left: 0;
}

/* Camera capture mode should be a true full-screen tool with no shared white app header. */
body.capture-mode-body.capture-live-active .mobile-app-header,
body.capture-mode-body.capture-live-active .mobile-menu-toggle,
body.capture-mode-body.capture-live-active .mobile-menu-overlay,
body.capture-mode-body.capture-live-active .capture-workflow-intro,
body.capture-mode-body.is-camera-first-launch .mobile-app-header,
body.capture-mode-body.is-camera-first-launch .mobile-menu-toggle,
body.capture-mode-body.is-camera-first-launch .mobile-menu-overlay {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

body.capture-mode-body.capture-live-active .app-shell,
body.capture-mode-body.capture-live-active .main-panel {
    display: block !important;
    width: 100vw !important;
    max-width: none !important;
    min-height: 100dvh !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    background: #000 !important;
}

/* Capture AI guidance mode: a non-recording helper state beside the record control. */
.capture-ai-mode-button {
    display: grid;
    place-items: center;
    width: 92px;
    height: 92px;
    min-width: 92px;
    min-height: 92px;
    max-width: 92px;
    max-height: 92px;
    border: 0;
    border-radius: 999px;
    padding: 0;
    color: var(--camera-lime, #c8f34a);
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    cursor: pointer;
    pointer-events: auto;
}

.capture-ai-mode-button svg {
    display: block;
    width: 58px;
    height: 58px;
    fill: none;
    stroke: currentColor;
    stroke-width: 3.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.capture-ai-mode-button:hover,
.capture-ai-mode-button:focus-visible,
.capture-ai-mode-button.is-active {
    color: var(--camera-lime, #c8f34a);
    background: transparent;
    box-shadow: 0 0 0 1px rgba(200, 243, 74, 0.45), 0 0 28px rgba(200, 243, 74, 0.24);
    outline: none;
}

.capture-ai-mode-button[hidden] {
    display: none !important;
}

.capture-screen.is-main-camera .capture-ai-mode-button,
.capture-screen.is-training-camera .capture-ai-mode-button {
    grid-area: right !important;
}

.capture-screen.is-main-camera .capture-recorder-controls,
.capture-screen.is-training-camera .capture-recorder-controls {
    grid-template-columns: 76px 96px 96px !important;
}

.capture-screen.is-training-camera .capture-control-tray {
    position: fixed !important;
    right: 0 !important;
    bottom: calc(16px + var(--camera-safe-bottom, 0px)) !important;
    left: 0 !important;
    display: flex !important;
    width: 100% !important;
    min-width: 0 !important;
    min-height: 0 !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 14px !important;
    padding: 0 calc(18px + var(--camera-safe-right, 0px)) 0 calc(18px + var(--camera-safe-left, 0px)) !important;
    background: transparent !important;
    box-shadow: none !important;
    pointer-events: none !important;
}

.capture-screen.is-training-camera .capture-recorder-controls {
    display: grid !important;
    width: min(360px, calc(100vw - 36px)) !important;
    grid-template-columns: 76px 96px 76px !important;
    grid-template-areas: "left center right" !important;
    align-items: center !important;
    justify-content: center !important;
    justify-items: center !important;
    gap: 22px !important;
    pointer-events: auto !important;
}

.capture-screen.is-training-camera .capture-record-toggle,
.capture-screen.is-training-camera .capture-pause-recording-button,
.capture-screen.is-training-camera .capture-photo-button:not(.capture-video-record-button),
.capture-screen.is-training-camera .live-capture-mode-row,
.capture-screen.is-training-camera [data-live-saved-state],
.capture-screen.is-training-camera .capture-gallery,
.capture-screen.is-training-camera .capture-live-summary {
    display: none !important;
}

.capture-screen.is-training-camera .capture-ai-mode-button {
    display: grid !important;
}

/* ==========================================================
   Survai Premium SaaS Design System Layer
   Dark navy navigation + bright operational workspaces.
   Visual refinement only: no workflow or data changes.
   ========================================================== */

:root {
    --sai-card-radius: 18px;
    --sai-control-radius: 999px;
    --sai-elevation-soft: 0 18px 50px rgba(11, 19, 33, 0.07);
    --sai-elevation-hover: 0 22px 62px rgba(11, 19, 33, 0.11);
    --shadow: var(--sai-elevation-soft);
}

html {
    background: var(--sai-workspace-soft);
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body):not(.output-report-page) {
    background:
        radial-gradient(circle at 82% -12%, rgba(27, 90, 249, 0.08), transparent 34%),
        linear-gradient(180deg, var(--survai-card) 0%, var(--sai-workspace-soft) 46%, var(--survai-bg-deep) 100%);
    color: var(--sai-text-main);
    font-feature-settings: "kern", "liga", "calt";
    text-rendering: optimizeLegibility;
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .app-shell {
    background: transparent;
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .main-panel {
    color: var(--sai-text-main);
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) h1,
body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) h2,
body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) h3,
body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) h4 {
    color: var(--sai-text-main);
    letter-spacing: -0.025em;
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) p,
body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .form-note,
body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .subtitle,
body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .ops-subtitle {
    color: var(--sai-text-secondary);
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar {
    color: #ffffff;
    /* No blue radial here — keeps active menu glyphs the same flat #1b5af9 as the logo */
    background: linear-gradient(180deg, var(--sai-navy) 0%, var(--sai-navy-deep) 100%) !important;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 22px 0 60px rgba(11, 19, 33, 0.16);
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar-nav {
    gap: 8px;
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar-nav a {
    border: 1px solid transparent;
    border-radius: 16px;
    color: rgba(255, 255, 255, 0.72);
    background: transparent;
    font-weight: 400;
    transition: color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar-nav a.active {
    color: #ffffff;
    border-color: transparent;
    background: transparent;
    box-shadow: none;
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar-nav a.active::before {
    display: none !important;
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .user-pill {
    border-color: rgba(255, 255, 255, 0.12);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.065);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .page-header {
    align-items: center;
    margin-bottom: clamp(24px, 3vw, 36px);
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .page-header h1 {
    font-size: clamp(2rem, 3.3vw, 3.5rem);
    line-height: 0.98;
    font-weight: 850;
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .eyebrow {
    color: var(--sai-text-secondary);
    font-size: 0.78rem;
    font-weight: 850;
    letter-spacing: 0.055em;
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .card,
body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .table-card,
body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .toolbar,
body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .supporting-upload,
body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .section-card,
body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .report-form,
body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .ops-card,
body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .ops-kpi-card,
body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .lifecycle-card,
body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .cost-card,
body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .cost-item-card,
body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sai-report-card,
body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .po-card,
body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .documents-carousel-card {
    border: 1px solid var(--card-border-color) !important;
    border-radius: var(--card-radius) !important;
    background: var(--card-bg) !important;
    box-shadow: var(--card-shadow) !important;
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .card:hover,
body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .ops-card:hover,
body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .ops-kpi-card:hover,
body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .po-card:hover {
    box-shadow: var(--card-shadow-hover) !important;
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) input,
body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) select,
body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) textarea {
    border: 1px solid var(--field-border-color) !important;
    border-radius: var(--field-radius) !important;
    background-color: var(--field-bg) !important;
    color: var(--field-ink) !important;
    box-shadow: var(--field-shadow);
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) input:not(:where([type="checkbox"], [type="radio"], [type="range"], [type="file"], [type="color"], [type="hidden"], [type="submit"], [type="button"], [type="reset"], [type="image"])),
body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) select {
    font-size: var(--field-font-size);
    font-weight: var(--field-font-weight);
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) textarea {
    font-size: var(--field-text-font-size);
    font-weight: var(--field-text-font-weight);
    line-height: var(--field-text-line-height);
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) input:focus,
body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) select:focus,
body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) textarea:focus,
body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) button:focus-visible,
body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) a:focus-visible {
    outline: none;
    box-shadow: var(--field-focus-ring) !important;
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .btn {
    min-height: var(--btn-height);
    border: 0 !important;
    border-radius: var(--btn-radius) !important;
    padding-inline: var(--btn-padding-inline);
    box-shadow: var(--btn-shadow);
    transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease, color 150ms ease;
}

/* .btn-small sets min-height 36px and tighter padding far earlier in this
   sheet at specificity (0,1,0), which the rule above — (0,4,2) — silently
   beats, so every "small" button has been rendering at the full 42px with
   only its font shrunk. Secondary actions then compete with primary ones for
   weight on pages that use a lot of them. Restated at this layer so the
   variant does what it says. */
body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .btn.btn-small {
    min-height: var(--btn-height-small);
    padding-inline: var(--btn-padding-inline-small);
    box-shadow: var(--btn-shadow-small);
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .btn:hover {
    opacity: 1;
    transform: translateY(-1px);
    box-shadow: var(--btn-shadow-hover);
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .btn-primary {
    background: var(--btn-primary-bg) !important;
    color: var(--btn-primary-ink) !important;
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .btn-secondary,
body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .btn-outline {
    background: var(--btn-secondary-bg) !important;
    color: var(--btn-secondary-ink) !important;
    box-shadow: inset 0 0 0 1px var(--sai-card-border), 0 10px 24px rgba(11, 19, 33, 0.04);
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .btn-danger {
    background: var(--btn-danger-bg) !important;
    color: var(--btn-danger-ink) !important;
    box-shadow: var(--btn-danger-shadow);
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) table {
    border-collapse: separate;
    border-spacing: 0;
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) th {
    color: var(--table-head-ink);
    font-size: var(--table-head-font-size);
    font-weight: var(--table-head-font-weight);
    letter-spacing: var(--table-head-tracking);
    text-transform: uppercase;
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) td {
    color: var(--table-cell-ink);
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .alert {
    border-radius: 14px;
    border-width: 1px;
    box-shadow: 0 12px 32px rgba(11, 19, 33, 0.05);
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .status,
body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .badge,
body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .pill {
    border-radius: 999px;
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .mobile-app-header {
    background: color-mix(in srgb, var(--survai-card) 94%, transparent);
    border-bottom: 1px solid rgba(230, 235, 242, 0.9);
    box-shadow: 0 14px 36px rgba(11, 19, 33, 0.08);
    backdrop-filter: blur(18px);
}

@media (max-width: 900px) {
    body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .main-panel {
        padding-inline: clamp(16px, 4vw, 24px);
    }

    body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .page-header {
        gap: 14px;
        align-items: flex-start;
    }

    body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .page-header h1 {
        font-size: clamp(2rem, 12vw, 3rem);
    }
}

/* ==========================================================
   Survai Official Premium SaaS Colour System
   Final cascade layer. Keep this block at the true end of
   style.css so older page-specific rules cannot override it.
   ========================================================== */

:root {
    --survai-navy: #0b1321;
    --survai-navy-deep: #08101c;
    /* Same as `--survai-logo-blue` — must match sidebar wordmark PNG, not an arbitrary hex */
    --survai-logo-blue: #1b5af9;
    --survai-blue: var(--survai-brand);
    --survai-blue-hover: var(--survai-brand-hover);
    --survai-menu-icon-blue: var(--survai-brand);
    --survai-green: #22c55e;
    --survai-amber: #f59e0b;
    --survai-red: #ef4444;
    /* Neutral workspace palette (surveyor, 3 Oct 2026: "neutral theme with brand-blue
       accents"). The page is #fafafa, every editor, card and toolbar sits on white, the
       rail is a very light grey, text is charcoal and brand blue marks the selected item
       and the primary action. Dark values live in the Dark mode block. */
    --survai-page-bg: #fafafa;
    --survai-surface: #ffffff;
    --survai-sidebar-bg: #f7f7f8;
    --survai-neutral-hover: #eeeeef;
    --survai-text-secondary: #525252;
    --survai-text-muted: #737373;
    --survai-brand: #2457f5;
    --survai-brand-hover: #1c46cb;
    --survai-brand-soft: #edf2ff;
    --survai-bg: var(--survai-page-bg);
    --survai-card: var(--survai-surface);
    --survai-border: #e5e5e5;
    --survai-text: #171717;
    --survai-secondary: var(--survai-text-secondary);
    --survai-muted: var(--survai-text-muted);
    --survai-shadow: 0 10px 30px rgba(16, 24, 40, 0.06);
    --survai-shadow-hover: 0 18px 44px rgba(16, 24, 40, 0.10);
    --survai-focus: 0 0 0 4px rgba(27, 90, 249, 0.18);
    /* The literal greys the page rules used, one token each, so dark mode can redefine them
       (see "Dark mode" at the end of this file). Light values are the literals they replaced. */
    --survai-bg-strong: #ffffff;
    --survai-bg-hover: #fafcfe;
    --survai-bg-deep: #f4f7fb;
    --survai-bg-soft: #fbfdff;
    --survai-bg-tint: #f1f5f9;
    --survai-bg-line: #eef2f7;
    --survai-border-soft: #e2e8f0;
    --survai-border-faint: #eef2f7;
    --survai-border-mid: #cbd5e1;
    --survai-border-ink: rgba(15, 23, 42, 0.1);
    --survai-text-strong: #0f172a;
    --survai-text-deep: #071421;
    --survai-text-slate: #1e293b;
    --survai-text-soft: #334155;
    --survai-navy-ink: #0b1321;
    --survai-secondary-strong: #475569;
    --survai-secondary-slate: #64748b;
    --survai-muted-cool: #94a3b8;
    --survai-muted-grey: #6b7280;
    --survai-ink-surface: #0f172a;
    --survai-navy-surface: #0b1321;
    /* Names older rules fall back from (var(--sai-text, #0f172a) and the like). */
    --sai-text: var(--survai-text-strong);
    --sai-text-muted: var(--survai-secondary-slate);
    --sai-muted: var(--survai-secondary-slate);
    --sai-panel: var(--survai-card);
    --sai-panel-bg-solid: var(--survai-card);
    --sai-surface: var(--survai-card);
    --text-main: var(--survai-text-strong);
    --text-muted: var(--survai-secondary-slate);
    --surface-muted: var(--survai-bg);
    --theme-text-muted: var(--survai-muted-grey);
    /* Legacy tints and inks, one token per literal the page rules used (light value = the literal). */
    --survai-tint-f9fbff: #f9fbff;
    --survai-ink-047857: #047857;
    --survai-ink-071a3d: #071a3d;
    --survai-ink-0b1736: #0b1736;
    --survai-ink-0e7490: #0e7490;
    --survai-ink-0f1b2d: #0f1b2d;
    --survai-ink-0f1b33: #0f1b33;
    --survai-ink-0f3d2d: #0f3d2d;
    --survai-ink-0f766e: #0f766e;
    --survai-ink-111a2e: #111a2e;
    --survai-ink-123053: #123053;
    --survai-ink-14532d: #14532d;
    --survai-ink-14804a: #14804a;
    --survai-ink-155dfc: #155dfc;
    --survai-ink-157347: #157347;
    --survai-ink-15803d: #15803d;
    --survai-ink-1648d4: #1648d4;
    --survai-ink-165ffa: #165ffa;
    --survai-ink-166534: #166534;
    --survai-ink-16704a: #16704a;
    --survai-ink-16a34a: #16a34a;
    --survai-ink-17653a: #17653a;
    --survai-ink-1b5af9: #1b5af9;
    --survai-ink-1d4ed8: #1d4ed8;
    --survai-ink-1e3a5f: #1e3a5f;
    --survai-ink-1e3a8a: #1e3a8a;
    --survai-ink-1e40af: #1e40af;
    --survai-ink-1e6b3a: #1e6b3a;
    --survai-ink-1f2937: #1f2937;
    --survai-ink-1f2a44: #1f2a44;
    --survai-ink-1f618d: #1f618d;
    --survai-ink-243044: #243044;
    --survai-ink-24354d: #24354d;
    --survai-ink-253246: #253246;
    --survai-ink-2563eb: #2563eb;
    --survai-ink-33445e: #33445e;
    --survai-ink-344054: #344054;
    --survai-ink-374151: #374151;
    --survai-ink-3b4b63: #3b4b63;
    --survai-ink-3d4861: #3d4861;
    --survai-ink-475467: #475467;
    --survai-ink-512e5f: #512e5f;
    --survai-ink-52627a: #52627a;
    --survai-ink-52637f: #52637f;
    --survai-ink-55657d: #55657d;
    --survai-ink-5b6b82: #5b6b82;
    --survai-ink-5b6b86: #5b6b86;
    --survai-ink-5c6b82: #5c6b82;
    --survai-ink-60708f: #60708f;
    --survai-ink-657188: #657188;
    --survai-ink-6b5310: #6b5310;
    --survai-ink-6d28d9: #6d28d9;
    --survai-ink-717d93: #717d93;
    --survai-ink-7a271a: #7a271a;
    --survai-ink-7a5a12: #7a5a12;
    --survai-ink-7a8699: #7a8699;
    --survai-ink-7b8798: #7b8798;
    --survai-ink-7c8a9d: #7c8a9d;
    --survai-ink-7f1d1d: #7f1d1d;
    --survai-ink-881337: #881337;
    --survai-ink-8a4b00: #8a4b00;
    --survai-ink-8a5a12: #8a5a12;
    --survai-ink-8f1d1d: #8f1d1d;
    --survai-ink-912018: #912018;
    --survai-ink-922b21: #922b21;
    --survai-ink-92400e: #92400e;
    --survai-ink-991b1b: #991b1b;
    --survai-ink-9a3412: #9a3412;
    --survai-ink-9a7b0a: #9a7b0a;
    --survai-ink-9f1d1d: #9f1d1d;
    --survai-ink-a16207: #a16207;
    --survai-ink-b42318: #b42318;
    --survai-ink-b45309: #b45309;
    --survai-ink-b76b00: #b76b00;
    --survai-ink-b7791f: #b7791f;
    --survai-ink-b91c1c: #b91c1c;
    --survai-ink-be123c: #be123c;
    --survai-ink-c2185b: #c2185b;
    --survai-ink-c2410c: #c2410c;
    --survai-ink-d2333a: #d2333a;
    --survai-ink-d97706: #d97706;
    --survai-ink-dc2626: #dc2626;
    --survai-ink-e11d48: #e11d48;
    --survai-ink-ef4444: #ef4444;
    --survai-ink-ff3b4f: #ff3b4f;
    --survai-tint-dbeafe: #dbeafe;
    --survai-tint-dcfce7: #dcfce7;
    --survai-tint-e4ecf6: #e4ecf6;
    --survai-tint-e6ecf5: #e6ecf5;
    --survai-tint-e7f0ff: #e7f0ff;
    --survai-tint-e7f6ec: #e7f6ec;
    --survai-tint-e8ecf4: #e8ecf4;
    --survai-tint-e8edf4: #e8edf4;
    --survai-tint-e8eef7: #e8eef7;
    --survai-tint-e9eef6: #e9eef6;
    --survai-tint-e9f7ef: #e9f7ef;
    --survai-tint-eaf1f8: #eaf1f8;
    --survai-tint-eaf2ff: #eaf2ff;
    --survai-tint-ecfdf3: #ecfdf3;
    --survai-tint-ecfdf5: #ecfdf5;
    --survai-tint-edf4ff: #edf4ff;
    --survai-tint-edf5ff: #edf5ff;
    --survai-tint-eef1f5: #eef1f5;
    --survai-tint-eef2f8: #eef2f8;
    --survai-tint-eef2ff: #eef2ff;
    --survai-tint-eef3f8: #eef3f8;
    --survai-tint-eef3fb: #eef3fb;
    --survai-tint-eef4fb: #eef4fb;
    --survai-tint-eef4ff: #eef4ff;
    --survai-tint-eef9f2: #eef9f2;
    --survai-tint-eff4ff: #eff4ff;
    --survai-tint-eff6ff: #eff6ff;
    --survai-tint-f0f4f9: #f0f4f9;
    --survai-tint-f0f4ff: #f0f4ff;
    --survai-tint-f0f6ff: #f0f6ff;
    --survai-tint-f0fdf4: #f0fdf4;
    --survai-tint-f1f6fc: #f1f6fc;
    --survai-tint-f2f4f7: #f2f4f7;
    --survai-tint-f2f7ff: #f2f7ff;
    --survai-tint-f2fbf5: #f2fbf5;
    --survai-tint-f3f4f8: #f3f4f8;
    --survai-tint-f3f6fb: #f3f6fb;
    --survai-tint-f4f6f9: #f4f6f9;
    --survai-tint-f4f7fd: #f4f7fd;
    --survai-tint-f4f9fc: #f4f9fc;
    --survai-tint-f5f9ff: #f5f9ff;
    --survai-tint-f6f9ff: #f6f9ff;
    --survai-tint-f7f6fd: #f7f6fd;
    --survai-tint-f7fafc: #f7fafc;
    --survai-tint-f7faff: #f7faff;
    --survai-tint-f7fdf9: #f7fdf9;
    --survai-tint-f8fbff: #f8fbff;
    --survai-tint-f9fafb: #f9fafb;
    --survai-tint-f9fbfd: #f9fbfd;
    --survai-tint-fafafa: #fafafa;
    --survai-tint-fafbfc: #fafbfc;
    --survai-tint-fbfcfe: #fbfcfe;
    --survai-tint-fdeaea: #fdeaea;
    --survai-tint-fdebd0: #fdebd0;
    --survai-tint-fdeeee: #fdeeee;
    --survai-tint-fdf2f1: #fdf2f1;
    --survai-tint-fdf3e0: #fdf3e0;
    --survai-tint-fdf5f4: #fdf5f4;
    --survai-tint-fdf6e9: #fdf6e9;
    --survai-tint-fee2e2: #fee2e2;
    --survai-tint-fef2f2: #fef2f2;
    --survai-tint-fef3c7: #fef3c7;
    --survai-tint-fef3f2: #fef3f2;
    --survai-tint-fefce8: #fefce8;
    --survai-tint-ffedd5: #ffedd5;
    --survai-tint-fff1f0: #fff1f0;
    --survai-tint-fff1f1: #fff1f1;
    --survai-tint-fff1f2: #fff1f2;
    --survai-tint-fff5f7: #fff5f7;
    --survai-tint-fff6e8: #fff6e8;
    --survai-tint-fff7ed: #fff7ed;
    --survai-tint-fff7f6: #fff7f6;
    --survai-tint-fff7f7: #fff7f7;
    --survai-tint-fff8e7: #fff8e7;
    --survai-tint-fff9ec: #fff9ec;
    --survai-tint-fffaf0: #fffaf0;
    --survai-tint-fffbeb: #fffbeb;
    --survai-tint-fffbf4: #fffbf4;

    --navy: var(--survai-navy);
    --navy-2: var(--survai-navy-deep);
    --ink: var(--survai-text);
    --muted: var(--survai-secondary);
    --line: var(--survai-border);
    --panel: var(--survai-card);
    --surface: var(--survai-bg);
    --accent: var(--survai-blue);
    --accent-dark: var(--survai-blue-hover);
    --success: var(--survai-green);
    --warning: var(--survai-amber);
    --danger: var(--survai-red);

    --theme-bg: var(--survai-bg);
    --theme-bg-strong: #ffffff;
    --theme-panel: #ffffff;
    --theme-panel-soft: #f8fafc;
    --theme-text: var(--survai-text);
    --theme-muted: var(--survai-secondary);
    --theme-border: var(--survai-border);
    --theme-accent: var(--survai-blue);
    --theme-accent-ink: #ffffff; /* derived from --survai-logo-blue */
    --theme-input: #ffffff;
    --theme-input-text: var(--survai-text);

    --sai-navy: var(--survai-navy);
    --sai-navy-deep: var(--survai-navy-deep);
    --sai-workspace: var(--survai-card);
    --sai-workspace-soft: var(--survai-bg);
    --sai-card-border: var(--survai-border);
    --sai-text-main: var(--survai-text);
    --sai-text-secondary: var(--survai-secondary);
    --sai-focus-ring: var(--survai-focus);
    --survai-brand-blue: var(--survai-blue);
    --survai-brand-blue-hover: var(--survai-blue-hover);
    /* Property overview band and branded planning map (surveyor, 29 Sep 2026: "make
       the map in branded colours ... ensure all colouring is survai branded"). The band
       was brand blue (30 Sep 2026); with the neutral theme (surveyor, 3 Oct 2026: "there's
       still a lot of the old design here") it is the header's own surface with charcoal
       text and outlined neutral pills, like the stage-tab row it replaces, in both themes.
       The address Edit pill and the photo's source label share the band tokens. The map
       keeps the brand palette: assets/js/app.js reads the --survai-map-* values for
       Google's map styles and the planning layers, so they stay plain colours. */
    --survai-band-bg: var(--survai-surface);
    --survai-band-text: var(--survai-text);
    --survai-band-muted: var(--survai-text-muted);
    --survai-band-chip-bg: var(--survai-surface);
    --survai-band-chip-border: var(--survai-border);
    --survai-band-chip-hover-bg: var(--survai-neutral-hover);
    --survai-band-chip-hover-border: var(--survai-border-mid);
    --survai-band-icon: var(--survai-text-secondary);
    /* White ink on a brand-blue or navy fill (legend toggles, count badges), in both themes. */
    --survai-on-brand: #ffffff;
    /* Text and icons drawn ON a brand fill: white on Survai blue in light, charcoal on the
       off-white brand fill in dark (Carbon, 7 Oct 2026). */
    --survai-brand-ink: #ffffff;
    /* A strong neutral fill for small badges that sit over photos or the map (white ink). */
    --survai-strong-surface: #171717;
    --survai-map-pin: var(--survai-logo-blue);
    --survai-map-land: #f1f5f9;
    --survai-map-water: #c9d8fd;
    --survai-map-road: #ffffff;
    --survai-map-road-major: #dbe6fe;
    --survai-map-label: #475569;
    --survai-map-building: #e2e8f0;
    --survai-map-park: #dcfce7;
    --survai-map-tile-filter: grayscale(1) sepia(0.28) hue-rotate(178deg) saturate(1.8) brightness(1.06) contrast(0.88);
    --survai-map-layer-title-extent: var(--survai-logo-blue);
    /* The overview map's title extents (as on the PDF's planning map): the property's own title, and every other plot. */
    --survai-map-layer-title-boundaries: var(--survai-logo-blue);
    --survai-map-plot-line: #64748b;
    --survai-map-layer-conservation-area: var(--survai-amber);
    --survai-map-layer-article-4: var(--survai-red);
    --survai-map-layer-tree-preservation-zone: var(--survai-green);
    --survai-map-layer-green-belt: var(--survai-green);
    --survai-map-layer-aonb: var(--survai-navy);
    --survai-map-layer-flood: var(--survai-logo-blue);
    --survai-map-layer-frontage: var(--survai-map-pin);
}

/* Dashboard rows and transcript document tiles: not cards (the card surface
   is the Cards block near the top of this file). */
.ops-donut-block,
.ops-action-row,
.ops-diary-row,
.ops-activity-row,
.ops-team-table,
.transcript-document-card {
    border-color: var(--survai-border) !important;
    background: var(--survai-card) !important;
    box-shadow: var(--survai-shadow) !important;
}

h1,
h2,
h3,
h4,
.page-header h1,
.ops-hero h1,
.ops-kpi-card__value,
.ops-card h2,
.card h2 {
    color: var(--survai-text) !important;
}

p,
.form-note,
.ops-subtitle,
.po-muted,
.ops-empty,
.secondary,
.muted {
    color: var(--survai-secondary) !important;
}

.eyebrow,
label span,
.po-hero-grid dt,
.po-doc-cat-stats,
.ops-kpi-card__label {
    color: var(--survai-muted) !important;
}

a:not(.btn):not(.sidebar-nav a):not(:where(.output-action-bar__button, .output-icon-action)),
.ops-card-link,
.table-card a:not(.btn),
.card a:not(.btn):not(:where(.output-action-bar__button, .output-icon-action)) {
    color: var(--survai-blue) !important;
}

.button,
button[type="submit"],
button[type="button"] {
    border-radius: 999px !important;
    transition: background 160ms ease, border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease !important;
}

table {
    background: var(--survai-card) !important;
}

thead,
thead tr,
th {
    background: var(--survai-bg) !important;
}

td {
    color: var(--survai-text) !important;
    border-color: var(--survai-border) !important;
}

tbody tr:hover {
    background: rgba(27, 90, 249, 0.035) !important;
}

.badge,
.status,
.pill {
    border-radius: 999px !important;
}

.status-completed,
.is-success {
    background: rgba(34, 197, 94, 0.11) !important;
    color: var(--survai-ink-15803d) !important;
}

.status-assigned,
.status-in-progress,
.is-active {
    background: rgba(27, 90, 249, 0.11) !important;
    color: var(--survai-blue) !important;
}

.is-warning {
    background: rgba(245, 158, 11, 0.12) !important;
    color: var(--survai-ink-b45309) !important;
}

.is-danger,
.status-overdue {
    background: rgba(239, 68, 68, 0.11) !important;
    color: var(--survai-red) !important;
}

.is-muted {
    background: var(--survai-tint-f2f4f7) !important;
    color: var(--survai-secondary) !important;
}

.mobile-app-header {
    border-color: var(--survai-border) !important;
    background: color-mix(in srgb, var(--survai-card) 94%, transparent) !important;
    box-shadow: 0 12px 34px rgba(16, 24, 40, 0.06) !important;
    backdrop-filter: blur(18px);
}

.ops-dashboard-customize-btn:hover:not(:disabled),
.ops-dashboard-dropzone.is-dashboard-drag-over {
    border-color: rgba(27, 90, 249, 0.38) !important;
    background: rgba(27, 90, 249, 0.06) !important;
}

.ops-dashboard-draggable.is-dashboard-dragging {
    border-color: rgba(27, 90, 249, 0.42) !important;
    box-shadow: 0 24px 70px rgba(27, 90, 249, 0.16) !important;
}

.progress-bar,
.progress-fill {
    background: var(--survai-blue) !important;
}

.ops-coverage-filters button:hover,
.ops-coverage-filters button.is-active,
.tab.is-active {
    border-color: rgba(27, 90, 249, 0.30) !important;
    background: rgba(27, 90, 249, 0.10) !important;
    color: var(--survai-blue) !important;
}

.output-workspace-tabs .output-workspace-tab.is-active {
    border-color: transparent !important;
    background: transparent !important;
    color: var(--survai-ink-3d4861) !important;
    box-shadow: none !important;
    font-weight: 800 !important;
}

.rating-cr1 {
    background: var(--survai-green) !important;
    color: #ffffff !important;
}

.rating-cr2 {
    background: var(--survai-amber) !important;
    color: #ffffff !important;
}

.rating-cr3 {
    background: var(--survai-red) !important;
    color: #ffffff !important;
}

.rating-na,
.rating-ni {
    background: var(--survai-muted) !important;
    color: #ffffff !important;
}

.media-bulk-toolbar,
.photo-bulk-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 16px 0;
    padding: 12px;
    border: 1px solid var(--survai-border);
    border-radius: 16px;
    background: var(--survai-card);
    box-shadow: 0 8px 22px rgba(16, 24, 40, 0.04);
}

.media-bulk-toolbar .check-row,
.photo-bulk-toolbar .check-row {
    width: auto;
    margin: 0;
}

.media-select-check,
.photo-select-check {
    position: absolute;
    z-index: 4;
    top: 12px;
    left: 12px;
    display: inline-grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border: 1px solid rgba(230, 235, 242, 0.9);
    border-radius: 999px;
    background: color-mix(in srgb, var(--survai-card) 94%, transparent);
    box-shadow: 0 8px 18px rgba(16, 24, 40, 0.10);
    cursor: pointer;
}

.media-select-check input,
.photo-select-check input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.media-select-check span,
.photo-select-check span {
    width: 16px;
    height: 16px;
    border: 2px solid var(--survai-muted);
    border-radius: 999px;
}

.media-select-check input:checked + span,
.photo-select-check input:checked + span {
    border-color: var(--survai-menu-icon-blue);
    background: var(--survai-menu-icon-blue);
}

.progress-media-item,
.progress-video-item,
.evidence-upload-item,
.evidence-video-item,
.supporting-document-item,
.workflow-photo-roll figure {
    position: relative;
}

.progress-media-item.is-selected,
.progress-video-item.is-selected,
.evidence-upload-item.is-selected,
.evidence-video-item.is-selected,
.supporting-document-item.is-selected,
.workflow-photo-roll figure.is-selected {
    outline: 2px solid rgba(27, 90, 249, 0.42);
    box-shadow: 0 12px 34px rgba(27, 90, 249, 0.12) !important;
}

.workflow-photo-roll:not(.is-photo-selecting) .photo-select-check {
    opacity: 0.86;
}

.image-manager-page {
    gap: 18px;
}

.image-manager-toolbar {
    background: var(--survai-card);
}

.image-manager-toolbar .workflow-title-meta {
    min-height: 34px;
}

.image-manager-icon-button {
    display: inline-grid;
    width: 40px;
    height: 40px;
    place-items: center;
    border: 1px solid var(--survai-border);
    border-radius: 10px;
    color: var(--survai-navy-ink);
    background: var(--survai-card);
    cursor: pointer;
}

.image-manager-icon-button:hover,
.image-manager-icon-button:focus-visible {
    border-color: rgba(27, 90, 249, 0.42);
    box-shadow: 0 10px 24px rgba(27, 90, 249, 0.08);
}

.image-manager-icon-button svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.image-manager-filter-button {
    border-color: rgba(15, 23, 42, 0.12);
    background: var(--survai-navy);
    color: #ffffff;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
}

.image-manager-filter-button:hover,
.image-manager-filter-button:focus-visible,
.image-manager-filter-button[aria-expanded="true"] {
    border-color: rgba(27, 90, 249, 0.42);
    background: #1b5af9;
    color: #ffffff;
    box-shadow: 0 16px 34px rgba(27, 90, 249, 0.22);
}

.image-manager-cta-card .section-head {
    align-items: center;
}

.image-manager-tabs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin: 18px 0 14px;
}

.image-manager-tab {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 48px;
    padding: 10px 12px;
    border: 1px solid var(--survai-border);
    border-radius: 10px;
    background: var(--survai-card);
    color: var(--survai-text);
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.image-manager-tab:hover,
.image-manager-tab:focus-visible,
.image-manager-tab.is-active {
    border-color: rgba(27, 90, 249, 0.45);
    box-shadow: 0 10px 24px rgba(27, 90, 249, 0.08);
}

.image-manager-tab.is-active {
    background: var(--survai-tint-f6f9ff);
}

.image-manager-tab strong {
    display: inline-flex;
    min-width: 30px;
    height: 26px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--survai-blue);
    color: #ffffff;
    font-size: 0.78rem;
}

.image-manager-filter-menu {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin: 0 0 14px;
}

.image-manager-filter-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid rgba(213, 222, 235, 0.94);
    border-radius: 999px;
    background: var(--survai-card);
    color: var(--survai-navy-ink);
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
    cursor: pointer;
}

.image-manager-filter-trigger:hover,
.image-manager-filter-trigger:focus-visible,
.image-manager-filter-trigger[aria-expanded="true"],
.image-manager-filter-trigger.is-active {
    border-color: rgba(27, 90, 249, 0.36);
    color: var(--survai-blue);
    box-shadow: 0 14px 30px rgba(27, 90, 249, 0.12);
}

.image-manager-filter-trigger svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.9;
}

.image-manager-filter-trigger strong {
    display: inline-grid;
    min-width: 20px;
    height: 20px;
    place-items: center;
    border-radius: 999px;
    background: var(--survai-blue);
    color: #ffffff;
    font-size: 0.72rem;
    line-height: 1;
}

.image-manager-filter-panel {
    position: absolute;
    z-index: 1200;
    top: calc(100% + 10px);
    left: 0;
    width: min(360px, calc(100vw - 36px));
    border: 1px solid var(--survai-border);
    border-radius: 16px;
    background: color-mix(in srgb, var(--survai-card) 98%, transparent);
    box-shadow: 0 26px 70px rgba(15, 23, 42, 0.18);
    overflow: hidden;
}

.image-manager-filter-panel[hidden] {
    display: none;
}

.image-manager-filter-panel__head {
    padding: 14px 16px 10px;
    border-bottom: 1px solid var(--survai-border-soft);
    color: var(--survai-navy-ink);
}

.image-manager-filter-options {
    display: grid;
    gap: 4px;
    padding: 8px;
}

.image-manager-filter-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 42px;
    padding: 9px 10px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: var(--survai-text);
    font: inherit;
    font-size: 0.9rem;
    text-align: left;
    cursor: pointer;
}

.image-manager-filter-option:hover,
.image-manager-filter-option:focus-visible,
.image-manager-filter-option.is-active {
    border-color: rgba(27, 90, 249, 0.22);
    background: color-mix(in srgb, var(--survai-tint-f6f9ff) 96%, transparent);
}

.image-manager-filter-option.is-active {
    color: var(--survai-blue);
    font-weight: 700;
}

.image-manager-filter-option strong {
    display: inline-grid;
    min-width: 30px;
    height: 24px;
    place-items: center;
    border-radius: 999px;
    background: rgba(27, 90, 249, 0.1);
    color: var(--survai-blue);
    font-size: 0.76rem;
}

.image-manager-filter-panel__actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid var(--survai-border-soft);
    background: color-mix(in srgb, var(--survai-bg) 82%, transparent);
}

@media (max-width: 720px) {
    .image-manager-filter-menu {
        width: 100%;
    }

    .image-manager-filter-trigger {
        width: 100%;
        justify-content: center;
    }

    .image-manager-filter-panel {
        position: fixed;
        inset: auto 12px calc(12px + env(safe-area-inset-bottom));
        width: auto;
        max-height: min(72vh, 520px);
        overflow-y: auto;
        border-radius: 18px;
    }

    .image-manager-filter-panel__actions {
        position: sticky;
        bottom: 0;
    }
}

.media-manager-main {
    gap: 20px;
}

.media-manager-shell-card .section-head {
    align-items: flex-start;
}

.media-manager-panel {
    margin-top: 0;
}

/* The tab's own title — "Videos", "Audio", and "Photographs" inside the grid card. It sits
   above the toolbar, in the page's heading type, with the gap the toolbar keeps below itself. */
.media-manager-tab-heading {
    margin: 0 0 12px;
}

.media-manager-tab-heading h2 {
    margin: 0;
}

/* Photographs tab: the page card is chrome-less, so the grid's own card (.image-manager-panel,
   with its 22px padding) is the one container, at the width the page card had. Videos and audio
   keep the page card (media-manager.php adds the modifier for photographs only). */
/* Specificity and !important match the card family (one card definition, output.php as the
   reference) and the workspace padding rule, which this page card must lose to the grid's card. */
body.media-manager-page.survey-workflow-surface .main-panel > .card.workflow-page-card.media-manager-shell-card--single {
    padding: 0;
    gap: 0;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

body.media-manager-page .media-manager-shell-card--single > .media-manager-panel > .image-manager-panel {
    margin-bottom: 0;
}

/* Media Manager photographs grid cards — and the same tile everywhere (.survai-photo-tile,
   photo_tile_helpers.php): the output section photos, the output photo album, room cards. */
.media-manager-panel .image-manager-grid {
    gap: 14px;
}

:is(.media-manager-panel .image-manager-card--grid, .survai-photo-tile) {
    display: block;
    padding: 0;
    overflow: hidden;
    /* No line and no card colour around a photo (surveyor, 28 Sep 2026: "a white or light grey
       border ... remove from all images"); the photo is the tile. Selection is the ring below. */
    border: 0;
    border-radius: 5px;
    background: transparent;
    box-shadow: none;
}

:is(.media-manager-panel .image-manager-card--grid, .survai-photo-tile).is-selected {
    box-shadow: 0 0 0 3px rgba(37, 99, 255, 0.28);
}

:is(.media-manager-panel .image-manager-card--grid, .survai-photo-tile) .photo-select-check {
    top: 8px;
    right: auto;
    left: 8px;
    z-index: 5;
    display: grid;
    width: 30px;
    height: 30px;
    border: 2px solid #2563eb;
    border-radius: 999px;
    background: transparent;
    box-shadow: none;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 160ms ease, visibility 160ms ease, transform 120ms ease;
}

:is(.media-manager-panel .image-manager-card--grid, .survai-photo-tile):hover .photo-select-check,
:is(.media-manager-panel .image-manager-card--grid, .survai-photo-tile):focus-within .photo-select-check,
:is(.media-manager-panel .image-manager-card--grid, .survai-photo-tile).is-selected .photo-select-check,
:is(.media-manager-panel .image-manager-card--grid, .survai-photo-tile) .photo-select-check:has(input:checked) {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* One circle, not two (surveyor, 28 Sep 2026): the 30px ring is the whole control. The inner
   span only hosts the tick; it draws nothing of its own. Selected: the ring fills blue. */
:is(.media-manager-panel .image-manager-card--grid, .survai-photo-tile) .photo-select-check span {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 999px;
    background: transparent;
}

:is(.media-manager-panel .image-manager-card--grid, .survai-photo-tile) .photo-select-check:has(input:checked) {
    background: #2563eb;
}

:is(.media-manager-panel .image-manager-card--grid, .survai-photo-tile) .photo-select-check input:checked + span {
    border: 0;
    background: #2563eb;
    box-shadow: none;
}

:is(.media-manager-panel .image-manager-card--grid, .survai-photo-tile) .photo-select-check input:checked + span::after {
    content: '';
    width: 6px;
    height: 11px;
    border: solid #ffffff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) translateY(-1px);
}

:is(.media-manager-panel, .survai-photo-tile) .image-manager-card__frame {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 5px;
    background: var(--survai-tint-e8edf4);
}

:is(.media-manager-panel, .survai-photo-tile) .image-manager-card__open {
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    cursor: pointer;
}

:is(.media-manager-panel, .survai-photo-tile) .image-manager-card__open img,
:is(.media-manager-panel, .survai-photo-tile) .image-manager-card__open .image-manager-photo-image,
:is(.media-manager-panel, .survai-photo-tile) .image-manager-card__open img[data-photo-preview-img],
:is(.media-manager-panel, .survai-photo-tile) .image-manager-card__open .image-manager-thumb-placeholder {
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: none;
    aspect-ratio: auto !important;
    border: 0;
    border-radius: 0 !important;
    object-fit: cover !important;
    object-position: center;
    background: var(--survai-tint-e8edf4);
}

:is(.media-manager-panel, .survai-photo-tile) .image-manager-card__open .image-manager-thumb-placeholder {
    display: grid;
    place-items: center;
    min-height: 100%;
    font-size: 0.78rem;
    color: #64748b;
}

:is(.media-manager-panel, .survai-photo-tile) .image-manager-card__info-btn {
    position: absolute;
    right: 8px;
    bottom: 8px;
    z-index: 4;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.48);
    color: #ffffff;
    opacity: 0;
    pointer-events: none;
    cursor: pointer;
    transition: opacity 160ms ease, background 160ms ease, transform 120ms ease;
}

:is(.media-manager-panel, .survai-photo-tile) .image-manager-card__info-btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

:is(.media-manager-panel, .survai-photo-tile) .image-manager-card__frame:hover .survai-image-ai-label-btn,
:is(.media-manager-panel, .survai-photo-tile) .image-manager-card__frame:focus-within .survai-image-ai-label-btn,
:is(.media-manager-panel, .survai-photo-tile) .image-manager-card__frame:hover .image-manager-card__info-btn,
:is(.media-manager-panel, .survai-photo-tile) .image-manager-card__info-btn:hover,
:is(.media-manager-panel, .survai-photo-tile) .image-manager-card__info-btn:focus-visible {
    opacity: 0.72;
    pointer-events: auto;
    background: rgba(15, 23, 42, 0.62);
}

:is(.media-manager-panel, .survai-photo-tile) .image-manager-card__info-popover {
    position: absolute;
    right: 8px;
    bottom: 46px;
    /* Above the AI badge (11), which otherwise shows through an open eye popover on a small tile. */
    z-index: 13;
    display: none;
    max-width: min(248px, calc(100% - 16px));
    padding: 10px 12px;
    border: 1px solid var(--survai-border-ink);
    border-radius: 14px;
    background: color-mix(in srgb, var(--survai-card) 98%, transparent);
    color: var(--survai-text-strong);
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.16);
    pointer-events: none;
}

:is(.media-manager-panel, .survai-photo-tile) .image-manager-card__info-popover[hidden]:not(.is-visible) {
    display: none !important;
}

:is(.media-manager-panel, .survai-photo-tile) .image-manager-card__frame:has(.image-manager-card__info-btn:hover) .image-manager-card__info-popover,
:is(.media-manager-panel, .survai-photo-tile) .image-manager-card__frame:has(.image-manager-card__info-btn:focus-visible) .image-manager-card__info-popover,
:is(.media-manager-panel, .survai-photo-tile) .image-manager-card__info-popover.is-visible {
    display: block !important;
}

:is(.media-manager-panel, .survai-photo-tile) .image-manager-card__info-popover p {
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.45;
}

:is(.media-manager-panel, .survai-photo-tile) .image-manager-card__info-popover p + p {
    margin-top: 6px;
}

:is(.media-manager-panel, .survai-photo-tile) .image-manager-card__info-popover strong {
    display: block;
    margin-bottom: 2px;
    font-size: 0.6875rem;
    font-weight: 750;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--survai-secondary-slate);
}

:is(.media-manager-panel, .survai-photo-tile) .image-manager-card__info-empty {
    color: var(--survai-secondary-slate);
    font-style: normal;
}

:is(.media-manager-panel .image-manager-card--grid, .survai-photo-tile) .image-manager-photo-form,
:is(.media-manager-panel .image-manager-card--grid, .survai-photo-tile) .image-manager-cover-form,
:is(.media-manager-panel .image-manager-card--grid, .survai-photo-tile) .image-manager-card-overlay {
    display: none !important;
}

/* Grid thumbnails must stay visible: the quarantine pill (label + reason) is
   hidden until the AI-label button is hovered or keyboard-focused — hovering
   the photo itself never shows it, so the select circle (top-left) and the AI
   button (top-right) stay clear. The pill sits BELOW that control row and
   never grows past the tile (full reason stays in the title tooltip). */
:is(.media-manager-panel .image-manager-card--grid, .survai-photo-tile) .image-manager-quarantine-badge {
    position: absolute;
    top: 44px;
    right: 8px;
    z-index: 5;
    margin: 0;
    max-width: calc(100% - 16px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.12s ease;
}

:is(.media-manager-panel .image-manager-card--grid, .survai-photo-tile):has(.survai-image-ai-label-btn:hover) .image-manager-quarantine-badge,
:is(.media-manager-panel .image-manager-card--grid, .survai-photo-tile):has(.survai-image-ai-label-btn:focus-visible) .image-manager-quarantine-badge {
    opacity: 1;
}

@media (max-width: 640px) {
    .media-manager-panel .image-manager-grid {
        gap: 10px;
    }
}

@media (hover: none) {
    :is(.media-manager-panel .image-manager-card--grid, .survai-photo-tile) .photo-select-check {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    :is(.media-manager-panel, .survai-photo-tile) .image-manager-card__info-btn {
        opacity: 0.58;
        pointer-events: auto;
    }

    /* No hover on touch: keep a compact icon-only quarantine flag so the
       state stays visible without covering the thumbnail. */
    :is(.media-manager-panel .image-manager-card--grid, .survai-photo-tile) .image-manager-quarantine-badge {
        opacity: 1;
        gap: 0;
        padding: 5px;
        font-size: 0;
    }
}

/* The AI badge's popover: what the AI said about the photo, with the button that
   (re)generates the AI label. Opens under the badge (top right) and, unlike the eye's
   hover tooltip, takes clicks. Its own class, so hovering the eye never opens it. */
.image-manager-card__ai-popover {
    position: absolute;
    top: 46px;
    right: 8px;
    z-index: 12;
    display: none;
    width: min(260px, calc(100% - 16px));
    max-height: calc(100% - 54px);
    overflow: auto;
    padding: 10px 12px;
    border: 1px solid var(--survai-border-ink);
    border-radius: 14px;
    background: color-mix(in srgb, var(--survai-card) 98%, transparent);
    color: var(--survai-text-strong);
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.16);
    text-align: left;
}

.image-manager-card__ai-popover.is-visible {
    display: block;
}

.image-manager-card__ai-popover[hidden]:not(.is-visible) {
    display: none !important;
}

.image-manager-card__ai-popover p {
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.45;
}

.image-manager-card__ai-popover p + p {
    margin-top: 6px;
}

.image-manager-card__ai-popover strong {
    display: block;
    margin-bottom: 2px;
    font-size: 0.6875rem;
    font-weight: 750;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--survai-secondary-slate);
}

.image-manager-card__ai-popover .survai-photo-tile__ai-title {
    color: var(--survai-text-strong);
    font-weight: 800;
}

.image-manager-card__ai-popover .image-manager-card__info-empty {
    color: var(--survai-secondary-slate);
}

.image-manager-card__ai-popover .survai-photo-tile__ai-generate {
    width: 100%;
    margin-top: 10px;
}

/* An open popover keeps its badge showing, as hover does. */
.survai-photo-tile[data-ai-popover-open="1"] .survai-image-ai-label-btn,
.image-manager-card[data-ai-popover-open="1"] .survai-image-ai-label-btn {
    opacity: 1;
    transform: translateY(0);
    background: #2563eb;
}

/* A tile's popovers may be taller than a small tile, so they overflow the tile instead of
   being clipped by it: the photo keeps its own rounded corners, and the tile with an open
   popover rises above its neighbours. */
.survai-photo-tile.image-manager-card--grid,
.survai-photo-tile.image-manager-card--grid .image-manager-card__frame {
    position: relative;
    overflow: visible;
}

/* The photo rounds itself: the open button stays unclipped, because the theme's
   button[type="button"] radius (999px) would turn a clipped photo into a circle. */
.survai-photo-tile.image-manager-card--grid .image-manager-card__open img,
.survai-photo-tile.image-manager-card--grid .image-manager-card__open .image-manager-photo-image {
    border-radius: 5px !important;
}

.survai-photo-tile[data-ai-popover-open="1"],
.survai-photo-tile[data-info-popover-open="1"] {
    z-index: 30;
}

.survai-photo-tile .image-manager-card__info-popover {
    width: 248px;
    max-width: min(248px, calc(100vw - 32px));
}

.survai-photo-tile .image-manager-card__ai-popover {
    width: 260px;
    max-width: min(260px, calc(100vw - 32px));
    max-height: none;
    overflow: visible;
}

/* Outside the Media Manager the eye's popover opens on a click (not only on hover) and
   carries an edit button, so an open one takes clicks. */
.survai-photo-tile .image-manager-card__info-popover.is-visible {
    pointer-events: auto;
}

.survai-photo-tile .survai-photo-tile__edit {
    width: 100%;
    margin-top: 10px;
}

/* The label under an output tile shows only when Display options > Image labels is
   "Always show"; otherwise it lives in the eye's popover, as in the Media Manager. */
.survai-photo-tile__caption {
    display: none;
    padding: 6px 8px 8px;
    overflow: hidden;
    color: var(--muted);
    font-size: 0.8rem;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.output-workspace-shell[data-image-label-mode="always"] .survai-photo-tile__caption {
    display: block;
}

/* The output photo album is the Media Manager grid inside a report card. */
.output-photo-album-panel {
    margin-top: 12px;
}

/* Grids of shared tiles outside the Media Manager use the Media Manager's sizes: the
   size control sets --image-manager-card-min on the grid, as it does there. */
.survai-photo-tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--image-manager-card-min, 150px), 1fr));
    gap: 14px;
    align-items: start;
}

@media (max-width: 640px) {
    .survai-photo-tile-grid {
        gap: 10px;
    }
}

/* Media Manager and output report: floating image selection dock. Every floating dock wears
   one skin (surveyor, 29 Sep 2026): the report tools dock's white pill with 44px circular blue
   icon buttons. The labels stay in the markup as the accessible name (and keep the phone short
   forms) but are not painted; each button's title carries the hint. Behaviour is untouched:
   the same data hooks, the same buttons, the same menu. */
.survai-image-action-dock {
    position: fixed;
    left: 50%;
    bottom: calc(18px + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    overflow: visible;
    min-height: 60px;
    max-width: calc(100vw - 28px);
    padding: 0 12px;
    border-radius: 999px;
    background: var(--survai-card);
    color: var(--survai-text-strong);
    border: 1px solid var(--survai-border);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
}

.survai-image-action-dock[hidden] {
    display: none !important;
}

.survai-image-action-dock__count,
.survai-image-action-dock__action {
    display: inline-flex;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 0;
    min-height: 60px;
    padding: 6px;
    margin: 0;
    border: 0;
    background: transparent;
    color: var(--survai-text-strong);
    font: 800 10px/1 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    white-space: nowrap;
}

.survai-image-action-dock__count {
    flex-direction: row;
    gap: 8px;
    margin-right: 2px;
    padding: 0 12px 0 4px;
    border-right: 1px solid var(--survai-border-soft);
}

.survai-image-action-dock__count .survai-image-action-dock__label {
    color: var(--survai-secondary-slate);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.survai-image-action-dock__badge {
    display: inline-grid;
    place-items: center;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border-radius: 999px;
    background: #2563ff;
    color: #fff;
    font-weight: 900;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    box-shadow: 0 8px 20px rgba(37, 99, 255, 0.35);
}

.survai-image-action-dock__icon {
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    background: var(--survai-card);
    border: 1px solid var(--survai-border);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
    color: var(--survai-text);
    font-size: 0;
    line-height: 1;
    transition: background 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.survai-image-action-dock__icon svg {
    display: block;
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.1;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* The label is the button's accessible name; the pill paints icons only, as the report tools
   dock does (its title shows the same words on hover). */
.survai-image-action-dock__action .survai-image-action-dock__label {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

.survai-image-action-dock__action {
    position: relative;
    cursor: pointer;
}

.survai-image-action-dock__action:hover,
.survai-image-action-dock__action:focus-visible {
    background: transparent;
    outline: none;
}

.survai-image-action-dock__action:hover .survai-image-action-dock__icon,
.survai-image-action-dock__action:focus-visible .survai-image-action-dock__icon,
.survai-image-action-dock__action[aria-expanded="true"] .survai-image-action-dock__icon {
    background: var(--survai-brand-soft);
    border-color: var(--survai-brand);
    color: var(--survai-brand);
    box-shadow: none;
    transform: translateY(-1px);
}

.survai-image-action-dock__action--danger .survai-image-action-dock__icon {
    border-color: var(--survai-ink-ff3b4f);
    color: var(--survai-ink-ff3b4f);
}

.survai-image-action-dock__action--danger:hover .survai-image-action-dock__icon,
.survai-image-action-dock__action--danger:focus-visible .survai-image-action-dock__icon {
    background: rgba(255, 59, 79, 0.08);
    box-shadow: 0 8px 20px rgba(255, 59, 79, 0.22);
}

.survai-image-action-dock__action:disabled .survai-image-action-dock__icon,
.survai-image-action-dock__action[aria-disabled="true"] .survai-image-action-dock__icon {
    opacity: 0.45;
    box-shadow: none;
    transform: none;
}

.survai-image-action-dock__more {
    position: relative;
    display: flex;
}

.survai-image-action-dock__menu {
    position: absolute;
    right: 0;
    bottom: calc(100% + 12px);
    min-width: 200px;
    padding: 8px;
    border-radius: 18px;
    background: var(--survai-card);
    color: var(--survai-text-strong);
    box-shadow: 0 18px 45px rgba(15,23,42,0.2);
    border: 1px solid var(--survai-border);
}

.survai-image-action-dock__menu[hidden] {
    display: none !important;
}

.survai-image-action-dock__menu button {
    display: block;
    width: 100%;
    padding: 11px 12px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--survai-text-strong);
    text-align: left;
    font-weight: 650;
    cursor: pointer;
}

.survai-image-action-dock__menu button:hover {
    background: var(--survai-bg-tint);
}

/* Output report: floating tools dock (matches Media Manager action dock) */
.floating-report-toolbar.survai-output-action-dock {
    position: fixed;
    left: 50%;
    bottom: calc(22px + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: auto;
    max-width: calc(100vw - 28px);
    pointer-events: none;
}

.floating-report-toolbar.survai-output-action-dock .survai-output-action-dock__navigator,
.floating-report-toolbar.survai-output-action-dock .survai-output-action-dock__bar {
    pointer-events: auto;
}

.floating-report-toolbar.survai-output-action-dock .survai-output-action-dock__navigator {
    width: min(360px, calc(100vw - 28px));
    margin: 0;
}

.floating-report-toolbar.survai-output-action-dock .survai-output-action-dock__bar {
    display: flex;
    align-items: stretch;
    overflow: visible;
    min-height: 62px;
    border-radius: 32px;
    background: linear-gradient(180deg, rgba(15, 25, 49, 0.98), rgba(8, 18, 38, 0.98));
    color: #fff;
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.08);
    /* No backdrop-filter: blur over a ~35,000px page forces one giant
       compositor layer and Chromium leaves deep regions as unpainted grey.
       The gradient is 98% opaque, so the blur was invisible anyway. */
}

/* Dragged docks pin to the exact spot the surveyor left them; the default
   centring transform and bottom anchor must both give way or the stored
   left/top would be offset by half the bar's width. */
.floating-report-toolbar.survai-output-action-dock.is-user-positioned {
    transform: none;
    bottom: auto;
    right: auto;
}

/* Default docking is bottom-left of the white content area (surveyor, 29 Sep 2026):
   app.js placeDockDefault() measures the main panel's left edge and sets `left`, so
   the centring transform gives way and the section list lines up with the bar's
   left edge instead of centring over it. */
.floating-report-toolbar.survai-output-action-dock.is-default-left {
    transform: none;
    align-items: flex-start;
}

/* A dock the surveyor has placed keeps its bar still when the section list opens: the
   list sits absolutely against the bar — above it by default, below it (is-panel-below,
   set by app.js placeSectionNavigator() when the bar is near the top of the window) —
   and shrinks to the space on that side rather than pushing the bar off screen. */
.floating-report-toolbar.survai-output-action-dock.is-user-positioned .survai-output-action-dock__navigator {
    position: absolute;
    left: 0;
    bottom: calc(100% + 12px);
    margin: 0;
    grid-template-rows: auto minmax(0, 1fr);
}

.floating-report-toolbar.survai-output-action-dock.is-user-positioned.is-panel-below .survai-output-action-dock__navigator {
    bottom: auto;
    top: calc(100% + 12px);
}

.floating-report-toolbar.survai-output-action-dock.is-user-positioned .survai-output-action-dock__navigator .floating-section-list {
    max-height: none;
    min-height: 0;
}

/* The grip that moves the dock. touch-action: none is load-bearing — without
   it a touch drag scrolls the page instead of moving the toolbar. */
.survai-output-action-dock__drag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    padding: 0 10px;
    border: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 32px 0 0 32px;
    background: transparent;
    color: rgba(255, 255, 255, 0.55);
    font-size: 15px;
    cursor: grab;
    touch-action: none;
    user-select: none;
}

.survai-output-action-dock__drag:hover,
.survai-output-action-dock__drag:focus-visible {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    outline: none;
}

.survai-output-action-dock__drag:active {
    cursor: grabbing;
}

.survai-output-action-dock__count,
.survai-output-action-dock__action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-width: 118px;
    padding: 0 24px;
    border: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.12);
    background: transparent;
    color: #fff;
    font: 700 16px/1.1 Arial, Helvetica, sans-serif;
    white-space: nowrap;
    text-decoration: none;
}

.survai-output-action-dock__count {
    min-width: 88px;
    justify-content: flex-start;
}

.survai-output-action-dock__count--qa {
    min-width: 72px;
    padding: 0 18px;
}

.survai-output-action-dock__action {
    cursor: pointer;
}

.survai-output-action-dock__action:hover,
.survai-output-action-dock__action:focus-visible {
    background: rgba(255, 255, 255, 0.06);
    outline: none;
    color: #fff;
}

.survai-output-action-dock__bar > .survai-output-action-dock__action:last-child {
    border-right: 0;
    border-radius: 0 32px 32px 0;
}

.survai-output-action-dock__bar > .survai-output-action-dock__count:first-child + .survai-output-action-dock__action,
.survai-output-action-dock__bar > .survai-output-action-dock__action:first-child {
    border-radius: 0;
}

.survai-output-action-dock__badge {
    display: inline-grid;
    place-items: center;
    min-width: 42px;
    height: 42px;
    padding: 0 10px;
    border-radius: 999px;
    background: #2563ff;
    color: #fff;
    font-weight: 900;
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    box-shadow: 0 8px 20px rgba(37, 99, 255, 0.35);
}

.survai-output-action-dock__badge--qa {
    background: #ff3b4f;
    box-shadow: 0 8px 20px rgba(255, 59, 79, 0.28);
}

.survai-output-action-dock__icon {
    display: inline-grid;
    place-items: center;
    font-size: 24px;
    line-height: 1;
    color: currentColor;
}

.survai-output-action-dock__icon .floating-tool-glyph,
.survai-output-action-dock__icon .floating-download-glyph,
.survai-output-action-dock__icon svg {
    display: block;
    width: 24px;
    height: 24px;
    color: #fff;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.1;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.survai-output-action-dock__action--disabled,
.survai-output-action-dock__action--disabled:hover {
    opacity: 0.45;
    cursor: not-allowed;
    background: transparent;
}

/* output.php: bottom-centred workspace toolbar; image bulk dock stays centre-bottom. */
.floating-report-toolbar.survai-output-action-dock--compact {
    /* Anchored bottom-left, 20px clear of the side rail (--survai-app-rail-width). */
    left: calc(var(--survai-app-rail-width, 124px) + 20px);
    right: auto;
    bottom: calc(18px + env(safe-area-inset-bottom, 0px));
    transform: none;
    z-index: 9980;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    width: auto;
}

.floating-report-toolbar.survai-output-action-dock--compact .survai-output-action-dock__navigator {
    width: min(420px, calc(100vw - 36px));
    margin: 0;
}

.floating-report-toolbar.survai-output-action-dock--compact .survai-output-action-dock__bar {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: auto;
    min-height: 60px;
    padding: 0 12px;
    overflow: visible;
    border-radius: 999px;
    background: var(--survai-card);
    border: 1px solid var(--survai-border);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
}

.survai-output-action-dock--compact .survai-output-action-dock__count,
.survai-output-action-dock--compact .survai-output-action-dock__action {
    display: inline-flex;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 0;
    width: auto;
    min-height: 60px;
    padding: 6px;
    margin: 0;
    border-right: 0;
    border-bottom: 0;
    font-size: 10px;
    line-height: 1;
}

.survai-output-action-dock--compact .survai-output-action-dock__count--qa {
    flex: 0 0 64px;
    min-width: 64px;
    width: auto;
    padding: 0 10px;
}

.survai-output-action-dock--compact .survai-output-action-dock__label {
    display: none;
}

.survai-output-action-dock--compact .survai-output-action-dock__icon {
    width: 44px;
    height: 44px;
    border-radius: 999px;
    background: var(--survai-card);
    border: 1px solid var(--survai-border);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
    color: var(--survai-text);
    font-size: 0;
    font-weight: 900;
    transition: background 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.survai-output-action-dock--compact .survai-output-action-dock__action:hover,
.survai-output-action-dock--compact .survai-output-action-dock__action:focus-visible {
    background: transparent;
    box-shadow: none;
}

.survai-output-action-dock--compact .survai-output-action-dock__action:hover .survai-output-action-dock__icon,
.survai-output-action-dock--compact .survai-output-action-dock__action:focus-visible .survai-output-action-dock__icon {
    background: var(--survai-brand-soft);
    border-color: var(--survai-brand);
    color: var(--survai-brand);
    box-shadow: none;
    transform: translateY(-1px);
}

.survai-output-action-dock--compact .survai-output-action-dock__icon svg,
.survai-output-action-dock--compact .survai-output-action-dock__icon .floating-tool-glyph {
    width: 24px;
    height: 24px;
    background: transparent;
    /* Glyph strokes follow the circle's ink (the base rule forces #fff, override here). */
    color: inherit;
    stroke: currentColor;
}

.survai-output-action-dock--compact .survai-output-action-dock__badge {
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    font-size: 0.68rem;
}

.survai-output-action-dock--compact .survai-output-action-dock__bar > .survai-output-action-dock__count:first-child {
    border-radius: 999px 0 0 999px;
}

.survai-output-action-dock--compact .survai-output-action-dock__bar > .survai-output-action-dock__action:first-child,
.survai-output-action-dock--compact .survai-output-action-dock__bar > .survai-output-action-dock__count:first-child + .survai-output-action-dock__action {
    border-radius: 999px 0 0 999px;
}

.survai-output-action-dock--compact .survai-output-action-dock__bar > .survai-output-action-dock__action:last-child {
    border-right: 0;
    border-radius: 0 999px 999px 0;
}

/* Image editor modal and centre bulk dock take priority over the page tools dock */
body:has([data-output-image-editor-modal]:not([hidden])) .floating-report-toolbar.survai-output-action-dock--compact {
    visibility: hidden;
    pointer-events: none;
}

/* So do the job cards (further investigations, rooms, legal, repairs). The
   dock is fixed at z-index 9980 and the card is a z-index 2000 overlay, so
   the dock stays on top of the card's own footer: on a 375px screen its
   launcher sat over Cancel and, once the home indicator's inset lifted it,
   over "Add to report" as well, and scrolling the card could not move a
   button out from under it (surveyor, 19 Sep 2026). Keyed on the class every
   card's open and close path already sets, so one rule covers all four. */
html.has-output-room-modal .floating-report-toolbar.survai-output-action-dock,
html.has-output-room-modal .floating-report-toolbar.survai-output-action-dock--compact {
    visibility: hidden;
    pointer-events: none;
}

body:has([data-output-image-bulk-bar]:not([hidden])) .floating-report-toolbar.survai-output-action-dock--compact {
    bottom: calc(96px + env(safe-area-inset-bottom, 0px));
}

.survai-output-action-dock__launcher {
    display: none;
}

@media (max-width: 760px) {
    .floating-report-toolbar.survai-output-action-dock--compact {
        /* Phones have no side rail (drawer nav) — keep the dock centred. */
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        flex-direction: column-reverse;
        align-items: center;
        gap: 10px;
        width: min(420px, calc(100vw - 20px));
    }

    .survai-output-action-dock__launcher {
        display: inline-grid;
        place-items: center;
        width: 52px;
        height: 52px;
        flex: 0 0 52px;
        /* The neutral dock's skin (surveyor, 3 Oct 2026): a white circle with a charcoal glyph,
           near black with a white glyph in dark mode; the navy gradient is gone. */
        border: 1px solid var(--survai-border);
        border-radius: 999px;
        padding: 0;
        background: var(--survai-surface);
        color: var(--survai-text);
        box-shadow: 0 10px 28px rgba(15, 23, 42, 0.16);
        cursor: pointer;
        pointer-events: auto;
    }

    .survai-output-action-dock__launcher:hover,
    .survai-output-action-dock__launcher:focus-visible {
        background: var(--survai-neutral-hover);
        outline: none;
        box-shadow: 0 12px 32px rgba(15, 23, 42, 0.2);
    }

    .survai-output-action-dock__launcher-icon {
        font-size: 1.45rem;
        font-weight: 900;
        line-height: 1;
        letter-spacing: 0.08em;
    }

    .floating-report-toolbar.survai-output-action-dock--compact.is-output-toolbar-collapsed .survai-output-action-dock__bar {
        display: none !important;
    }

    .floating-report-toolbar.survai-output-action-dock--compact.is-output-toolbar-expanded .survai-output-action-dock__navigator:not([hidden]) {
        margin-bottom: 4px;
    }

    .floating-report-toolbar.survai-output-action-dock--compact.is-output-toolbar-expanded .survai-output-action-dock__bar {
        box-shadow: 0 8px 18px rgba(15, 23, 42, 0.22);
        /* The dock is a column flex box, so the bar's width is its cross size,
           and a cross size of `auto` never resolves below the bar's own
           min-content width. Every child used to be flex: 0 0 70px, so that
           min-content was the whole row (440px) — wider than the phone. The bar
           sized itself to it and bled off BOTH edges, which is why it read as a
           square white band edge to edge (its rounded ends were off screen) with
           the last button cut in half, and why overflow-x had nothing to scroll:
           the box was as wide as its content. Cap it at the dock's width, and
           let the buttons below share what is left. */
        max-width: 100%;
        overflow-x: auto;
        justify-content: flex-start;
        scrollbar-width: none;
    }

    .floating-report-toolbar.survai-output-action-dock--compact.is-output-toolbar-expanded .survai-output-action-dock__bar::-webkit-scrollbar {
        display: none;
    }

    /* Share the bar's width between the buttons rather than demanding a fixed
       70px each: five fit on the narrowest phone, and the basis keeps them at a
       comfortable size on a wider one. */
    .survai-output-action-dock--compact .survai-output-action-dock__action {
        flex: 1 1 60px;
        /* 44px is the icon, so this is the floor at which a button is still
           tappable. Below it the bar scrolls (it can, now that max-width caps
           it) rather than overlapping the icons. */
        min-width: 44px;
        max-width: 92px;
    }

    /* No drag grip on a phone: it was eating 34px of a bar with none to spare,
       and a dock is not something anyone repositions by hand on a phone.
       restoreDockPosition() in app.js skips the same media query, so a stored
       position can never strand a dock that now has no grip to reset it. */
    .survai-output-action-dock--compact .survai-output-action-dock__drag {
        display: none;
    }
}

@media (max-width: 760px) {
    .floating-report-toolbar.survai-output-action-dock:not(.survai-output-action-dock--compact) {
        bottom: calc(16px + env(safe-area-inset-bottom, 0px));
        max-width: calc(100vw - 20px);
    }

    .floating-report-toolbar.survai-output-action-dock:not(.survai-output-action-dock--compact) .survai-output-action-dock__bar {
        min-height: 58px;
        border-radius: 28px;
    }

    .survai-output-action-dock:not(.survai-output-action-dock--compact) .survai-output-action-dock__count,
    .survai-output-action-dock:not(.survai-output-action-dock--compact) .survai-output-action-dock__action {
        min-width: auto;
        padding: 0 14px;
        gap: 8px;
        font-size: 12px;
    }

    .survai-output-action-dock:not(.survai-output-action-dock--compact) .survai-output-action-dock__badge {
        min-width: 32px;
        height: 32px;
        padding: 0 8px;
    }

    .survai-output-action-dock:not(.survai-output-action-dock--compact) .survai-output-action-dock__icon {
        font-size: 21px;
    }

    .survai-output-action-dock:not(.survai-output-action-dock--compact) .survai-output-action-dock__action span:last-child {
        max-width: 74px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    body:has([data-output-image-bulk-bar]:not([hidden])) .floating-report-toolbar.survai-output-action-dock--compact {
        /* Clear of the 60px selection pill (18px + 60px + 18px), so the launcher never touches it. */
        bottom: calc(96px + env(safe-area-inset-bottom, 0px));
    }
}

@media (max-width: 900px) {
    .floating-report-toolbar.survai-output-action-dock:not(.survai-output-action-dock--compact) {
        left: 50%;
        transform: translateX(-50%);
        width: auto;
    }
}

.media-manager-list {
    display: grid;
    gap: 12px;
}

.media-manager-item {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    padding: 14px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 16px;
    background: var(--survai-card);
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}

.media-manager-item__thumb {
    display: flex;
    width: 72px;
    height: 72px;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 14px;
    background: linear-gradient(145deg, rgba(27, 90, 249, 0.1), rgba(15, 23, 42, 0.04));
    color: var(--survai-blue, #1b5af9);
    font-weight: 850;
    letter-spacing: 0.04em;
}

.media-manager-item__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media-manager-media-thumb {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 10px;
    background: linear-gradient(145deg, rgba(27, 90, 249, 0.1), rgba(15, 23, 42, 0.04));
    color: var(--survai-blue, #1b5af9);
    text-decoration: none;
}

.media-manager-media-thumb img,
.media-manager-media-thumb video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}

.media-manager-media-thumb--video {
    background: #0b1321;
}

.media-manager-media-thumb--list {
    width: 72px;
    height: 72px;
    border-radius: 14px;
}

.media-manager-media-thumb--transcription {
    width: 80px;
    height: 60px;
}

.media-manager-media-thumb__icon {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    color: var(--survai-blue, #1b5af9);
}

.media-manager-media-thumb__icon svg {
    width: 28px;
    height: 28px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.media-manager-media-thumb__fallback {
    font-size: 0.72rem;
    font-weight: 850;
    letter-spacing: 0.06em;
}

.media-manager-transcription-row__identity {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.media-manager-transcription-row__copy {
    min-width: 0;
}

.media-manager-item__body {
    min-width: 0;
}

.media-manager-item__body h3 {
    margin: 0;
    overflow: hidden;
    color: var(--survai-text, #0b1321);
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.media-manager-item__body p {
    margin: 0.25rem 0 0;
    overflow: hidden;
    color: var(--survai-secondary);
    font-size: 0.9rem;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.media-manager-item__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.media-manager-item__meta span {
    display: inline-flex;
    min-height: 26px;
    align-items: center;
    padding: 4px 9px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 999px;
    background: var(--survai-bg);
    color: var(--survai-secondary);
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1.2;
}

.media-manager-empty-state {
    padding: clamp(24px, 5vw, 42px);
    border: 1px dashed rgba(15, 23, 42, 0.16);
    border-radius: 18px;
    background: var(--survai-bg-soft);
    text-align: center;
}

.media-manager-empty-state h3 {
    margin: 0;
    color: var(--survai-text, #0b1321);
    font-size: 1.05rem;
    font-weight: 850;
}

.media-manager-empty-state p {
    max-width: 34rem;
    margin: 0.45rem auto 0;
    color: var(--survai-secondary);
    line-height: 1.45;
}

.media-manager-bulk-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    padding: 12px 14px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 16px;
    background: var(--survai-bg-soft);
}

.media-manager-bulk-actions > div {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.media-manager-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
    padding: 8px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    box-shadow: none;
}

/* These carry their own display rule, which beats the browser's [hidden]. The page script hides
   them when the last video or audio file is deleted; without this the toolbar stayed on screen
   above "No videos uploaded yet". */
.media-manager-filter-bar[hidden],
.media-manager-bulk-actions[hidden],
.media-manager-video-list[hidden],
.media-manager-audio-list[hidden] {
    display: none;
}

.media-manager-filter-bar__group,
.media-manager-filter-bar__actions {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.media-manager-filter-bar__actions {
    justify-content: flex-end;
}

.media-manager-filter-select {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    gap: 8px;
    padding: 5px 6px 5px 13px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 999px;
    background: var(--survai-card);
    color: var(--survai-ink-344054);
    font-size: 0.84rem;
    font-weight: 850;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.04);
}

/* The label keeps its own width: at phone width the select is 100% wide and
   squeezed "Size" onto two lines. */
.media-manager-filter-select span {
    flex: 0 0 auto;
    white-space: nowrap;
}

.media-manager-filter-select select {
    min-height: 28px;
    border: 0;
    border-radius: 999px;
    background: var(--survai-bg-deep);
    color: var(--survai-text-strong);
    font: inherit;
    outline: 0;
    padding: 4px 28px 4px 10px;
}

.media-manager-filter-pill,
.media-manager-filter-action {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 999px;
    background: var(--survai-card);
    color: var(--survai-ink-344054);
    font-size: 0.88rem;
    font-weight: 800;
    line-height: 1.1;
    text-decoration: none;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.04);
}

.media-manager-filter-pill--select {
    cursor: pointer;
}

.media-manager-filter-pill input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--survai-blue, #1b5af9);
}

.media-manager-filter-action {
    cursor: pointer;
}

.media-manager-filter-action--danger {
    border-color: rgba(180, 35, 24, 0.16);
    color: var(--survai-ink-b42318);
    background: var(--survai-tint-fff7f6);
}

.media-manager-filter-action--danger:hover:not(:disabled),
.media-manager-filter-action--danger:focus-visible:not(:disabled) {
    border-color: rgba(180, 35, 24, 0.32);
    background: var(--survai-tint-fef3f2);
    color: var(--survai-ink-912018);
}

.media-manager-filter-action:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.media-manager-select-all,
.media-manager-card-select {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--survai-ink-475467);
    font-size: 0.9rem;
    font-weight: 800;
}

.media-manager-select-all input,
.media-manager-card-select input {
    width: 18px;
    height: 18px;
    accent-color: var(--survai-blue, #1b5af9);
}

.media-manager-card-select {
    justify-content: center;
}

/* The video album mirrors the Photographs album: the same auto-fill grid keyed
   off the shared --image-manager-card-min (set by the Size selector), instead
   of a fixed two-column layout. */
.media-manager-video-list.video-grid {
    grid-template-columns: repeat(auto-fill, minmax(var(--image-manager-card-min, 220px), 1fr));
    margin-top: 0;
}

/* The <video> fills the square frame exactly like a photo thumbnail. */
.media-manager-video-card .image-manager-card__frame .video-card-preview-video,
.media-manager-video-card .image-manager-card__frame .video-placeholder {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: var(--survai-navy-surface);
}

.media-manager-video-card .image-manager-card__frame .video-placeholder {
    display: grid;
    place-items: center;
    color: rgba(255, 255, 255, 0.85);
    font-size: 1.6rem;
}

/* Delete reveals on hover/focus, as on the photo cards. The select circle
   stays visible so multi-select is discoverable. */
.media-manager-video-card .survai-photo-card-delete {
    opacity: 0;
    transition: opacity 120ms ease;
}

.media-manager-video-card:hover .survai-photo-card-delete,
.media-manager-video-card:focus-within .survai-photo-card-delete {
    opacity: 1;
}

/* While a video plays fullscreen, none of the card chrome (select circles,
   hover delete buttons) may paint — exiting fullscreen could leave the album
   grid composited over the still-playing video (media-playback.js toggles
   the class and forces a repaint on exit). */
body.has-fullscreen-video .photo-select-check,
body.has-fullscreen-video .media-select-check,
body.has-fullscreen-video .survai-photo-card-delete {
    visibility: hidden;
}

/* The video card is the picture and nothing else: no file name, size, date or
   status line under it, and so no List view either (surveyor, 2 Oct 2026). */

/* Video cards now use the shared .photo-select-check circle (same as the
   Photographs album); the old bespoke checkbox positioning is gone — its
   `width: auto` would have collapsed the circle. Audio keeps its own. */

.media-manager-video-card__preview.video-thumbnail {
    border-radius: 0;
}

@media (min-width: 900px) {
    .media-manager-video-list.video-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 1280px) {
    .media-manager-video-list.video-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.media-manager-audio-list {
    display: grid;
    gap: 14px;
}

.media-manager-audio-card {
    display: grid;
    grid-template-columns: 32px 58px minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    padding: 16px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 18px;
    background: var(--survai-card);
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.07);
}

.media-manager-audio-card__icon {
    display: flex;
    width: 58px;
    height: 58px;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    background: rgba(27, 90, 249, 0.08);
    color: var(--survai-blue, #1b5af9);
}

.media-manager-audio-card__icon svg {
    width: 28px;
    height: 28px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.media-manager-audio-card__copy {
    min-width: 0;
}

.media-manager-audio-card__copy h3 {
    margin: 0;
    overflow: hidden;
    color: var(--survai-text, #0b1321);
    font-size: 1.05rem;
    font-weight: 850;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.media-manager-audio-card__copy p {
    margin: 0.3rem 0 0;
    overflow: hidden;
    color: var(--survai-secondary);
    font-size: 0.9rem;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.media-manager-audio-card__copy audio {
    width: min(100%, 520px);
    margin-top: 10px;
}

.media-manager-audio-card__details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 14px;
    margin: 12px 0 0;
}

.media-manager-audio-card__details div {
    min-width: 0;
}

.media-manager-audio-card__details dt {
    color: var(--survai-muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.media-manager-audio-card__details dd {
    margin: 3px 0 0;
    overflow: hidden;
    color: var(--survai-ink-344054);
    font-size: 0.88rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.media-manager-audio-card__actions {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.media-manager-transcription-shell {
    display: grid;
    gap: 18px;
}

.media-manager-transcription-summary {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 12px;
}

.media-manager-transcription-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.media-manager-transcription-list {
    display: grid;
    gap: 10px;
}

.media-manager-transcription-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 16px;
    background: var(--survai-card);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.media-manager-transcription-select {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
}

.media-manager-transcription-select input {
    width: 18px;
    height: 18px;
    accent-color: #3d4861;
}

.media-manager-transcription-row > div {
    min-width: 0;
}

.media-manager-transcription-row strong {
    display: block;
    overflow: hidden;
    color: var(--survai-text, #0b1321);
    font-size: 0.98rem;
    font-weight: 850;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.media-manager-transcription-row span:not(.media-manager-transcription-pill) {
    display: block;
    margin-top: 3px;
    overflow: hidden;
    color: var(--survai-secondary);
    font-size: 0.86rem;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.media-manager-transcription-pill {
    display: inline-flex;
    min-height: 30px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    padding: 5px 12px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 999px;
    background: var(--survai-bg);
    color: var(--survai-secondary);
    font-size: 0.78rem;
    font-weight: 850;
    line-height: 1.15;
}

.media-manager-transcription-pill--ready {
    border-color: rgba(16, 185, 129, 0.24);
    background: color-mix(in srgb, var(--survai-tint-ecfdf5) 92%, transparent);
    color: var(--survai-ink-047857);
}

.media-manager-transcription-pill--processing {
    border-color: rgba(27, 90, 249, 0.2);
    background: color-mix(in srgb, var(--survai-tint-eff6ff) 92%, transparent);
    color: var(--survai-blue, #1b5af9);
}

.media-manager-transcription-pill--needs-attention {
    border-color: rgba(244, 63, 94, 0.22);
    background: color-mix(in srgb, var(--survai-tint-fff1f2) 92%, transparent);
    color: var(--survai-ink-be123c);
}

.media-manager-transcription-pill--not-started {
    border-color: rgba(148, 163, 184, 0.22);
    background: color-mix(in srgb, var(--survai-bg) 96%, transparent);
    color: var(--survai-ink-475467);
}

.media-manager-transcription-pill--uploaded,
.media-manager-transcription-pill--pending-audio-extraction,
.media-manager-transcription-pill--extracting-audio,
.media-manager-transcription-pill--queued-for-transcription,
.media-manager-transcription-pill--transcribing {
    border-color: rgba(27, 90, 249, 0.2);
    background: color-mix(in srgb, var(--survai-tint-eff6ff) 92%, transparent);
    color: var(--survai-blue, #1b5af9);
}

.media-manager-transcription-pill--approved,
.media-manager-transcription-pill--awaiting-transcript-review {
    border-color: rgba(16, 185, 129, 0.24);
    background: color-mix(in srgb, var(--survai-tint-ecfdf5) 92%, transparent);
    color: var(--survai-ink-047857);
}

.media-manager-transcription-pill--failed-needs-retry,
.media-manager-transcription-pill--needs-retry {
    border-color: rgba(244, 63, 94, 0.22);
    background: color-mix(in srgb, var(--survai-tint-fff1f2) 92%, transparent);
    color: var(--survai-ink-be123c);
}

.media-manager-transcription-error {
    display: block;
    max-width: 280px;
    margin-top: 6px;
    font-size: 0.74rem;
    line-height: 1.4;
    color: var(--survai-ink-be123c);
    word-break: break-word;
}

@media (max-width: 720px) {
    .media-manager-item {
        grid-template-columns: 56px minmax(0, 1fr);
        padding: 12px;
    }

    .media-manager-item__thumb {
        width: 56px;
        height: 56px;
        border-radius: 12px;
        font-size: 0.78rem;
    }

    .media-manager-item__meta {
        gap: 6px;
    }

    .media-manager-item__meta span {
        max-width: 100%;
    }

    .media-manager-card-select {
        justify-content: flex-end;
    }

    .media-manager-audio-card {
        grid-template-columns: 1fr;
        padding: 12px;
    }

    .media-manager-bulk-actions,
    .media-manager-bulk-actions > div {
        align-items: stretch;
        flex-direction: column;
    }

    .media-manager-filter-bar {
        align-items: stretch;
        flex-direction: column;
        border-radius: 20px;
    }

    .media-manager-filter-bar__group,
    .media-manager-filter-bar__actions {
        align-items: stretch;
        flex-direction: column;
        width: 100%;
    }

    .media-manager-filter-pill,
    .media-manager-filter-action {
        width: 100%;
    }

    .media-manager-filter-select,
    .media-manager-filter-select select {
        width: 100%;
    }

    .media-manager-bulk-actions .btn {
        width: 100%;
    }

    .media-manager-audio-card__icon {
        width: 52px;
        height: 52px;
    }

    .media-manager-audio-card__details {
        grid-template-columns: 1fr;
    }

    .media-manager-audio-card__actions {
        justify-content: stretch;
    }

    .media-manager-audio-card__actions .btn {
        flex: 1 1 150px;
    }

    .media-manager-transcription-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .media-manager-transcription-actions .btn {
        width: 100%;
    }

    .media-manager-transcription-row {
        align-items: flex-start;
        flex-direction: column;
        padding: 12px;
    }

    .media-manager-media-thumb--transcription {
        width: 60px;
        height: 45px;
    }

    .media-manager-transcription-row__identity {
        width: 100%;
    }

    .media-manager-transcription-pill {
        width: 100%;
    }
}

.image-manager-filterbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 0 0 14px;
}

.image-manager-view-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin: 0 0 14px;
    padding: 10px;
    border: 1px solid rgba(213, 222, 235, 0.92);
    border-radius: 18px;
    background: color-mix(in srgb, var(--survai-card) 94%, transparent);
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.06);
}

.image-manager-selection-controls {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.image-manager-zoom-controls {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px;
    border: 1px solid var(--survai-border);
    border-radius: 999px;
    background: var(--survai-card);
}

.image-manager-zoom-controls span {
    min-width: 142px;
    color: var(--survai-muted);
    font-size: 0.84rem;
    text-align: center;
}

.image-manager-filterbar label {
    display: grid;
    gap: 5px;
}

.image-manager-filterbar label {
    width: min(380px, 100%);
}

.image-manager-bulk-toolbar {
    display: inline-flex;
    flex: 1 1 640px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    min-width: min(100%, 520px);
    margin: 0;
    border-left: 1px solid rgba(213, 222, 235, 0.9);
    padding: 4px 0 4px 12px;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
}

.image-manager-bulk-toolbar[hidden] {
    display: none !important;
}

.image-manager-bulk-toolbar > strong {
    min-width: 132px;
    color: var(--survai-navy-ink);
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.image-manager-bulk-toolbar__group {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding-left: 10px;
    border-left: 1px solid rgba(213, 222, 235, 0.78);
}

.image-manager-bulk-toolbar__group:first-of-type {
    padding-left: 0;
    border-left: 0;
}

.image-manager-bulk-icon-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 34px;
    padding-inline: 10px;
    border-radius: 999px;
}

.image-manager-bulk-icon-btn svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
}

@media (max-width: 720px) {
    .image-manager-view-controls {
        align-items: stretch;
    }

    .image-manager-zoom-controls {
        width: 100%;
        justify-content: space-between;
    }

    .image-manager-bulk-toolbar {
        flex: 1 1 100%;
        min-width: 0;
        overflow-x: auto;
        flex-wrap: nowrap;
        border-left: 0;
        border-top: 1px solid rgba(213, 222, 235, 0.9);
        padding: 10px 0 2px;
        -webkit-overflow-scrolling: touch;
    }

    .image-manager-bulk-toolbar__group {
        flex: 0 0 auto;
        flex-wrap: nowrap;
    }
}

.image-manager-bulk-edit-modal {
    position: fixed;
    inset: 0;
    z-index: 2700;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(2, 8, 23, 0.52);
}

.image-manager-bulk-edit-modal[hidden] {
    display: none;
}

.image-manager-bulk-edit-modal__panel {
    width: min(560px, 100%);
    border: 1px solid var(--survai-border);
    border-radius: 12px;
    padding: 18px;
    background: var(--survai-card);
    box-shadow: 0 30px 90px rgba(2, 8, 23, 0.34);
}

.image-manager-bulk-edit-modal__head {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.image-manager-bulk-edit-modal__head h2 {
    margin: 0;
    color: var(--survai-navy-ink);
    font-size: 1.18rem;
}

.image-manager-bulk-edit-modal__body {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.image-manager-bulk-edit-modal__body label {
    display: grid;
    gap: 6px;
}

.image-manager-bulk-edit-modal__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
}

.image-manager-grid {
    grid-template-columns: repeat(auto-fill, minmax(var(--image-manager-card-min, 220px), 1fr));
    margin-top: 18px;
}

.image-manager-grid-state {
    display: grid;
    justify-items: center;
    gap: 16px;
    margin-top: 18px;
}

.image-manager-skeleton-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--image-manager-card-min, 220px), 1fr));
    gap: 18px;
    width: 100%;
}

.image-manager-skeleton-grid[hidden] {
    display: none;
}

.image-manager-skeleton-grid span {
    display: block;
    min-height: 190px;
    border: 1px solid rgba(213, 222, 235, 0.95);
    background:
        linear-gradient(90deg, rgba(245, 248, 252, 0.95), rgba(232, 238, 247, 0.92), rgba(245, 248, 252, 0.95));
    background-size: 220% 100%;
    animation: image-manager-skeleton 1.2s ease-in-out infinite;
}

.image-manager-load-error {
    max-width: 520px;
    margin: 0;
    padding: 10px 14px;
    border: 1px solid rgba(220, 38, 38, 0.16);
    border-radius: 12px;
    background: color-mix(in srgb, var(--survai-tint-fef2f2) 86%, transparent);
    color: var(--survai-ink-9f1d1d);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.45;
    text-align: center;
}

@keyframes image-manager-skeleton {
    0% {
        background-position: 100% 0;
    }
    100% {
        background-position: -100% 0;
    }
}

.image-manager-card {
    align-content: start;
    padding: 0;
    overflow: visible;
    border-radius: 0 !important;
    border: 0;
    background: transparent;
    box-shadow: none;
    clip-path: none !important;
    -webkit-mask-image: none !important;
    mask-image: none !important;
}

.image-manager-card[hidden] {
    display: none !important;
}

.image-manager-card.is-deleting,
[data-photo-card].is-deleting {
    opacity: 0.45;
    pointer-events: none;
}

[data-photo-card].is-deleting[hidden] {
    display: none !important;
}

.image-manager-thumb {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    overflow: visible;
    border: 0;
    border-radius: 0 !important;
    clip-path: none !important;
    -webkit-mask-image: none !important;
    mask-image: none !important;
    color: inherit;
    background: transparent;
    cursor: zoom-in;
    text-align: inherit;
}

.image-manager-card .image-manager-thumb > .image-manager-photo-image,
.image-manager-card .image-manager-thumb > img[data-photo-preview-img],
.image-manager-card .image-manager-thumb > img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    border: 0;
    border-radius: 0 !important;
    clip-path: none !important;
    -webkit-mask-image: none !important;
    mask-image: none !important;
    object-fit: contain;
    background: #f3f6fa;
}

.image-manager-thumb-placeholder {
    display: grid;
    width: 100%;
    aspect-ratio: 4 / 3;
    place-items: center;
    border: 1px dashed rgba(148, 163, 184, 0.7);
    color: var(--survai-muted);
    font-size: 0.88rem;
    font-weight: 700;
    text-align: center;
    background: #f8fafc;
}

img.image-manager-photo-image,
.image-manager-card img[data-photo-preview-img] {
    border-radius: 0 !important;
    clip-path: none !important;
    -webkit-mask-image: none !important;
    mask-image: none !important;
    object-fit: contain !important;
}

:is(.media-manager-panel .image-manager-card--grid, .survai-photo-tile) .image-manager-card__frame .image-manager-photo-image,
:is(.media-manager-panel .image-manager-card--grid, .survai-photo-tile) .image-manager-card__frame img[data-photo-preview-img] {
    width: 100% !important;
    height: 100% !important;
    aspect-ratio: auto !important;
    object-fit: cover !important;
    object-position: center;
}

.image-manager-photo-form {
    padding: 14px;
}

.image-manager-panel:not([data-display-mode="full"]) .image-manager-photo-form,
.image-manager-panel:not([data-display-mode="full"]):not([data-select-mode="cover"]) .image-manager-cover-form {
    display: none;
}

.image-manager-meta {
    padding-bottom: 2px;
}

.image-manager-meta strong {
    color: var(--survai-navy-ink);
    font-size: 0.95rem;
    line-height: 1.35;
}

.image-manager-meta .image-manager-quarantine-badge {
    margin-top: 2px;
}

.image-manager-meta span,
.image-manager-meta em {
    color: var(--survai-muted);
    font-size: 0.82rem;
    line-height: 1.35;
}

.image-manager-card .form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.image-manager-card textarea {
    min-height: 84px;
}

.image-manager-actions {
    align-items: center;
    gap: 8px;
}

.image-manager-cover-form {
    display: flex;
    justify-content: flex-end;
    padding: 0 14px 14px;
}

.media-manager-cover-selection-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 16px;
    border: 1px solid rgba(37, 99, 235, 0.14);
    border-radius: 18px;
    padding: 16px;
    background: var(--survai-tint-f8fbff);
    box-shadow: 0 16px 38px rgba(15, 23, 42, 0.06);
}

.media-manager-cover-selection-banner div {
    display: grid;
    gap: 4px;
}

.media-manager-cover-selection-banner strong {
    color: var(--survai-navy-ink);
    font-size: 1rem;
    font-weight: 800;
}

.media-manager-cover-selection-banner span {
    color: var(--survai-muted);
    font-size: 0.84rem;
    font-weight: 600;
}

.image-manager-settings-panel {
    position: fixed;
    z-index: 2200;
    top: 86px;
    right: 24px;
    width: min(330px, calc(100vw - 32px));
    max-height: calc(100dvh - 110px);
    overflow: auto;
    border: 1px solid var(--survai-border-ink);
    border-radius: 18px;
    padding: 0;
    background: var(--survai-card);
    box-shadow: 0 26px 70px rgba(15, 23, 42, 0.18);
}

.image-manager-settings-panel[hidden] {
    display: none;
}

.image-manager-settings-panel__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 16px 12px;
    border-bottom: 1px solid var(--survai-border-soft);
    background: linear-gradient(180deg, var(--survai-card) 0%, var(--survai-bg) 100%);
}

.image-manager-settings-panel__head .eyebrow {
    margin: 0 0 5px;
    color: var(--survai-muted);
    font-size: 0.7rem;
    letter-spacing: 0.08em;
}

.image-manager-settings-panel__head h2 {
    margin: 0;
    color: var(--survai-navy-ink);
    font-size: 1.02rem;
    line-height: 1.1;
}

.image-manager-settings-options {
    display: grid;
    gap: 6px;
    margin: 0;
    padding: 14px;
    border: 0;
}

.image-manager-settings-options legend {
    margin: 0 0 4px;
    color: var(--survai-muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.image-manager-settings-options label {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 10px 11px;
    border: 1px solid var(--survai-border-faint);
    border-radius: 12px;
    background: var(--survai-card);
    color: var(--survai-navy-ink);
    font-size: 0.9rem;
    font-weight: 750;
    cursor: pointer;
    transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.image-manager-settings-options label:hover,
.image-manager-settings-options label:focus-within {
    border-color: rgba(27, 90, 249, 0.32);
    background: var(--survai-tint-f8fbff);
    box-shadow: 0 10px 24px rgba(27, 90, 249, 0.08);
}

.image-manager-settings-options input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: #1b5af9;
    flex: 0 0 auto;
}

@media (max-width: 640px) {
    .image-manager-settings-panel {
        top: auto;
        right: 10px;
        bottom: calc(14px + env(safe-area-inset-bottom, 0px));
        left: 10px;
        width: auto;
        max-height: min(520px, calc(100dvh - 32px));
        border-radius: 18px;
    }
}

.image-manager-selection-box {
    position: fixed;
    z-index: 2100;
    border: 1px solid rgba(27, 90, 249, 0.86);
    border-radius: 8px;
    background: rgba(27, 90, 249, 0.12);
    pointer-events: none;
}

.image-manager-selection-box[hidden] {
    display: none;
}

.image-manager-modal {
    position: fixed;
    inset: 0;
    z-index: 2600;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(2, 8, 23, 0.74);
}

.image-manager-modal[hidden] {
    display: none;
}

.image-manager-modal__dialog {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 380px);
    width: min(1320px, 100%);
    height: min(860px, calc(100dvh - 36px));
    overflow: hidden;
    border-radius: 0 !important;
    background: var(--survai-card);
    box-shadow: 0 30px 90px rgba(2, 8, 23, 0.42);
    clip-path: none !important;
    -webkit-mask-image: none !important;
    mask-image: none !important;
}

.image-manager-modal__media {
    display: grid;
    min-width: 0;
    min-height: 0;
    place-items: center;
    background: #0a0a0a;
    border-radius: 0 !important;
    clip-path: none !important;
    -webkit-mask-image: none !important;
    mask-image: none !important;
}

.image-manager-modal__media img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    border-radius: 0 !important;
    clip-path: none !important;
    -webkit-mask-image: none !important;
    mask-image: none !important;
    object-fit: contain;
}

.image-manager-modal__panel {
    display: grid;
    grid-template-rows: auto auto auto minmax(90px, 1fr) auto auto;
    gap: 14px;
    min-height: 0;
    overflow: auto;
    padding: 18px;
}

.image-manager-modal__label-field {
    display: grid;
    gap: 6px;
}

.image-manager-modal__label-field label {
    color: var(--survai-muted);
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
}

.image-manager-modal__label-field input {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--field-border-color);
    border-radius: 10px;
    font: inherit;
}

.image-manager-modal__tool-row {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
}

.image-manager-modal__tool-row .btn {
    flex: 0 0 auto;
    white-space: nowrap;
}

.image-manager-modal__status {
    margin: 0;
    min-height: 1.2em;
    font-size: 0.84rem;
    color: var(--survai-muted);
}

.image-manager-modal__status[data-status="success"] {
    color: var(--survai-ink-166534);
}

.image-manager-modal__status[data-status="error"] {
    color: var(--survai-ink-b91c1c);
}

.image-manager-modal__head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.image-manager-modal__head h2 {
    margin: 0;
    overflow-wrap: anywhere;
}

.image-manager-modal__details {
    display: grid;
    gap: 10px;
    margin: 0;
}

.image-manager-modal__details div {
    display: grid;
    gap: 3px;
}

.image-manager-modal__details dt,
.image-manager-modal__notes h3 {
    color: var(--survai-muted);
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
}

.image-manager-modal__details dd {
    margin: 0;
    color: var(--survai-text);
    overflow-wrap: anywhere;
}

.image-manager-modal__notes {
    min-height: 0;
}

.image-manager-modal__notes p {
    margin: 6px 0 0;
    color: var(--survai-text);
    white-space: pre-wrap;
}

.image-manager-modal__actions {
    align-self: end;
}

.image-delete-dialog {
    position: fixed;
    inset: 0;
    z-index: 2800;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(2, 8, 23, 0.58);
}

.image-delete-dialog[hidden] {
    display: none;
}

.image-delete-dialog__panel {
    width: min(520px, 100%);
    border: 1px solid var(--survai-border);
    border-radius: 12px;
    padding: 18px;
    background: var(--survai-card);
    box-shadow: 0 30px 90px rgba(2, 8, 23, 0.34);
}

.image-delete-dialog__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 12px;
}

.image-delete-dialog__head h2 {
    margin: 0;
    color: var(--survai-navy-ink);
    font-size: 1.25rem;
}

.image-delete-dialog__progress {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
    align-items: center;
    margin: 16px 0 0;
}

.image-delete-dialog__progress[hidden] {
    display: none;
}

.image-delete-dialog__bar {
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--survai-tint-e8eef7);
}

.image-delete-dialog__bar span {
    display: block;
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: var(--survai-blue);
    transition: width 180ms ease;
}

.image-delete-dialog__progress .form-note {
    grid-column: 1 / -1;
    margin: 0;
}

.image-delete-dialog.is-error .image-delete-dialog__bar span {
    background: #dc2626;
}

.image-delete-dialog__actions {
    justify-content: flex-end;
    margin-top: 18px;
}

@media (max-width: 720px) {
    .image-manager-cta-card .section-head-actions {
        width: 100%;
        justify-content: flex-start;
    }

    /*
     * Phones: fixed column counts driven by the thumbnail-size preference
     * (the desktop minmax() card width can never fit three across a phone).
     */
    .image-manager-panel .image-manager-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }

    .image-manager-panel[data-zoom-level="small"] .image-manager-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 6px;
    }

    .image-manager-panel[data-zoom-level="large"] .image-manager-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .image-manager-panel[data-zoom-level="xlarge"] .image-manager-grid {
        grid-template-columns: 1fr;
    }

    /*
     * The photographs gallery sits inside two nested cards; on phones that
     * chrome costs ~56px of image width per side. Collapse the outer shell
     * and gutters so the grid runs nearly edge to edge.
     */
    body.media-manager-page .main-panel {
        padding-left: max(6px, env(safe-area-inset-left));
        padding-right: max(6px, env(safe-area-inset-right));
    }

    body.media-manager-page.survey-workflow-surface .main-panel > .media-manager-shell-card {
        padding: 0;
        border: none;
        box-shadow: none;
    }

    /* The page card has no padding at this width, so the Videos / Audio title lines up with
       the toolbar's own 8px inset. (On Photographs the title sits inside the grid's card,
       whose padding already does this.) */
    body.media-manager-page .media-manager-panel > .media-manager-tab-heading {
        padding: 10px 8px 0;
    }

    body.media-manager-page .media-manager-panel .image-manager-panel {
        padding: 10px 8px;
        gap: 12px;
    }

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

    .image-manager-bulk-toolbar {
        width: 100%;
        max-width: 100%;
    }

    .image-manager-bulk-toolbar > strong {
        min-width: 78px;
    }

    .image-manager-bulk-icon-btn {
        flex: 1 1 0;
        justify-content: center;
    }

    .image-manager-bulk-edit-modal__body {
        grid-template-columns: 1fr;
    }

    .image-manager-modal__dialog {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(0, 1fr) auto;
    }

    .image-manager-modal__panel {
        max-height: 46dvh;
    }
}

/* Final contrast audit guard: blue actions must always carry white content. */
[class*="primary-btn"],
[class*="create-survey"] {
    background: var(--survai-blue) !important;
    border-color: var(--survai-blue) !important;
    color: #ffffff !important;
}

[class*="primary-btn"] *,
[class*="create-survey"] * {
    color: inherit !important;
}

[class*="primary-btn"] svg,
[class*="create-survey"] svg {
    color: inherit !important;
    fill: none;
    stroke: currentColor !important;
}

[class*="primary-btn"]:hover,
[class*="create-survey"]:hover {
    background: var(--survai-blue-hover) !important;
    border-color: var(--survai-blue-hover) !important;
    color: #ffffff !important;
}

/* Blue surface contrast guard: any interactive Survai-blue control must remain white-on-blue. */
button[style*="#2563eb"],
a[style*="#2563eb"],
.btn[style*="#2563eb"],
button[style*="#1b5af9"],
a[style*="#1b5af9"],
.btn[style*="#1b5af9"],
button[style*="#1d4ed8"],
a[style*="#1d4ed8"],
.btn[style*="#1d4ed8"],
button[style*="--survai-blue"],
a[style*="--survai-blue"],
.btn[style*="--survai-blue"],
[class*="blue-btn"],
[class*="blue-button"],
[class*="blue-action"],
[class*="action-blue"] {
    color: #ffffff !important;
}

button[style*="#2563eb"] *,
a[style*="#2563eb"] *,
.btn[style*="#2563eb"] *,
button[style*="#1b5af9"] *,
a[style*="#1b5af9"] *,
.btn[style*="#1b5af9"] *,
button[style*="#1d4ed8"] *,
a[style*="#1d4ed8"] *,
.btn[style*="#1d4ed8"] *,
button[style*="--survai-blue"] *,
a[style*="--survai-blue"] *,
.btn[style*="--survai-blue"] *,
[class*="blue-btn"] *,
[class*="blue-button"] *,
[class*="blue-action"] *,
[class*="action-blue"] * {
    color: inherit !important;
}

button[style*="#2563eb"] svg,
a[style*="#2563eb"] svg,
.btn[style*="#2563eb"] svg,
button[style*="#1b5af9"] svg,
a[style*="#1b5af9"] svg,
.btn[style*="#1b5af9"] svg,
button[style*="#1d4ed8"] svg,
a[style*="#1d4ed8"] svg,
.btn[style*="#1d4ed8"] svg,
button[style*="--survai-blue"] svg,
a[style*="--survai-blue"] svg,
.btn[style*="--survai-blue"] svg,
[class*="blue-btn"] svg,
[class*="blue-button"] svg,
[class*="blue-action"] svg,
[class*="action-blue"] svg {
    color: inherit !important;
    stroke: currentColor !important;
}

/* ==========================================================
   Sidebar nav: compact square icon tiles (premium accent behind glyphs).
   ========================================================== */

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar .sidebar-nav a,
body.dashboard-body .sidebar .sidebar-nav a,
body.ops-dashboard-page .sidebar .sidebar-nav a,
body.survey-workflow-surface .sidebar .sidebar-nav a,
body.progress-page .sidebar .sidebar-nav a {
    border-color: transparent !important;
    box-shadow: none !important;
    transform: none !important;
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar .sidebar-nav a.active,
body.dashboard-body .sidebar .sidebar-nav a.active,
body.ops-dashboard-page .sidebar .sidebar-nav a.active,
body.survey-workflow-surface .sidebar .sidebar-nav a.active,
body.progress-page .sidebar .sidebar-nav a.active {
    border-color: transparent !important;
    transform: none !important;
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar .sidebar-nav-icon,
body.dashboard-body .sidebar .sidebar-nav-icon,
body.ops-dashboard-page .sidebar .sidebar-nav-icon,
body.survey-workflow-surface .sidebar .sidebar-nav-icon,
body.progress-page .sidebar .sidebar-nav-icon {
    position: relative;
    z-index: 0;
    /* Prevent ::after backgrounds from sinking under ancestor layers (blue halo / rail reads as a gradient tile) */
    isolation: isolate;
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar .sidebar-nav-icon svg,
body.dashboard-body .sidebar .sidebar-nav-icon svg,
body.ops-dashboard-page .sidebar .sidebar-nav-icon svg,
body.survey-workflow-surface .sidebar .sidebar-nav-icon svg,
body.progress-page .sidebar .sidebar-nav-icon svg {
    position: relative;
    z-index: 1;
}

/* Sidebar rail: flat icon backing on every menu item; solid accent when active (no gradient). */
body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar .sidebar-nav a .sidebar-nav-icon::after,
body.dashboard-body .sidebar .sidebar-nav a .sidebar-nav-icon::after,
body.ops-dashboard-page .sidebar .sidebar-nav a .sidebar-nav-icon::after,
body.survey-workflow-surface .sidebar .sidebar-nav a .sidebar-nav-icon::after,
body.progress-page .sidebar .sidebar-nav a .sidebar-nav-icon::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 46px;
    height: 46px;
    transform: translate(-50%, -50%);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.11);
    box-shadow: none;
    z-index: 0;
    mix-blend-mode: normal;
    pointer-events: none;
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar .sidebar-nav a:hover:not(.active) .sidebar-nav-icon::after,
body.dashboard-body .sidebar .sidebar-nav a:hover:not(.active) .sidebar-nav-icon::after,
body.ops-dashboard-page .sidebar .sidebar-nav a:hover:not(.active) .sidebar-nav-icon::after,
body.survey-workflow-surface .sidebar .sidebar-nav a:hover:not(.active) .sidebar-nav-icon::after,
body.progress-page .sidebar .sidebar-nav a:hover:not(.active) .sidebar-nav-icon::after {
    background: rgba(255, 255, 255, 0.11);
    border-color: rgba(255, 255, 255, 0.16);
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar .sidebar-nav a:focus-visible:not(.active) .sidebar-nav-icon::after,
body.dashboard-body .sidebar .sidebar-nav a:focus-visible:not(.active) .sidebar-nav-icon::after,
body.ops-dashboard-page .sidebar .sidebar-nav a:focus-visible:not(.active) .sidebar-nav-icon::after,
body.survey-workflow-surface .sidebar .sidebar-nav a:focus-visible:not(.active) .sidebar-nav-icon::after,
body.progress-page .sidebar .sidebar-nav a:focus-visible:not(.active) .sidebar-nav-icon::after {
    background: rgba(255, 255, 255, 0.11);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 0 2px rgba(27, 90, 249, 0.38);
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar .sidebar-nav a.active .sidebar-nav-icon::after,
body.dashboard-body .sidebar .sidebar-nav a.active .sidebar-nav-icon::after,
body.ops-dashboard-page .sidebar .sidebar-nav a.active .sidebar-nav-icon::after,
body.survey-workflow-surface .sidebar .sidebar-nav a.active .sidebar-nav-icon::after,
body.progress-page .sidebar .sidebar-nav a.active .sidebar-nav-icon::after {
    /* Flat fill = `--survai-logo-blue` (sampled from `survai-wordmark-menu.png`) */
    background: var(--survai-logo-blue, #1b5af9);
    border: 1px solid rgba(255, 255, 255, 0.22);
    box-shadow: none;
    opacity: 1;
    mix-blend-mode: normal;
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body)
    .sidebar
    .sidebar-nav
    a.active:focus-visible
    .sidebar-nav-icon::after,
body.dashboard-body .sidebar .sidebar-nav a.active:focus-visible .sidebar-nav-icon::after,
body.ops-dashboard-page .sidebar .sidebar-nav a.active:focus-visible .sidebar-nav-icon::after,
body.survey-workflow-surface .sidebar .sidebar-nav a.active:focus-visible .sidebar-nav-icon::after,
body.progress-page .sidebar .sidebar-nav a.active:focus-visible .sidebar-nav-icon::after {
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.52);
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar .sidebar-nav a.active .sidebar-nav-icon,
body.dashboard-body .sidebar .sidebar-nav a.active .sidebar-nav-icon,
body.ops-dashboard-page .sidebar .sidebar-nav a.active .sidebar-nav-icon,
body.survey-workflow-surface .sidebar .sidebar-nav a.active .sidebar-nav-icon,
body.progress-page .sidebar .sidebar-nav a.active .sidebar-nav-icon {
    color: #ffffff;
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar .sidebar-nav a.active .sidebar-nav-label,
body.dashboard-body .sidebar .sidebar-nav a.active .sidebar-nav-label,
body.ops-dashboard-page .sidebar .sidebar-nav a.active .sidebar-nav-label,
body.survey-workflow-surface .sidebar .sidebar-nav a.active .sidebar-nav-label,
body.progress-page .sidebar .sidebar-nav a.active .sidebar-nav-label {
    color: rgba(255, 255, 255, 0.96) !important;
    font-weight: 400 !important;
}

@media (min-width: 901px) {
    body.sidebar-desktop-collapsed:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body)
        .sidebar
        .sidebar-nav
        a
        .sidebar-nav-icon::after,
    body.sidebar-desktop-collapsed.dashboard-body .sidebar .sidebar-nav a .sidebar-nav-icon::after,
    body.sidebar-desktop-collapsed.ops-dashboard-page .sidebar .sidebar-nav a .sidebar-nav-icon::after,
    body.sidebar-desktop-collapsed.survey-workflow-surface .sidebar .sidebar-nav a .sidebar-nav-icon::after,
    body.sidebar-desktop-collapsed.progress-page .sidebar .sidebar-nav a .sidebar-nav-icon::after {
        width: 42px;
        height: 42px;
        border-radius: 9px;
    }
}

/*
 * Menu / app-chrome CTAs only: flat fills (no tinted lift shadow that reads like a gradient).
 * Main-panel primary buttons keep default elevation from earlier .btn-primary rules.
 */
.sidebar .btn-primary,
.sidebar a.btn-primary,
.sidebar button.btn-primary,
.mobile-app-header .btn-primary,
.mobile-app-header a.btn-primary,
.mobile-app-header button.btn-primary,
.workspace-topbar .btn-primary,
.workspace-topbar a.btn-primary,
.workspace-topbar button.btn-primary {
    background-color: #1b5af9 !important;
    background-image: none !important;
    border-color: #1b5af9 !important;
    box-shadow: none !important;
}

.sidebar .btn-primary:hover,
.sidebar a.btn-primary:hover,
.sidebar button.btn-primary:hover,
.mobile-app-header .btn-primary:hover,
.mobile-app-header a.btn-primary:hover,
.mobile-app-header button.btn-primary:hover,
.workspace-topbar .btn-primary:hover,
.workspace-topbar a.btn-primary:hover,
.workspace-topbar button.btn-primary:hover {
    background-color: var(--survai-blue-hover, #1648d4) !important;
    border-color: var(--survai-blue-hover, #1648d4) !important;
    box-shadow: none !important;
}

/* Mobile: flatten main-panel gradient (late cascade wins over premium SaaS hero blob). */
@media (max-width: 900px) {
    body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .main-panel,
    body.dashboard-body .main-panel,
    body.ops-dashboard-page .main-panel,
    body.survey-workflow-surface .main-panel,
    body.progress-page .main-panel {
        background: linear-gradient(180deg, var(--survai-card) 0%, var(--survai-bg) 46%, var(--survai-bg-line) 100%) !important;
    }
}


/* Standard white page/header title: shared by Dashboard topbar and all page headers. */
.page-header-title {
    margin: 0 !important;
    color: var(--survai-text, #0b1321) !important;
    font-size: clamp(1.45rem, 2vw, 1.65rem) !important;
    font-weight: 850 !important;
    line-height: 1.15 !important;
    letter-spacing: 0 !important;
}

.page-header .page-header-title,
.workflow-page-header .page-header-title,
.workspace-topbar .page-header-title,
.transcript-workspace-header .page-header-title {
    overflow: hidden;
    max-width: min(72vw, 920px);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.page-header-address {
    margin: 0.22rem 0 0;
    overflow: hidden;
    max-width: min(78vw, 960px);
    color: var(--survai-ink-7a8699);
    font-size: 0.84rem;
    font-weight: 650;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.workspace-topbar .page-header-address {
    max-width: min(72vw, 920px);
    font-size: 0.76rem;
    line-height: 1.2;
}

@media (max-width: 700px) {
    .page-header-title {
        font-size: 1.45rem !important;
        line-height: 1.15 !important;
    }

    .page-header-address {
        max-width: 100%;
        font-size: 0.8rem;
    }
}

/* Survai sidebar colour standard: light toolbar rail with slate glyphs/text. */
:root {
    --survai-sidebar-surface: #fafcfe;
    --survai-sidebar-ink: #3d4861;
    --theme-sidebar: var(--survai-sidebar-surface);
    --theme-sidebar-panel: var(--survai-sidebar-surface);
}

.sidebar .sidebar-nav a,
.sidebar .sidebar-nav a:hover,
.sidebar .sidebar-nav a:focus-visible,
.sidebar .sidebar-nav a.active,
.sidebar .sidebar-nav-label,
.sidebar .sidebar-footer,
.sidebar .sidebar-footer *,
.sidebar .user-pill,
.sidebar .user-pill *,
.sidebar a:not(.btn) {
    color: var(--survai-sidebar-ink) !important;
}

.sidebar .sidebar-nav-icon,
.sidebar .sidebar-nav-icon svg {
    color: var(--survai-sidebar-ink) !important;
    stroke: currentColor !important;
}

.sidebar .sidebar-nav-icon svg *,
.sidebar .sidebar-nav-icon svg .sai-icon-accent {
    stroke: currentColor !important;
}

.sidebar .sidebar-nav a .sidebar-nav-icon::after,
.sidebar .sidebar-nav a:hover:not(.active) .sidebar-nav-icon::after,
.sidebar .sidebar-nav a:focus-visible:not(.active) .sidebar-nav-icon::after,
.sidebar .sidebar-nav a.active .sidebar-nav-icon::after,
.sidebar .sidebar-nav a.active:focus-visible .sidebar-nav-icon::after {
    background: rgba(61, 72, 97, 0.06) !important;
    border-color: rgba(61, 72, 97, 0.12) !important;
    box-shadow: none !important;
}

.sidebar .sidebar-nav a:hover:not(.active) .sidebar-nav-icon::after,
.sidebar .sidebar-nav a:focus-visible:not(.active) .sidebar-nav-icon::after,
.sidebar .sidebar-nav a.active .sidebar-nav-icon::after {
    background: rgba(61, 72, 97, 0.1) !important;
}

.sidebar .sidebar-nav {
    scrollbar-width: thin;
}

.sidebar .sidebar-nav a {
    overflow: hidden !important;
}

.sidebar .sidebar-nav a .sidebar-nav-label,
.sidebar .sidebar-nav-label {
    display: block !important;
    max-width: 100% !important;
    min-width: 0;
    overflow: visible !important;
    color: currentColor !important;
    opacity: 1 !important;
    text-align: left;
    text-overflow: clip !important;
    visibility: visible !important;
    white-space: normal !important;
    overflow-wrap: anywhere;
}

/* Final sidebar label guard: every menu item must keep its visible name in desktop,
   collapsed desktop and mobile drawers. Earlier legacy rail styles sometimes clip
   or visually collapse label spans. */
body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar .sidebar-nav a {
    flex-direction: column !important;
    justify-content: center !important;
    overflow: hidden !important;
    color: var(--survai-sidebar-ink, #3d4861) !important;
    line-height: 1.18 !important;
    text-indent: 0 !important;
    white-space: normal !important;
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar .sidebar-nav a:has(.sidebar-nav-icon) {
    min-height: 44px !important;
    justify-content: start !important;
    padding-top: 8px !important;
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar .sidebar-nav a > .sidebar-nav-icon {
    align-items: center !important;
    justify-content: center !important;
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar .sidebar-nav a > .sidebar-nav-label {
    position: static !important;
    display: block !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    clip: auto !important;
    clip-path: none !important;
    overflow: hidden !important;
    color: var(--survai-sidebar-ink, #3d4861) !important;
    -webkit-text-fill-color: var(--survai-sidebar-ink, #3d4861) !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    opacity: 1 !important;
    text-align: left !important;
    text-indent: 0 !important;
    text-overflow: clip !important;
    transform: none !important;
    visibility: visible !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
}

@media (max-width: 900px) {
    body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar .sidebar-nav {
        max-height: calc(100dvh - 190px);
    }

    body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar .sidebar-nav a {
        min-height: 44px !important;
    }

    body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar .sidebar-nav a:has(.sidebar-nav-icon) {
        min-height: 44px !important;
    }
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar .sidebar-nav a.active > .sidebar-nav-label {
    color: var(--survai-sidebar-ink, #3d4861) !important;
    -webkit-text-fill-color: var(--survai-sidebar-ink, #3d4861) !important;
}

.sidebar-logout-button {
    justify-content: flex-start;
}

.sidebar-logout-icon {
    flex: 0 0 auto;
    place-items: center;
}

.sidebar-logout-icon svg {
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Final sidebar rhythm: consistent spacing and text weight across ops/workflow/settings rails. */
body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar:not(.sidebar--workspace) .sidebar-nav,
body.dashboard-body .sidebar.sidebar--ops .sidebar-nav,
body.ops-dashboard-page .sidebar.sidebar--ops .sidebar-nav {
    display: grid !important;
    gap: 8px !important;
    min-height: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    padding: 4px 2px !important;
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar:not(.sidebar--workspace) .sidebar-nav a,
body.dashboard-body .sidebar.sidebar--ops .sidebar-nav a,
body.ops-dashboard-page .sidebar.sidebar--ops .sidebar-nav a {
    display: grid !important;
    grid-template-columns: 24px minmax(0, 1fr);
    grid-template-rows: auto;
    align-content: center !important;
    align-items: center !important;
    justify-items: start !important;
    gap: 12px !important;
    min-height: 44px !important;
    padding: 8px 12px !important;
    border-radius: 12px !important;
    font-size: 14px !important;
    line-height: 18px !important;
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar:not(.sidebar--workspace) .sidebar-nav a:has(.sidebar-nav-icon),
body.dashboard-body .sidebar.sidebar--ops .sidebar-nav a:has(.sidebar-nav-icon),
body.ops-dashboard-page .sidebar.sidebar--ops .sidebar-nav a:has(.sidebar-nav-icon) {
    grid-template-rows: auto;
    min-height: 44px !important;
    padding: 8px 12px !important;
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar:not(.sidebar--workspace) .sidebar-nav a > .sidebar-nav-icon,
body.dashboard-body .sidebar.sidebar--ops .sidebar-nav a > .sidebar-nav-icon,
body.ops-dashboard-page .sidebar.sidebar--ops .sidebar-nav a > .sidebar-nav-icon {
    align-self: center !important;
    justify-self: center !important;
    width: 24px !important;
    height: 24px !important;
    flex: 0 0 24px !important;
    margin: 0 !important;
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar:not(.sidebar--workspace) .sidebar-nav a > .sidebar-nav-icon::after,
body.dashboard-body .sidebar.sidebar--ops .sidebar-nav a > .sidebar-nav-icon::after,
body.ops-dashboard-page .sidebar.sidebar--ops .sidebar-nav a > .sidebar-nav-icon::after {
    width: 42px !important;
    height: 42px !important;
    border-radius: 10px !important;
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar:not(.sidebar--workspace) .sidebar-nav a > .sidebar-nav-label,
body.dashboard-body .sidebar.sidebar--ops .sidebar-nav a > .sidebar-nav-label,
body.ops-dashboard-page .sidebar.sidebar--ops .sidebar-nav a > .sidebar-nav-label {
    display: block !important;
    align-self: center !important;
    justify-self: start !important;
    max-width: 100% !important;
    margin: 0 !important;
    color: var(--survai-sidebar-ink, #3d4861) !important;
    -webkit-text-fill-color: var(--survai-sidebar-ink, #3d4861) !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    letter-spacing: 0 !important;
    line-height: 18px !important;
    text-align: left !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar:not(.sidebar--workspace) .sidebar-nav a.active > .sidebar-nav-label,
body.dashboard-body .sidebar.sidebar--ops .sidebar-nav a.active > .sidebar-nav-label,
body.ops-dashboard-page .sidebar.sidebar--ops .sidebar-nav a.active > .sidebar-nav-label {
    font-weight: 600 !important;
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar:not(.sidebar--workspace) .user-pill,
body.dashboard-body .sidebar.sidebar--ops .user-pill,
body.ops-dashboard-page .sidebar.sidebar--ops .user-pill {
    gap: 4px !important;
    border-color: rgba(61, 72, 97, 0.12) !important;
    padding: 12px !important;
    background: rgba(61, 72, 97, 0.04) !important;
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar:not(.sidebar--workspace) .user-pill strong,
body.dashboard-body .sidebar.sidebar--ops .user-pill strong,
body.ops-dashboard-page .sidebar.sidebar--ops .user-pill strong {
    font-size: 0.84rem !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar:not(.sidebar--workspace) .user-pill span,
body.dashboard-body .sidebar.sidebar--ops .user-pill span,
body.ops-dashboard-page .sidebar.sidebar--ops .user-pill span {
    color: rgba(61, 72, 97, 0.72) !important;
    font-size: 0.76rem !important;
    font-weight: 500 !important;
    line-height: 1.25 !important;
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar:not(.sidebar--workspace) .sidebar-logout-button,
body.dashboard-body .sidebar.sidebar--ops .sidebar-logout-button,
body.ops-dashboard-page .sidebar.sidebar--ops .sidebar-logout-button {
    min-height: 42px !important;
    gap: 9px !important;
    padding: 10px 11px !important;
    font-size: 0.84rem !important;
    font-weight: 600 !important;
    line-height: 1.2 !important;
}

/* Sidebar symmetry lock: one exact icon cell and one exact label cell per menu item (rows,
   surveyor, 3 Oct 2026). */
body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar .sidebar-nav {
    align-content: start !important;
    gap: 4px !important;
    padding: 4px 0 !important;
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar .sidebar-nav a {
    display: grid !important;
    width: 100% !important;
    box-sizing: border-box !important;
    grid-template-columns: 24px minmax(0, 1fr) !important;
    grid-template-rows: auto !important;
    align-items: center !important;
    justify-items: start !important;
    gap: 12px !important;
    min-height: 44px !important;
    padding: 8px 12px !important;
    text-align: left !important;
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar .sidebar-nav a:not(:has(.sidebar-nav-icon)) {
    grid-template-columns: minmax(0, 1fr) !important;
    min-height: 44px !important;
    padding: 8px 12px !important;
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar .sidebar-nav a > .sidebar-nav-icon {
    position: relative !important;
    display: grid !important;
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    min-height: 24px !important;
    flex: 0 0 24px !important;
    place-items: center !important;
    align-self: center !important;
    justify-self: center !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1 !important;
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar .sidebar-nav a > .sidebar-nav-icon::after {
    left: 50% !important;
    top: 50% !important;
    width: 42px !important;
    height: 42px !important;
    transform: translate(-50%, -50%) !important;
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar .sidebar-nav a > .sidebar-nav-icon svg {
    display: block !important;
    width: 22px !important;
    height: 22px !important;
    max-width: 22px !important;
    max-height: 22px !important;
    overflow: visible !important;
    transform: none !important;
}

body.dashboard-body .sidebar.sidebar--ops .sidebar-nav a > .sidebar-nav-icon svg *,
body.ops-dashboard-page .sidebar.sidebar--ops .sidebar-nav a > .sidebar-nav-icon svg * {
    vector-effect: non-scaling-stroke;
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar .sidebar-nav a > .sidebar-nav-label {
    align-self: center !important;
    justify-self: start !important;
    min-height: 18px !important;
    max-width: 100% !important;
    line-height: 18px !important;
}

/* Report workspace toolbar: fixed geometry for perfectly centred icon rows. */
body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar.sidebar--workspace .sidebar-nav {
    display: grid !important;
    grid-auto-rows: auto !important;
    gap: 8px !important;
    align-content: start !important;
    min-height: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    padding: 4px 0 !important;
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar.sidebar--workspace .sidebar-nav a {
    display: grid !important;
    width: 100% !important;
    min-height: 44px !important;
    box-sizing: border-box !important;
    grid-template-columns: 24px minmax(0, 1fr) !important;
    grid-template-rows: auto !important;
    align-items: center !important;
    justify-items: start !important;
    align-content: center !important;
    gap: 12px !important;
    border-radius: 12px !important;
    padding: 8px 12px !important;
    text-align: left !important;
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar.sidebar--workspace .sidebar-nav a > .sidebar-nav-icon {
    position: relative !important;
    display: grid !important;
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    min-height: 24px !important;
    place-items: center !important;
    align-self: center !important;
    justify-self: center !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1 !important;
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar.sidebar--workspace .sidebar-nav a > .sidebar-nav-icon::after {
    left: 50% !important;
    top: 50% !important;
    width: 42px !important;
    height: 42px !important;
    border-radius: 10px !important;
    transform: translate(-50%, -50%) !important;
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar.sidebar--workspace .sidebar-nav a > .sidebar-nav-icon svg {
    display: block !important;
    width: 22px !important;
    height: 22px !important;
    max-width: 22px !important;
    max-height: 22px !important;
    overflow: visible !important;
    transform: none !important;
    transform-box: view-box !important;
    transform-origin: center !important;
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar.sidebar--workspace .sidebar-nav a > .sidebar-nav-icon svg *,
body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar.sidebar--workspace .sidebar-nav a > .sidebar-nav-icon svg path,
body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar.sidebar--workspace .sidebar-nav a > .sidebar-nav-icon svg circle,
body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar.sidebar--workspace .sidebar-nav a > .sidebar-nav-icon svg rect {
    vector-effect: non-scaling-stroke !important;
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar.sidebar--workspace .sidebar-nav a > .sidebar-nav-label {
    display: -webkit-box !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    align-self: center !important;
    justify-self: start !important;
    overflow: hidden !important;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    color: var(--survai-sidebar-ink, #3d4861) !important;
    -webkit-text-fill-color: var(--survai-sidebar-ink, #3d4861) !important;
    font-size: 0.9rem !important;
    font-weight: 500 !important;
    letter-spacing: 0 !important;
    line-height: 1.25 !important;
    text-align: left !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
}

/* ==========================================================
   Global Survai Navigation Design System
   Central visual layer for ops, workspace and admin sidebars.
   Keeps existing widths, routes, collapse behaviour and markup.
   ========================================================== */
:root {
    --sidebar-padding: 12px;
    --sidebar-brand-padding-block-start: 24px;
    --sidebar-brand-padding-block-end: 20px;
    --sidebar-brand-padding-inline: 24px;
    --sidebar-nav-padding-inline: 5px;
    --sidebar-nav-gap: 4px;
    --sidebar-group-gap: 8px;
    /* Rows (surveyor, 3 Oct 2026): a 24px icon cell beside a 14px label, 44px tall. */
    --sidebar-item-height: 44px;
    --sidebar-item-padding-inline: 12px;
    --sidebar-item-gap: 12px;
    --sidebar-font-size: 14px;
    --sidebar-line-height: 18px;
    --sidebar-icon-size: 22px;
    --sidebar-icon-cell-size: 24px;
    --sidebar-logout-icon-size: 18px;
    --sidebar-radius: 12px;
    --sidebar-ink-muted: rgba(61, 72, 97, 0.68);
    --sidebar-hover-bg: rgba(61, 72, 97, 0.055);
    --sidebar-active-bg: rgba(27, 90, 249, 0.082);
    --sidebar-active-ink: #1b5af9;
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar,
body.dashboard-body .sidebar,
body.ops-dashboard-page .sidebar,
body.survey-workflow-surface .sidebar,
body.progress-page .sidebar,
body.has-mobile-sidebar .sidebar {
    gap: var(--sidebar-group-gap) !important;
    padding: 0 var(--sidebar-padding) 16px !important;
    scrollbar-width: thin;
}

.sidebar-desktop-header-row,
body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar > .sidebar-brand,
body.dashboard-body .sidebar > .sidebar-brand,
body.ops-dashboard-page .sidebar > .sidebar-brand,
body.survey-workflow-surface .sidebar > .sidebar-brand,
body.progress-page .sidebar > .sidebar-brand {
    display: flex !important;
    align-items: center !important;
    justify-content: var(--sidebar-brand-justify, center) !important;
    min-height: auto !important;
    margin: 0 calc(var(--sidebar-padding) * -1) !important;
    padding: var(--sidebar-brand-padding-block-start) var(--sidebar-brand-padding-inline)
        var(--sidebar-brand-padding-block-end) !important;
}

.sidebar-desktop-header-row .sidebar-brand,
body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar > .sidebar-brand,
body.dashboard-body .sidebar > .sidebar-brand,
body.ops-dashboard-page .sidebar > .sidebar-brand,
body.survey-workflow-surface .sidebar > .sidebar-brand,
body.progress-page .sidebar > .sidebar-brand {
    width: 100% !important;
    min-width: 0 !important;
    justify-content: var(--sidebar-brand-justify, center) !important;
    padding: 0 !important;
}

.sidebar .sidebar-brand img.brand-logo-sidebar {
    display: block !important;
    max-width: 100% !important;
    height: auto !important;
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar .sidebar-nav,
body.dashboard-body .sidebar .sidebar-nav,
body.ops-dashboard-page .sidebar .sidebar-nav,
body.survey-workflow-surface .sidebar .sidebar-nav,
body.progress-page .sidebar .sidebar-nav {
    display: grid !important;
    align-content: start !important;
    gap: var(--sidebar-nav-gap) !important;
    min-height: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    padding: 0 var(--sidebar-nav-padding-inline) !important;
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar .sidebar-nav a,
body.dashboard-body .sidebar .sidebar-nav a,
body.ops-dashboard-page .sidebar .sidebar-nav a,
body.survey-workflow-surface .sidebar .sidebar-nav a,
body.progress-page .sidebar .sidebar-nav a {
    display: grid !important;
    grid-template-columns: var(--sidebar-icon-cell-size) minmax(0, 1fr) !important;
    grid-template-rows: auto !important;
    align-items: center !important;
    justify-items: start !important;
    align-content: center !important;
    width: 100% !important;
    min-height: var(--sidebar-item-height) !important;
    box-sizing: border-box !important;
    gap: var(--sidebar-item-gap) !important;
    margin: 0 !important;
    border-radius: var(--sidebar-radius) !important;
    padding: 8px var(--sidebar-item-padding-inline) !important;
    color: var(--survai-sidebar-ink, #3d4861) !important;
    background: transparent !important;
    font-size: var(--sidebar-font-size) !important;
    font-weight: 500 !important;
    letter-spacing: 0 !important;
    line-height: var(--sidebar-line-height) !important;
    text-align: left !important;
    text-decoration: none !important;
    transition: background-color 160ms ease, color 160ms ease, box-shadow 160ms ease !important;
}

/* An entry without an icon (older one-off rails) spans the row. */
body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar .sidebar-nav a:not(:has(.sidebar-nav-icon)),
body.dashboard-body .sidebar .sidebar-nav a:not(:has(.sidebar-nav-icon)),
body.ops-dashboard-page .sidebar .sidebar-nav a:not(:has(.sidebar-nav-icon)),
body.survey-workflow-surface .sidebar .sidebar-nav a:not(:has(.sidebar-nav-icon)),
body.progress-page .sidebar .sidebar-nav a:not(:has(.sidebar-nav-icon)) {
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: auto !important;
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar .sidebar-nav a:hover,
body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar .sidebar-nav a:focus-visible,
body.dashboard-body .sidebar .sidebar-nav a:hover,
body.dashboard-body .sidebar .sidebar-nav a:focus-visible,
body.ops-dashboard-page .sidebar .sidebar-nav a:hover,
body.ops-dashboard-page .sidebar .sidebar-nav a:focus-visible,
body.survey-workflow-surface .sidebar .sidebar-nav a:hover,
body.survey-workflow-surface .sidebar .sidebar-nav a:focus-visible,
body.progress-page .sidebar .sidebar-nav a:hover,
body.progress-page .sidebar .sidebar-nav a:focus-visible {
    background: var(--sidebar-hover-bg) !important;
    outline: none !important;
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar .sidebar-nav a.active,
body.dashboard-body .sidebar .sidebar-nav a.active,
body.ops-dashboard-page .sidebar .sidebar-nav a.active,
body.survey-workflow-surface .sidebar .sidebar-nav a.active,
body.progress-page .sidebar .sidebar-nav a.active {
    color: var(--survai-sidebar-ink, #3d4861) !important;
    font-weight: 600 !important;
}

.sidebar .sidebar-nav a::before,
.sidebar .sidebar-nav a > .sidebar-nav-icon::after {
    display: none !important;
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar .sidebar-nav a > .sidebar-nav-icon,
body.dashboard-body .sidebar .sidebar-nav a > .sidebar-nav-icon,
body.ops-dashboard-page .sidebar .sidebar-nav a > .sidebar-nav-icon,
body.survey-workflow-surface .sidebar .sidebar-nav a > .sidebar-nav-icon,
body.progress-page .sidebar .sidebar-nav a > .sidebar-nav-icon {
    position: static !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: var(--sidebar-icon-cell-size) !important;
    height: var(--sidebar-icon-cell-size) !important;
    min-width: var(--sidebar-icon-cell-size) !important;
    min-height: var(--sidebar-icon-cell-size) !important;
    flex: 0 0 var(--sidebar-icon-cell-size) !important;
    align-self: center !important;
    justify-self: center !important;
    margin: 0 !important;
    padding: 0 !important;
    color: currentColor !important;
    line-height: 1 !important;
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar .sidebar-nav a.active > .sidebar-nav-icon,
body.dashboard-body .sidebar .sidebar-nav a.active > .sidebar-nav-icon,
body.ops-dashboard-page .sidebar .sidebar-nav a.active > .sidebar-nav-icon,
body.survey-workflow-surface .sidebar .sidebar-nav a.active > .sidebar-nav-icon,
body.progress-page .sidebar .sidebar-nav a.active > .sidebar-nav-icon {
    color: var(--sidebar-active-ink) !important;
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar .sidebar-nav a > .sidebar-nav-icon svg,
body.dashboard-body .sidebar .sidebar-nav a > .sidebar-nav-icon svg,
body.ops-dashboard-page .sidebar .sidebar-nav a > .sidebar-nav-icon svg,
body.survey-workflow-surface .sidebar .sidebar-nav a > .sidebar-nav-icon svg,
body.progress-page .sidebar .sidebar-nav a > .sidebar-nav-icon svg, body.capture-mode-body .sidebar .sidebar-nav a > .sidebar-nav-icon svg {
    display: block !important;
    width: var(--sidebar-icon-size) !important;
    height: var(--sidebar-icon-size) !important;
    max-width: var(--sidebar-icon-size) !important;
    max-height: var(--sidebar-icon-size) !important;
    overflow: visible !important;
    stroke: currentColor !important;
    stroke-width: 1.55 !important;
    transform: none !important;
    transform-box: view-box !important;
    transform-origin: center !important;
}

.sidebar .sidebar-nav a > .sidebar-nav-icon svg *,
.sidebar .sidebar-nav a > .sidebar-nav-icon svg path,
.sidebar .sidebar-nav a > .sidebar-nav-icon svg circle,
.sidebar .sidebar-nav a > .sidebar-nav-icon svg rect {
    vector-effect: non-scaling-stroke !important;
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar .sidebar-nav a > .sidebar-nav-label,
body.dashboard-body .sidebar .sidebar-nav a > .sidebar-nav-label,
body.ops-dashboard-page .sidebar .sidebar-nav a > .sidebar-nav-label,
body.survey-workflow-surface .sidebar .sidebar-nav a > .sidebar-nav-label,
body.progress-page .sidebar .sidebar-nav a > .sidebar-nav-label,
.sidebar .sidebar-nav-label {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    align-self: center !important;
    justify-self: start !important;
    margin: 0 !important;
    padding: 0 !important;
    clip: auto !important;
    clip-path: none !important;
    overflow: hidden !important;
    -webkit-box-orient: initial !important;
    -webkit-line-clamp: initial !important;
    color: currentColor !important;
    -webkit-text-fill-color: currentColor !important;
    font-size: var(--sidebar-font-size) !important;
    font-weight: 500 !important;
    letter-spacing: 0 !important;
    line-height: var(--sidebar-line-height) !important;
    opacity: 1 !important;
    text-align: left !important;
    text-overflow: clip !important;
    transform: none !important;
    visibility: visible !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar .sidebar-nav a.active > .sidebar-nav-label,
body.dashboard-body .sidebar .sidebar-nav a.active > .sidebar-nav-label,
body.ops-dashboard-page .sidebar .sidebar-nav a.active > .sidebar-nav-label,
body.survey-workflow-surface .sidebar .sidebar-nav a.active > .sidebar-nav-label,
body.progress-page .sidebar .sidebar-nav a.active > .sidebar-nav-label {
    font-weight: 600 !important;
}

.sidebar-nav a.sidebar-nav-follow-settings {
    margin-top: var(--sidebar-group-gap) !important;
    padding-top: 8px !important;
    border-top: 1px solid rgba(61, 72, 97, 0.1) !important;
}

.sidebar-footer {
    display: grid !important;
    gap: 12px !important;
    margin-top: auto !important;
    padding: 8px 10px 0 !important;
}

.user-pill {
    display: grid !important;
    gap: 5px !important;
    border: 1px solid rgba(61, 72, 97, 0.1) !important;
    border-radius: var(--sidebar-radius) !important;
    padding: 13px 14px !important;
    background: color-mix(in srgb, var(--survai-card) 72%, transparent) !important;
    color: var(--survai-sidebar-ink, #3d4861) !important;
}

.user-pill strong {
    color: var(--survai-sidebar-ink, #3d4861) !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    letter-spacing: 0 !important;
    line-height: 18px !important;
}

.user-pill span {
    color: var(--sidebar-ink-muted) !important;
    font-size: 12px !important;
    font-weight: 400 !important;
    letter-spacing: 0 !important;
    line-height: 16px !important;
    overflow-wrap: anywhere !important;
}

.sidebar-logout-form {
    margin: 0 !important;
}

.sidebar-logout-button {
    display: grid !important;
    grid-template-columns: var(--sidebar-logout-icon-size) minmax(0, 1fr) !important;
    align-items: center !important;
    width: 100% !important;
    min-height: 44px !important;
    gap: 10px !important;
    border: 1px solid rgba(61, 72, 97, 0.1) !important;
    border-radius: var(--sidebar-radius) !important;
    padding: 9px 14px !important;
    color: var(--survai-sidebar-ink, #3d4861) !important;
    background: color-mix(in srgb, var(--survai-card) 62%, transparent) !important;
    font: inherit !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    letter-spacing: 0 !important;
    line-height: 20px !important;
    text-align: left !important;
    cursor: pointer !important;
    transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease !important;
}

.sidebar-logout-button:hover,
.sidebar-logout-button:focus-visible {
    border-color: rgba(61, 72, 97, 0.16) !important;
    background: var(--sidebar-hover-bg) !important;
    color: var(--survai-sidebar-ink, #3d4861) !important;
    outline: none !important;
}

.sidebar-logout-icon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: var(--sidebar-logout-icon-size) !important;
    height: var(--sidebar-logout-icon-size) !important;
    min-width: var(--sidebar-logout-icon-size) !important;
    min-height: var(--sidebar-logout-icon-size) !important;
}

.sidebar-logout-icon svg {
    display: block !important;
    width: var(--sidebar-logout-icon-size) !important;
    height: var(--sidebar-logout-icon-size) !important;
    stroke: currentColor !important;
    stroke-width: 1.65 !important;
}

body.sidebar-desktop-collapsed .brand-logo-sidebar {
    display: none !important;
}

body.sidebar-desktop-collapsed .user-pill {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    border: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
}

@media (max-width: 900px) {
    body.has-mobile-sidebar .sidebar .sidebar-nav {
        padding-inline: var(--sidebar-nav-padding-inline) !important;
    }

    body.has-mobile-sidebar .sidebar .sidebar-nav a {
        min-height: var(--sidebar-item-height) !important;
        padding-inline: var(--sidebar-item-padding-inline) !important;
    }
}

/* Global flash notices: float briefly over the workspace instead of pushing page layout. */
@keyframes survai-flash-toast {
    0% {
        opacity: 0;
        transform: translate3d(12px, -8px, 0) scale(0.985);
    }

    10%,
    76% {
        opacity: 1;
        transform: translate3d(0, 0, 0) scale(1);
    }

    100% {
        opacity: 0;
        transform: translate3d(12px, -8px, 0) scale(0.985);
        visibility: hidden;
    }
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .main-panel > .alert,
body.dashboard-body .main-panel > .alert,
body.ops-dashboard-page .main-panel > .alert,
body.survey-workflow-surface .main-panel > .alert,
body.progress-page .main-panel > .alert {
    position: fixed !important;
    top: max(18px, calc(env(safe-area-inset-top, 0px) + 18px)) !important;
    right: max(18px, calc(env(safe-area-inset-right, 0px) + 18px)) !important;
    z-index: 12000 !important;
    width: min(420px, calc(100vw - 36px)) !important;
    max-width: calc(100vw - 36px) !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    border-radius: 14px !important;
    padding: 12px 15px !important;
    box-shadow: 0 20px 54px rgba(15, 23, 42, 0.16) !important;
    font-size: 0.9rem !important;
    font-weight: 650 !important;
    line-height: 1.35 !important;
    pointer-events: none !important;
    animation: survai-flash-toast 5.2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards !important;
}

@media (max-width: 900px) {
    body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .main-panel > .alert,
    body.dashboard-body .main-panel > .alert,
    body.ops-dashboard-page .main-panel > .alert,
    body.survey-workflow-surface .main-panel > .alert,
    body.progress-page .main-panel > .alert {
        top: max(72px, calc(env(safe-area-inset-top, 0px) + 72px)) !important;
        right: max(12px, calc(env(safe-area-inset-right, 0px) + 12px)) !important;
        left: max(12px, calc(env(safe-area-inset-left, 0px) + 12px)) !important;
        width: auto !important;
        max-width: none !important;
    }
}

/* Absolute sidebar alignment lock: applies to report-overview/property workspace and every sidebar rail. */
.sidebar .sidebar-nav {
    display: grid !important;
    align-content: start !important;
    gap: var(--sidebar-nav-gap, 4px) !important;
    min-height: 0 !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior: contain !important;
    padding: 0 var(--sidebar-nav-padding-inline, 6px) !important;
}

.sidebar .sidebar-nav a {
    display: grid !important;
    grid-template-columns: var(--sidebar-icon-cell-size, 24px) minmax(0, 1fr) !important;
    grid-template-rows: auto !important;
    align-content: center !important;
    align-items: center !important;
    justify-items: start !important;
    width: 100% !important;
    min-height: var(--sidebar-item-height, 84px) !important;
    box-sizing: border-box !important;
    gap: var(--sidebar-item-gap, 7px) !important;
    border-radius: var(--sidebar-radius, 12px) !important;
    padding: 8px var(--sidebar-item-padding-inline, 8px) !important;
    color: var(--survai-sidebar-ink, #3d4861) !important;
    font-size: var(--sidebar-font-size, 13px) !important;
    font-weight: 500 !important;
    letter-spacing: 0.01em !important;
    line-height: var(--sidebar-line-height, 18px) !important;
    text-align: left !important;
}

.sidebar .sidebar-nav a:not(:has(.sidebar-nav-icon)) {
    grid-template-columns: minmax(0, 1fr) !important;
}

.sidebar .sidebar-nav a > .sidebar-nav-icon {
    position: static !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: var(--sidebar-icon-cell-size, 24px) !important;
    height: var(--sidebar-icon-cell-size, 24px) !important;
    min-width: var(--sidebar-icon-cell-size, 24px) !important;
    min-height: var(--sidebar-icon-cell-size, 24px) !important;
    margin: 0 !important;
    padding: 0 !important;
    justify-self: center !important;
    align-self: center !important;
    line-height: 1 !important;
}

.sidebar .sidebar-nav a > .sidebar-nav-icon svg {
    display: block !important;
    width: var(--sidebar-icon-size, 22px) !important;
    height: var(--sidebar-icon-size, 22px) !important;
    max-width: var(--sidebar-icon-size, 22px) !important;
    max-height: var(--sidebar-icon-size, 22px) !important;
}

.sidebar .sidebar-nav a > .sidebar-nav-label {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    justify-self: start !important;
    align-self: center !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    color: currentColor !important;
    -webkit-text-fill-color: currentColor !important;
    font-size: var(--sidebar-font-size, 14px) !important;
    font-weight: 500 !important;
    line-height: var(--sidebar-line-height, 18px) !important;
    letter-spacing: 0.01em !important;
    text-align: left !important;
    white-space: normal !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
    hyphens: none !important;
}

.sidebar .sidebar-nav a.active > .sidebar-nav-label {
    font-weight: 600 !important;
}

/* Property/workspace toolbar final lock: exact selector for the report-overview sidebar rail. */
body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body)
    aside.sidebar.sidebar--workspace#appSidebar
    .sidebar-nav {
    display: grid !important;
    align-content: start !important;
    gap: 5px !important;
    padding: 0 5px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body)
    aside.sidebar.sidebar--workspace#appSidebar
    .sidebar-nav
    a {
    /* Report workspace rows (surveyor, 3 Oct 2026 design): icon left, label right. */
    display: grid !important;
    grid-template-columns: 24px minmax(0, 1fr) !important;
    grid-template-rows: auto !important;
    align-content: center !important;
    align-items: center !important;
    justify-items: start !important;
    min-height: 44px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    gap: 12px !important;
    margin: 0 !important;
    border-radius: 12px !important;
    padding: 8px 12px !important;
    text-align: left !important;
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body)
    aside.sidebar.sidebar--workspace#appSidebar
    .sidebar-nav
    a
    > .sidebar-nav-icon {
    position: static !important;
    display: grid !important;
    place-items: center !important;
    align-self: center !important;
    justify-self: center !important;
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    min-height: 24px !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1 !important;
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body)
    aside.sidebar.sidebar--workspace#appSidebar
    .sidebar-nav
    a
    > .sidebar-nav-icon
    svg {
    display: block !important;
    width: 22px !important;
    height: 22px !important;
    max-width: 22px !important;
    max-height: 22px !important;
    overflow: visible !important;
    transform: none !important;
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body)
    aside.sidebar.sidebar--workspace#appSidebar
    .sidebar-nav
    a
    > .sidebar-nav-label {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: 18px !important;
    max-height: none !important;
    align-self: center !important;
    justify-self: start !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    color: var(--survai-sidebar-ink, #3d4861) !important;
    -webkit-text-fill-color: var(--survai-sidebar-ink, #3d4861) !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    letter-spacing: 0.01em !important;
    line-height: 18px !important;
    text-align: left !important;
    white-space: normal !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
    hyphens: none !important;
}

body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body)
    aside.sidebar.sidebar--workspace#appSidebar
    .sidebar-nav
    a.active
    > .sidebar-nav-label {
    font-weight: 600 !important;
}

/* ID-level toolbar alignment: the final source of truth for every rendered Survai sidebar. */
#appSidebar.sidebar .sidebar-nav {
    display: grid !important;
    align-content: start !important;
    gap: 5px !important;
    padding: 0 5px !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
}

#appSidebar.sidebar .sidebar-nav a {
    /* Rows (surveyor, 3 Oct 2026): icon left, label right, in every rail. */
    display: grid !important;
    grid-template-columns: 24px minmax(0, 1fr) !important;
    grid-template-rows: auto !important;
    align-content: center !important;
    align-items: center !important;
    justify-items: start !important;
    width: 100% !important;
    min-height: 44px !important;
    box-sizing: border-box !important;
    gap: 12px !important;
    margin: 0 !important;
    border-radius: 12px !important;
    padding: 8px 12px !important;
    text-align: left !important;
}

#appSidebar.sidebar .sidebar-nav a:not(:has(.sidebar-nav-icon)) {
    grid-template-columns: minmax(0, 1fr) !important;
}

#appSidebar.sidebar .sidebar-nav a > .sidebar-nav-icon {
    position: static !important;
    display: grid !important;
    place-items: center !important;
    align-self: center !important;
    justify-self: center !important;
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    min-height: 24px !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1 !important;
}

#appSidebar.sidebar .sidebar-nav a > .sidebar-nav-icon::after {
    display: none !important;
}

#appSidebar.sidebar .sidebar-nav a > .sidebar-nav-icon svg {
    display: block !important;
    width: 22px !important;
    height: 22px !important;
    max-width: 22px !important;
    max-height: 22px !important;
    overflow: visible !important;
    transform: none !important;
}

#appSidebar.sidebar .sidebar-nav a > .sidebar-nav-label {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: 18px !important;
    max-height: none !important;
    align-self: center !important;
    justify-self: start !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    color: var(--survai-sidebar-ink, #3d4861) !important;
    -webkit-text-fill-color: var(--survai-sidebar-ink, #3d4861) !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    letter-spacing: 0.01em !important;
    line-height: 18px !important;
    text-align: left !important;
    white-space: normal !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
    hyphens: none !important;
}

#appSidebar.sidebar .sidebar-nav a.active > .sidebar-nav-label {
    font-weight: 600 !important;
}

/* Sidebar footer polish: compact premium account block and balanced logout control. */
#appSidebar.sidebar .sidebar-footer,
.sidebar .sidebar-footer {
    display: grid !important;
    gap: 8px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    margin-top: auto !important;
    padding: 10px 7px 14px !important;
}

#appSidebar.sidebar .user-pill,
.sidebar .user-pill {
    display: grid !important;
    justify-items: center !important;
    gap: 3px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    border: 1px solid rgba(61, 72, 97, 0.1) !important;
    border-radius: 14px !important;
    padding: 10px 7px !important;
    background: linear-gradient(180deg, color-mix(in srgb, var(--survai-card) 82%, transparent), rgba(248, 251, 255, 0.72)) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
    color: var(--survai-sidebar-ink, #3d4861) !important;
    text-align: center !important;
}

#appSidebar.sidebar .user-pill strong,
.sidebar .user-pill strong {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
    color: var(--survai-sidebar-ink, #3d4861) !important;
    -webkit-text-fill-color: var(--survai-sidebar-ink, #3d4861) !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    letter-spacing: 0 !important;
    line-height: 15px !important;
    text-align: center !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

#appSidebar.sidebar .user-pill span,
.sidebar .user-pill span {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
    color: rgba(61, 72, 97, 0.62) !important;
    -webkit-text-fill-color: rgba(61, 72, 97, 0.62) !important;
    font-size: 10.5px !important;
    font-weight: 400 !important;
    letter-spacing: 0 !important;
    line-height: 13px !important;
    text-align: center !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

#appSidebar.sidebar .sidebar-logout-form,
.sidebar .sidebar-logout-form {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
}

#appSidebar.sidebar .sidebar-logout-button,
.sidebar .sidebar-logout-button {
    /* The same row as the entries above it. */
    display: grid !important;
    grid-template-columns: 24px minmax(0, 1fr) !important;
    grid-template-rows: auto !important;
    align-content: center !important;
    align-items: center !important;
    justify-items: start !important;
    width: 100% !important;
    min-height: 44px !important;
    box-sizing: border-box !important;
    gap: 12px !important;
    border-radius: 12px !important;
    padding: 8px 12px !important;
    box-shadow: none !important;
    font: inherit !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    letter-spacing: 0 !important;
    line-height: 18px !important;
    text-align: left !important;
    cursor: pointer !important;
}

#appSidebar.sidebar .sidebar-logout-button:hover,
#appSidebar.sidebar .sidebar-logout-button:focus-visible,
.sidebar .sidebar-logout-button:hover,
.sidebar .sidebar-logout-button:focus-visible {
    outline: none !important;
}

#appSidebar.sidebar .sidebar-logout-icon,
.sidebar .sidebar-logout-icon {
    display: grid !important;
    place-items: center !important;
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    min-height: 24px !important;
    margin: 0 !important;
}

#appSidebar.sidebar .sidebar-logout-icon svg,
.sidebar .sidebar-logout-icon svg {
    display: block !important;
    width: 18px !important;
    height: 18px !important;
    stroke: currentColor !important;
    stroke-width: 1.65 !important;
}

#appSidebar.sidebar .sidebar-logout-button > span:last-child,
.sidebar .sidebar-logout-button > span:last-child {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
    text-align: left !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

/* ==========================================================
   Sidebar rail (final override): the neutral theme (surveyor,
   3 Oct 2026). Redefining the tokens on the .sidebar element sets
   every downstream var() rule (text, icons, labels, hover and
   current page) in one move: a very light grey rail, charcoal text
   and icons, and the current page shown only by a slightly bolder
   label (surveyor, 3 Oct 2026: no blue overlay, no thick left
   border). Scoped to the rail so the mobile app header and the
   content cards that read the same tokens are untouched.
   ========================================================== */
body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar,
body.dashboard-body .sidebar,
body.ops-dashboard-page .sidebar,
body.survey-workflow-surface .sidebar,
body.progress-page .sidebar,
body.has-mobile-sidebar .sidebar, body.capture-mode-body .sidebar {
    --survai-sidebar-ink: var(--survai-text);
    --sidebar-ink-muted: var(--survai-text-secondary);
    --sidebar-hover-bg: var(--survai-neutral-hover);
    --sidebar-active-bg: transparent;
    --sidebar-active-ink: var(--survai-text);
    border-right: 1px solid var(--survai-border) !important;
    background: var(--survai-sidebar-bg) !important;
    box-shadow: none !important;
    color: var(--survai-text) !important;
}

/* Current page: no pill and no indicator bar, the same charcoal ink as the other rows;
   the label is a little bolder (the rule after it). Hover shows the quiet grey. */
body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .sidebar .sidebar-nav a.active,
body.dashboard-body .sidebar .sidebar-nav a.active,
body.ops-dashboard-page .sidebar .sidebar-nav a.active,
body.survey-workflow-surface .sidebar .sidebar-nav a.active,
body.progress-page .sidebar .sidebar-nav a.active, body.capture-mode-body .sidebar .sidebar-nav a.active {
    --survai-sidebar-ink: var(--sidebar-active-ink);
    background: var(--sidebar-active-bg) !important;
    box-shadow: none !important;
}

/* Written at the id-level label locks' specificity and after them, so they yield. */
body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) aside.sidebar.sidebar--workspace#appSidebar .sidebar-nav a.active > .sidebar-nav-label,
body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) aside.sidebar#appSidebar .sidebar-nav a.active > .sidebar-nav-label,
.sidebar .sidebar-nav a.active > .sidebar-nav-label {
    font-weight: 650 !important;
}

/* Log out: a quiet neutral row near the bottom of the rail. */
#appSidebar.sidebar .sidebar-logout-button,
.sidebar .sidebar-logout-button {
    border: 1px solid transparent !important;
    background: transparent !important;
    color: var(--survai-text) !important;
}

#appSidebar.sidebar .sidebar-logout-button:hover,
#appSidebar.sidebar .sidebar-logout-button:focus-visible,
.sidebar .sidebar-logout-button:hover,
.sidebar .sidebar-logout-button:focus-visible {
    border-color: transparent !important;
    background: var(--survai-neutral-hover) !important;
    color: var(--survai-text) !important;
}

/* output.php — final cascade: flat workspace (beats global blue radial gradients) */
body.output-report-page:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) {
    background: var(--survai-bg) !important;
}

body.output-report-page:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .main-panel {
    background: var(--survai-bg) !important;
}

/* The rendered report is a preview of the printed document: paper white in both themes. */
body.output-report-page .output-workspace-shell .report-renderer .output-preview-card,
body.output-report-page .output-workspace-shell .report-renderer .output-summary-card,
body.output-report-page .output-workspace-shell .report-renderer .report-render-report-body,
body.output-report-page .output-workspace-shell .report-renderer .condition-ratings-panel {
    border-color: rgba(15, 23, 42, 0.1) !important;
    background: #ffffff !important;
    box-shadow: 0 10px 32px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04) !important;
}

body.output-report-page .output-workspace-shell .output-image-display-panel,
body.output-report-page .output-workspace-shell .output-workspace-tabs {
    border-color: var(--survai-border-ink) !important;
    background: var(--survai-card) !important;
    box-shadow: 0 10px 32px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04) !important;
}

body.output-report-page .output-workspace-panel,
body.output-report-page .output-workspace-panel.is-active {
    background: transparent !important;
    background-color: transparent !important;
    box-shadow: none !important;
    color: inherit !important;
}

.ai-control-centre-tabs {
    margin: 0 0 16px;
    flex-wrap: wrap;
    gap: 8px;
}

.ai-control-centre-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin: 16px 0;
}

.ai-control-centre-metric {
    padding: 14px 16px;
    border: 1px solid var(--survai-border);
    border-radius: 14px;
    background: var(--survai-card);
}

.ai-control-centre-metric__value {
    margin: 6px 0 0;
    font-size: 1.35rem;
    font-weight: 600;
    color: var(--survai-text);
}

.ai-vector-domain-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
    margin: 16px 0;
}

.ai-vector-domain-card {
    margin: 0;
    padding: 14px 16px;
    border: 1px solid var(--survai-border);
    border-radius: 14px;
    background: var(--survai-tint-fafbfc);
}

.ai-vector-custom-stores {
    margin: 20px 0;
}

.ai-vector-custom-stores__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.ai-vector-custom-stores__list {
    display: grid;
    gap: 14px;
}

.ai-vector-custom-card .ai-vector-custom-tasks {
    width: 100%;
    min-height: 8rem;
}

.ai-vector-custom-card [data-remove-vector-store-custom] {
    margin-top: 8px;
}

.ai-epc-finder-form {
    display: grid;
    gap: 12px;
    margin-top: 16px;
}

.ai-epc-finder-json {
    margin-top: 12px;
    padding: 12px;
    border-radius: 12px;
    background: var(--survai-ink-surface);
    color: #e2e8f0;
    font-size: 12px;
    overflow-x: auto;
    max-height: 320px;
}

.ai-control-centre-table-wrap {
    overflow-x: auto;
    margin-top: 12px;
}

.ai-control-centre-checklist {
    margin: 12px 0 0;
    padding-left: 1.2rem;
}

.ai-control-centre-flag-list ul {
    margin: 8px 0 0;
    padding-left: 1.2rem;
}

/* Property Overview — editable Street View */
.po-location-street-view-column {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 0;
}

.po-street-view-editor-preview {
    margin-top: 2px;
}

.po-street-view-editor-preview__trigger {
    display: block;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    padding: 0;
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-radius: 12px;
    background: var(--survai-card);
    overflow: hidden;
    cursor: pointer;
    text-align: center;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.po-street-view-editor-preview__trigger:hover,
.po-street-view-editor-preview__trigger:focus-visible {
    border-color: rgba(240, 158, 31, 0.55);
    outline: none;
}

.po-street-view-editor-preview__image {
    display: block;
    width: 100%;
    max-width: 400px;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.po-street-view-editor-preview__hint {
    display: block;
    padding: 10px 12px 12px;
    color: var(--survai-secondary-slate);
    font-size: 0.82rem;
    font-weight: 650;
}

.po-street-view-editor-preview--unavailable {
    max-width: 400px;
    margin: 0 auto;
}

.po-street-view-editor-preview__unavailable {
    margin: 0;
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--survai-tint-fff7ed);
    border: 1px solid rgba(240, 158, 31, 0.25);
    color: var(--survai-ink-9a3412);
    font-size: 0.84rem;
    line-height: 1.45;
}

.po-street-view-editor-preview__trigger.is-disabled,
.po-street-view-editor-preview__trigger:disabled,
.po-cover-picker-link.is-disabled,
.po-cover-picker-link:disabled {
    cursor: not-allowed;
    opacity: 0.72;
}

.street-view-editor-modal {
    border: none;
    padding: 0;
    max-width: calc(100vw - 2rem);
    width: min(920px, calc(100vw - 2rem));
    background: transparent;
}

.street-view-editor-modal[open] {
    display: block;
    opacity: 1;
    visibility: visible;
}

.street-view-editor-modal::backdrop {
    background: rgba(15, 23, 42, 0.5);
}

.street-view-editor-modal__content {
    margin: 0;
    background: var(--survai-card);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.18);
}

.street-view-editor-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--survai-border-soft);
}

.street-view-editor-modal__header .modal-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
}

.street-view-editor-modal__close {
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 999px;
    background: var(--survai-bg-tint);
    color: var(--survai-text-soft);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
}

.street-view-editor-modal__map-wrap {
    position: relative;
}

.street-view-editor-modal__panorama {
    border-radius: 8px;
    overflow: hidden;
}

.street-view-editor-modal__loading {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: grid;
    place-items: center;
    gap: 10px;
    background: color-mix(in srgb, var(--survai-bg) 88%, transparent);
    color: var(--survai-secondary-strong);
    font-size: 0.9rem;
    font-weight: 650;
}

.street-view-editor-modal__loading[hidden] {
    display: none !important;
}

.street-view-editor-modal__spinner {
    width: 28px;
    height: 28px;
    border: 3px solid var(--survai-border-ink);
    border-top-color: #f09e1f;
    border-radius: 50%;
    animation: street-view-editor-spin 0.8s linear infinite;
}

@keyframes street-view-editor-spin {
    to {
        transform: rotate(360deg);
    }
}

.street-view-editor-modal__error {
    margin: 0 0 10px;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--survai-tint-fef2f2);
    color: var(--survai-ink-b91c1c);
    font-size: 0.86rem;
    line-height: 1.45;
}

.street-view-editor-modal__footer {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 14px 18px 18px;
    border-top: 1px solid var(--survai-border-soft);
}

/* Regenerate-with-notes dropdown and modal (output workspace) */
.survai-regen-menu {
    position: absolute;
    z-index: 10050;
    min-width: 230px;
    padding: 6px;
    border-radius: 12px;
    background: var(--survai-card);
    border: 1px solid var(--survai-border-ink);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
}

.survai-regen-menu__item {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 9px 11px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--survai-text-slate);
    font-size: 0.86rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
}

.survai-regen-menu__item:hover,
.survai-regen-menu__item:focus-visible {
    background: rgba(37, 99, 235, 0.08);
    color: var(--survai-ink-1d4ed8);
}

.survai-regen-notes-modal {
    position: fixed;
    inset: 0;
    z-index: 10060;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

/* display:flex above would otherwise defeat the hidden attribute set on close */
.survai-regen-notes-modal[hidden] {
    display: none !important;
}

.survai-regen-notes-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
}

.survai-regen-notes-modal__card {
    position: relative;
    width: min(560px, 100%);
    padding: 20px 22px;
    border-radius: 16px;
    background: var(--survai-card);
    box-shadow: 0 30px 70px rgba(15, 23, 42, 0.35);
}

.survai-regen-notes-modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}

.survai-regen-notes-modal__head h3 {
    margin: 0;
    font-size: 1.05rem;
}

.survai-regen-notes-modal__close {
    border: 0;
    background: transparent;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--survai-secondary-slate);
    cursor: pointer;
}

.survai-regen-notes-modal__hint {
    margin: 0 0 10px;
    color: var(--survai-secondary-slate);
    font-size: 0.84rem;
}

.survai-regen-notes-modal__textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid rgba(15, 23, 42, 0.18);
    border-radius: 10px;
    font: inherit;
    font-size: 0.9rem;
    resize: vertical;
}

.survai-regen-notes-modal__status {
    min-height: 1.1em;
    margin: 8px 0 10px;
    color: var(--survai-ink-b45309);
    font-size: 0.8rem;
}

.survai-regen-notes-modal__actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.survai-regen-notes-modal__spacer {
    flex: 1;
}

.survai-regen-notes-modal__mic {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.survai-regen-notes-modal__mic.is-recording {
    color: var(--survai-ink-b91c1c);
    border-color: #b91c1c;
    animation: survai-regen-mic-pulse 1.2s ease-in-out infinite;
}

@keyframes survai-regen-mic-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(185, 28, 28, 0.25); }
    50% { box-shadow: 0 0 0 6px rgba(185, 28, 28, 0.08); }
}

/* Surveyor regeneration notes shown on the transcript workspace */
.survai-regen-note-item {
    margin: 0 0 10px;
    padding: 10px 14px;
    background: var(--survai-tint-fefce8);
    border-left: 3px solid #eab308;
    border-radius: 8px;
}

.survai-regen-note-item__badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--survai-ink-a16207);
}

.survai-regen-note-item__meta {
    margin: 2px 0 4px;
    color: var(--survai-secondary-slate);
    font-size: 0.78rem;
}

.survai-regen-note-item__text {
    margin: 0;
    white-space: pre-wrap;
    color: var(--survai-text-slate);
    font-size: 0.88rem;
}

/* Visible in-card progress while a section regenerates on the output workspace */
.output-section.is-section-regenerating {
    position: relative;
}

.output-section.is-section-regenerating .section-text {
    opacity: 0.4;
    transition: opacity 0.2s ease;
}

.output-section.is-section-regenerating.is-collapsed::after,
.output-section.is-section-regenerating:not(.is-collapsed) .output-section-box::after {
    content: 'Regenerating section…';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 10px 20px;
    border-radius: 999px;
    background: #1d4ed8;
    color: #ffffff;
    font-size: 0.86rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    box-shadow: 0 12px 30px rgba(29, 78, 216, 0.35);
    z-index: 5;
    pointer-events: none;
    animation: survai-section-regen-pulse 1.4s ease-in-out infinite;
}

.output-section.is-section-regenerating [data-regenerate-section] svg,
.section-card.is-section-regenerating [data-regenerate-section] svg {
    animation: survai-section-regen-spin 1s linear infinite;
}

@keyframes survai-section-regen-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.72; }
}

@keyframes survai-section-regen-spin {
    to { transform: rotate(360deg); }
}

/* Grouped workspace navigation (SURVAI_WORKSPACE_NAV=grouped, the default).
   Stage row reuses the flat-nav link styling; the sub-row holds the active
   stage's pages as pills. Set SURVAI_WORKSPACE_NAV=classic to restore the
   original flat 18-link nav. */
.workspace-stage-nav {
    display: flex;
    align-items: stretch;
    width: 100%;
    min-height: 50px;
}

/* Stages span the full row as evenly-sized segments rather than bunching
   on the left. */
.workspace-stage-nav .workspace-stage-nav__stage {
    flex: 1 1 0;
    min-width: 0;
    justify-content: center;
    text-align: center;
    font-size: 0.92rem;
}

.workspace-stage-nav__stage--advanced {
    color: var(--survai-text) !important;
}

/* Each stage owns a hover-dropdown of its children, so the persistent subnav
   row is gone (frees a whole row of viewport). The children only appear when
   the parent stage is hovered or focused. */

/* The base .report-workspace-nav is a scroll container (overflow-x: auto,
   overflow-y: hidden) for the old many-tabs row — that CLIPS the dropdowns,
   which open below the bar, so hovering appeared to do nothing. The grouped
   menubar has only four stage links that flex to fit, so it never needs to
   scroll: let the dropdowns escape. */
.report-workspace-nav.workspace-stage-nav {
    overflow: visible;
}

/* Brand styling (structure): parent stages are pill buttons in a gapped row.
   The COLOURS live in the "Brand nav colours" block much later in this file —
   they must come after the monochrome header catch-all to win. */
.report-workspace-nav.workspace-stage-nav {
    gap: 10px;
    align-items: center;
    padding-block: 7px;
}

.workspace-stage-nav__item {
    position: relative;
    display: flex;
    flex: 1 1 0;
    min-width: 0;
    align-items: center;
}

.workspace-stage-nav .workspace-stage-nav__stage {
    gap: 8px;
    min-height: 40px;
    border-radius: 10px;
    font-weight: 650;
}

/* The pills sit in their own gapped row: the shared-row underline indicator
   no longer applies. */
.workspace-stage-nav .report-workspace-nav__link::after {
    display: none !important;
}

/* Parent icons render small and inherit the pill's white. */
.workspace-stage-nav .workspace-stage-nav__stage .workspace-stage-subnav__icon {
    width: 17px;
    min-width: 17px;
    height: 17px;
}

.workspace-stage-nav__item .workspace-stage-nav__stage {
    flex: 1 1 auto;
    width: 100%;
}

.workspace-stage-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 60;
    min-width: 100%;
    width: max-content;
    max-width: 340px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0;
    padding: 6px;
    background: var(--survai-card);
    border: 1px solid var(--survai-border-soft);
    border-radius: 12px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 120ms ease, transform 120ms ease, visibility 120ms;
    pointer-events: none;
}

/* Right-align the last stage's menu so it never runs off the right edge. */
.workspace-stage-nav__item:last-child .workspace-stage-dropdown {
    left: auto;
    right: 0;
}

/* The menu opens on the scripted state only (a click toggles it — see
   workspace_nav_grouped.php); a :hover rule would hold a menu open under
   the pointer after the user clicked to close it. */
.workspace-stage-nav__item.is-open .workspace-stage-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

/* Children stack as icon + label rows inside the dropdown. */
.workspace-stage-dropdown .workspace-stage-subnav__link {
    flex: 0 0 auto;
    flex-direction: row;
    justify-content: flex-start;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    white-space: nowrap;
}

.workspace-stage-dropdown .workspace-stage-subnav__link:hover {
    background: var(--survai-bg-tint);
}

/* The current page in a stage menu is a little bolder, with no tinted field (surveyor, 3 Oct 2026). */
.workspace-stage-dropdown .workspace-stage-subnav__link.is-active {
    background: transparent;
    font-weight: 650;
}

.workspace-stage-subnav {
    display: flex;
    align-items: stretch;
    gap: 0;
    width: 100%;
    min-height: 46px;
    padding: 7px clamp(16px, 2vw, 30px);
    border-top: 1px solid rgba(15, 23, 42, 0.06);
    background: color-mix(in srgb, var(--survai-bg) 80%, transparent);
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
}

.workspace-stage-subnav::-webkit-scrollbar {
    height: 0;
}

.workspace-stage-subnav__link {
    position: relative;
    display: inline-flex;
    flex: 1 1 0;
    min-width: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 9px 16px;
    border: 0;
    color: var(--survai-text) !important;
    font-size: 0.86rem;
    font-weight: 550;
    line-height: 1.25;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    transition: color 140ms ease, background-color 140ms ease;
}

.workspace-stage-subnav__link + .workspace-stage-subnav__link::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 24px;
    background: var(--survai-border-ink);
    pointer-events: none;
}

/* Hover counts for Photos/Videos: album vs quarantine, below the icon.
   The row clips (overflow auto) on small screens; desktop relaxes it so the
   tooltip can escape — hover is a desktop interaction anyway. */
.workspace-stage-subnav__tooltip {
    position: absolute;
    top: calc(100% + 4px);
    left: 50%;
    /* Above every sticky toolbar, modal dock and the image editor (12500):
       the count must never slide underneath the page content. */
    z-index: 13000;
    padding: 6px 12px;
    border-radius: 8px;
    background: #2563eb;
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    white-space: nowrap;
    box-shadow: 0 10px 24px rgba(37, 99, 235, 0.35);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(-50%) translateY(-2px);
    transition: opacity 120ms ease, transform 120ms ease, visibility 120ms;
}

/* The hovered tab itself rises too, so the tooltip wins inside any local
   stacking context created by the header row. */
.workspace-stage-subnav__link:hover,
.workspace-stage-subnav__link:focus-visible {
    z-index: 13000;
}

.workspace-stage-subnav__link:hover .workspace-stage-subnav__tooltip,
.workspace-stage-subnav__link:focus-visible .workspace-stage-subnav__tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* ── STANDARD: popup / tooltip / notification text is ALWAYS white ──────────
   Every hover tooltip, hint and notification in the app sits on a dark or
   brand-coloured bubble, so its text must be white — never the page's dark
   body colour, and never a hovered control's `color: #111827 !important`
   bleeding in through inheritance (which is what turned the media-tab tooltips
   black). The `!important` here is what makes the bubble text defend itself
   against that ancestor bleed on every page and state. Intentionally-light
   toasts (success/status) are NOT listed, so they keep their dark-on-light
   treatment. */
.workspace-stage-subnav__tooltip,
.workspace-stage-subnav__tooltip *,
.workspace-stage-subnav__link:hover .workspace-stage-subnav__tooltip,
.workspace-stage-subnav__link:focus-visible .workspace-stage-subnav__tooltip,
.survai-notification,
.survai-notification * {
    color: #ffffff !important;
}

.workspace-tool-button:hover::after,
.workspace-tool-button:focus-visible::after,
.workspace-topbar .workspace-fullscreen-toggle:hover::after,
.workspace-topbar .workspace-fullscreen-toggle:focus-visible::after,
.output-icon-action::after {
    color: #ffffff !important;
}

/* Transcript tab: a small brand-blue pulse while audio/video is still being
   transcribed, so the surveyor can see at a glance the page is busy (not
   broken). Hover reveals the "Transcribing… N of M done" progress tooltip. */
/* Always-visible count badge on a dropdown row ("142", "23/38"). The menu is
   vertical, so the number belongs ON the row — a hover-only tooltip made the
   surveyor hunt for it and covered the row beneath. */
.workspace-stage-subnav__count {
    margin-left: auto;
    flex: 0 0 auto;
    padding: 2px 9px;
    border-radius: 999px;
    background: var(--survai-tint-eef4ff);
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1.5;
    letter-spacing: 0.01em;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* Only the vertical dropdown gets the inline badge; a horizontal subnav row
   has no width to spare. */
.workspace-stage-subnav:not(.workspace-stage-dropdown) .workspace-stage-subnav__count {
    display: none;
}

/* The pulse dot sits beside the badge rather than over it. */
.workspace-stage-dropdown .workspace-stage-subnav__count + .workspace-stage-subnav__pulse {
    position: static;
    margin-left: 6px;
    align-self: center;
}

/* In the dropdown the tooltip must open to the SIDE: `top: 100%` was written
   for the old horizontal tab row, and in a vertical menu it lands on top of
   the next item (which is what covered "Videos"). */
.workspace-stage-dropdown .workspace-stage-subnav__tooltip {
    top: 50%;
    left: calc(100% + 10px);
    transform: translateY(-50%) translateX(-2px);
}

.workspace-stage-dropdown .workspace-stage-subnav__link:hover .workspace-stage-subnav__tooltip,
.workspace-stage-dropdown .workspace-stage-subnav__link:focus-visible .workspace-stage-subnav__tooltip {
    transform: translateY(-50%) translateX(0);
}

.workspace-stage-subnav__pulse {
    position: absolute;
    top: 6px;
    right: 12px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2563eb;
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.55);
    animation: survaiSubnavPulse 1.6s ease-out infinite;
    pointer-events: none;
}

.workspace-stage-subnav__pulse[hidden] {
    display: none;
}

@keyframes survaiSubnavPulse {
    0% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.55); }
    70% { box-shadow: 0 0 0 7px rgba(37, 99, 235, 0); }
    100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}

@media (min-width: 921px) {
    .workspace-stage-subnav {
        overflow: visible;
    }
}

.workspace-stage-subnav__icon {
    display: inline-flex;
    flex: 0 0 auto;
    /* 25% smaller than the old 38px (icons read too large/heavy). */
    width: 28px;
    min-width: 28px;
    height: 28px;
}

.workspace-stage-subnav__icon svg {
    display: block;
    width: 100%;
    height: 100%;
}

/* Active state keeps the main stage nav's no-pill treatment without an underline. */
.workspace-stage-subnav__link::after {
    content: "";
    display: none;
    position: absolute;
    right: 14px;
    bottom: 0;
    left: 14px;
    height: 2px;
    border-radius: 999px 999px 0 0;
    background: transparent;
}

/* On narrow screens keep natural widths and let the rows scroll, so labels
   like "Accommodation" don't get squashed. */
@media (max-width: 720px) {
    .workspace-stage-nav .workspace-stage-nav__stage,
    .workspace-stage-subnav__link {
        flex: 0 0 auto;
    }
}

.workspace-stage-subnav__link:hover,
.workspace-stage-subnav__link:focus-visible {
    color: var(--survai-text) !important;
    background: transparent;
    outline: none;
}

.workspace-stage-subnav__link.is-active {
    color: var(--survai-text) !important;
    font-weight: 700;
    background: transparent;
}

.workspace-stage-subnav__link.is-active::after {
    background: transparent;
}

/* Unified notification pop-ups (window.survaiNotify). One palette across the
   app: brand blue for success/info/loading, red for error/warning. Fixed
   top-centre below the header, fade in 200ms / out 300ms, stacking. */
.survai-notification-container {
    position: fixed;
    /* Top-right of the white header (JS refines this per layout). Above the
       header z-index (~880) so pop-ups float over it, never in the workspace. */
    top: 14px;
    right: calc(16px + env(safe-area-inset-right, 0px));
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    max-width: min(500px, calc(100vw - 32px));
    min-width: min(300px, calc(100vw - 32px));
    width: auto;
    pointer-events: none;
}

.survai-notification {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 20px;
    border-radius: 14px;
    border: none;
    box-shadow: none;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    text-align: center;
    color: #ffffff;
    background-color: #165ffa;
    pointer-events: auto;
    cursor: default;
    animation: survaiNotificationFadeIn 0.2s ease-out;
}

.survai-notification.is-paused {
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.22);
}

.survai-notification-success,
.survai-notification-info,
.survai-notification-loading {
    background-color: #165ffa;
}

.survai-notification-error {
    background-color: #dc2626;
}

.survai-notification.is-fading-out {
    animation: survaiNotificationFadeOut 0.3s ease-in forwards;
}

.survai-notification__spinner {
    display: block;
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: var(--survai-card);
    animation: survaiNotificationSpin 0.8s linear infinite;
}

@keyframes survaiNotificationFadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes survaiNotificationFadeOut {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-10px); }
}

@keyframes survaiNotificationSpin {
    to { transform: rotate(360deg); }
}

/* "Hey Survai" voice assistant widget. Surveyor mode is brand blue; admin
   command-centre mode is dark navy so the access level is always visible. */
.survai-voice-assistant {
    display: inline-flex;
    align-items: center;
}

/* Launcher matches the other workspace header icons: light grey, transparent,
   42px round button sitting in the header's top-right action cluster. */
.survai-voice-assistant__launcher {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    min-height: 42px;
    border: 0;
    border-radius: 999px;
    padding: 0;
    color: var(--survai-text-secondary);
    background: transparent;
    box-shadow: none;
    cursor: pointer;
    transition: color 140ms ease, transform 140ms ease;
}

/* Find & Replace: every match highlighted at once, so scrolling the page
   shows them all without stepping through with Next. Painted as boxes in a
   fixed overlay rather than by wrapping text — the matches live inside
   textareas (which cannot contain markup) and inside editor-bound content
   that must never be rewritten for display. */
.ofr-highlight-layer {
    /* No transform, filter or contain here: any of those would make this a
       containing block for its position:fixed children, and the boxes are
       positioned in viewport coordinates. z-index sits above the workspace
       but below the find panel (10050) so the controls stay usable. */
    position: fixed;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
    z-index: 10040;
    pointer-events: none;
}

.ofr-highlight-box {
    position: fixed;
    background: rgba(250, 204, 21, 0.55);
    box-shadow: 0 0 0 1px rgba(202, 138, 4, 0.65);
    border-radius: 2px;
    pointer-events: none;
}

@media (prefers-contrast: more) {
    .ofr-highlight-box {
        background: rgba(250, 204, 21, 0.85);
        box-shadow: 0 0 0 1px #854d0e;
    }
}

.survai-find-replace {
    position: relative;
    display: inline-flex;
}

.survai-find-replace__launcher {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    min-height: 42px;
    border: 0;
    border-radius: 999px;
    padding: 0;
    color: var(--survai-text-secondary);
    background: transparent;
    box-shadow: none;
    cursor: pointer;
    transition: color 140ms ease, transform 140ms ease;
}

.survai-find-replace__launcher:hover,
.survai-find-replace__launcher:focus-visible {
    color: #ffffff;
    background: transparent;
    outline: none;
    transform: translateY(-1px);
}

.survai-find-replace__panel[hidden] {
    display: none;
}

.survai-find-replace__panel {
    position: fixed;
    top: 132px;
    right: max(16px, env(safe-area-inset-right, 0px));
    /* The app's floating-UI tier (menus, popovers) — above every workspace
       card and sticky toolbar, below full-screen modals at 100000. */
    z-index: 10050;
    width: min(340px, calc(100vw - 32px));
    border: 1px solid var(--survai-border-ink);
    border-radius: 14px;
    background: var(--survai-card);
    box-shadow: 0 22px 54px rgba(15, 23, 42, 0.22);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.survai-find-replace__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.survai-find-replace__head strong {
    font-size: 0.95rem;
    color: var(--survai-text-strong);
}

.survai-find-replace__close {
    border: 0;
    background: transparent;
    color: var(--survai-secondary-slate);
    font-size: 1.3rem;
    line-height: 1;
    cursor: pointer;
    padding: 2px 6px;
}

.survai-find-replace__field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.survai-find-replace__field span {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--survai-secondary-strong);
}

.survai-find-replace__field input {
    width: 100%;
}

.survai-find-replace__case {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    color: var(--survai-secondary-strong);
    cursor: pointer;
}

.survai-find-replace__case input[type="checkbox"] {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
}

.survai-find-replace__count {
    margin: 0;
    min-height: 1.1em;
    font-size: 0.8rem;
    color: var(--survai-ink-2563eb);
}

.survai-find-replace__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Trial-week badge: reports generated via the segment transcript path. */
.workspace-header-badge--segment {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--survai-tint-ecfdf5);
    border: 1px solid #a7f3d0;
    color: var(--survai-ink-047857);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}

/* Replace-all fail-safe: the confirm/cancel pair that replaces the Replace all
   button while armed. */
.survai-find-replace__confirm {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
}

.survai-find-replace__confirm[hidden] {
    display: none;
}

/* Survey Query Bot inside the "Hey Survai" panel: report scope chips
   (General / Search report / Compare / Add) above the log, and an actions
   row (section picker + add / regenerate) below it. */
.survai-voice-assistant__scopes {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 12px 0;
    background: var(--survai-card);
}

.survai-voice-assistant__scopes[hidden] {
    display: none;
}

.survai-voice-assistant__scope {
    padding: 4px 12px;
    border: 1px solid var(--line, #e6edf7);
    border-radius: 999px;
    background: var(--survai-card);
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--survai-ink-60708f);
    cursor: pointer;
}

.survai-voice-assistant__scope.is-active {
    background: #1b5af9;
    border-color: #1b5af9;
    color: #ffffff;
}

.survai-voice-assistant__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid var(--line, #e6edf7);
    background: var(--survai-card);
}

.survai-voice-assistant__actions[hidden] {
    display: none;
}

.survai-voice-assistant__section-pick {
    flex: 1 1 100%;
}

.survai-voice-assistant__section-pick select {
    width: 100%;
}

.survai-voice-assistant__bubble--note {
    font-size: 0.78rem;
    color: var(--survai-ink-60708f);
    background: var(--survai-tint-eef2f8);
}

.survai-voice-assistant__feedback {
    align-self: flex-start;
    display: flex;
    gap: 6px;
    font-size: 0.74rem;
    color: var(--survai-ink-60708f);
}

.survai-voice-assistant__feedback-btn {
    border: 1px solid var(--line, #e6edf7);
    border-radius: 999px;
    background: var(--survai-card);
    color: var(--survai-ink-60708f);
    font-size: 0.72rem;
    padding: 2px 10px;
    cursor: pointer;
}

.survai-voice-assistant__feedback-btn:hover {
    background: var(--survai-tint-eef2f8);
}

@media (max-width: 900px) {
    .survai-find-replace__panel {
        top: 108px;
        left: max(16px, env(safe-area-inset-left, 0px));
        right: max(16px, env(safe-area-inset-right, 0px));
        width: auto;
    }
}

.survai-voice-assistant__launcher:hover,
.survai-voice-assistant__launcher:focus-visible {
    color: #ffffff;
    background: transparent;
    outline: none;
    transform: translateY(-1px);
}

/* Keep the admin / wake-listening variants the same grey header icon. */
.survai-voice-assistant--admin .survai-voice-assistant__launcher {
    background: transparent;
}

.survai-voice-assistant__panel {
    position: fixed;
    top: 132px;
    right: max(16px, env(safe-area-inset-right, 0px));
    z-index: 1200;
    width: min(360px, calc(100vw - 32px));
    border: 1px solid var(--survai-border-ink);
    border-radius: 14px;
    background: var(--survai-card);
    box-shadow: 0 22px 54px rgba(15, 23, 42, 0.22);
    overflow: hidden;
}

@media (max-width: 900px) {
    .survai-voice-assistant__panel {
        top: calc(var(--survai-mobile-app-header-total, 110px) + 8px);
    }
}

.survai-voice-assistant__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    color: #ffffff;
    background: #165ffa;
}

.survai-voice-assistant--admin .survai-voice-assistant__head {
    background: var(--survai-navy-surface);
}

.survai-voice-assistant__badge {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.survai-voice-assistant__close {
    border: none;
    background: none;
    color: #ffffff;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
}

.survai-voice-assistant__log {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 280px;
    min-height: 80px;
    padding: 12px;
    overflow-y: auto;
    background: var(--survai-bg);
}

.survai-voice-assistant__bubble {
    max-width: 90%;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 0.88rem;
    line-height: 1.45;
    white-space: pre-wrap;
}

.survai-voice-assistant__bubble--user {
    align-self: flex-end;
    color: #ffffff;
    background: #165ffa;
}

.survai-voice-assistant__bubble--assistant {
    align-self: flex-start;
    color: var(--survai-text-strong);
    background: var(--survai-card);
    border: 1px solid var(--survai-border-ink);
}

.survai-voice-assistant__form {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-top: 1px solid var(--survai-border-soft);
    background: var(--survai-card);
}

.survai-voice-assistant__form input {
    flex: 1;
    min-width: 0;
    min-height: 38px;
    border: 1px solid rgba(15, 23, 42, 0.14);
    border-radius: 999px;
    padding: 0 14px;
    font-size: 0.88rem;
}

.survai-voice-assistant__mic,
.survai-voice-assistant__send {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    border: none;
    border-radius: 999px;
    color: #ffffff;
    background: #165ffa;
    cursor: pointer;
}

.survai-voice-assistant--admin .survai-voice-assistant__mic,
.survai-voice-assistant--admin .survai-voice-assistant__send {
    background: var(--survai-navy-surface);
}

.survai-voice-assistant__mic.is-recording {
    background: #dc2626;
    animation: survaiVoicePulse 1.1s ease-in-out infinite;
}

@keyframes survaiVoicePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

.survai-voice-assistant__head-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.survai-voice-assistant__speak {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    color: #ffffff;
    cursor: pointer;
    opacity: 0.95;
}

.survai-voice-assistant__speak.is-muted {
    opacity: 0.45;
}

/* Property Overview "Edit details" modal: one popup for the whole job sheet
   instead of inline edit buttons scattered across the page. */
.po-hero-detail-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.po-details-modal {
    position: fixed;
    inset: 0;
    z-index: 1500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
}

.po-details-modal[hidden] {
    display: none !important;
}

.po-details-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(11, 19, 33, 0.55);
}

.po-details-modal__card {
    position: relative;
    width: min(640px, calc(100vw - 36px));
    max-height: calc(100vh - 64px);
    overflow-y: auto;
    border-radius: 14px;
    background: var(--survai-card);
    box-shadow: 0 26px 70px rgba(15, 23, 42, 0.32);
    padding: 20px 22px;
}

.po-details-modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.po-details-modal__head h3 {
    margin: 0;
    font-size: 1.05rem;
}

.po-details-modal__close {
    border: none;
    background: none;
    font-size: 1.4rem;
    line-height: 1;
    color: var(--survai-secondary-slate);
    cursor: pointer;
}

.po-details-modal__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.po-details-modal__field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 0.85rem;
    font-weight: 650;
    color: var(--survai-text-soft);
}

.po-details-modal__field--wide {
    grid-column: 1 / -1;
}

.po-details-modal__field input,
.po-details-modal__field select {
    min-height: 42px;
    border: 1px solid rgba(15, 23, 42, 0.16);
    border-radius: 9px;
    padding: 0 12px;
    font-size: 0.92rem;
    font-weight: 500;
}

.po-details-modal__field select {
    background: var(--survai-card);
}

.po-details-modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
}

.survai-voice-assistant__wake {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: none;
    color: #ffffff;
    cursor: pointer;
    opacity: 0.45;
}

.survai-voice-assistant__wake.is-active {
    opacity: 1;
}

/* Pulsing ring on the launcher while the 'Hey Survai' ear is open. */
.survai-voice-assistant.is-wake-listening .survai-voice-assistant__launcher {
    animation: survaiWakePulse 2.4s ease-in-out infinite;
}

@keyframes survaiWakePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(22, 95, 250, 0.35); }
    50% { box-shadow: 0 0 0 9px rgba(22, 95, 250, 0); }
}

/* Hands-free conversation active: the header launcher is the only visible
   control, so make its listening state clear (brand-blue, pulsing ring). */
.survai-voice-assistant.is-conversing .survai-voice-assistant__launcher {
    color: #ffffff;
    background: #165ffa;
    animation: survaiConversePulse 1.6s ease-in-out infinite;
}

@keyframes survaiConversePulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(22, 95, 250, 0.45); }
    50% { box-shadow: 0 0 0 10px rgba(22, 95, 250, 0); }
}

/* Report processing (svrpm-*). The header holds one control, the play button that opens
   the processing card (surveyor, 7 Oct 2026: "the header will no longer ... contain
   [anything but] the play button ... when you click the play button, a pop-up appears in
   the center of the screen to display the status ... we don't need to have the ellipsis
   anymore"); the card is the shared overlay shell, centred, with the compact orb, the
   status of every section, and the processing toolbar laid out as labelled buttons and
   options (report_progress_modal.php, report_processing_toolbar.php actions_in_card). The
   panel is portaled to <body> in JS, so the header's backdrop-filter does not clip it and
   the toolbar inside it no longer sits under .svrpm: the output and progress pages'
   floating-dock rules are beaten here by the .svrpm__sheet rules, written at their weight.
   Before 7 Oct 2026 the header held the toolbar itself as a pill with a ⋯ drop-down. */
.svrpm {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.svrpm[hidden] {
    display: none;
}

/* -- The header's play button: the circled play glyph, its state in its colour -- */
.svrpm__play {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 40px;
    height: 40px;
    min-height: 40px;
    margin: 0;
    padding: 0 0 0 2px;
    border: 1.4px solid var(--survai-border-ink);
    border-radius: 999px;
    background: var(--survai-card);
    color: var(--survai-text-secondary);
    font: inherit;
    box-shadow: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform 140ms ease, color 140ms ease;
}

.svrpm__play:hover,
.svrpm__play:focus-visible {
    background: var(--survai-bg-tint);
    outline: none;
}

.svrpm__play:focus-visible {
    box-shadow: var(--survai-focus);
}

.svrpm__play[aria-expanded="true"] {
    background: var(--survai-bg-tint);
}

.svrpm__play-icon {
    position: relative;
    z-index: 1;
    display: block;
    width: 16px;
    height: 16px;
    flex: none;
}

/* No processing ring (M61, owner, 11-12 Oct 2026: "you can still see a ring around the play button",
   "we need consistency across the board"): the glyph's colour alone shows the state on every page, and
   its title names it. The ring (::before) once turned while writing; nothing is painted round ▶ now. */
.svrpm.is-processing .svrpm__play {
    color: var(--survai-brand);
}

.svrpm.is-complete .svrpm__play {
    color: var(--survai-ink-16a34a);
}

.svrpm.is-error .svrpm__play {
    color: var(--survai-ink-dc2626);
}

/* No light on the corner (M55, owner: "remove the dot from the play button in the header"): the
   glyph's colour shows the state, in the header toolbar from workspace-toolbar.css. */

/* -- The card: a sheet in the centre of the screen -- */
/* Minimal since 8 Oct 2026 (owner: "too much going on on the pop-up"): ×, the orb, the state, the
   count, the bar and one line; the section list and the regenerate options behind two rows. The
   panel (on <body>) carries data-rpm-phase. Two classes: the shell's 640px dialog rule is later. */
.survai-progress-overlay__dialog.svrpm__dialog {
    max-width: 400px;
}

.svrpm__sheet {
    position: relative;
    display: grid;
    gap: 10px;
    max-height: calc(100dvh - 40px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    overflow-y: auto;
    padding: 20px 20px 16px;
    border: 1px solid var(--survai-border);
    border-radius: 18px;
    background: var(--survai-card);
    color: var(--survai-text);
    box-shadow: var(--survai-shadow-hover);
}

/* A tap outside never closes the card; the sheet gives the shell's nudge (report-progress-modal.js). */
.svrpm__sheet.is-nudged {
    animation: survaiProgressNudge 360ms ease;
}

@media (prefers-reduced-motion: reduce) {
    .svrpm__sheet.is-nudged,
    .svrpm__sheet .svrpm-more__toggle::after,
    .svrpm__sheet .svrpm-menu__fill {
        animation: none;
        transition: none;
    }
}

/* × in the corner, a 44px target: the one close control (the writing carries on). */
.svrpm__dismiss {
    position: absolute;
    top: 6px;
    right: 6px;
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--survai-text-secondary);
    font: inherit;
    font-size: 20px;
    cursor: pointer;
}

.svrpm__dismiss:hover,
.svrpm__dismiss:focus-visible {
    background: var(--survai-bg-tint);
    color: var(--survai-text-strong);
    box-shadow: var(--survai-focus);
    outline: none;
}

/* One line under the bar, two at most, never an ellipsis (the error text was cut off). */
.svrpm-menu__activity {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    min-height: 18px;
    margin: 0 0 6px;
    font-size: 13px;
    line-height: 1.4;
    color: var(--survai-text-soft);
    overflow: hidden;
}

.svrpm-menu__activity[hidden],
.svrpm__panel[data-rpm-phase="writing"] [data-rpm-menu-last],
.svrpm__panel[data-rpm-phase="queued"] [data-rpm-menu-last] {
    display: none;
}

/* The activity line is a live region and stays in the tree; while it is empty, or while nothing
   runs (the last-processed line takes its place), it takes no room: visually hidden. */
.svrpm-menu__activity:empty,
.svrpm__panel[data-rpm-phase="idle"] [data-rpm-menu-activity],
.svrpm__panel[data-rpm-phase="stopped"] [data-rpm-menu-activity],
.svrpm__panel[data-rpm-phase="complete"] [data-rpm-menu-activity] {
    position: absolute;
    width: 1px;
    height: 1px;
    min-height: 0;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* The Sections and Regenerate rows: native <details>, closed by default; opening one closes the
   other (name="svrpm-more"). No ⋯, nothing on hover. The chevron turns down when open. */
.svrpm__sheet .svrpm-more {
    grid-column: 1 / -1;
    border-top: 1px solid var(--survai-border-soft);
}

.svrpm-more__toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 4px;
    border-radius: 10px;
    color: var(--survai-text-strong);
    font-size: 14px;
    font-weight: 600;
    list-style: none;
    cursor: pointer;
}

.svrpm-more__toggle::-webkit-details-marker {
    display: none;
}

.svrpm-more__toggle::after {
    content: "";
    width: 7px;
    height: 7px;
    margin: 0 4px 0 auto;
    border: solid var(--survai-text-soft);
    border-width: 0 1.6px 1.6px 0;
    transform: rotate(-45deg);
    transition: transform 160ms ease;
}

.svrpm-more[open] > .svrpm-more__toggle::after {
    transform: rotate(45deg);
}

.svrpm-more__flag {
    color: var(--survai-ink-dc2626);
}

/* -- The actions: the toolbar laid out as buttons, never the floating dock -- */
.svrpm__sheet .survai-progress-action-dock,
.output-report-page .svrpm__sheet .survai-progress-action-dock,
.progress-page .svrpm__sheet .survai-progress-action-dock {
    position: static;
    inset: auto;
    transform: none;
    z-index: auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px 0;
    width: auto;
    max-width: none;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--survai-text);
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    overflow: visible;
}

.svrpm__sheet .survai-progress-action-dock[hidden],
.svrpm__sheet .survai-progress-action-dock__action[hidden],
.svrpm__sheet .svrpm-actions__option[hidden] {
    display: none !important;
}

.svrpm__sheet .survai-progress-action-dock__action,
.svrpm__sheet .survai-progress-overlay__control,
.svrpm__sheet .survai-progress-action-dock__action:first-child,
.svrpm__sheet .survai-progress-action-dock__action:last-child,
.output-report-page .svrpm__sheet .survai-progress-action-dock__action,
.progress-page .svrpm__sheet .survai-progress-action-dock__action {
    position: static;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    width: auto;
    min-width: 0;
    min-height: 46px;
    margin: 0;
    padding: 0 18px;
    border: 1.4px solid transparent;
    border-radius: 999px;
    font: inherit;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    opacity: 1;
    transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}

/* Start / Pause / Resume (and a pop-up's Try again): the brand button. */
.svrpm__sheet [data-survai-progress-retry],
.svrpm__sheet [data-section-play-pause],
.svrpm__sheet [data-room-play-pause] {
    background: var(--survai-brand);
    border-color: var(--survai-brand);
    color: var(--survai-brand-ink);
}

.svrpm__sheet [data-survai-progress-retry]:hover,
.svrpm__sheet [data-section-play-pause]:hover,
.svrpm__sheet [data-room-play-pause]:hover,
.svrpm__sheet [data-section-play-pause]:focus-visible,
.svrpm__sheet [data-room-play-pause]:focus-visible {
    background: var(--survai-brand-hover);
    border-color: var(--survai-brand-hover);
    outline: none;
}

/* Once the report is written or finished (M81), play is a quiet outline: nothing is waiting to start (a pop-up's
   other buttons are always one). */
.svrpm__sheet .survai-progress-overlay__control:not([data-survai-progress-retry]),
.svrpm__panel[data-rpm-phase="complete"] .svrpm__sheet [data-section-play-pause], .svrpm__panel[data-rpm-phase="finished"] .svrpm__sheet [data-section-play-pause],
.svrpm__panel[data-rpm-phase="complete"] .svrpm__sheet [data-room-play-pause], .svrpm__panel[data-rpm-phase="finished"] .svrpm__sheet [data-room-play-pause] {
    background: transparent;
    border-color: var(--survai-border-mid);
    color: var(--survai-text-strong);
}

.svrpm__sheet .survai-progress-overlay__control:not([data-survai-progress-retry]):hover,
.svrpm__panel[data-rpm-phase="complete"] .svrpm__sheet [data-section-play-pause]:hover, .svrpm__panel[data-rpm-phase="finished"] .svrpm__sheet [data-section-play-pause]:hover,
.svrpm__panel[data-rpm-phase="complete"] .svrpm__sheet [data-room-play-pause]:hover, .svrpm__panel[data-rpm-phase="finished"] .svrpm__sheet [data-room-play-pause]:hover {
    background: var(--survai-bg-tint);
}

/* Stop: quiet red outline, beside play while a run is on. */
.svrpm__sheet [data-stop-processing]:not([hidden]),
.svrpm__sheet [data-stop-room-processing]:not([hidden]) {
    display: inline-flex;
    margin-left: 10px;
    background: transparent;
    border-color: var(--survai-border-mid);
    color: var(--survai-ink-dc2626);
}

.svrpm__sheet [data-stop-processing]:hover,
.svrpm__sheet [data-stop-room-processing]:hover,
.svrpm__sheet [data-stop-processing]:focus-visible,
.svrpm__sheet [data-stop-room-processing]:focus-visible {
    background: var(--survai-tint-fef2f2);
    border-color: var(--survai-ink-dc2626);
    color: var(--survai-ink-b91c1c);
    outline: none;
}

.svrpm__sheet .survai-progress-action-dock__action:focus-visible,
.svrpm__sheet .survai-progress-overlay__control:focus-visible,
.svrpm-more__toggle:focus-visible {
    outline: none;
    box-shadow: var(--survai-focus);
}

/* Nothing to start or pause: play is shown, but plainly off. */
.svrpm__sheet .survai-progress-action-dock__action--inactive,
.svrpm__sheet .survai-progress-action-dock__action:disabled,
.svrpm__sheet .survai-progress-overlay__control:disabled,
.svrpm__sheet .survai-progress-action-dock__action--inactive:hover,
.svrpm__sheet .survai-progress-action-dock__action:disabled:hover {
    opacity: 0.45;
    cursor: not-allowed;
    background: var(--survai-bg-tint);
    border-color: transparent;
    color: var(--survai-text-secondary);
}

.svrpm__sheet .survai-progress-action-dock__icon,
.svrpm__sheet .survai-progress-action-dock__action--danger .survai-progress-action-dock__icon {
    display: inline-grid;
    place-items: center;
    width: auto;
    height: auto;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 12px;
    line-height: 1;
    font-weight: 700;
    letter-spacing: 0;
    font-variant-emoji: text;
}

/* The Ⅱ glyph while writing (the paused state is the ▶): text at the ▶'s size, never emoji. */
.svrpm__sheet [data-section-play-pause][data-progress-action-state="pause"] .survai-progress-action-dock__icon,
.svrpm__sheet [data-room-play-pause][data-progress-action-state="pause"] .survai-progress-action-dock__icon {
    font-size: 11px;
    letter-spacing: 0.02em;
}

.svrpm__sheet .survai-progress-action-dock__icon--stop {
    font-size: 0;
    line-height: 0;
}

.svrpm__sheet .survai-progress-action-dock__icon--stop::before {
    content: "";
    display: block;
    width: 11px;
    height: 11px;
    border-radius: 2px;
    background: currentColor;
}

.svrpm-actions__label {
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

/* The regenerate options: rows across the full width inside the Regenerate row, titles only. */
.svrpm-actions__options {
    grid-column: 1 / -1;
    display: grid;
    gap: 2px;
}

/* The sibling selector matches the output and progress pages' floating-dock rule (.output-report-page
   .survai-progress-action-dock__menu-item + ...: a 12px gap above rows 2 and 3); this comes later. */
.svrpm__sheet .svrpm-actions__option,
.svrpm__sheet .svrpm-actions__option + .svrpm-actions__option {
    width: 100%;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;
    align-items: center;
    min-height: 44px;
    margin: 0;
    padding: 7px 8px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--survai-text-strong);
    text-align: left;
    cursor: pointer;
    font: inherit;
}

.svrpm__sheet .svrpm-actions__option:hover,
.svrpm__sheet .svrpm-actions__option:focus-visible {
    background: var(--survai-bg-tint);
    outline: none;
}

/* Hidden, not greyed, when they cannot act (app.js marks them disabled or --inactive): Stop, an
   option, a Regenerate row left empty. After the rules of the same weight above; play never hides. */
.svrpm__sheet [data-stop-processing]:disabled,
.svrpm__sheet [data-stop-processing].survai-progress-action-dock__action--inactive,
.svrpm__sheet [data-stop-room-processing]:disabled,
.svrpm__sheet [data-stop-room-processing].survai-progress-action-dock__action--inactive,
.svrpm__sheet .svrpm-actions__option:disabled,
.svrpm__sheet .svrpm-actions__option.survai-progress-action-dock__menu-item--inactive,
.svrpm__sheet .svrpm-more[data-rpm-regenerate]:not(:has(.svrpm-actions__option:not(:disabled):not([hidden]):not(.survai-progress-action-dock__menu-item--inactive))) {
    display: none;
}

.svrpm__sheet .svrpm-actions__option .survai-progress-action-dock__menu-copy strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--survai-text-strong);
}

.svrpm__sheet .svrpm-actions__option .survai-progress-action-dock__menu-icon {
    display: grid;
    place-items: center;
    width: auto;
    min-width: 1.6rem;
    height: auto;
    font-size: 1rem;
    color: var(--survai-text);
}

.svrpm__sheet .svrpm-actions__option .survai-progress-action-dock__menu-icon--warning {
    color: var(--survai-ink-b45309);
}

@media (max-width: 480px) {
    .svrpm__sheet {
        padding: 18px 16px 14px;
        border-radius: 16px;
    }
}

/* The progress block at the top of the menu: now the card's state, count, bar, line and lights. */
.svrpm-menu {
    display: grid;
    margin: 0;
    padding: 0;
    text-align: center;
}

.svrpm-menu__head {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    margin-bottom: 10px;
}

.svrpm-menu__state {
    font-size: 17px;
    font-weight: 650;
    letter-spacing: -0.01em;
    color: var(--survai-text-strong);
}

.svrpm-menu__count {
    font-size: 13px;
    font-weight: 600;
    color: var(--survai-text-soft);
    font-variant-numeric: tabular-nums;
}

.svrpm-menu__bar {
    display: block;
    margin-bottom: 8px;
    height: 5px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--survai-bg-tint);
}

.svrpm-menu__fill {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #245cff 0%, #367eff 64%, #58c5ee 100%);
    transition: width 0.5s ease;
}

.svrpm-menu__legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 6px;
    margin: 0;
    font-size: 12px;
    color: var(--survai-text-soft);
    font-variant-numeric: tabular-nums;
}

.svrpm-menu__legend .svrpm-light {
    margin-left: 4px;
}

.svrpm-menu__legend .svrpm-light:first-child {
    margin-left: 0;
}

.svrpm-menu__list {
    display: grid;
    max-height: max(132px, min(320px, calc(100dvh - 520px)));
    margin: 0;
    padding: 0 4px 6px 2px;
    text-align: left;
    overflow-y: auto;
    overscroll-behavior: contain;
    list-style: none;
}

.svrpm-menu__list:empty {
    display: none;
}

.svrpm-menu__row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 9px;
    padding: 5px 2px;
    font-size: 13px;
}

.svrpm-menu__row.is-nested {
    padding-left: 14px;
}

.svrpm-menu__name {
    min-width: 0;
    overflow: hidden;
    color: var(--survai-text);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.svrpm-menu__status {
    font-size: 11.5px;
    font-weight: 650;
    color: var(--survai-text-soft);
}

.svrpm-menu__group {
    padding: 8px 2px 3px;
    font-size: 11px;
    font-weight: 750;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--survai-text-soft);
}

/* Status lights: green done, blue writing (pulsing), red failed, grey to do. */
.svrpm-light {
    display: inline-block;
    flex: 0 0 auto;
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: #a3a3a3;
}

.svrpm-light.is-completed { background: #16a34a; box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.16); }
.svrpm-light.is-processing { background: #1b5af9; box-shadow: 0 0 0 3px rgba(27, 90, 249, 0.18); animation: svrpmLightPulse 1.4s ease-in-out infinite; }
.svrpm-light.is-failed { background: #dc2626; box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.16); }
.svrpm-light.is-pending { background: #a3a3a3; box-shadow: 0 0 0 3px rgba(163, 163, 163, 0.14); }
/* Waiting to retry after a slow or busy AI call: amber, not red (the worker comes back to it). */
.svrpm-light.is-retrying { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18); }

@keyframes svrpmLightPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.45; }
}

@media (prefers-reduced-motion: reduce) {
    .svrpm-light.is-processing { animation: none; }
}

/* Reports dashboard: status overview cards, status tabs, and card-style list. */
.reports-page .reports-content {
    display: grid;
    gap: 16px;
}

@media (max-width: 920px) {
    .reports-page .reports-content {
        gap: 14px;
    }
}

@media (max-width: 900px) {
    /* In-page Filters duplicate the mobile topbar filter controls. */
    .reports-page .reports-filter-dd {
        display: none !important;
    }
}

/* Desktop reports list card: the rows carry their own padding, and the card
   must not clip a row's ⋯ actions menu. */

@media (min-width: 921px) {
    .reports-page .card.table-card {
        padding: 0;
        overflow: visible;
    }
}

/* Final workspace-header ink guard: this intentionally lives after the global
   blue link rule so report workspace header/tool/menu text cannot be recoloured. */
.workspace-topbar.report-workspace-header,
.workspace-topbar.report-workspace-header :is(a, button, summary, span, strong, p, div, label, legend, select, option, small, input, svg) {
    color: var(--survai-text) !important;
    text-decoration: none !important;
}

.workspace-topbar.report-workspace-header :is(
    a,
    button,
    summary,
    span,
    strong,
    p,
    div,
    label,
    legend,
    select,
    option,
    small,
    input,
    svg
):is(
    :hover,
    :focus,
    :focus-visible,
    :active,
    .is-active,
    .is-selected,
    [aria-current="page"],
    [aria-expanded="true"],
    [aria-selected="true"]
) {
    color: var(--survai-text) !important;
    text-decoration: none !important;
}

.workspace-topbar.report-workspace-header .workspace-tool-button,
.workspace-topbar.report-workspace-header .output-display-options-trigger,
.workspace-topbar.report-workspace-header .output-image-display-panel details[open] .output-display-options-trigger,
.workspace-topbar.report-workspace-header .workspace-fullscreen-toggle,
.workspace-topbar.report-workspace-header .report-workspace-nav__link,
.workspace-topbar.report-workspace-header .report-workspace-nav__link:hover,
.workspace-topbar.report-workspace-header .report-workspace-nav__link:focus-visible,
.workspace-topbar.report-workspace-header .report-workspace-nav__link.is-active,
.workspace-topbar.report-workspace-header .workspace-stage-subnav__link,
.workspace-topbar.report-workspace-header .workspace-stage-subnav__link:hover,
.workspace-topbar.report-workspace-header .workspace-stage-subnav__link:focus-visible,
.workspace-topbar.report-workspace-header .workspace-stage-subnav__link.is-active,
.workspace-topbar.report-workspace-header .report-status-pill,
.workspace-topbar.report-workspace-header .report-status-pill:hover,
.workspace-topbar.report-workspace-header .report-status-pill:focus-visible,
.workspace-topbar.report-workspace-header .report-status-pill-menu__option,
.workspace-topbar.report-workspace-header .report-status-pill-menu__option:hover,
.workspace-topbar.report-workspace-header .report-status-pill-menu__option:focus-visible,
.workspace-topbar.report-workspace-header .report-status-pill-menu__option.is-selected,
.workspace-topbar.report-workspace-header .survai-progress-action-dock__action,
.workspace-topbar.report-workspace-header .survai-progress-action-dock__action:hover,
.workspace-topbar.report-workspace-header .survai-progress-action-dock__action:focus-visible,
.workspace-topbar.report-workspace-header .survai-progress-action-dock__menu-item,
.workspace-topbar.report-workspace-header .survai-progress-action-dock__menu-item:hover,
.workspace-topbar.report-workspace-header .survai-progress-action-dock__menu-item:focus-visible,
.workspace-topbar.report-workspace-header .survai-progress-action-dock__menu-copy strong,
.workspace-topbar.report-workspace-header .survai-progress-action-dock__menu-copy small {
    color: var(--survai-text) !important;
    text-decoration: none !important;
}

.workspace-topbar.report-workspace-header .report-workspace-nav__link::after,
.workspace-topbar.report-workspace-header .workspace-stage-subnav__link::after,
.workspace-topbar.report-workspace-header .report-workspace-nav__link.is-active::after,
.workspace-topbar.report-workspace-header .workspace-stage-subnav__link.is-active::after {
    content: none !important;
    display: none !important;
    background: transparent !important;
}

/* Brand nav colours: parent stage pills are brand blue with white text and
   icons; dropdown children are brand blue on the white card. This block must
   sit AFTER the monochrome header catch-all above (which forces #111827
   !important on every nav link state) and carry !important so it also beats
   the global `.is-active` badge tint (background: rgba(27,90,249,0.11)
   !important). Structural pill rules live next to the dropdown CSS. */
.workspace-topbar.report-workspace-header .workspace-stage-nav .workspace-stage-nav__stage,
.workspace-topbar.report-workspace-header .workspace-stage-nav .workspace-stage-nav__stage--advanced {
    color: var(--survai-text-secondary) !important;
    background: transparent !important;
}

/* Compact tabs (surveyor, 3 Oct 2026): neutral at rest, and a quiet grey on hover or while a
   stage's menu is open. The current page has no blue overlay and no underline; its label is
   simply a little bolder, in the primary text colour ("remove the blue overlay over the
   buttons on the banner on all parts of the site ... when a menu item is active ... it should
   just [be] slightly bold"). The active rule comes first so hover still shows on it. */
.workspace-topbar.report-workspace-header .workspace-stage-nav .workspace-stage-nav__stage.is-active {
    color: var(--survai-text) !important;
    background: transparent !important;
    box-shadow: none !important;
    font-weight: 650 !important;
}

.workspace-topbar.report-workspace-header .workspace-stage-nav .workspace-stage-nav__stage:hover,
.workspace-topbar.report-workspace-header .workspace-stage-nav .workspace-stage-nav__stage:focus-visible,
.workspace-topbar.report-workspace-header .workspace-stage-nav__item.is-open .workspace-stage-nav__stage {
    color: var(--survai-text) !important;
    background: var(--survai-neutral-hover) !important;
    box-shadow: none !important;
}

.workspace-topbar.report-workspace-header .workspace-stage-dropdown .workspace-stage-subnav__link,
.workspace-topbar.report-workspace-header .workspace-stage-dropdown .workspace-stage-subnav__link:hover,
.workspace-topbar.report-workspace-header .workspace-stage-dropdown .workspace-stage-subnav__link:focus-visible {
    color: var(--survai-text) !important;
}

.workspace-topbar.report-workspace-header .workspace-stage-dropdown .workspace-stage-subnav__link.is-active {
    color: var(--survai-text) !important;
    background: transparent !important;
    font-weight: 650 !important;
}

/* The header ink guard also stamps #111827 directly on every span/svg, so
   the labels and stroke=currentColor icons need their own recolour. */
.workspace-topbar.report-workspace-header .workspace-stage-nav .workspace-stage-nav__stage :is(span, svg),
.workspace-topbar.report-workspace-header .workspace-stage-dropdown .workspace-stage-subnav__link :is(span, svg) {
    color: inherit !important;
}

/* …but NOT the two chips that carry their own background. The blanket span
   recolour above painted the hover tooltip's text brand-blue on its brand-blue
   bubble — the count rendered as an unreadable blue shape. Both re-assert
   their own ink here, after the blanket rule and with higher specificity. */
.workspace-topbar.report-workspace-header .workspace-stage-dropdown .workspace-stage-subnav__link .workspace-stage-subnav__tooltip,
.workspace-topbar.report-workspace-header .workspace-stage-dropdown .workspace-stage-subnav__link .workspace-stage-subnav__tooltip * {
    color: #ffffff !important;
}

.workspace-topbar.report-workspace-header .workspace-stage-dropdown .workspace-stage-subnav__link .workspace-stage-subnav__count {
    color: var(--survai-ink-1e40af) !important;
}

/* Mobile (≤899px, the embedded-header breakpoint): the stage pills share the
   row equally with breathing room at the edges, and every stage's dropdown
   opens as a full-width panel anchored to the menu BAR rather than its pill —
   the same presentation on every workspace page, and it can never run off
   the side of a narrow screen. */
@media (max-width: 899px) {
    .report-workspace-nav.workspace-stage-nav {
        position: relative;
        padding-inline: 10px;
    }

    .workspace-stage-nav .workspace-stage-nav__stage {
        flex: 1 1 0;
        min-width: 0;
    }

    .workspace-stage-nav .workspace-stage-nav__item {
        position: static;
    }

    .workspace-stage-nav .workspace-stage-dropdown,
    .workspace-stage-nav .workspace-stage-nav__item:last-child .workspace-stage-dropdown {
        left: 8px;
        right: 8px;
        width: auto;
        min-width: 0;
        max-width: none;
    }
}

/* Sort Images control beside the image gallery filter trigger (Media Manager) */
.image-manager-sort-controls {
    display: inline-flex;
    align-items: center;
    margin: 0 10px 14px 0;
}

/* Move-to-section control in the output image action dock: a pill select beside the Move circle. */
.survai-image-action-dock__move {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
}

.survai-image-action-dock__move select {
    max-width: clamp(150px, 24vw, 240px);
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid var(--survai-border);
    border-radius: 999px;
    background: var(--survai-card);
    color: var(--survai-text-strong);
    font-size: 0.86rem;
    font-weight: 700;
}

/* "Show N images" selector beside the gallery Sort button */
.image-manager-show-count {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 14px 10px;
    font-size: 0.88rem;
    font-weight: 640;
    color: var(--survai-ink-3d4861);
}

.image-manager-show-count select {
    min-height: 34px;
    border-radius: 10px;
}

/* Uploaded photos on the site-media page, matching the output.php figures */
.report-site-media-uploaded-card {
    margin-top: 18px;
}

.report-site-media-uploaded-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
    margin-top: 14px;
}

.report-site-media-uploaded-grid .output-embedded-image {
    margin: 0;
}

@media (max-width: 720px) {
    .report-site-media-uploaded-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 10px;
    }
}

/* Clear-labels rows in the bulk edit modals */
.image-manager-bulk-clear-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.88rem;
}

.image-manager-bulk-clear-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    min-height: 0;
}

/* Reinstatement Valuation form on the report settings page */
.reinstatement-valuation-form__include {
    margin-bottom: 1rem;
}

.reinstatement-valuation-form__calc {
    margin: 0 0 1rem;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--survai-tint-eff6ff);
    color: var(--survai-ink-1e3a8a);
}

.reinstatement-valuation-form__notes {
    width: 100%;
    resize: vertical;
}

/* Fixed block-policy wording printed on the PDF page for a flat (read-only preview) */
.reinstatement-valuation-form__flat-notice {
    margin: 0 0 1rem;
    padding: 10px 14px;
    border-radius: 10px;
    background: var(--survai-bg);
    border: 1px solid var(--survai-border-soft);
    color: var(--survai-text-strong);
    max-width: 100%;
}

.reinstatement-valuation-form__flat-notice span {
    display: block;
    margin-bottom: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--survai-secondary-strong);
}

.reinstatement-valuation-form__flat-notice p {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.55;
}

.reinstatement-valuation-form__flat-notice .form-note {
    margin-top: 8px;
}

.reinstatement-valuation-form .form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 1rem;
}

@media (max-width: 600px) {
    .reinstatement-valuation-form .form-grid {
        grid-template-columns: 1fr;
    }
}

/* Reinstatement Valuation — its own Report-tab section (it is a standalone PDF
   page, not part of Costs).

   The box deliberately carries the SAME border, 16px radius, 16px padding and
   shadow as .output-repair-head and the other Report-tab fragment boxes, so the
   sections line up instead of each having its own corner radius and inset. Do
   not add .card here: its !important rules force a 20px radius and a heavier
   shadow, which is what made this section look bolted on. */
.output-reinstatement {
    display: grid;
    gap: 12px;
}

.reinstatement-valuation-card {
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 16px;
    /* Roomier than the 16px fragment default: this is a form-heavy section and
       the fields need clear air from the box edges on every side. */
    padding: 24px;
    background: var(--survai-card);
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.05);
}

.reinstatement-valuation-card .section-head {
    margin-bottom: 18px;
}

.reinstatement-valuation-card .section-head h3 {
    margin: 2px 0 4px;
}

.reinstatement-valuation-card .reinstatement-valuation-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* flex-direction: row is load-bearing — the generic label rule below stacks
   labels into columns, which floated the checkbox above centred text. */
.reinstatement-valuation-card .reinstatement-valuation-form__include {
    margin: 0;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

/* Constrain the include checkbox so the global input rule can't stretch it. */
.reinstatement-valuation-card .reinstatement-valuation-form__include input[type="checkbox"] {
    width: 18px;
    height: 18px;
    min-width: 18px;
    min-height: 18px;
    flex: 0 0 18px;
    margin: 0;
    accent-color: #2563eb;
}

.reinstatement-valuation-card .form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin: 0;
}

/* Additional BCIS-style components: label + cost rows with a remove control. */
.reinstatement-valuation-form__components {
    display: grid;
    gap: 10px;
    justify-items: start;
}

.reinstatement-valuation-form__components-head span {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--survai-secondary-strong);
}

.reinstatement-valuation-form__components-head .form-note {
    margin: 4px 0 0;
}

.reinstatement-valuation-form__component-list {
    display: grid;
    gap: 8px;
    width: 100%;
}

.reinstatement-valuation-form__component-list:empty {
    display: none;
}

.reinstatement-valuation-form__component-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 150px 36px;
    gap: 8px;
    align-items: center;
    width: 100%;
}

.reinstatement-valuation-form__component-remove {
    width: 36px;
    height: 36px;
    min-height: 0;
    padding: 0;
    border: 1px solid rgba(148, 163, 184, 0.5);
    border-radius: 10px;
    background: var(--survai-card);
    color: var(--survai-secondary-slate);
    font-size: 1.05rem;
    line-height: 1;
    cursor: pointer;
}

.reinstatement-valuation-form__component-remove:hover {
    border-color: #dc2626;
    color: var(--survai-ink-dc2626);
}

.reinstatement-valuation-card label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
}

.reinstatement-valuation-card label > span {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--survai-secondary-strong);
}

.reinstatement-valuation-card input[type="text"],
.reinstatement-valuation-card textarea {
    width: 100%;
    min-height: 0;
    padding: 10px 12px;
    border: 1px solid rgba(148, 163, 184, 0.5);
    border-radius: 10px;
    background: var(--survai-card);
    font-family: inherit;
    font-size: 0.95rem;
    /* Fields inherit a bold weight from the surrounding form context otherwise,
       which made the long Notes/caveats block render heavy and hard to read. */
    font-weight: 400;
    color: var(--survai-text-strong);
}

.reinstatement-valuation-card textarea {
    min-height: 130px;
    resize: vertical;
    line-height: 1.55;
}

.reinstatement-valuation-card .reinstatement-valuation-form__calc {
    margin: 0;
    padding: 10px 14px;
    border-radius: 10px;
    background: var(--survai-tint-eff6ff);
    color: var(--survai-ink-1e3a8a);
    font-weight: 600;
}

.reinstatement-valuation-card .form-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin: 0;
}

.reinstatement-valuation-card .form-actions .form-note {
    color: var(--survai-secondary-slate);
}

@media (max-width: 600px) {
    .reinstatement-valuation-card {
        padding: 16px;
    }

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

    .reinstatement-valuation-form__component-row {
        grid-template-columns: minmax(0, 1fr) 110px 36px;
    }

    .reinstatement-valuation-card .form-actions {
        align-items: stretch;
    }

    .reinstatement-valuation-card .form-actions .btn {
        width: 100%;
    }
}

/* Manual weather entry on the Property Overview weather card */
.po-weather-manual {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.po-weather-manual__label {
    margin: 0 0 8px;
    font-size: 0.86rem;
    font-weight: 640;
    color: var(--survai-ink-3d4861);
}

.po-weather-manual__recorded {
    margin: 0 0 8px;
}

.po-weather-manual__controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.po-weather-manual__controls select {
    flex: 1 1 180px;
    min-height: 36px;
    border-radius: 10px;
}

.po-weather-manual__controls input[type="number"] {
    flex: 0 1 120px;
    min-height: 36px;
    border-radius: 10px;
}

/* The image editor pop-up (.siex) is styled in assets/css/survai-image-editor.css,
 * linked from pwa_head.php; its dark-theme overrides stay with the dark rules below. */

/* Reports header filter panel: apply/clear footer. */
.reports-filter-panel__foot {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 10px 14px;
    border-top: 1px solid var(--survai-border-faint);
}

/* Gallery toolbar: Sort Images, Show count, Filters and Section filter sit
   on ONE organised row, wrapping cleanly on narrow screens. */
.image-manager-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    margin: 0 0 14px;
}

.image-manager-toolbar .image-manager-sort-controls,
.image-manager-toolbar .image-manager-filter-menu,
.image-manager-toolbar .image-manager-filterbar {
    margin: 0;
}

.image-manager-toolbar .image-manager-sort-controls {
    gap: 10px;
}

.image-manager-toolbar .image-manager-show-count {
    margin: 0;
}

.image-manager-toolbar .image-manager-show-count span {
    white-space: nowrap;
}

/* Section filter: label and select inline, taking the remaining row space. */
.image-manager-toolbar .image-manager-filterbar {
    flex: 1 1 240px;
    min-width: 0;
}

.image-manager-toolbar .image-manager-filterbar label {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 440px;
}

.image-manager-toolbar .image-manager-filterbar label > span {
    white-space: nowrap;
    font-size: 0.85rem;
    font-weight: 650;
    color: var(--survai-ink-3d4861);
}

.image-manager-toolbar .image-manager-filterbar select {
    flex: 1 1 auto;
    min-width: 140px;
    min-height: 38px;
}

@media (max-width: 640px) {
    .image-manager-toolbar {
        gap: 8px 10px;
    }

    /* Sort + Show + Size share one full-width row without wrapping or clipping. */
    .image-manager-toolbar .image-manager-sort-controls {
        flex: 1 1 100%;
        justify-content: space-between;
        gap: 8px;
    }

    .image-manager-toolbar .image-manager-sort-controls .btn {
        flex: 0 0 auto;
        white-space: nowrap;
        padding-left: 12px;
        padding-right: 12px;
    }

    .image-manager-toolbar .image-manager-show-count {
        gap: 5px;
        min-width: 0;
        font-size: 0.8rem;
    }

    .image-manager-toolbar .image-manager-show-count select {
        flex: 0 0 auto;
        width: 62px;
        min-width: 0;
        padding-left: 8px;
        padding-right: 20px;
    }

    .image-manager-toolbar .image-manager-show-count select[data-image-size-select] {
        width: 96px;
    }
}

/* Narrow phones: the row only fits without the "Show"/"Size" text labels
   (the selects keep their aria-labels and self-explanatory values). */
@media (max-width: 430px) {
    .image-manager-toolbar .image-manager-show-count span {
        display: none;
    }

    .image-manager-toolbar .image-manager-filterbar {
        flex: 1 1 100%;
    }

    .image-manager-toolbar .image-manager-filterbar label {
        max-width: none;
    }
}

/* ------------------------------------------------------------------ */
/* Defect register (shadow mode) — whole-property consolidation view. */
/* ------------------------------------------------------------------ */

.defect-register-page .section-head {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: flex-start;
    justify-content: space-between;
}

.desk-radon-atlas-note,
.desk-authority-note {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    margin-top: 5px;
    font-size: 0.82rem;
    color: var(--survai-secondary-strong);
    line-height: 1.4;
}

.desk-authority-note {
    display: block;
}

.desk-authority-note strong {
    color: var(--survai-ink-b45309);
}

.desk-radon-atlas-swatch {
    flex: 0 0 14px;
    width: 14px;
    height: 14px;
    margin-top: 2px;
    border-radius: 4px;
    border: 1px solid rgba(15, 23, 42, 0.25);
}

.defect-register-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.defect-audit-panel {
    margin-top: 18px;
    border: 1px solid #c8d8ec;
    border-radius: 12px;
    background: var(--survai-tint-f8fbff);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.defect-audit-panel__head h3 {
    margin: 0 0 4px;
    font-size: 1rem;
    color: var(--navy);
}

.defect-audit-clean {
    color: var(--survai-ink-157347);
}

.defect-audit-finding {
    border: 1px solid #f1c9c9;
    border-left: 4px solid #dc2626;
    border-radius: 10px;
    background: var(--survai-card);
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.defect-audit-finding--warning {
    border-color: #e8d9b5;
    border-left-color: #b45309;
}

.defect-audit-finding__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.defect-audit-finding__type {
    background: var(--survai-tint-fdeaea);
    color: var(--survai-ink-b91c1c);
}

.defect-audit-finding--warning .defect-audit-finding__type {
    background: var(--survai-tint-fdf3e0);
    color: var(--survai-ink-92400e);
}

.defect-audit-finding__section {
    color: var(--survai-ink-5b6b82);
    font-size: 0.85rem;
}

.defect-audit-finding__detail {
    margin: 0;
    font-size: 0.88rem;
    color: var(--survai-text-soft);
}

.defect-audit-finding__excerpt {
    margin: 0;
    padding: 6px 12px;
    border-left: 3px solid var(--survai-border-mid);
    color: var(--survai-ink-55657d);
    font-size: 0.85rem;
    font-style: italic;
    overflow-wrap: anywhere;
}

.defect-register-group {
    margin-top: 22px;
}

.defect-register-group__title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 10px;
    font-size: 1.05rem;
    color: var(--navy);
}

.defect-register-group__count {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--survai-ink-5b6b82);
    background: var(--survai-tint-eef2f8);
    border-radius: 999px;
    padding: 2px 10px;
    white-space: nowrap;
}

.defect-register-card {
    border: 1px solid #d7e3f4;
    border-radius: 12px;
    background: var(--survai-card);
    padding: 14px 16px;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.defect-register-card__head {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: space-between;
    align-items: flex-start;
}

.defect-register-card__title {
    color: var(--navy);
    display: block;
}

.defect-register-card__location {
    display: block;
    color: var(--survai-ink-5b6b82);
    font-size: 0.85rem;
}

.defect-register-card__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.defect-badge {
    font-size: 0.72rem;
    font-weight: 600;
    border-radius: 999px;
    padding: 3px 9px;
    background: var(--survai-tint-eef2f8);
    color: var(--survai-ink-3b4b63);
    white-space: nowrap;
}

.defect-badge--source-manual { background: #165ffa; color: #fff; }
.defect-badge--source-rule { background: var(--survai-tint-e7f0ff); color: #164db8; }
.defect-badge--confidence-high { background: var(--survai-tint-e7f6ec); color: #17693a; }
.defect-badge--confidence-limited { background: var(--survai-tint-fdeeee); color: #a02222; }

.defect-register-card__observation {
    margin: 0;
    color: var(--survai-ink-24354d);
    line-height: 1.5;
}

.defect-register-card__facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 10px 18px;
    margin: 0;
}

.defect-register-card__facts dt {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--survai-ink-5b6b82);
}

.defect-register-card__facts dd {
    margin: 2px 0 0;
    color: var(--survai-ink-24354d);
    font-size: 0.9rem;
    line-height: 1.45;
}

.defect-register-card__facts-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--survai-ink-5b6b82);
    margin-right: 6px;
}

.defect-register-card__evidence {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.defect-evidence-chip {
    font-size: 0.78rem;
    background: var(--survai-bg-deep);
    border: 1px solid #dbe5f2;
    border-radius: 8px;
    padding: 3px 8px;
    color: var(--survai-ink-33445e);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.defect-register-card__crossrefs ul {
    margin: 4px 0 0;
    padding-left: 18px;
}

.defect-register-card__crossrefs li {
    font-size: 0.88rem;
    color: var(--survai-ink-24354d);
    line-height: 1.45;
}

.defect-register-card__notes {
    margin: 0;
    font-size: 0.82rem;
    color: var(--survai-ink-8a5a12);
    background: var(--survai-tint-fdf6e9);
    border-radius: 8px;
    padding: 8px 10px;
}

.defect-register-card__reassign {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 10px;
    border-top: 1px solid #edf2f9;
    padding-top: 10px;
}

.defect-register-card__reassign label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    flex: 1 1 260px;
    max-width: 420px;
}

.defect-register-card__reassign label span {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--survai-ink-5b6b82);
}

@media (max-width: 640px) {
    .defect-register-card__reassign label { max-width: none; }
    .defect-register-card__badges { justify-content: flex-start; }
}

/* ---- Keyword-Assisted Regeneration ---- */
.keyword-regen-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.keyword-regen-modal[hidden] {
    display: none;
}

.keyword-regen-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(11, 23, 54, 0.5);
}

.keyword-regen-modal__card {
    position: relative;
    width: 100%;
    max-width: 650px;
    max-height: min(80vh, 720px);
    background: var(--survai-card);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(11, 23, 54, 0.25);
    display: flex;
    flex-direction: column;
}

.keyword-regen-modal__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 20px;
    /* Neutral (surveyor, 3 Oct 2026): the card's own surface with a rule under it, not navy. */
    border-bottom: 1px solid var(--survai-border);
    background: var(--survai-card);
    color: var(--survai-text);
}

.keyword-regen-modal__head h3 {
    margin: 0;
    font-size: 16px;
    /* The skin layer colours every h1-h4 with an !important declaration; match its weight. */
    color: var(--survai-text) !important;
}

.keyword-regen-modal__close {
    background: none;
    border: 0;
    color: var(--survai-text-secondary);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.75;
}

.keyword-regen-modal__close:hover {
    opacity: 1;
}

.keyword-regen-modal__body {
    padding: 16px 20px;
    overflow-y: auto;
    flex: 1;
}

.keyword-regen-context {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    background: var(--survai-tint-f7faff);
    border-radius: 8px;
    font-size: 13px;
    color: var(--survai-ink-60708f);
}

/* Management page: one block per category inside each component card, so
   the options can be filled out group by group. */
.keyword-management-category {
    display: grid;
    gap: 6px;
    padding: 10px 0 0;
    border-top: 1px solid var(--survai-border-faint);
}
.keyword-management-category:first-of-type { border-top: 0; padding-top: 0; }
.keyword-management-category__label {
    margin: 0;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--survai-secondary-slate);
}

/* The card is now grouped input, not one flat keyword list: Location,
   Materials, Defects, Other — each a headed set of pills the surveyor
   toggles, so a section can be written without a transcript. */
.keyword-regen-pills {
    display: grid;
    gap: 14px;
    padding: 14px 0 4px;
}
.keyword-regen-group {
    display: grid;
    gap: 8px;
}
.keyword-regen-group__label {
    margin: 0;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--survai-secondary-slate);
}
.keyword-regen-group__pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.keyword-regen-group .keyword-regen-empty {
    margin: 0;
    font-size: 0.8rem;
}

.keyword-regen-pill {
    padding: 6px 16px;
    border: 2px solid var(--survai-border);
    border-radius: 999px;
    background: var(--survai-card);
    font-size: 14px;
    color: var(--survai-ink-0b1736);
    cursor: pointer;
    user-select: none;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.keyword-regen-pill:hover {
    border-color: #155dfc;
    background: var(--survai-tint-f0f4ff);
}

.keyword-regen-pill.is-selected {
    background: #155dfc;
    border-color: #155dfc;
    color: #ffffff;
}

.keyword-regen-empty {
    color: var(--survai-ink-60708f);
    font-size: 14px;
    margin: 12px 0;
}

.keyword-regen-note {
    display: block;
    margin-top: 12px;
}

.keyword-regen-note span {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--survai-ink-0b1736);
    margin-bottom: 4px;
}

.keyword-regen-note textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--field-border-color);
    border-radius: 8px;
    font-size: 14px;
    resize: vertical;
}

.keyword-regen-note textarea:focus {
    outline: none;
    border-color: #155dfc;
}

.keyword-regen-preview {
    margin-top: 12px;
    padding: 10px 14px;
    background: var(--survai-tint-f7faff);
    border-left: 3px solid #155dfc;
    border-radius: 8px;
    font-size: 13px;
}

.keyword-regen-preview span {
    display: block;
    font-weight: 500;
    color: var(--survai-ink-60708f);
    margin-bottom: 4px;
}

.keyword-regen-preview [data-keyword-preview-text] {
    color: var(--survai-ink-0b1736);
    white-space: pre-wrap;
}

.keyword-regen-modal__footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 14px 20px;
    border-top: 1px solid var(--survai-border);
    background: var(--survai-tint-f7faff);
}

/* ---- Keyword Management page ---- */
.keyword-management-section-group {
    margin-bottom: 26px;
}

.keyword-management-section-group__title {
    margin: 0 0 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
    font-size: 17px;
    color: var(--survai-ink-0b1736);
}

/* Responsive card grid: 3+ cards per row on desktop, collapsing gracefully. */
.keyword-management-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 14px;
    align-items: start;
}

.keyword-management-tag__count {
    font-style: normal;
    font-size: 11px;
    color: var(--survai-ink-60708f);
}

.keyword-management-group {
    background: var(--survai-card);
    border: 1px solid #e6edf7;
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.keyword-management-group h3 {
    margin: 0 0 10px;
    font-size: 15px;
    color: var(--survai-ink-0b1736);
}

.keyword-management-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.keyword-management-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px 4px 14px;
    background: var(--survai-tint-f0f4f9);
    border-radius: 999px;
    font-size: 13px;
    color: var(--survai-ink-0b1736);
}

.keyword-management-tag--locked {
    background: var(--survai-tint-eef1f5);
    color: var(--survai-ink-5b6b86);
    padding-right: 14px;
    border: 1px dashed #cdd6e4;
}

.keyword-management-tag button {
    background: none;
    border: 0;
    color: var(--survai-ink-60708f);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    padding: 0 2px;
}

.keyword-management-tag button:hover {
    color: var(--survai-ink-dc2626);
}

.keyword-management-add {
    display: flex;
    gap: 8px;
    margin-top: auto;
}

.keyword-management-add input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #e6edf7;
    border-radius: 8px;
    font-size: 14px;
}

@media (max-width: 600px) {
    .keyword-regen-modal__card {
        max-height: 90vh;
    }

    .keyword-regen-pill {
        font-size: 12px;
        padding: 4px 12px;
    }
}

/* ---- Legal matter templates management page ---- */
.legal-templates-table {
    display: grid;
    gap: 6px;
}
.legal-templates-row {
    display: grid;
    grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)) minmax(0, 1fr) minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 1px solid var(--survai-border-soft);
    border-radius: 12px;
    background: var(--survai-bg-soft);
    /* Light surfaces are hard-coded, so the text colour must be too — the
       dark theme paints .card text white, unreadable on these pills. */
    color: var(--survai-text-soft);
    font-size: 0.9rem;
}
.legal-templates-row strong { color: var(--survai-text-strong); }
.legal-templates-row--head {
    border: 0;
    background: transparent;
    padding-top: 0;
    padding-bottom: 0;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--survai-secondary-slate);
}
.legal-templates-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.legal-templates-actions form { margin: 0; }
.legal-templates-form { display: grid; gap: 18px; }
.legal-templates-form__grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)) auto;
    gap: 12px;
    align-items: end;
}
.legal-templates-form__grid label { display: grid; gap: 6px; font-size: 0.85rem; font-weight: 600; }
.legal-templates-form__active {
    display: inline-flex !important;
    grid-auto-flow: column;
    align-items: center;
    gap: 8px;
    padding-bottom: 10px;
}
.legal-templates-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 10px;
}
.legal-templates-option {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--survai-border-soft);
    border-radius: 12px;
    background: var(--survai-card);
    cursor: pointer;
}
.legal-templates-option:has(input:checked) {
    border-color: rgba(37, 99, 235, 0.45);
    background: var(--survai-tint-f0f6ff);
}
/* The global input rule stretches naked checkboxes to 46px bordered boxes —
   these must stay native-sized. */
.legal-templates-option input[type='checkbox'],
.legal-templates-form__active input[type='checkbox'] {
    width: 18px;
    height: 18px;
    min-height: 0;
    padding: 0;
    flex: 0 0 auto;
}
.legal-templates-option input { margin-top: 3px; }
.legal-templates-option span { display: grid; gap: 3px; font-size: 0.85rem; color: var(--survai-text-strong); }
.legal-templates-option small { color: var(--survai-secondary-slate); font-size: 0.78rem; line-height: 1.45; }
.legal-templates-form__footer { display: flex; gap: 10px; }
.output-legal-template-note { margin: 0; }
.output-legal-template-note a { margin-left: 6px; }
.legal-categories-row {
    grid-template-columns: auto minmax(0, 1.2fr) minmax(0, 2fr) minmax(0, 0.6fr) auto;
}
.legal-categories-lineitems { color: var(--survai-secondary-slate); font-size: 0.82rem; }
.legal-categories-form__grid {
    grid-template-columns: minmax(0, 2fr) minmax(0, 0.6fr) minmax(0, 1fr) auto;
}
.legal-categories-form__wide { display: grid; gap: 6px; font-size: 0.85rem; font-weight: 600; }
.legal-categories-form__wide textarea {
    resize: vertical;
    min-height: 96px;
    font: inherit;
    font-weight: 400;
}
.legal-categories-form__wide small { font-weight: 400; }
/* ---- Trade bodies management page (trade-bodies.php) ---- */
.trade-bodies-row {
    grid-template-columns: auto minmax(0, 1.4fr) minmax(0, 2fr) minmax(0, 0.5fr) auto;
}
.trade-bodies-row--fallback {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) minmax(0, 0.5fr) auto;
}
.trade-bodies-row a { word-break: break-all; }
.trade-bodies-order { display: inline-flex; gap: 4px; }
.trade-bodies-order form { margin: 0; }
.trade-bodies-order .btn { padding-left: 8px; padding-right: 8px; }
.trade-bodies-order .btn[disabled] { opacity: 0.35; cursor: default; }
.trade-bodies-form__grid {
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1.6fr) minmax(0, 1.2fr) minmax(0, 0.4fr) auto;
}
.trade-bodies-try-result { margin-top: 12px; }
/* 1180px matches the output-legal table's own stacking point: below it the
   seven columns share too little width (the 761-900px single-column shell
   band, and 901-1150px beside the sidebar) and values spill across tracks. */
@media (max-width: 1180px) {
    .legal-templates-row { grid-template-columns: minmax(0, 1fr); align-items: start; }
    .legal-templates-row--head { display: none; }
    .legal-templates-row [data-label]::before { content: attr(data-label) ': '; font-weight: 700; color: var(--survai-secondary-slate); }
    .legal-templates-row [data-label='Template']::before { content: ''; }
}
@media (max-width: 760px) {
    .legal-templates-form__grid { grid-template-columns: minmax(0, 1fr); align-items: stretch; }
    .legal-templates-options { grid-template-columns: minmax(0, 1fr); }
}

/* ---- Room detail modal: prev/next room navigation arrows ---- */
/* Room-nav arrows match the Media Manager photo editor (.siex__nav) exactly.
   Anchored to the fixed overlay — NOT the scrolling panel — so they are never
   clipped and stay pinned to the viewport middle while the card scrolls. The
   panel is centred and max 980px wide, so the arrows land ~12px inside its
   left/right edge, in the form's widened side margin. */
.output-room-modal__nav {
    position: absolute;
    top: 50%;
    z-index: 7;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    padding: 0;
    border: 1px solid rgba(37, 99, 235, 0.35);
    border-radius: 999px;
    background: color-mix(in srgb, var(--survai-card) 94%, transparent);
    color: var(--survai-ink-2563eb);
    cursor: pointer;
    transform: translateY(-50%);
    box-shadow: 0 10px 26px rgba(11, 19, 33, 0.28);
}

.output-room-modal__nav svg {
    width: 26px;
    height: 26px;
}

.output-room-modal__nav:hover,
.output-room-modal__nav:focus-visible {
    background: #2563eb;
    color: #ffffff;
}

.output-room-modal__nav--prev {
    left: max(34px, calc(50% - 478px));
}

.output-room-modal__nav--next {
    right: max(34px, calc(50% - 478px));
}

@media (max-width: 760px) {
    .output-room-modal__nav {
        width: 38px;
        height: 38px;
    }

    .output-room-modal__nav svg {
        width: 22px;
        height: 22px;
    }

    .output-room-modal__nav--prev {
        left: 8px;
    }

    .output-room-modal__nav--next {
        right: 8px;
    }
}

/* Property overview: compact drag-and-drop upload box. Files POST to
   upload_site_media.php (server allocates them to their S3 folders); on success
   the page redirects to the Media Manager photos tab for immediate editing. */
.po-quick-upload {
    margin: 0 0 16px;
}
.po-quick-upload__zone {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    border: 1.5px dashed #c3d0e2;
    border-radius: 14px;
    background: var(--survai-tint-f8fbff);
    color: var(--survai-text-soft);
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.po-quick-upload__zone:hover {
    border-color: #1b5af9;
    background: var(--survai-tint-f2f7ff);
}
.po-quick-upload.is-dragover .po-quick-upload__zone {
    border-color: #1b5af9;
    background: var(--survai-tint-eaf2ff);
    box-shadow: 0 0 0 4px rgba(27, 90, 249, 0.12);
}
.po-quick-upload.is-uploading .po-quick-upload__zone {
    pointer-events: none;
    opacity: 0.75;
}
.po-quick-upload__title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--survai-text-strong);
}
.po-quick-upload__status {
    margin: 8px 2px 0;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--survai-secondary-strong);
}
.po-quick-upload__status.is-busy { color: var(--survai-ink-1b5af9); }
.po-quick-upload__status.is-done { color: var(--survai-ink-15803d); }
.po-quick-upload__status.is-error { color: var(--survai-ink-b42318); }

/* Dictation (survai-dictation.js): a microphone sits after any [data-dictate]
   field. The field gets right padding so its text never runs under the
   button; the button is sized explicitly — the global input rule would
   otherwise stretch it (see the checkbox pin). Sits on the same red as the
   regenerate-notes mic so "listening" reads the same everywhere. */
.survai-dictate-target { padding-right: 44px !important; }
.survai-dictate { position: relative; display: block; height: 0; }
.survai-dictate__button {
    position: absolute;
    right: 8px;
    bottom: 8px;
    width: 30px;
    height: 30px;
    min-height: 30px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(15, 23, 42, 0.18);
    border-radius: 999px;
    background: var(--sai-surface, #fff);
    color: var(--survai-secondary-strong);
    cursor: pointer;
    line-height: 1;
}
.survai-dictate__button:hover { color: var(--survai-ink-1b5af9); border-color: #1b5af9; }
.survai-dictate__button:focus-visible { outline: 2px solid #1b5af9; outline-offset: 2px; }
.survai-dictate__button.is-listening {
    color: var(--survai-ink-b91c1c);
    border-color: #b91c1c;
    animation: survai-regen-mic-pulse 1.2s ease-in-out infinite;
}
/* Single-line inputs: centre the mic on the field regardless of its height.
   The wrapper is 0px tall and sits on the field's bottom edge, so half the
   field's height up is the middle; the JS stamps that height as a custom
   property. */
input.survai-dictate-target + .survai-dictate .survai-dictate__button {
    bottom: auto;
    top: calc(-1 * (var(--survai-dictate-field-height, 44px) / 2) - 15px - var(--survai-dictate-gap, 0px));
}
.survai-dictate-target--listening { box-shadow: inset 0 0 0 1px rgba(185, 28, 28, 0.45); }
.survai-dictate-status {
    display: block;
    font-size: 0.8rem;
    color: var(--survai-secondary-strong);
    margin-top: 6px;
    min-height: 0;
}
.survai-dictate-status.is-error { color: var(--survai-ink-b91c1c); }
.survai-dictate-status:empty { display: none; }

/* Extension feasibility — 50% permitted-development coverage note. */
.ext-feasibility-pd-note { margin-top: 12px; }
.ext-feasibility-pd-note--exceeded { color: var(--survai-ink-b91c1c); font-weight: 600; }
.ext-feasibility-context__item input[type="number"] { max-width: 160px; }

/* Extension feasibility — surveyor-defined route adder. */
.ext-feasibility-add-route { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.ext-feasibility-add-route input[type="text"] { flex: 1 1 320px; max-width: 480px; }

/* A job card lifted out of the hidden Costs panel for a section edit has no
   visible neighbours to step to. */
.output-repair-modal--section-edit .output-repair-modal__nav {
    display: none;
}

/* ------------------------------------------------------------------ */
/* Mobile white header: abbreviated survey type (L2 / L3 / L3+) and the  */
/* address on ONE line (surveyor, 6 Sep 2026). The full label and the    */
/* stacked address remain on desktop. The job reference keeps its place  */
/* beneath the address.                                                  */
/* ------------------------------------------------------------------ */
.report-workspace-header__eyebrow-short {
    display: none;
}

body.survai-report-workspace-context-mobile-embedded.has-mobile-sidebar
    .mobile-app-header
    > .report-workspace-header__context--mobile-embedded
    .report-workspace-header__eyebrow-full {
    display: none;
}

body.survai-report-workspace-context-mobile-embedded.has-mobile-sidebar
    .mobile-app-header
    > .report-workspace-header__context--mobile-embedded
    .report-workspace-header__eyebrow-short {
    display: inline;
}

body.survai-report-workspace-context-mobile-embedded.has-mobile-sidebar
    .mobile-app-header
    > .report-workspace-header__context--mobile-embedded
    .report-workspace-header__title {
    gap: 2px;
}

body.survai-report-workspace-context-mobile-embedded.has-mobile-sidebar
    .mobile-app-header
    > .report-workspace-header__context--mobile-embedded
    .report-workspace-header__address {
    flex: 1 1 100%;
    min-width: 0;
    flex-direction: row;
    align-items: center;
    gap: 0;
}

/* Outranks the earlier "identity strong" mobile rule that let the first
   address line wrap and take the whole row. */
body.survai-report-workspace-context-mobile-embedded.has-mobile-sidebar
    .mobile-app-header
    > .report-workspace-header__context--mobile-embedded
    .report-workspace-header__identity
    .report-workspace-header__address-line--primary {
    flex: 0 1 auto;
    min-width: 0;
    max-width: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.86rem;
    line-height: 1.2;
}

body.survai-report-workspace-context-mobile-embedded.has-mobile-sidebar
    .mobile-app-header
    > .report-workspace-header__context--mobile-embedded
    .report-workspace-header__address-line--secondary {
    flex: 0 1 auto;
    min-width: 0;
    font-size: 0.86rem;
    line-height: 1.2;
    white-space: nowrap;
}

body.survai-report-workspace-context-mobile-embedded.has-mobile-sidebar
    .mobile-app-header
    > .report-workspace-header__context--mobile-embedded
    .report-workspace-header__address-line--status-only {
    margin-left: 6px;
}

body.survai-report-workspace-context-mobile-embedded.has-mobile-sidebar
    .mobile-app-header
    > .report-workspace-header__context--mobile-embedded
    .report-workspace-header__address-tail {
    font-size: 0.86rem;
    line-height: 1.2;
}

body.survai-report-workspace-context-mobile-embedded.has-mobile-sidebar
    .mobile-app-header
    > .report-workspace-header__context--mobile-embedded
    .report-workspace-header__address-tail::before {
    content: ",";
    margin-right: 6px;
}

/* ------------------------------------------------------------------ */
/* Accommodation on a phone: room name + action buttons only. This IS the  */
/* mobile layout (surveyor, 6 Sep 2026: compact as standard, no toggle).   */
/* The name keeps at least 40% of the row; the six icon actions sit in a   */
/* 3 x 2 block beside it. Desktop is untouched.                            */
/* ------------------------------------------------------------------ */
@media (max-width: 720px) {
    .output-accommodation-table .output-accommodation-row:not(.output-accommodation-row--head) {
        display: grid;
        grid-template-columns: minmax(40%, 1fr) minmax(0, max-content);
        align-items: center;
        gap: 6px 8px;
        padding: 6px 0;
    }

    .output-accommodation-table .output-accommodation-row > [data-label]::before {
        content: none;
    }

    .output-accommodation-table .output-accommodation-cell[data-label="Select"],
    .output-accommodation-table .output-accommodation-cell[data-label="Floor"],
    .output-accommodation-table .output-accommodation-cell[data-label="Location"],
    .output-accommodation-table .output-accommodation-cell[data-label="Observations"],
    .output-accommodation-table .output-accommodation-cell[data-label="Linked images"] {
        display: none;
    }

    .output-accommodation-table .output-accommodation-room-cell {
        min-width: 0;
        gap: 6px;
    }

    .output-accommodation-table .output-accommodation-room-cell [data-room-name] {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-weight: 700;
    }

    .output-accommodation-table .output-accommodation-actions {
        display: grid;
        grid-template-columns: repeat(3, max-content);
        justify-content: end;
        align-items: center;
        gap: 4px;
        padding: 0;
    }
}

/* ------------------------------------------------------------------ */
/* Round icon buttons (regenerate, copy, listen, edit, delete… beside the  */
/* text boxes and on the Accommodation rows): glyph only at rest — no      */
/* outline, no grey fill — fewer elements for the eye (surveyor, 6 Sep     */
/* 2026). The circle stays as the hit area and shows on hover/focus.       */
/* ------------------------------------------------------------------ */
.output-icon-action,
.output-accommodation-icon-btn {
    border-color: transparent;
    background: transparent;
    box-shadow: none;
}

.output-icon-action:hover,
.output-icon-action:focus-visible {
    border-color: rgba(100, 116, 139, 0.28);
    background: color-mix(in srgb, var(--survai-bg-tint) 90%, transparent);
}

.output-accommodation-icon-btn:hover {
    border-color: rgba(61, 72, 97, 0.2);
    background: color-mix(in srgb, var(--survai-bg) 90%, transparent);
}

/* ------------------------------------------------------------------ */
/* Mobile white header: the address spans the header; every header glyph  */
/* and button sits on its own row BENEATH it (surveyor, 6 Sep 2026).       */
/* Desktop keeps the side-by-side row. The header's height is re-measured  */
/* by app.js (ResizeObserver), so the extra row pushes the page down.      */
/* ------------------------------------------------------------------ */
body.survai-report-workspace-context-mobile-embedded.has-mobile-sidebar
    .mobile-app-header
    > .report-workspace-header__context--mobile-embedded {
    flex-wrap: wrap;
    row-gap: 6px;
}

body.survai-report-workspace-context-mobile-embedded.has-mobile-sidebar
    .mobile-app-header
    > .report-workspace-header__context--mobile-embedded
    .report-workspace-header__title {
    flex: 1 1 100%;
    width: 100%;
}

body.survai-report-workspace-context-mobile-embedded.has-mobile-sidebar
    .mobile-app-header
    > .report-workspace-header__context--mobile-embedded
    .report-workspace-header__actions,
body.survai-report-workspace-context-mobile-embedded.has-mobile-sidebar
    .mobile-app-header
    > .report-workspace-header__context--mobile-embedded
    .report-workspace-header__toolbar {
    flex: 1 1 100%;
    width: 100%;
    align-self: auto;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0;
}

/* ------------------------------------------------------------------ */
/* Reports page — compact rows that LOOK compact (surveyor, 6 Sep 2026:   */
/* the toggle changed 8px of padding and nothing else, so it read as      */
/* broken). Compact = one lean line per report: address, status, date,    */
/* menu — no thumbnail, no media counts, no second address line.          */
/* ------------------------------------------------------------------ */
.reports-page .reports-list--compact .report-row {
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) 48px;
    gap: 6px 14px;
    padding: 7px 22px;
}

.reports-page .reports-list--compact .report-row__thumb,
.reports-page .reports-list--compact .report-media,
.reports-page .reports-list--compact .report-property p {
    display: none;
}

.reports-page .reports-list--compact .report-property,
.reports-page .reports-list--compact .report-status,
.reports-page .reports-list--compact .report-date {
    grid-column: auto;
    grid-row: auto;
}

.reports-page .reports-list--compact .report-property strong,
.reports-page .reports-list--compact .report-property h3,
.reports-page .reports-list--compact .report-property a {
    font-size: 0.92rem;
    line-height: 1.25;
}

@media (max-width: 640px) {
    /* Two lean lines: address + status on the first, date on the second. */
    .reports-page .reports-list--compact .report-row {
        grid-template-columns: minmax(0, 1fr) auto 40px;
        padding: 8px var(--reports-content-edge, 16px);
    }

    .reports-page .reports-list--compact .report-property {
        grid-column: 1 / 2;
        grid-row: 1;
    }

    .reports-page .reports-list--compact .report-status {
        grid-column: 2 / 3;
        grid-row: 1;
    }

    .reports-page .reports-list--compact .report-date {
        grid-column: 1 / 3;
        grid-row: 2;
        font-size: 0.78rem;
    }
}

/* ------------------------------------------------------------------ */
/* Reports page on a phone: the search bar on top, then ONE row holding    */
/* the compact/full toggle and a smaller Order-by control (surveyor,       */
/* 6 Sep 2026). The order-by no longer takes the whole width.              */
/* ------------------------------------------------------------------ */
@media (max-width: 760px) {
    .reports-page .reports-command-tools {
        flex-wrap: nowrap;
        justify-content: flex-start;
        align-items: center;
        gap: 10px;
    }

    .reports-page .reports-density {
        order: -1;
        padding: 3px;
    }

    .reports-page .reports-density__btn {
        width: 34px;
        height: 30px;
    }

    .reports-page .reports-density__btn svg {
        width: 17px;
        height: 17px;
    }

    .reports-page .reports-order-by {
        flex: 1 1 auto;
        min-width: 0;
        gap: 6px;
    }

    .reports-page .reports-order-by label {
        font-size: 12px;
    }

    body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .reports-order-by select {
        width: 100%;
        max-width: none;
        min-height: 36px;
        height: 36px;
        padding: 0 28px 0 10px;
        font-size: 13px;
    }
}

/* ------------------------------------------------------------------ */
/* Section header quick-actions show ONLY on a collapsed card (surveyor,   */
/* 6 Sep 2026: the regenerate button was still visible with the section   */
/* open). Open = the text box carries its own actions; the header keeps    */
/* the rating badge, the save state and the collapse arrow.                */
/* ------------------------------------------------------------------ */
.output-section:not(.is-collapsed) > header .section-head-actions .output-icon-action {
    display: none;
}

.output-section.is-collapsed > header .section-head-actions .output-icon-action {
    display: inline-flex;
}

/* ------------------------------------------------------------------ */
/* A quiet hover on the glyph buttons (surveyor, 3 Oct 2026: subtle       */
/* neutral hover, no lift), and the collapse arrow stands alone with no    */
/* grey border or fill (surveyor, 6 Sep 2026).                             */
/* ------------------------------------------------------------------ */
.output-icon-action:hover,
.output-icon-action:focus-visible,
.output-accommodation-icon-btn:hover,
.output-accommodation-icon-btn--danger:hover {
    border-color: var(--survai-border);
    background: var(--survai-neutral-hover);
    color: var(--survai-text);
    box-shadow: none;
    transform: none;
}

.output-icon-action:focus-visible,
.output-accommodation-icon-btn:focus-visible,
.collapse-toggle:focus-visible {
    outline: 2px solid var(--survai-brand);
    outline-offset: 2px;
}

.collapse-toggle,
.collapse-toggle:hover,
.collapse-toggle:focus-visible {
    border-color: transparent;
    background: transparent;
    box-shadow: none;
}

/* Voice assistant: which model answered and how long it took, under the reply. */
.survai-voice-assistant__meta {
    margin: -2px 0 8px 6px;
    color: var(--survai-muted-cool);
    font-size: 11px;
    line-height: 1.3;
}

/* Property Overview location card: the Orientation and Map of Location
   selector sits beneath the map it prints with (7 Sep 2026). */
.property-location-orientation {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid rgba(148, 163, 184, 0.22);
}

.property-location-orientation .output-orientation-facing .save-state {
    display: block;
    min-height: 1em;
    font-size: 0.78rem;
    color: var(--survai-secondary-slate);
}

.property-location-orientation .output-orientation-facing .save-state.is-saved {
    color: var(--survai-ink-166534);
}
\n

/* ==========================================================================
   Photo gallery on phones (Media Manager, Image Manager) — surveyor, 8 Sep 2026:
   "the photo album is moving all over the screen when swiped" and "the black
   navigation bar at the bottom does not show all options".

   1. The gallery panel is a CSS grid. Its Sort / Restore / Show / Size row
      could not shrink (nowrap buttons), so that one row widened the whole
      panel to ~500px on a 390px phone: the third photo column, the Filters
      pill and the Section filter ran off the right edge and the page panned
      sideways on every swipe. The panel's single column is now capped at its
      own width, every row is capped with it, and the toolbar row wraps.
   2. The floating action dock centred a 600px row of nowrap buttons inside a
      360px pill, so only "selected / Select All / Move" showed. Its row is
      ~845px wide, so every viewport under the 900px app-shell breakpoint
      (phones, phones in landscape, iPad portrait) clipped it. Up to 900px it
      spans the screen edge to edge and every action sits icon-over-label,
      with the long labels shortened (the full text stays the accessible name).
   ========================================================================== */
.image-manager-panel {
    grid-template-columns: minmax(0, 1fr);
}

.image-manager-panel > *,
.image-manager-toolbar > * {
    min-width: 0;
    max-width: 100%;
}

/* The cap above is for in-flow rows; the fixed dock (a direct child of the
   panel) keeps its own side margins on wide screens. */
.survai-image-action-dock {
    max-width: calc(100vw - 28px);
}

@media (max-width: 640px) {
    .image-manager-toolbar .image-manager-sort-controls {
        flex-wrap: wrap;
        row-gap: 8px;
    }

    .image-manager-toolbar .image-manager-sort-controls .btn {
        min-width: 0;
    }

    .image-manager-panel .image-manager-grid {
        max-width: 100%;
    }
}

/* Phones and tablets, up to the 900px app-shell breakpoint: the pill is centred at the report
   tools dock's phone width (420px at most, 10px clear of each edge) without a transform, so the
   More menu can sit fixed above it and escape the pill's horizontal scroll; the buttons share
   the width down to the size of their icon, and past that the pill scrolls sideways rather
   than overlapping them. */
@media (max-width: 900px) {
    .survai-image-action-dock {
        left: max(10px, calc(50vw - 210px));
        right: max(10px, calc(50vw - 210px));
        width: auto;
        max-width: none;
        transform: none;
        justify-content: flex-start;
        gap: 4px;
        min-height: 60px;
        padding: 0 8px;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
    }

    .survai-image-action-dock::-webkit-scrollbar {
        display: none;
    }

    .survai-image-action-dock__count {
        flex: 0 0 auto;
        margin-right: 0;
        padding: 0 8px 0 2px;
    }

    .survai-image-action-dock__count .survai-image-action-dock__label {
        display: none;
    }

    .survai-image-action-dock__badge {
        min-width: 32px;
        height: 32px;
        font-size: 0.68rem;
    }

    .survai-image-action-dock__action,
    .survai-image-action-dock__more {
        flex: 1 1 60px;
        min-width: 50px;
        max-width: 92px;
    }

    .survai-image-action-dock__action {
        padding: 6px 3px;
    }

    .survai-image-action-dock__more {
        position: static;
    }

    .survai-image-action-dock__more > .survai-image-action-dock__action {
        width: 100%;
        min-width: 0;
        max-width: none;
    }

    .survai-image-action-dock__menu {
        position: fixed;
        left: 50%;
        right: auto;
        bottom: calc(18px + env(safe-area-inset-bottom, 0px) + 60px + 12px);
        transform: translateX(-50%);
        width: min(306px, calc(100vw - 24px));
        max-width: calc(100vw - 24px);
        z-index: 10050;
    }

    /* Output report dock: the move-to-section select stays beside its Move circle, narrow, so
       the pill keeps its one 60px row and scrolls sideways instead of growing taller. */
    .survai-image-action-dock__move {
        flex: 0 0 auto;
        flex-direction: row;
        gap: 4px;
        min-width: 0;
        padding: 0 2px;
    }

    .survai-image-action-dock__move select {
        width: 112px;
        min-width: 0;
        max-width: 112px;
        min-height: 36px;
        padding: 0 10px;
        font-size: 11px;
    }

    .survai-image-action-dock__move .survai-image-action-dock__action {
        flex: 0 0 auto;
        min-width: 50px;
        max-width: none;
        padding: 6px 3px;
    }
}

/* ------------------------------------------------------------------ */
/* Phone pass (≤640px) for the three pages the Survai Camera app opens   */
/* in its web view: Transcript (transcript-workspace.php), Report          */
/* (output.php) and Property Overview (report-overview.php). Measured at  */
/* 390px on 10 Sep 2026; each rule names the fault it corrects. Fit and  */
/* reach only — nothing is restyled.                                       */
/* ------------------------------------------------------------------ */
@media (max-width: 640px) {
    /* The Report page scrolled sideways by 27px (417 vs 390). The body is
       pinned on the workspace pages and .main-panel is the scroller; the
       hidden tooltips on the round glyph buttons (`.output-icon-action::after`
       — opacity 0 but still laid out, one line, centred on the button) hang
       past the right edge of the section-actions row and widen it. Clip the
       scroller sideways: anything genuinely wide (the site-uploads table on
       the Transcript page) already scrolls inside its own container. */
    body.output-report-page .main-panel,
    .main-panel.transcript-workspace-main,
    .main-panel.property-overview-main {
        overflow-x: hidden;
    }

    /* And remove the cause: a finger cannot hover, so the hover labels never
       show on the phone — drop them and the row stops overflowing at all. */
    body.output-report-page .output-icon-action::after {
        display: none;
    }

    /* iOS zooms the whole page when a text box focuses at under 16px, and
       the surveyor then pinches back out after every edit. Hold the boxes
       he types into at 16px: the section text (15.7px), the transcript
       editor and the per-upload transcript cells (15.2px), the overview
       summary (15.2px), the surveyor-name pill (13.1px), the orientation and
       summary-source selects (13.6px / 12.8px), the Edit-details form
       (14.7px), the regenerate note (14px) and the header assistant box
       (14.1px). */
    body.output-report-page textarea.output-section-text,
    body.output-report-page textarea#keywordRegenNote,
    .main-panel.transcript-workspace-main textarea.transcript-workspace-editor,
    .main-panel.property-overview-main input.po-surveyor-name-input,
    .main-panel.property-overview-main textarea.po-summary-text,
    .main-panel.property-overview-main .po-summary-source select,
    .main-panel.property-overview-main .output-orientation-facing select,
    .po-details-modal .po-details-modal__field input,
    .po-details-modal .po-details-modal__field select,
    .survai-voice-assistant__form input {
        font-size: 16px;
    }

    /* Tap targets under 40px. The round glyph buttons beside every text box
       and on the format bar (35–38px), the collapse arrows, the
       section-images button, the display-options trigger, the cover-image
       pencil and the modal close buttons: 40px hit area, the glyph itself
       unchanged (the circle is invisible at rest). */
    body.output-report-page .output-icon-action,
    body.output-report-page .output-format-bar .output-icon-action,
    body.output-report-page .collapse-toggle,
    body.output-report-page .output-section-gallery-trigger,
    body.output-report-page .workspace-tool-button.output-display-options-trigger,
    body.output-report-page .output-room-modal__close,
    body.output-report-page .output-image-editor-close,
    .main-panel.property-overview-main .po-cover-edit-trigger,
    .po-details-modal .po-details-modal__close,
    .street-view-editor-modal .street-view-editor-modal__close,
    .keyword-regen-modal .keyword-regen-modal__close,
    .survai-find-replace .survai-find-replace__close {
        min-width: 40px;
        min-height: 40px;
    }

    /* Seven 40px buttons no longer fit the fixed format bar on a narrow
       phone in one row; let it wrap rather than spill past its background. */
    body.output-report-page .output-format-bar {
        flex-wrap: wrap;
    }

    /* Small buttons (34px) and the two pill controls on the overview job
       sheet (30px) reach 40px. The theme skins `.btn.btn-small` at 34px
       under body:not(...)×4 (0,6,1); the same body chain plus .main-panel
       outranks it. */
    body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .main-panel .btn.btn-small,
    body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .survai-find-replace__panel .btn.btn-small,
    .main-panel.property-overview-main .po-date-edit-button,
    .main-panel.property-overview-main input.po-surveyor-name-input {
        min-height: 40px;
    }

    /* Text-only controls that were 18–19px tall: the "Review detail"
       toggles on the desk-study highlight cards keep their marker (list-item)
       and gain padding; the "Edit details" button in each photo caption
       becomes a 40px row. */
    .main-panel.property-overview-main .po-desk-highlight summary {
        padding: 11px 0;
    }

    body.output-report-page .output-image-tip button {
        display: inline-flex;
        align-items: center;
        min-height: 40px;
    }

    /* Native checkboxes stretched to 13×46 / 18×46 by the global input
       sizing: the "apply to all" box in the bulk image-edit modal and the
       match-case box in Find and replace. Sized to 18px like every other
       checkbox in the workspace. */
    body.output-report-page .output-room-modal .check-row input[type="checkbox"],
    .survai-find-replace .survai-find-replace__case input[type="checkbox"] {
        width: 18px;
        height: 18px;
        min-width: 18px;
        min-height: 18px;
        max-width: 18px;
        flex: 0 0 18px;
        margin: 0;
        padding: 0;
    }
}

/* ==========================================================================
   Transcript boxes: read the whole thing, and let Cmd+F find it
   (surveyor, 10 Sep 2026).

   Two problems, one pair of rules. A transcript sat in a box a few lines
   tall, so most of it could only be reached by scrolling inside that box;
   and a textarea's contents are not part of the page's rendered text, so
   the browser's own Find cannot see a single word inside one. The read-only
   per-file transcripts are therefore rendered text (.transcript-readable),
   the editable ones keep a twin that is shown whenever nobody is typing,
   and any of them opens to its full height when clicked.
   ========================================================================== */
.transcript-readable {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: 13px 14px;
    border: 1px solid var(--theme-border, #e6ebf2);
    border-radius: 14px;
    background: var(--theme-input, #ffffff);
    color: var(--theme-input-text, #111827);
    font: inherit;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    overflow-y: auto;
    cursor: text;
}

.transcript-readable:focus-visible {
    border-color: rgba(27, 90, 249, 0.62);
    box-shadow: var(--survai-focus);
    outline: none;
}

/* The empty state reads as a placeholder, like the box it replaced. */
.transcript-readable.is-placeholder {
    color: var(--survai-muted, #64748b);
}

.transcript-readable--main {
    min-height: clamp(320px, 43vh, 560px);
    font-size: 1rem;
    line-height: 1.6;
}

/* Only one of the editor and its twin is ever in the page at a time, so a
   search can never match the same sentence twice. */
.transcript-readable.is-swapped-out,
.transcript-workspace-editor.is-swapped-out {
    display: none !important;
}

/* Open: the box grows to its content instead of scrolling inside itself, so
   every word is on the page for the eye and for Find. */
.transcript-readable.is-expanded {
    max-height: none;
    overflow: visible;
}

textarea.transcript-workspace-editor.is-expanded {
    max-height: none;
    overflow-y: hidden;
}

/* A hairline while open: on a page of boxes it says which one you opened. */
.transcript-readable.is-expanded,
textarea.transcript-workspace-editor.is-expanded {
    border-color: rgba(27, 90, 249, 0.45);
}

@media (max-width: 900px) {
    .transcript-readable--main {
        min-height: 44vh;
        font-size: 0.95rem;
    }
}

/* ==========================================================================
   The report pages seen inside Survai Camera (surveyor, 11 Sep 2026).

   On the phone, in the app, the top of the screen was doing two jobs it did
   not need to do. The white header carried the Survai logo — the surveyor is
   already in the Survai app, so it only ate the width the address needed —
   and below the blue stage buttons sat a hand's width of empty page before
   the Executive Summary card (40px of toolbar gap plus a 50px first-card
   offset on top of the main padding: 105.6px measured at 390px wide).

   These rules only ever apply to a page served to the app's web view: the
   marker class comes from survai_request_is_mobile_app() in
   mobile_app_context.php, which reads the "SurvAICamera/" the app appends to
   its user agent. A desktop browser never carries the class, so nothing here
   can reach the desktop.
   ========================================================================== */

/* The expanded-workspace sidebar pin is a menu icon, not the wordmark (3 Oct 2026), so it
   stays visible in the app too: in expanded mode it is the one control that brings the
   drawer back, and hiding it would strand the surveyor exactly as hiding the phone
   hamburger would. */

/* The logo in the white bar is a harder case, because on a phone it IS the menu
   button: assets/js/app.js builds one .mobile-menu-toggle and drops the wordmark
   inside it. Hiding the button would take the workspace drawer with it — and the
   drawer is the only way to the AI Processor, Documents & Files and Costings. So
   the wordmark goes and the button stays, wearing the three bars it draws for
   itself when no logo asset is found. It also stops eating up to 58vw, which is
   width the address needs. */
body.survai-mobile-app .mobile-menu-toggle--brand .mobile-menu-toggle__logo {
    display: none !important;
}

body.survai-mobile-app .mobile-menu-toggle--brand {
    justify-content: center;
    max-width: 44px;
    padding: 6px;
    color: var(--survai-text);
}

body.survai-mobile-app .mobile-menu-toggle--brand::before {
    content: "";
    width: 18px;
    height: 2px;
    border-radius: 1px;
    background: currentColor;
    box-shadow: 0 -6px 0 currentColor, 0 6px 0 currentColor;
}

@media (max-width: 900px) {
    /* The two lengths that made the gap, zeroed for the app only. The first
       card then clears the stage buttons by --app-main-padding (16px on a
       390px screen) — the same inset it already has on its left and right, so
       the card sits square in the page instead of floating below it. */
    body.survai-mobile-app {
        --survai-toolbar-content-gap: 0px;
        --survai-workspace-mobile-first-card-offset: 0px;
    }
}

/* The third blue stage button, Advanced, is not wanted in the app (surveyor,
   11 Sep 2026). Everything behind it is desk work — Structured Costing,
   Structured Export, Structured Assembly, Structured QA, Export Lock & Audit,
   Versioning & Changes, Delivery — and all of those are anchors further down
   the report page the surveyor is already on, so the button is doing nothing
   for him there. Lifecycle is in the workspace drawer as well. One thing DOES
   go with it: Defect Register is a page of its own and this dropdown is the
   only link to it anywhere, so on the phone it is now unreachable. That is the
   surveyor's own call (11 Sep 2026); if he wants it back, the drawer list in
   workflow_report_workspace_nav_items() is where it belongs, not here.

   The whole .workspace-stage-nav__item goes, not just the link inside it: the
   item is the positioned box the dropdown hangs off, so hiding it takes the
   menu with the button, and because every item is flex: 1 1 0, Overview and
   Report then share the row evenly with no orphan third left behind. Hiding
   only the link would leave that empty third sitting there.

   :has() is how we reach the item from the modifier class on its link. If a
   web view ever lacked it the button simply stays, which is the safe way round
   — no gap, no stranded menu. */
body.survai-mobile-app .workspace-stage-nav__item:has(.workspace-stage-nav__stage--advanced) {
    display: none !important;
}

/* The floating text-formatting bar is desktop only (surveyor, 18 Sep 2026): on a
   phone it is fixed near the top of the screen and springs up whenever a text box
   takes focus, straight over the words he was about to edit.
   assets/js/output-text-format-bar.js already declines to build it in the app;
   this is the belt to that braces, and it also covers a bar built before the
   class was read. The accommodation-room editors' inline bar is exempt — it sits
   in the page flow at its own width and covers nothing. */
body.survai-mobile-app .output-format-bar:not(.output-format-bar--inline) {
    display: none !important;
}

/* The website's own menu is gone from the app (surveyor, 2 Oct 2026: "if I click
   on it it brings up the website sidebar… it's not a seamless experience… we
   need an app version"). The three-bar button opened the site's navy drawer
   over the page, with Start Survey and Log out in it — the website's way
   round, inside an app that has its own camera and its own sign-out.

   The app's navigation bar now carries the menu instead (ReportWebView.swift:
   Overview, Report, Transcript, Lifecycle; the overview's own menu there),
   so on the phone the button, the drawer and its scrim are all taken away and
   the white header gives its width to the address.

   Only for a build that says it has that menu ("SurvAIMenu/" in its user
   agent, body class survai-mobile-app-menu from mobile_app_context.php). An
   older build keeps the button above, which for it is the only way to those
   pages. Phone width only: on a wide web view the sidebar is the page's left
   rail, not a drawer, and the layout is built round it. */
@media (max-width: 900px) {
    body.survai-mobile-app.survai-mobile-app-menu .mobile-menu-toggle {
        display: none !important;
    }

    body.survai-mobile-app.survai-mobile-app-menu.has-mobile-sidebar .sidebar {
        display: none !important;
    }

    body.survai-mobile-app.survai-mobile-app-menu .mobile-menu-overlay {
        display: none !important;
    }
}

@media (max-width: 900px) {
    /* ------------------------------------------------------------------ */
    /* The in-app header is gone (surveyor, 6 Oct 2026: "the header       */
    /* shouldn't be visible, it doesn't look like a proper mobile app").   */
    /* The bar stays in the DOM only as a slim toolbar: the status dot,    */
    /* Find & Replace, play/more and the microphone sit on one row, the    */
    /* address words and the web-workspace chrome are hidden. app.js       */
    /* measures the slim height into --survai-mobile-app-header-total, so */
    /* the stage tabs and the page content follow it up on their own.     */
    /* ------------------------------------------------------------------ */
    body.survai-mobile-app.has-mobile-sidebar .mobile-app-header {
        min-height: 0;
        padding-top: calc(env(safe-area-inset-top, 0px) + 6px);
        padding-bottom: 6px;
        gap: 8px;
        align-items: center;
    }

    /* The words go; the secondary line stays because the status dot lives inside it. */
    body.survai-mobile-app .mobile-app-header .report-workspace-header__eyebrow,
    body.survai-mobile-app .mobile-app-header .report-workspace-header__address-line--primary,
    body.survai-mobile-app .mobile-app-header .report-workspace-header__address-tail {
        display: none !important;
    }

    body.survai-mobile-app .mobile-app-header .report-workspace-header__address-line--secondary {
        gap: 0 !important;
    }

    /* One row: the embedded context rules above stack title and actions
       on two full-width rows, so shrink-wrap the title chain and let the
       actions take the rest of the row. */
    body.survai-mobile-app .mobile-app-header .report-workspace-header__context--mobile-embedded {
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        gap: 8px !important;
    }

    body.survai-mobile-app .mobile-app-header .report-workspace-header__title,
    body.survai-mobile-app .mobile-app-header .report-workspace-header__identity,
    body.survai-mobile-app .mobile-app-header .report-workspace-header__address,
    body.survai-mobile-app .mobile-app-header .report-workspace-header__address-line--secondary {
        flex: 0 0 auto !important;
        width: auto !important;
        max-width: none !important;
        flex-wrap: nowrap !important;
    }

    body.survai-mobile-app .mobile-app-header .report-workspace-header__actions {
        flex: 1 1 auto !important;
        width: auto !important;
        min-width: 0 !important;
        justify-content: flex-start !important;
        margin: 0 !important;
        order: 0 !important;
    }

    /* Web-workspace chrome with no meaning inside the app. */
    body.survai-mobile-app .mobile-app-header .workspace-topbar-title,
    body.survai-mobile-app .mobile-app-header .workspace-fullscreen-toggle {
        display: none !important;
    }

    /* Find & Replace opens under the slim bar, as the voice panel already does. */
    body.survai-mobile-app .survai-find-replace__panel {
        top: calc(var(--survai-mobile-app-header-total, 0px) + 8px);
    }
}

/* end Survai Camera web chrome */

/* Swipe down from the header to refresh, in the app (surveyor, 7 Oct 2026: "swipe down from
   the header to refresh the whole screen ... remove the refresh button on the header"). The
   pill slides out from under the header's bottom edge as the finger pulls
   (assets/js/app-header-pull-refresh.js sets --survai-header-pull-top to that edge and
   --survai-header-pull to the pull), drawn under both header rows (.workspace-topbar 880,
   .mobile-app-header 890) so it emerges from the lower one, and turns the brand colour once
   letting go will refresh. Tokens only: right in both themes. Outside the app-chrome block and
   not scoped to body.survai-mobile-app on purpose: the element exists only where the app loads
   that script, and some in-app report pages (transcript-upload.php, capture.php, audio.php ...)
   carry no app body class. */
.survai-header-pull {
    position: fixed;
    top: var(--survai-header-pull-top, 0px);
    left: 50%;
    z-index: 879;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 40px;
    padding: 8px 16px;
    border: 1px solid var(--survai-border);
    border-radius: 999px;
    background: var(--survai-card);
    color: var(--survai-text);
    box-shadow: var(--survai-shadow-hover);
    font-size: 0.84rem;
    font-weight: 750;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, calc(var(--survai-header-pull, 0px) * 0.6 - 100%));
    transition: opacity 140ms ease, background-color 140ms ease, color 140ms ease, border-color 140ms ease;
}

.survai-header-pull.is-visible {
    opacity: 1;
}

.survai-header-pull.is-ready,
.survai-header-pull.is-refreshing {
    border-color: var(--survai-brand);
    background: var(--survai-brand);
    color: var(--survai-brand-ink);
}

/* The mark: an arrow pointing down while pulling, up once letting go refreshes, a turning
   ring while the page reloads. */
.survai-header-pull__mark {
    width: 10px;
    height: 10px;
    border-right: 2.5px solid currentColor;
    border-bottom: 2.5px solid currentColor;
    transform: rotate(45deg) translate(-2px, -2px);
    transition: transform 140ms ease;
}

.survai-header-pull.is-ready .survai-header-pull__mark {
    transform: rotate(225deg) translate(-2px, -2px);
}

.survai-header-pull.is-refreshing .survai-header-pull__mark {
    width: 14px;
    height: 14px;
    border: 2.5px solid currentColor;
    border-right-color: transparent;
    border-radius: 999px;
    transform: none;
    animation: survai-header-pull-spin 0.8s linear infinite;
}

@keyframes survai-header-pull-spin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .survai-header-pull,
    .survai-header-pull__mark {
        transition: none;
    }

    .survai-header-pull.is-refreshing .survai-header-pull__mark {
        animation: none;
    }
}

/* ==========================================================
   Dark mode (surveyor, 28 Sep 2026: "fix dark mode properly").
   The theme is html[data-theme="dark"], set before paint by pwa_head.php
   from the device's saved choice (Settings > Appearance). Every surface and
   text colour above reads a token; this block gives those tokens their dark
   values, so there is one dark theme and no page carries its own. The
   rendered report preview, the PDF and the camera screens keep their own
   colours. Add a colour to a component through a token, never as a literal.
   ========================================================== */

:root {
    color-scheme: light;
}

html[data-theme="dark"] {
    color-scheme: dark;

    /* The marketing site's dark palette, "Carbon" (surveyor, 7 Oct 2026: "copy all of the
       colours, the branding colours from the marketing site for the dark setting, so that the
       same colour scheme is across the entire app"): graphite page #151515, charcoal cards
       #242424, off-white text, light buttons with charcoal ink, and no blue. The values are
       assets/css/marketing.css :root[data-theme="dark"]; the roles are mapped in
       docs/DARK_MODE_CARBON.md. Status inks and tints use Carbon's success/warning/error. Earlier (3 Oct): neutral greys with a blue accent. */
    --survai-page-bg: #151515;
    --survai-surface: #242424;
    --survai-sidebar-bg: #1c1c1c;
    --survai-neutral-hover: #333333;
    --survai-text-secondary: #b3b3ae;
    --survai-text-muted: #a2a29d;
    --survai-brand: #f2f2f0;
    --survai-brand-hover: #d4d4d0;
    --survai-brand-soft: #2f2f2f;
    --survai-brand-ink: #151515;
    --survai-on-brand: #151515;
    --btn-primary-ink: #151515;
    --btn-primary-bg: var(--survai-brand);
    --survai-bg: #151515;
    --survai-bg-strong: #151515;
    --survai-bg-hover: #333333;
    --survai-bg-deep: #1c1c1c;
    --survai-bg-soft: #1c1c1c;
    --survai-bg-tint: #2f2f2f;
    --survai-bg-line: #2f2f2f;
    --survai-card: #242424;
    --survai-border: #303030;
    --survai-border-soft: #303030;
    --survai-border-faint: #303030;
    --survai-border-mid: #4a4a48;
    --survai-border-ink: #303030;
    --survai-text: #f5f5f3;
    --survai-text-strong: #f5f5f3;
    --survai-text-deep: #f5f5f3;
    --survai-text-slate: #dcdcd8;
    --survai-text-soft: #dcdcd8;
    --survai-navy-ink: #f5f5f3;
    --survai-secondary: #b3b3ae;
    --survai-secondary-strong: #dcdcd8;
    --survai-secondary-slate: #b3b3ae;
    --survai-muted: #a2a29d;
    --survai-muted-cool: #a2a29d;
    --survai-muted-grey: #a2a29d;
    --survai-ink-surface: #262626;
    --survai-navy-surface: #4a4a48;
    --survai-blue: #f2f2f0;
    --survai-tint-f9fbff: #2f2f2f;
    --survai-ink-047857: #86d6a6;
    --survai-ink-071a3d: #f5f5f3;
    --survai-ink-0b1736: #f5f5f3;
    --survai-ink-0e7490: #f5f5f3;
    --survai-ink-0f1b2d: #f5f5f3;
    --survai-ink-0f1b33: #f5f5f3;
    --survai-ink-0f3d2d: #86d6a6;
    --survai-ink-0f766e: #86d6a6;
    --survai-ink-111a2e: #f5f5f3;
    --survai-ink-123053: #f5f5f3;
    --survai-ink-14532d: #86d6a6;
    --survai-ink-14804a: #86d6a6;
    --survai-ink-155dfc: #f5f5f3;
    --survai-ink-157347: #86d6a6;
    --survai-ink-15803d: #86d6a6;
    --survai-ink-1648d4: #f5f5f3;
    --survai-ink-165ffa: #f5f5f3;
    --survai-ink-166534: #86d6a6;
    --survai-ink-16704a: #86d6a6;
    --survai-ink-16a34a: #86d6a6;
    --survai-ink-17653a: #86d6a6;
    --survai-ink-1b5af9: #f5f5f3;
    --survai-ink-1d4ed8: #f5f5f3;
    --survai-ink-1e3a5f: #f5f5f3;
    --survai-ink-1e3a8a: #f5f5f3;
    --survai-ink-1e40af: #f5f5f3;
    --survai-ink-1e6b3a: #86d6a6;
    --survai-ink-1f2937: #f5f5f3;
    --survai-ink-1f2a44: #f5f5f3;
    --survai-ink-1f618d: #f5f5f3;
    --survai-ink-243044: #f5f5f3;
    --survai-ink-24354d: #f5f5f3;
    --survai-ink-253246: #f5f5f3;
    --survai-ink-2563eb: #f5f5f3;
    --survai-ink-33445e: #dcdcd8;
    --survai-ink-344054: #dcdcd8;
    --survai-ink-374151: #dcdcd8;
    --survai-ink-3b4b63: #dcdcd8;
    --survai-ink-3d4861: #dcdcd8;
    --survai-ink-475467: #dcdcd8;
    --survai-ink-512e5f: #c4b5fd;
    --survai-ink-52627a: #b3b3ae;
    --survai-ink-52637f: #b3b3ae;
    --survai-ink-55657d: #b3b3ae;
    --survai-ink-5b6b82: #b3b3ae;
    --survai-ink-5b6b86: #b3b3ae;
    --survai-ink-5c6b82: #b3b3ae;
    --survai-ink-60708f: #b3b3ae;
    --survai-ink-657188: #b3b3ae;
    --survai-ink-6b5310: #f0c56e;
    --survai-ink-6d28d9: #c4b5fd;
    --survai-ink-717d93: #a2a29d;
    --survai-ink-7a271a: #ff9d93;
    --survai-ink-7a5a12: #f0c56e;
    --survai-ink-7a8699: #a2a29d;
    --survai-ink-7b8798: #a2a29d;
    --survai-ink-7c8a9d: #a2a29d;
    --survai-ink-7f1d1d: #ff9d93;
    --survai-ink-881337: #ff9d93;
    --survai-ink-8a4b00: #f0c56e;
    --survai-ink-8a5a12: #f0c56e;
    --survai-ink-8f1d1d: #ff9d93;
    --survai-ink-912018: #ff9d93;
    --survai-ink-922b21: #ff9d93;
    --survai-ink-92400e: #f0c56e;
    --survai-ink-991b1b: #ff9d93;
    --survai-ink-9a3412: #f0c56e;
    --survai-ink-9a7b0a: #f0c56e;
    --survai-ink-9f1d1d: #ff9d93;
    --survai-ink-a16207: #f0c56e;
    --survai-ink-b42318: #ff9d93;
    --survai-ink-b45309: #f0c56e;
    --survai-ink-b76b00: #f0c56e;
    --survai-ink-b7791f: #f0c56e;
    --survai-ink-b91c1c: #ff9d93;
    --survai-ink-be123c: #ff9d93;
    --survai-ink-c2185b: #ff9d93;
    --survai-ink-c2410c: #f0c56e;
    --survai-ink-d2333a: #ff9d93;
    --survai-ink-d97706: #f0c56e;
    --survai-ink-dc2626: #ff9d93;
    --survai-ink-e11d48: #ff9d93;
    --survai-ink-ef4444: #ff9d93;
    --survai-ink-ff3b4f: #ff9d93;
    --survai-tint-dbeafe: #2f2f2f;
    --survai-tint-dcfce7: #13261b;
    --survai-tint-e4ecf6: #2f2f2f;
    --survai-tint-e6ecf5: #2f2f2f;
    --survai-tint-e7f0ff: #2f2f2f;
    --survai-tint-e7f6ec: #13261b;
    --survai-tint-e8ecf4: #2f2f2f;
    --survai-tint-e8edf4: #2f2f2f;
    --survai-tint-e8eef7: #2f2f2f;
    --survai-tint-e9eef6: #2f2f2f;
    --survai-tint-e9f7ef: #13261b;
    --survai-tint-eaf1f8: #2f2f2f;
    --survai-tint-eaf2ff: #2f2f2f;
    --survai-tint-ecfdf3: #13261b;
    --survai-tint-ecfdf5: #13261b;
    --survai-tint-edf4ff: #2f2f2f;
    --survai-tint-edf5ff: #2f2f2f;
    --survai-tint-eef1f5: #2f2f2f;
    --survai-tint-eef2f8: #2f2f2f;
    --survai-tint-eef2ff: #2f2f2f;
    --survai-tint-eef3f8: #2f2f2f;
    --survai-tint-eef3fb: #2f2f2f;
    --survai-tint-eef4fb: #2f2f2f;
    --survai-tint-eef4ff: #2f2f2f;
    --survai-tint-eef9f2: #13261b;
    --survai-tint-eff4ff: #2f2f2f;
    --survai-tint-eff6ff: #2f2f2f;
    --survai-tint-f0f4f9: #2f2f2f;
    --survai-tint-f0f4ff: #2f2f2f;
    --survai-tint-f0f6ff: #2f2f2f;
    --survai-tint-f0fdf4: #13261b;
    --survai-tint-f1f6fc: #2f2f2f;
    --survai-tint-f2f4f7: #2f2f2f;
    --survai-tint-f2f7ff: #2f2f2f;
    --survai-tint-f2fbf5: #2f2f2f;
    --survai-tint-f3f4f8: #2f2f2f;
    --survai-tint-f3f6fb: #2f2f2f;
    --survai-tint-f4f6f9: #2f2f2f;
    --survai-tint-f4f7fd: #2f2f2f;
    --survai-tint-f4f9fc: #2f2f2f;
    --survai-tint-f5f9ff: #2f2f2f;
    --survai-tint-f6f9ff: #2f2f2f;
    --survai-tint-f7f6fd: #2f2f2f;
    --survai-tint-f7fafc: #2f2f2f;
    --survai-tint-f7faff: #2f2f2f;
    --survai-tint-f7fdf9: #2f2f2f;
    --survai-tint-f8fbff: #2f2f2f;
    --survai-tint-f9fafb: #2f2f2f;
    --survai-tint-f9fbfd: #2f2f2f;
    --survai-tint-fafafa: #2f2f2f;
    --survai-tint-fafbfc: #2f2f2f;
    --survai-tint-fbfcfe: #2f2f2f;
    --survai-tint-fdeaea: #2c1513;
    --survai-tint-fdebd0: #2a2111;
    --survai-tint-fdeeee: #2c1513;
    --survai-tint-fdf2f1: #2c1513;
    --survai-tint-fdf3e0: #2a2111;
    --survai-tint-fdf5f4: #2f2f2f;
    --survai-tint-fdf6e9: #2a2111;
    --survai-tint-fee2e2: #2c1513;
    --survai-tint-fef2f2: #2c1513;
    --survai-tint-fef3c7: #2a2111;
    --survai-tint-fef3f2: #2c1513;
    --survai-tint-fefce8: #2a2111;
    --survai-tint-ffedd5: #2a2111;
    --survai-tint-fff1f0: #2c1513;
    --survai-tint-fff1f1: #2c1513;
    --survai-tint-fff1f2: #2c1513;
    --survai-tint-fff5f7: #2c1513;
    --survai-tint-fff6e8: #2a2111;
    --survai-tint-fff7ed: #2a2111;
    --survai-tint-fff7f6: #2f2f2f;
    --survai-tint-fff7f7: #2f2f2f;
    --survai-tint-fff8e7: #2a2111;
    --survai-tint-fff9ec: #2a2111;
    --survai-tint-fffaf0: #2a2111;
    --survai-tint-fffbeb: #2a2111;
    --survai-tint-fffbf4: #2a2111;
    --survai-shadow: 0 18px 44px rgba(0, 0, 0, 0.45);
    --survai-shadow-hover: 0 18px 44px rgba(0, 0, 0, 0.45);
    --survai-focus: 0 0 0 3px #f2f2f0;
    --survai-white-header-color: #f5f5f3;

    --card-border-color: #303030;
    --card-bg: #242424;
    --card-shadow: 0 18px 44px rgba(0, 0, 0, 0.45);
    --card-shadow-hover: 0 22px 62px rgba(0, 0, 0, 0.45);

    --field-border-color: #7d7d79;
    --field-bg: #151515;
    --field-ink: #f5f5f3;
    --field-placeholder: #a2a29d;
    --field-shadow: none;
    --field-focus-border: #f2f2f0;
    --field-focus-ring: 0 0 0 3px #f2f2f0;

    --table-head-ink: #b3b3ae;
    --table-cell-ink: #dcdcd8;

    --btn-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
    --btn-shadow-small: 0 6px 16px rgba(0, 0, 0, 0.3);
    --btn-shadow-hover: 0 14px 32px rgba(0, 0, 0, 0.45);
    --btn-primary-shadow: 0 10px 24px rgba(0, 0, 0, 0.45);
    --btn-secondary-bg: #2f2f2f;
    --btn-secondary-ink: #f5f5f3;
    --btn-secondary-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
    --btn-danger-bg: #2c1513;
    --btn-danger-ink: #ff9d93;
    --btn-danger-shadow: inset 0 0 0 1px #6a2f2a;

    /* The older token names follow the same values. */
    --theme-bg: var(--survai-bg);
    --theme-bg-strong: var(--survai-bg);
    --theme-panel: var(--survai-card);
    --theme-panel-soft: var(--survai-bg-tint);
    --theme-text: var(--survai-text);
    --theme-muted: var(--survai-secondary);
    --theme-border: var(--survai-border);
    --theme-input: var(--field-bg);
    --theme-input-text: var(--field-ink);
    --panel: var(--survai-card);
    --line: var(--survai-border);
    --ink: var(--survai-text);
    --muted: var(--survai-secondary);
    --surface: var(--survai-bg);
    --shadow: var(--survai-shadow);
    --survai-strong-surface: #4a4a48;
    /* No --survai-map-* here: the property maps keep their light planning palette in dark
       mode (surveyor, 3 Oct 2026: "when we're in dark mode, we need that map to be in light
       mode"), the same map the PDF prints. Only the page around them goes dark. */
}

/* Status colours: the light tints' inks are too dark on a dark page. */
html[data-theme="dark"] .status-completed,
html[data-theme="dark"] .status-complete,
html[data-theme="dark"] .status-success,
html[data-theme="dark"] .ops-trend--positive,
html[data-theme="dark"] .condition-rating-badge.rating-cr1 {
    color: #86d6a6 !important;
    background: #13261b !important;
}

html[data-theme="dark"] .status-warning,
html[data-theme="dark"] .ops-trend--warning,
html[data-theme="dark"] .condition-rating-badge.rating-cr2 {
    color: #f0c56e !important;
    background: #2a2111 !important;
}

html[data-theme="dark"] .status-failed,
html[data-theme="dark"] .status-danger,
html[data-theme="dark"] .condition-rating-badge.rating-cr3 {
    color: #ff9d93 !important;
    background: #2c1513 !important;
}

html[data-theme="dark"] body:not(.login-body) a:not(.btn):not(.sidebar-nav a):not(.report-workspace-nav__link):not(.workspace-stage-nav__stage):not(:where(.output-action-bar__button, .output-icon-action)),
html[data-theme="dark"] .ops-card-link,
html[data-theme="dark"] .table-card a:not(.btn),
html[data-theme="dark"] .card a:not(.btn) {
    color: var(--survai-text-strong) !important;
}

/* Drop-down menus: white text in dark mode (surveyor, 3 Oct 2026: "on the drop-down menu,
   it still showing blue text. The text should be white. Wherever there's a drop-down
   menu."). The link rule above out-ranks every menu's own text colour, so menu items that
   are links (the report banner's Overview and Advanced menus, the notifications list)
   showed link blue; a few menu items also set a blue ink of their own. Menu text takes the
   theme's text colour instead. Light mode is unchanged, and a menu's other accents (status
   dots, the red delete action, primary buttons) keep their colours. The first selector
   repeats the link rule's :not()s so it out-ranks it. */
html[data-theme="dark"] body:not(.login-body) :is(
    .workspace-stage-dropdown,
    .reports-filter-panel,
    .ops-notification-panel,
    .ops-dashboard-layout-panel,
    .report-row__menu-panel,
    .report-status-pill-menu,
    .survai-regen-menu,
    .output-section-cost-popover,
    .survai-progress-action-dock__menu,
    .survai-image-action-dock__menu,
    .image-manager-filter-panel,
    .image-manager-settings-panel,
    .sort-settings-panel,
    .po-cover-edit-menu,
    .po-summary-menu-panel,
    .condition-rating-picker,
    .output-display-options,
    [role="menu"],
    [role="listbox"]
) a:not(.btn):not(.sidebar-nav a):not(.report-workspace-nav__link):not(.workspace-stage-nav__stage),
html[data-theme="dark"] .workspace-topbar.report-workspace-header .workspace-stage-dropdown .workspace-stage-subnav__link .workspace-stage-subnav__count {
    color: var(--survai-text) !important;
}

html[data-theme="dark"] .reports-filter-status__link,
html[data-theme="dark"] .report-status-pill-menu__option.is-selected,
html[data-theme="dark"] .output-section-cost-popover__option:hover,
html[data-theme="dark"] .output-section-cost-popover__option:focus-visible,
html[data-theme="dark"] .output-section-cost-popover__edit,
html[data-theme="dark"] .survai-regen-menu__item:hover,
html[data-theme="dark"] .survai-regen-menu__item:focus-visible {
    color: var(--survai-text);
}

/* Templates' own danger red is readable on the dark cards. */
html[data-theme="dark"] body.templates-page {
    --tpl-danger: #ff9d93;
}

/* The login page keeps its own light design whatever the device's theme. */
html[data-theme="dark"] body.login-body {
    color-scheme: light;
    --survai-bg: #f8fafc;
    --survai-bg-strong: #ffffff;
    --survai-bg-hover: #fafcfe;
    --survai-bg-deep: #f4f7fb;
    --survai-bg-soft: #fbfdff;
    --survai-bg-tint: #f1f5f9;
    --survai-bg-line: #eef2f7;
    --survai-card: #ffffff;
    --survai-border: #e6ebf2;
    --survai-border-soft: #e2e8f0;
    --survai-border-faint: #eef2f7;
    --survai-border-mid: #cbd5e1;
    --survai-border-ink: rgba(15, 23, 42, 0.1);
    --survai-text: #111827;
    --survai-text-strong: #0f172a;
    --survai-text-deep: #071421;
    --survai-text-slate: #1e293b;
    --survai-text-soft: #334155;
    --survai-navy-ink: #0b1321;
    --survai-secondary: #667085;
    --survai-secondary-strong: #475569;
    --survai-secondary-slate: #64748b;
    --survai-muted: #98a2b3;
    --survai-muted-cool: #94a3b8;
    --survai-muted-grey: #6b7280;
    --survai-ink-surface: #0f172a;
    --survai-navy-surface: #0b1321;
    --survai-blue: var(--survai-logo-blue);
    --survai-ink-047857: #047857;
    --survai-ink-071a3d: #071a3d;
    --survai-ink-0b1736: #0b1736;
    --survai-ink-0e7490: #0e7490;
    --survai-ink-0f1b2d: #0f1b2d;
    --survai-ink-0f1b33: #0f1b33;
    --survai-ink-0f3d2d: #0f3d2d;
    --survai-ink-0f766e: #0f766e;
    --survai-ink-111a2e: #111a2e;
    --survai-ink-123053: #123053;
    --survai-ink-14532d: #14532d;
    --survai-ink-14804a: #14804a;
    --survai-ink-155dfc: #155dfc;
    --survai-ink-157347: #157347;
    --survai-ink-15803d: #15803d;
    --survai-ink-1648d4: #1648d4;
    --survai-ink-165ffa: #165ffa;
    --survai-ink-166534: #166534;
    --survai-ink-16704a: #16704a;
    --survai-ink-16a34a: #16a34a;
    --survai-ink-17653a: #17653a;
    --survai-ink-1b5af9: #1b5af9;
    --survai-ink-1d4ed8: #1d4ed8;
    --survai-ink-1e3a5f: #1e3a5f;
    --survai-ink-1e3a8a: #1e3a8a;
    --survai-ink-1e40af: #1e40af;
    --survai-ink-1e6b3a: #1e6b3a;
    --survai-ink-1f2937: #1f2937;
    --survai-ink-1f2a44: #1f2a44;
    --survai-ink-1f618d: #1f618d;
    --survai-ink-243044: #243044;
    --survai-ink-24354d: #24354d;
    --survai-ink-253246: #253246;
    --survai-ink-2563eb: #2563eb;
    --survai-ink-33445e: #33445e;
    --survai-ink-344054: #344054;
    --survai-ink-374151: #374151;
    --survai-ink-3b4b63: #3b4b63;
    --survai-ink-3d4861: #3d4861;
    --survai-ink-475467: #475467;
    --survai-ink-512e5f: #512e5f;
    --survai-ink-52627a: #52627a;
    --survai-ink-52637f: #52637f;
    --survai-ink-55657d: #55657d;
    --survai-ink-5b6b82: #5b6b82;
    --survai-ink-5b6b86: #5b6b86;
    --survai-ink-5c6b82: #5c6b82;
    --survai-ink-60708f: #60708f;
    --survai-ink-657188: #657188;
    --survai-ink-6b5310: #6b5310;
    --survai-ink-6d28d9: #6d28d9;
    --survai-ink-717d93: #717d93;
    --survai-ink-7a271a: #7a271a;
    --survai-ink-7a5a12: #7a5a12;
    --survai-ink-7a8699: #7a8699;
    --survai-ink-7b8798: #7b8798;
    --survai-ink-7c8a9d: #7c8a9d;
    --survai-ink-7f1d1d: #7f1d1d;
    --survai-ink-881337: #881337;
    --survai-ink-8a4b00: #8a4b00;
    --survai-ink-8a5a12: #8a5a12;
    --survai-ink-8f1d1d: #8f1d1d;
    --survai-ink-912018: #912018;
    --survai-ink-922b21: #922b21;
    --survai-ink-92400e: #92400e;
    --survai-ink-991b1b: #991b1b;
    --survai-ink-9a3412: #9a3412;
    --survai-ink-9a7b0a: #9a7b0a;
    --survai-ink-9f1d1d: #9f1d1d;
    --survai-ink-a16207: #a16207;
    --survai-ink-b42318: #b42318;
    --survai-ink-b45309: #b45309;
    --survai-ink-b76b00: #b76b00;
    --survai-ink-b7791f: #b7791f;
    --survai-ink-b91c1c: #b91c1c;
    --survai-ink-be123c: #be123c;
    --survai-ink-c2185b: #c2185b;
    --survai-ink-c2410c: #c2410c;
    --survai-ink-d2333a: #d2333a;
    --survai-ink-d97706: #d97706;
    --survai-ink-dc2626: #dc2626;
    --survai-ink-e11d48: #e11d48;
    --survai-ink-ef4444: #ef4444;
    --survai-ink-ff3b4f: #ff3b4f;
    --survai-tint-dbeafe: #dbeafe;
    --survai-tint-dcfce7: #dcfce7;
    --survai-tint-e4ecf6: #e4ecf6;
    --survai-tint-e6ecf5: #e6ecf5;
    --survai-tint-e7f0ff: #e7f0ff;
    --survai-tint-e7f6ec: #e7f6ec;
    --survai-tint-e8ecf4: #e8ecf4;
    --survai-tint-e8edf4: #e8edf4;
    --survai-tint-e8eef7: #e8eef7;
    --survai-tint-e9eef6: #e9eef6;
    --survai-tint-e9f7ef: #e9f7ef;
    --survai-tint-eaf1f8: #eaf1f8;
    --survai-tint-eaf2ff: #eaf2ff;
    --survai-tint-ecfdf3: #ecfdf3;
    --survai-tint-ecfdf5: #ecfdf5;
    --survai-tint-edf4ff: #edf4ff;
    --survai-tint-edf5ff: #edf5ff;
    --survai-tint-eef1f5: #eef1f5;
    --survai-tint-eef2f8: #eef2f8;
    --survai-tint-eef2ff: #eef2ff;
    --survai-tint-eef3f8: #eef3f8;
    --survai-tint-eef3fb: #eef3fb;
    --survai-tint-eef4fb: #eef4fb;
    --survai-tint-eef4ff: #eef4ff;
    --survai-tint-eef9f2: #eef9f2;
    --survai-tint-eff4ff: #eff4ff;
    --survai-tint-eff6ff: #eff6ff;
    --survai-tint-f0f4f9: #f0f4f9;
    --survai-tint-f0f4ff: #f0f4ff;
    --survai-tint-f0f6ff: #f0f6ff;
    --survai-tint-f0fdf4: #f0fdf4;
    --survai-tint-f1f6fc: #f1f6fc;
    --survai-tint-f2f4f7: #f2f4f7;
    --survai-tint-f2f7ff: #f2f7ff;
    --survai-tint-f2fbf5: #f2fbf5;
    --survai-tint-f3f4f8: #f3f4f8;
    --survai-tint-f3f6fb: #f3f6fb;
    --survai-tint-f4f6f9: #f4f6f9;
    --survai-tint-f4f7fd: #f4f7fd;
    --survai-tint-f4f9fc: #f4f9fc;
    --survai-tint-f5f9ff: #f5f9ff;
    --survai-tint-f6f9ff: #f6f9ff;
    --survai-tint-f7f6fd: #f7f6fd;
    --survai-tint-f7fafc: #f7fafc;
    --survai-tint-f7faff: #f7faff;
    --survai-tint-f7fdf9: #f7fdf9;
    --survai-tint-f8fbff: #f8fbff;
    --survai-tint-f9fafb: #f9fafb;
    --survai-tint-f9fbfd: #f9fbfd;
    --survai-tint-fafafa: #fafafa;
    --survai-tint-fafbfc: #fafbfc;
    --survai-tint-fbfcfe: #fbfcfe;
    --survai-tint-fdeaea: #fdeaea;
    --survai-tint-fdebd0: #fdebd0;
    --survai-tint-fdeeee: #fdeeee;
    --survai-tint-fdf2f1: #fdf2f1;
    --survai-tint-fdf3e0: #fdf3e0;
    --survai-tint-fdf5f4: #fdf5f4;
    --survai-tint-fdf6e9: #fdf6e9;
    --survai-tint-fee2e2: #fee2e2;
    --survai-tint-fef2f2: #fef2f2;
    --survai-tint-fef3c7: #fef3c7;
    --survai-tint-fef3f2: #fef3f2;
    --survai-tint-fefce8: #fefce8;
    --survai-tint-ffedd5: #ffedd5;
    --survai-tint-fff1f0: #fff1f0;
    --survai-tint-fff1f1: #fff1f1;
    --survai-tint-fff1f2: #fff1f2;
    --survai-tint-fff5f7: #fff5f7;
    --survai-tint-fff6e8: #fff6e8;
    --survai-tint-fff7ed: #fff7ed;
    --survai-tint-fff7f6: #fff7f6;
    --survai-tint-fff7f7: #fff7f7;
    --survai-tint-fff8e7: #fff8e7;
    --survai-tint-fff9ec: #fff9ec;
    --survai-tint-fffaf0: #fffaf0;
    --survai-tint-fffbeb: #fffbeb;
    --survai-tint-fffbf4: #fffbf4;
    --survai-shadow: 0 10px 30px rgba(16, 24, 40, 0.06);
    --survai-shadow-hover: 0 18px 44px rgba(16, 24, 40, 0.10);
    --survai-focus: 0 0 0 4px rgba(27, 90, 249, 0.18);
    --survai-white-header-color: var(--survai-text);
    --card-border-color: #e6ebf2;
    --card-bg: rgba(255, 255, 255, 0.96);
    --card-shadow: 0 18px 50px rgba(11, 19, 33, 0.07);
    --card-shadow-hover: 0 22px 62px rgba(11, 19, 33, 0.11);
    --field-border-color: #e6ebf2;
    --field-bg: #ffffff;
    --field-ink: #111827;
    --field-placeholder: #98a2b3;
    --field-shadow: inset 0 1px 0 rgba(11, 19, 33, 0.02);
    --field-focus-border: #1b5af9;
    --field-focus-ring: 0 0 0 4px rgba(27, 90, 249, 0.18);
    --table-head-ink: #64748b;
    --table-cell-ink: #111827;
    --btn-shadow: 0 10px 26px rgba(11, 19, 33, 0.07);
    --btn-shadow-small: 0 6px 16px rgba(11, 19, 33, 0.05);
    --btn-shadow-hover: 0 14px 32px rgba(11, 19, 33, 0.11);
    --btn-primary-shadow: 0 10px 24px rgba(27, 90, 249, 0.18);
    --btn-secondary-bg: #ffffff;
    --btn-secondary-ink: var(--sai-text-main, #111827);
    --btn-secondary-shadow: 0 6px 18px rgba(16, 24, 40, 0.04);
    --btn-danger-bg: #fff1f3;
    --btn-danger-ink: #b42318;
    --btn-danger-shadow: inset 0 0 0 1px #ffd6db;
    --theme-bg: var(--survai-bg);
    --theme-bg-strong: #ffffff;
    --theme-panel: #ffffff;
    --theme-panel-soft: #f8fafc;
    --theme-text: var(--survai-text);
    --theme-muted: var(--survai-secondary);
    --theme-border: var(--survai-border);
    --theme-input: #ffffff;
    --theme-input-text: var(--survai-text);
    --panel: var(--survai-card);
    --line: var(--survai-border);
    --ink: var(--survai-text);
    --muted: var(--survai-secondary);
    --surface: var(--survai-bg);
    --shadow: var(--sai-elevation-soft);
}

/* The Property Overview's key-facts band in the header row (property_overview_sprift_render.php).
   The ink guard above stamps the header's text colour on every span, svg and button, and the
   app's .btn rules give buttons a white 42px pill, so the band's own colours and sizes are
   restated here with the same weight. Tokens only: --survai-band-* are defined with the brand
   tokens and follow the theme's surface and text. */
.workspace-topbar.report-workspace-header .po-sprift-band,
.workspace-topbar.report-workspace-header .po-sprift-band :is(a, button, span, svg, p, div, li, ul, strong, small),
.workspace-topbar.report-workspace-header .po-sprift-band :is(a, button, span, svg, p, div, li, ul, strong, small):is(:hover, :focus, :focus-visible, :active, [aria-current="page"], [aria-expanded="true"]) {
    color: var(--survai-band-text) !important;
    text-decoration: none !important;
}

.workspace-topbar.report-workspace-header .po-sprift-band .po-sprift-fact__icon,
.workspace-topbar.report-workspace-header .po-sprift-band .po-sprift-fact__icon svg {
    color: var(--survai-band-icon) !important;
}

.workspace-topbar.report-workspace-header .po-sprift-band .po-sprift-fact__icon svg,
.workspace-topbar.report-workspace-header .po-sprift-band .po-icon {
    width: 18px !important;
    height: 18px !important;
    max-width: none !important;
    flex: 0 0 18px;
}

/* Words only, as in output.php's banner, which is text only (M126, owner, 19 Oct 2026: "Can we
   remove the pill? And just have the words, please ... use the output.php page as the source of
   truth for formatting on that section"). The icons stay in the markup, as the banner's do. */
.workspace-topbar.report-workspace-header .po-sprift-band .po-sprift-band__actions :is(.po-sprift-band__action, .po-desk-study-regenerate) svg {
    display: none !important;
}

.workspace-topbar.report-workspace-header .po-sprift-band__actions .po-hero-street-view-actions {
    display: inline-flex !important;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0 !important;
    padding: 0 !important;
}

/* Regenerate desk study, Download report and Report are drawn exactly like the Report pages in
   output.php's banner (.workspace-stage-nav__stage): secondary text on no background at rest, the
   primary text on the neutral hover wash on hover or focus, 0.85rem at weight 500, 38px tall,
   11px either side (M126, owner, 19 Oct 2026). They are .btn elements, whose site-wide pill
   rules carry !important, so these do too, one class above them. */
.workspace-topbar.report-workspace-header .po-sprift-band .po-sprift-band__actions .btn:is(.po-sprift-band__action, .po-desk-study-regenerate) {
    display: inline-flex !important;
    width: auto !important;
    height: 38px !important;
    min-height: 38px !important;
    align-items: center;
    gap: 6px;
    margin: 0 !important;
    padding: 0 11px !important;
    border: 0 !important;
    border-radius: 8px 8px 0 0 !important;
    background: transparent !important;
    color: var(--survai-text-secondary) !important;
    box-shadow: none !important;
    font-size: 0.85rem !important;
    font-weight: 500 !important;
    line-height: 1 !important;
    white-space: nowrap;
    transform: none !important;
    transition: color 0.14s, background-color 0.14s;
}

.workspace-topbar.report-workspace-header .po-sprift-band .po-sprift-band__actions .btn:is(.po-sprift-band__action, .po-desk-study-regenerate):is(:hover, :focus-visible) {
    background: var(--survai-neutral-hover) !important;
    color: var(--survai-text) !important;
}

/* The header ink guard above stamps the band's text colour on every span, so the labels follow
   their button. */
.workspace-topbar.report-workspace-header .po-sprift-band .po-sprift-band__actions .btn:is(.po-sprift-band__action, .po-desk-study-regenerate) span {
    color: inherit !important;
}

.workspace-topbar.report-workspace-header .po-sprift-band .po-sprift-band__actions .btn:is(.po-sprift-band__action, .po-desk-study-regenerate):focus-visible {
    outline: 2px solid var(--survai-blue) !important;
    outline-offset: -2px;
}

/* QC still has sections to release: Download report stays usable (the picker explains), just quieter. */
.workspace-topbar.report-workspace-header .po-sprift-band .po-sprift-band__download.is-pdf-qc-gated {
    opacity: 0.7;
}

.workspace-topbar.report-workspace-header .po-sprift-band .po-desk-study-regenerate-status {
    flex: 1 1 100%;
    margin: 0 !important;
    color: var(--survai-band-muted) !important;
    font-size: 0.72rem !important;
}

.workspace-topbar.report-workspace-header .po-sprift-band .po-desk-study-regenerate-status[hidden] {
    display: none !important;
}

/* Overview on a phone (surveyor, 7 Oct 2026), 900px and under, the width at which the workspace
   header turns into the phone header.
   1. The band's Summary Report button and the page foot's shortcut were removed in M45 (owner,
      11 Oct 2026: "remove the copy summary report. We don't need that button anymore."), with
      the rules that showed one on a phone and the other on desktop. */

/* 2. "the menu goes off screen on the mobile view ... we need that menu to be positioned in the
      center of the screen so that we can see all the options": the cover image menu. It cannot
      be centred in place (.po-sprift-left is a CSS container, which traps position: fixed), so
      report-overview.php moves the open panel to <body> on a phone and marks it .is-centred,
      over this backdrop, under the processing card's layer. */
.po-cover-edit-backdrop {
    position: fixed;
    inset: 0;
    z-index: 10070;
    background: rgba(23, 23, 23, 0.42);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

html[data-theme="dark"] .po-cover-edit-backdrop {
    background: rgba(0, 0, 0, 0.6);
}

.po-cover-edit-panel.is-centred {
    position: fixed;
    top: 50%;
    right: auto;
    bottom: auto;
    left: 50%;
    z-index: 10071;
    width: min(320px, calc(100vw - 32px));
    min-width: 0;
    max-width: calc(100vw - 32px);
    max-height: calc(100dvh - 32px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 8px;
    border-radius: 16px;
    background: var(--survai-card);
    box-shadow: var(--survai-shadow-hover);
    transform: translate(-50%, -50%);
}

.po-cover-edit-panel.is-centred .po-cover-edit-action {
    min-height: 46px;
    padding: 10px 14px;
    font-size: 0.95rem;
}

/* Every option reads the same: the app's global link blue (an a:not(.btn) rule) and its muted
   "label span" ink otherwise make "Change from photos" look like a link and "Upload image" look
   disabled. Both are !important; these carry one more class. Danger keeps its red. */
.po-cover-edit-panel.is-centred a.po-cover-edit-action,
.po-cover-edit-panel.is-centred .po-cover-edit-action--upload span {
    color: var(--survai-text-strong) !important;
}

/* ==========================================================================
   Report overview layout (surveyor, 28 Sep 2026: "the dashboard should be out of this world …
   intuitive, logical", desktop, tablet and phone, existing colours).

   report-overview.php keeps its inline 12-column bento (display: grid and the two column wrappers'
   display: contents, both forced from the page's own style block). This block re-places its items
   and gives every card one anatomy. Three bands on the one grid:
     IDENTITY       at-a-glance strip · Property Details (1-8) · map + uploader stack (9-12)
     INTELLIGENCE   band label · Condition Ratings (1-6) · Inspection Focus (7-12) · Property Summary
                    · Desk Study Highlights · Legal prompts · async desk-study cards (3 per row)
     WORK           band label · Missing Data · Summary Report (1-8, two rows) · Documents and Recent
                    activity (9-12) · Area Risk · the two copy buttons as a tools footer
   >= 1181px as above · 721-1180px two columns in pairs that never leave an orphan · <= 720px one
   column in the same order. The hero row wrapper and the legal/focus split become display: contents
   so their children are grid items; every item carries an explicit order and grid-column here — a
   card added to the page needs both. Selectors start `.property-overview-main .report-overview-grid`
   (0,3,0), which beats the page's inline block on specificity alone. Colours are tokens only, so no
   dark override is needed. The block sits before the dashboard block on purpose: that block's test
   forbids `display: none` after its own heading.
   ========================================================================== */

/* 1. Page tokens and the main panel as a one-column grid (so the utility row can sit at the foot).
      The summary editor and area-risk rules read --sai-* names that were never declared; aliasing
      them makes those borders, the focus ring and the disabled fill follow dark mode. */
.main-panel.property-overview-main {
    --sai-border: var(--survai-border-soft);
    --sai-accent: var(--survai-blue);
    --sai-surface-muted: var(--survai-bg-soft);
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    gap: 16px;
}

.main-panel.property-overview-main > .po-page-actions {
    order: 10;
    margin: 4px 0 0;
    padding-top: 14px;
    border-top: 1px solid var(--survai-border-soft);
    justify-content: flex-start;
}

/* 2. Wrappers that become transparent: hero row (hero | side stack) and the legal/focus split. */
.property-overview-main .report-overview-grid > .po-primary > .po-overview-hero-location-row {
    display: contents;
}

/* 3. Placement (desktop base). Order-modified document order + definite columns; the sparse
      cursor only drops a row when a column-start is left of the previous item's. */
.property-overview-main .report-overview-grid .po-overview-hero-location-row > .po-hero {
    order: -110;
    grid-column: 1 / 9;
    height: auto;
    min-width: 0;
}

.property-overview-main .report-overview-grid .po-overview-hero-location-row > .po-hero-side-stack {
    order: -109;
    grid-column: 9 / -1;
    min-width: 0;
}

/* Condition Ratings and Property Summary are both short cards; stacked in 1-6 they fill the
   height of Inspection Focus in 7-12, so no card is stretched around empty space. */
.property-overview-main .report-overview-grid > .po-rail > .po-condition {
    order: -95;
    grid-column: 1 / 7;
    align-self: stretch;
}

.property-overview-main .report-overview-grid > .po-primary > .po-property-summary {
    order: -93;
    grid-column: 1 / 7;
    align-self: stretch;
}

.property-overview-main .report-overview-grid > .po-primary > .po-desk-highlights {
    order: -85;
    grid-column: 1 / -1;
}

.property-overview-main .report-overview-grid > .po-primary > .po-missing-data {
    order: -50;
    grid-column: 1 / -1;
}

.property-overview-main .report-overview-grid > .po-primary > .po-summary-report {
    order: -41;
    grid-column: 1 / 9;
    grid-row: span 2;
}

.property-overview-main .report-overview-grid > .po-rail > .po-docs {
    order: -40;
    grid-column: 9 / -1;
    align-self: start;
}

.property-overview-main .report-overview-grid > .po-rail > .po-activity {
    order: -39;
    grid-column: 9 / -1;
    align-self: stretch;
}

/* 4. One head for every card (the site white-header band — 44px min-height, 10px 0 4px padding —
      is zeroed on this page only). Left: eyebrow over title. Right: one action or one chip. */
.property-overview-main .report-overview-grid .po-card-head,
.property-overview-main .report-overview-grid .po-condition .condition-ratings-panel__head,
.property-overview-main .report-overview-grid .po-hero-head,
.property-overview-main .report-overview-grid .property-location-card__head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    row-gap: 6px;
    column-gap: 12px;
    width: auto;
    min-height: 0;
    margin: 0 0 14px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

/* The ratings head has no inner wrapper (its eyebrow and h2 are siblings), so it stacks them. */
.property-overview-main .report-overview-grid .po-condition .condition-ratings-panel__head {
    flex-direction: column;
    align-items: flex-start;
    row-gap: 0;
}

.property-overview-main .report-overview-grid .po-card-head .eyebrow,
.property-overview-main .report-overview-grid .po-condition .condition-ratings-panel__head .eyebrow,
.property-overview-main .report-overview-grid .po-hero-head .eyebrow,
.property-overview-main .report-overview-grid .property-location-card__head .eyebrow {
    margin: 0 0 3px;
    font-size: 0.66rem;
    font-weight: 750;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--survai-secondary-slate);
}

.property-overview-main .report-overview-grid .po-card-head h2,
.property-overview-main .report-overview-grid .po-card-head h3,
.property-overview-main .report-overview-grid .po-condition .condition-ratings-panel__head h2 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 780;
    letter-spacing: -0.01em;
    line-height: 1.25;
    color: var(--po-navy);
}

.property-overview-main .report-overview-grid .po-card-head .form-note {
    margin: 4px 0 0;
    max-width: 60ch;
    font-size: 0.8rem;
    line-height: 1.4;
    color: var(--survai-secondary-slate);
}

.property-overview-main .report-overview-grid .po-card-head .po-card-head-actions,
.property-overview-main .report-overview-grid .po-card-head .section-head-actions {
    align-self: flex-start;
    margin-left: auto;
    gap: 8px;
}

/* 5. Chips, tiles, tones, admin controls, empty states, disclaimers, loader. */
.property-overview-main .report-overview-grid :is(.po-desk-highlight__top span, .po-summary-badge) {
    display: inline-flex;
    align-items: center;
    width: auto;
    height: auto;
    min-height: 24px;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.2;
}

.property-overview-main .report-overview-grid :is(.po-property-summary-item, .po-desk-highlight, .po-missing-data-item, .po-doc-cat) {
    border: 1px solid var(--survai-border-soft);
    border-radius: 12px;
    background: var(--survai-bg-hover);
    box-shadow: none;
}

.property-overview-main .report-overview-grid :is(.po-desk-highlight--warning, .po-missing-data-item--warning, .po-epc-warning, .po-geology-warning, .po-flood-warning, .po-heritage-warning) {
    background: color-mix(in srgb, var(--survai-tint-fff7ed) 55%, var(--survai-card));
    border-color: color-mix(in srgb, var(--po-amber) 28%, transparent);
    box-shadow: inset 3px 0 0 var(--po-amber);
}

.property-overview-main .report-overview-grid :is(.po-desk-highlight--review, .po-missing-data-item--review) {
    background: color-mix(in srgb, var(--survai-tint-eff6ff) 55%, var(--survai-card));
    border-color: color-mix(in srgb, var(--po-blue) 24%, transparent);
    box-shadow: inset 3px 0 0 var(--po-blue);
}

.property-overview-main .report-overview-grid .po-admin-tools {
    margin-top: 12px;
    border-top: 1px solid var(--survai-border-soft);
    padding-top: 10px;
}

.property-overview-main .report-overview-grid .po-admin-tools > summary {
    font-size: 0.68rem;
    letter-spacing: 0.08em;
}

.property-overview-main .report-overview-grid :is(.po-muted, .po-epc-empty, .po-geology-empty, .po-heritage-empty, .po-flood-empty, .po-weather-empty, .property-location-empty p) {
    margin: 0;
    font-size: 0.86rem;
    line-height: 1.5;
}

.property-overview-main .report-overview-grid :is(.po-weather-disclaimer, .po-geology-meta-note) {
    margin: 10px 0 0;
    font-size: 0.72rem;
    line-height: 1.4;
    color: var(--survai-muted);
}

/* 6. (The at-a-glance strip went with M73b: area 02, assets/css/property-overview-areas.css.) */
/* 7. (The band labels went with M73b and M73c: the six areas have their own headings.) */
/* 8. Hero (Property Details): photo column beside a job sheet whose values wrap, the reference as
      the page title, Project settings pinned to the card foot. */
.property-overview-main .report-overview-grid .po-hero {
    display: grid;
    grid-template-columns: minmax(220px, 30%) minmax(0, 1fr);
    grid-template-areas:
        "head head"
        "visual body"
        "status status";
    grid-template-rows: auto minmax(0, 1fr) auto;
    column-gap: 24px;
    row-gap: 0;
    /* The hero row is as tall as the map + uploader stack beside it; the photo/sheet row
       absorbs that height, so the card never ends on an empty floor. */
    align-content: stretch;
    align-items: stretch;
}

.property-overview-main .report-overview-grid .po-hero .po-hero-head { grid-area: head; }
.property-overview-main .report-overview-grid .po-hero .po-hero-admin-status { grid-area: status; }

/* The photo column is a flex column the height of the job sheet beside it: the photo takes the
   height (cover-cropped), the desk-study button sits under it. No blank card floor under a
   square photo, whatever the sheet's height. */
.property-overview-main .report-overview-grid .po-hero .po-hero-visual {
    grid-area: visual;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 0;
}

.property-overview-main .report-overview-grid .po-hero .po-hero-body {
    grid-area: body;
    display: flex;
    flex-direction: column;
    padding-top: 0;
    min-width: 0;
}

.property-overview-main .report-overview-grid .po-hero .po-hero-media {
    flex: 1 1 auto;
    width: 100%;
    max-width: 100%;
    margin: 0;
    min-height: 260px;
    max-height: none;
    aspect-ratio: auto;
    border-radius: 12px;
}

.property-overview-main .report-overview-grid .po-hero .po-hero-media > .po-cover-picker-link,
.property-overview-main .report-overview-grid .po-hero .po-hero-media .po-hero-img,
.property-overview-main .report-overview-grid .po-hero .po-hero-media .po-hero-placeholder {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.property-overview-main .report-overview-grid .po-hero .po-hero-visual .po-hero-attribution,
.property-overview-main .report-overview-grid .po-hero .po-hero-visual .po-hero-warning {
    padding: 0;
}

.property-overview-main .report-overview-grid .po-hero .po-hero-visual .po-hero-street-view-actions {
    flex: 0 0 auto;
    padding: 0;
}

.property-overview-main .report-overview-grid .po-hero .po-hero-visual .po-hero-street-view-actions .btn {
    width: 100%;
    justify-content: center;
}

/* Title row: reference and type badge on one baseline, the two actions on the right. */
.property-overview-main .report-overview-grid .po-hero .po-hero-top {
    align-items: center;
    gap: 10px 14px;
    margin: 0 0 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--survai-border-soft);
}

.property-overview-main .report-overview-grid .po-hero .po-hero-top > div:first-child {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    min-width: 0;
}

.property-overview-main .report-overview-grid .po-hero .po-hero-top .workflow-title-meta {
    margin: 0;
}

.property-overview-main .report-overview-grid .po-hero .po-hero-ref {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 800;
    letter-spacing: -0.015em;
    line-height: 1.2;
    color: var(--po-navy);
}

.property-overview-main .report-overview-grid .po-hero .po-hero-detail-actions {
    margin-left: auto;
    gap: 8px;
}

/* The job sheet: three equal columns on one rhythm. The client fields sit on one row of three
   like every other row (the page's own .po-detail-wide spanned each across the sheet, leaving
   two thirds of three rows empty). Each cell is a small tile so the sheet reads as a grid. */
.property-overview-main .report-overview-grid .po-hero .po-job-sheet {
    flex: 1 1 auto;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: minmax(0, 1fr);
    align-content: stretch;
    gap: 10px;
    margin: 0 0 14px;
}

.property-overview-main .report-overview-grid .po-hero .po-job-sheet > div {
    display: grid;
    align-content: start;
    gap: 4px;
    min-width: 0;
    padding: 9px 11px;
    border: 1px solid var(--survai-border-soft);
    border-radius: 10px;
    background: var(--survai-bg-hover);
}

.property-overview-main .report-overview-grid .po-hero .po-job-sheet > .po-detail-wide {
    grid-column: auto;
}

.property-overview-main .report-overview-grid .po-hero .po-job-sheet dt {
    font-size: 0.64rem;
    letter-spacing: 0.08em;
    white-space: normal;
}

.property-overview-main .report-overview-grid .po-hero .po-job-sheet dd {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 26px;
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.3;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    /* Break only where a token is longer than the tile, never mid-word by default. */
    overflow-wrap: break-word;
    word-break: normal;
}

.property-overview-main .report-overview-grid .po-hero .po-job-sheet dd > span:not(.po-inline-icon) {
    min-width: 0;
    overflow-wrap: anywhere;
}

/* Long values (an email address) read at the caption size on one or two clean lines rather
   than a value-size word split at random. */
.property-overview-main .report-overview-grid .po-hero .po-job-sheet dd [data-po-detail="client_email"] {
    font-size: 0.8rem;
    line-height: 1.35;
    word-break: break-all;
}

.property-overview-main .report-overview-grid .po-hero .po-job-sheet .po-date-edit-button {
    max-width: 100%;
    padding: 4px 10px;
    white-space: nowrap;
    font-size: 0.82rem;
}

.property-overview-main .report-overview-grid .po-hero .po-job-sheet .po-date-edit-button .po-inline-icon svg {
    width: 15px;
    height: 15px;
}

.property-overview-main .report-overview-grid .po-hero .po-job-sheet .po-surveyor-name-input {
    min-height: 34px;
    padding: 4px 10px;
    font-size: 0.88rem;
}

.property-overview-main .report-overview-grid .po-hero .po-job-sheet dd .po-inline-icon {
    flex: 0 0 auto;
    display: inline-flex;
    color: var(--survai-secondary-slate);
}

.property-overview-main .report-overview-grid .po-hero .po-job-sheet dd .po-inline-icon svg {
    width: 16px;
    height: 16px;
}

.property-overview-main .report-overview-grid .po-hero .po-job-sheet .po-surveyor-name-input {
    width: 100%;
    max-width: 100%;
}

.property-overview-main .report-overview-grid .po-hero .po-job-sheet .po-date-edit-button {
    max-width: 100%;
}

.property-overview-main .report-overview-grid .po-hero .po-hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-top: auto;
    padding-top: 0;
    border-top: 0;
}

/* Both footers (Regenerate under the photo, Project settings under the sheet) are 36px pills
   on one baseline, so the card ends on a single tidy row and never on empty floor. */
.property-overview-main .report-overview-grid .po-hero .po-hero-visual .po-hero-street-view-actions .btn,
.property-overview-main .report-overview-grid .po-hero .po-hero-actions .btn {
    min-height: 38px;
    padding-top: 6px;
    padding-bottom: 6px;
    font-size: 0.86rem;
}

.property-overview-main .report-overview-grid .po-hero .po-hero-actions .btn {
    width: auto;
}

/* 9. Map card in the side stack: the map fills the card, the explanatory prose is demoted, the
      orientation select keeps its wrapper and save-state. app.js measures the map once, so the
      min-height is declared here (220 / 240 / 220). */
.property-overview-main .report-overview-grid .po-hero-side-stack > .po-location-street-view-column {
    flex: 1 1 auto;
    display: flex;
    min-height: 0;
    min-width: 0;
}

.property-overview-main .report-overview-grid .po-hero-side-stack .property-location-card--overview {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.property-overview-main .report-overview-grid .property-location-card--overview .property-location-card__head .form-note {
    display: none;
}

.property-overview-main .report-overview-grid .property-location-card--overview .property-location-map {
    flex: 1 1 auto;
    height: auto;
    min-height: 220px;
    border-radius: 12px;
}

.property-overview-main .report-overview-grid .property-location-card--overview .property-location-empty {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 180px;
    border: 1px dashed var(--survai-border-soft);
    border-radius: 12px;
}

.property-overview-main .report-overview-grid .property-location-card--overview .property-location-orientation {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--survai-border-soft);
}

.property-overview-main .report-overview-grid .property-location-orientation .output-orientation-facing > span.form-note:not(.output-orientation-facing__derived),
.property-overview-main .report-overview-grid .property-location-orientation .output-orientation-facing > p.form-note {
    display: none;
}

.property-overview-main .report-overview-grid .property-location-orientation .output-orientation-facing__derived {
    font-size: 0.8rem;
    color: var(--po-navy);
}

/* 10. Condition Ratings: legible pills (the pinned repeat(5)/repeat(2) and 899px rules stay in the
       file; these win at 0,5,0). */
.property-overview-main .report-overview-grid > .po-rail > .po-condition {
    padding: 20px 22px;
    gap: 0;
    align-content: start;
}

.property-overview-main .report-overview-grid .po-rail .po-condition .condition-rating-summary-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.property-overview-main .report-overview-grid .po-rail .po-condition .condition-rating-summary-card {
    min-height: 84px;
    gap: 6px;
    padding: 12px 6px;
    border: 1px solid var(--survai-border-soft);
    border-radius: 12px;
    box-shadow: none;
}

.property-overview-main .report-overview-grid .po-rail .po-condition .condition-rating-summary-badge {
    width: 34px;
    height: 34px;
    font-size: 0.68rem;
}

.property-overview-main .report-overview-grid .po-rail .po-condition .condition-rating-summary-label {
    font-size: 0.6rem;
    line-height: 1.15;
    white-space: normal;
}

.property-overview-main .report-overview-grid .po-rail .po-condition .condition-rating-summary-card strong {
    font-size: 1.35rem;
}

/* 11. Intelligence band internals: orphan-free tile grids (the async cards' columns went with M73c:
       the cards open beneath their area 03 rows, assets/css/property-overview-areas.css). */
.property-overview-main .report-overview-grid .po-property-summary-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.property-overview-main .report-overview-grid .po-property-summary-grid > .po-property-summary-item {
    flex: 1 1 160px;
    min-width: 0;
}

.property-overview-main .report-overview-grid .po-desk-highlight-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 12px;
}

.property-overview-main .report-overview-grid .po-desk-highlight {
    gap: 8px;
    padding: 12px;
}

.property-overview-main .report-overview-grid .po-desk-highlight h4 {
    font-size: 0.88rem;
}

.property-overview-main .report-overview-grid .po-desk-highlight > p {
    margin: 0;
    font-size: 0.8rem;
}

.property-overview-main .report-overview-grid .po-desk-highlight details {
    border-top-color: var(--survai-border-soft);
}

/* 12. Work band internals: wrapping missing-data tiles, a summary card whose editor absorbs the
       rail's height, the toolbar's duplicate Send hidden (the footer pair stays), quiet documents
       and activity rows, the area-risk placeholder as a one-line note. */
.property-overview-main .report-overview-grid .po-missing-data-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.property-overview-main .report-overview-grid .po-missing-data-grid > .po-missing-data-item {
    flex: 1 1 calc(33.333% - 8px);
    min-width: 0;
}

.property-overview-main .report-overview-grid > .po-primary > .po-summary-report {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.property-overview-main .report-overview-grid .po-summary-report .po-summary-head {
    flex: 0 0 auto;
    gap: 10px 16px;
}

.property-overview-main .report-overview-grid .po-summary-report .po-summary-body {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
    margin-top: 12px;
}

.property-overview-main .report-overview-grid .po-summary-report textarea.po-summary-editor {
    flex: 1 1 auto;
    min-height: 220px;
}

.property-overview-main .report-overview-grid .po-summary-report .po-summary-footer {
    flex: 0 0 auto;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--survai-border-soft);
}

.property-overview-main .report-overview-grid .po-summary-report .po-summary-toolbar > [data-po-summary-send] {
    display: none;
}

.property-overview-main .report-overview-grid .po-doc-cats {
    gap: 8px;
}

.property-overview-main .report-overview-grid .po-doc-cat {
    padding: 10px 12px;
}

.property-overview-main .report-overview-grid .po-doc-cat-stats em {
    font-size: 0.62rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--survai-secondary-slate);
}

.property-overview-main .report-overview-grid .po-activity .po-activity-list {
    max-height: 380px;
}

.property-overview-main .report-overview-grid .po-activity-row {
    border-bottom-color: var(--survai-border-soft);
}

/* 13. Strip anchors land below the fixed workspace header. */
.property-overview-main .report-overview-grid #missingDataTitle,
.property-overview-main .report-overview-grid #poSiteMediaUnifiedTitle,
.property-overview-main .report-overview-grid > .po-primary > .po-summary-report {
    scroll-margin-top: calc(var(--survai-report-workspace-header-offset) + var(--survai-toolbar-content-gap) + 16px);
}

/* 14. Tablet: two columns in pairs; the ratings pills 3 + 2; no nested scroll on touch. */
@media (max-width: 1180px) {
    .property-overview-main .report-overview-grid .po-overview-hero-location-row > .po-hero,
    .property-overview-main .report-overview-grid .po-overview-hero-location-row > .po-hero-side-stack,
    .property-overview-main .report-overview-grid > .po-primary > .po-summary-report {
        grid-column: 1 / -1;
    }

    .property-overview-main .report-overview-grid > .po-primary > .po-summary-report {
        grid-row: auto;
    }

    .property-overview-main .report-overview-grid > .po-rail > .po-condition {
        grid-column: 1 / 7;
    }

    .property-overview-main .report-overview-grid > .po-primary > .po-property-summary {
        grid-column: 1 / 7;
    }

    .property-overview-main .report-overview-grid > .po-rail > .po-docs {
        grid-column: 1 / 7;
        align-self: stretch;
    }

    .property-overview-main .report-overview-grid > .po-rail > .po-activity {
        grid-column: 7 / -1;
    }

    .property-overview-main .report-overview-grid .po-hero {
        grid-template-columns: minmax(200px, 34%) minmax(0, 1fr);
    }

    .property-overview-main .report-overview-grid .property-location-card--overview .property-location-map {
        min-height: 240px;
    }

    .property-overview-main .report-overview-grid .po-rail .po-condition .condition-rating-summary-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
        gap: 8px;
    }

    .property-overview-main .report-overview-grid .po-rail .po-condition .condition-rating-summary-card {
        grid-column: span 2;
    }

    .property-overview-main .report-overview-grid .po-rail .po-condition .condition-rating-summary-card:nth-child(n + 4) {
        grid-column: span 3;
    }

    .property-overview-main .report-overview-grid .po-desk-highlight-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .property-overview-main .report-overview-grid .po-activity .po-activity-list {
        max-height: none;
        overflow: visible;
    }
}

/* Tablet only: the map and the uploader sit side by side under the hero (the stack is the inline
   flex column again on the phone). */
@media (min-width: 721px) and (max-width: 1180px) {
    .property-overview-main .report-overview-grid .po-overview-hero-location-row > .po-hero-side-stack {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 18px;
        align-items: stretch;
    }

    .property-overview-main .report-overview-grid .po-hero-side-stack > .po-location-street-view-column,
    .property-overview-main .report-overview-grid .po-hero-side-stack > .po-upload-column {
        min-width: 0;
        display: flex;
    }
}

/* 15. Phone: one column, the strip two-up with Next and Survey date across both columns, the hero
       photo a 16:10 banner, compact highlight tiles, no nested scroll, the two utility buttons side
       by side at the foot. */
@media (max-width: 720px) {
    .property-overview-main .report-overview-grid > .po-rail > .po-condition,
    .property-overview-main .report-overview-grid > .po-primary > .po-property-summary,
    .property-overview-main .report-overview-grid > .po-rail > .po-docs,
    .property-overview-main .report-overview-grid > .po-rail > .po-activity {
        grid-column: 1 / -1;
    }

    .property-overview-main .report-overview-grid .po-hero {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "head"
            "visual"
            "body"
            "status";
        row-gap: 14px;
    }

    .property-overview-main .report-overview-grid .po-hero .po-hero-media {
        flex: 0 0 auto;
        width: 100%;
        max-width: 100%;
        margin: 0;
        min-height: 0;
        aspect-ratio: 16 / 10;
        max-height: none;
    }

    .property-overview-main .report-overview-grid .po-hero .po-hero-body {
        padding-top: 0;
    }

    .property-overview-main .report-overview-grid .po-hero .po-job-sheet {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .property-overview-main .report-overview-grid .po-hero .po-job-sheet .po-date-edit-button,
    .property-overview-main .report-overview-grid .po-hero .po-job-sheet .po-surveyor-name-input {
        width: 100%;
        justify-content: flex-start;
    }

    .property-overview-main .report-overview-grid .po-hero .po-hero-actions {
        justify-content: space-between;
    }

    .property-overview-main .report-overview-grid .property-location-card--overview .property-location-map {
        min-height: 220px;
    }

    .property-overview-main .report-overview-grid .po-property-summary-grid > .po-property-summary-item {
        flex-basis: calc(50% - 6px);
    }

    .property-overview-main .report-overview-grid .po-desk-highlight-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
    }

    .property-overview-main .report-overview-grid .po-desk-highlight {
        padding: 10px 12px;
        gap: 6px;
    }

    .property-overview-main .report-overview-grid .po-desk-highlight > p {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .property-overview-main .report-overview-grid .po-missing-data-grid > .po-missing-data-item {
        flex-basis: 100%;
    }

    .property-overview-main .report-overview-grid .po-summary-report textarea.po-summary-editor {
        min-height: 260px;
    }

    .property-overview-main .report-overview-grid .po-activity .po-activity-list {
        max-height: none;
    }

    .main-panel.property-overview-main > .po-page-actions .btn {
        flex: 1 1 calc(50% - 4px);
        justify-content: center;
    }
}

/* 16. Visual system pass (surveyor, 29 Sep 2026: "proper styling and layout ... a real dashboard").
       One rhythm for the whole page, in the main dashboard's language:
         - every card: 22/24px padding, one head (eyebrow, title, one action), 16px between head and body;
         - no boxes inside boxes: the job sheet, property summary, highlights, prompts, focus checks,
           missing-data items and document rows are hairline rows on the card surface, with a 3px
           tone bar where a tone matters;
         - the hero photo panel is a landscape 4:3 stage at the card's full column height, its
           caption chip and edit control inside it;
         - equal heights across a band come from the grid, never from stretched empty tiles.
       Same selectors (0,3,0 and up), later in source, so these win over 1-15 above. */
.property-overview-main .report-overview-grid > .po-primary > .po-card,
.property-overview-main .report-overview-grid > .po-rail > .po-card,
.property-overview-main .report-overview-grid .po-overview-hero-location-row .po-card {
    padding: 22px 24px;
}

.property-overview-main .report-overview-grid .po-card-head,
.property-overview-main .report-overview-grid .po-hero-head,
.property-overview-main .report-overview-grid .property-location-card__head,
.property-overview-main .report-overview-grid .po-condition .condition-ratings-panel__head {
    margin-bottom: 16px;
    align-items: center;
}

.property-overview-main .report-overview-grid .po-card-head h2,
.property-overview-main .report-overview-grid .po-card-head h3,
.property-overview-main .report-overview-grid .po-condition .condition-ratings-panel__head h2 {
    font-size: 1.02rem;
    font-weight: 760;
}

.property-overview-main .report-overview-grid .po-card-head .eyebrow,
.property-overview-main .report-overview-grid .po-hero-head .eyebrow,
.property-overview-main .report-overview-grid .property-location-card__head .eyebrow,
.property-overview-main .report-overview-grid .po-condition .condition-ratings-panel__head .eyebrow {
    margin-bottom: 4px;
    font-size: 0.64rem;
}

.property-overview-main .report-overview-grid .po-card-head .btn,
.property-overview-main .report-overview-grid .po-hero-top .btn {
    min-height: 34px;
    padding: 5px 12px;
    font-size: 0.8rem;
    box-shadow: none;
}

/* 16b. Hero: a landscape photo stage beside a spec sheet of hairline rows. */
.property-overview-main .report-overview-grid .po-hero {
    grid-template-columns: minmax(300px, 42%) minmax(0, 1fr);
    column-gap: 28px;
}

.property-overview-main .report-overview-grid .po-hero .po-hero-visual {
    gap: 12px;
}

.property-overview-main .report-overview-grid .po-hero .po-hero-media {
    min-height: 240px;
    border-radius: 14px;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.06);
}

.property-overview-main .report-overview-grid .po-hero .po-hero-visual .po-hero-attribution,
.property-overview-main .report-overview-grid .po-hero .po-hero-visual .po-hero-warning {
    margin: 0;
    font-size: 0.72rem;
    line-height: 1.4;
    color: var(--survai-muted);
}

.property-overview-main .report-overview-grid .po-hero .po-hero-top {
    margin-bottom: 4px;
    padding-bottom: 12px;
}

.property-overview-main .report-overview-grid .po-hero .po-hero-ref {
    font-size: 1.25rem;
}

.property-overview-main .report-overview-grid .po-hero .po-job-sheet {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: minmax(0, 1fr);
    gap: 0 24px;
    margin: 0 0 12px;
}

.property-overview-main .report-overview-grid .po-hero .po-job-sheet > div {
    gap: 3px;
    padding: 12px 0 11px;
    border: 0;
    border-bottom: 1px solid var(--survai-border-soft);
    border-radius: 0;
    background: transparent;
    align-content: center;
}

.property-overview-main .report-overview-grid .po-hero .po-job-sheet dt {
    font-size: 0.62rem;
    font-weight: 750;
    letter-spacing: 0.09em;
    color: var(--survai-secondary-slate);
}

.property-overview-main .report-overview-grid .po-hero .po-job-sheet dd {
    min-height: 24px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--po-navy);
}

.property-overview-main .report-overview-grid .po-hero .po-job-sheet dd [data-po-detail="client_email"] {
    font-size: 0.82rem;
    font-weight: 500;
}

.property-overview-main .report-overview-grid .po-hero .po-job-sheet .po-date-edit-button,
.property-overview-main .report-overview-grid .po-hero .po-job-sheet .po-surveyor-name-input {
    min-height: 32px;
    border-radius: 8px;
    font-weight: 600;
}

.property-overview-main .report-overview-grid .po-hero .po-hero-actions {
    padding-top: 4px;
}

/* 16c. Map card: the stage matches the photo's corner radius; the orientation row is a hairline row. */
.property-overview-main .report-overview-grid .property-location-card--overview .property-location-map,
.property-overview-main .report-overview-grid .property-location-card--overview .property-location-empty {
    border-radius: 14px;
}

/* 16d. Condition Ratings: the pills breathe in their card. */
.property-overview-main .report-overview-grid > .po-rail > .po-condition {
    padding: 22px 24px;
}

.property-overview-main .report-overview-grid .po-rail .po-condition .condition-rating-summary-grid {
    gap: 12px;
}

.property-overview-main .report-overview-grid .po-rail .po-condition .condition-rating-summary-card {
    min-height: 96px;
    padding: 14px 8px;
    border-radius: 14px;
}

/* 16e. Rows, not boxes. One hairline-row primitive for every list on the page. */
.property-overview-main .report-overview-grid .po-property-summary-grid,
.property-overview-main .report-overview-grid .po-missing-data-grid,
.property-overview-main .report-overview-grid .po-desk-highlight-grid {
    display: grid;
    gap: 0 28px;
}

.property-overview-main .report-overview-grid .po-property-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.property-overview-main .report-overview-grid .po-desk-highlight-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.property-overview-main .report-overview-grid .po-missing-data-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.property-overview-main .report-overview-grid :is(.po-property-summary-item, .po-desk-highlight, .po-missing-data-item) {
    flex: none;
    min-width: 0;
    margin: 0;
    padding: 12px 0;
    border: 0;
    border-bottom: 1px solid var(--survai-border-soft);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.property-overview-main .report-overview-grid :is(.po-desk-highlight--warning, .po-missing-data-item--warning, .po-desk-highlight--review, .po-missing-data-item--review) {
    padding-left: 12px;
    background: transparent;
    border-color: var(--survai-border-soft);
    box-shadow: inset 3px 0 0 var(--po-amber);
}

.property-overview-main .report-overview-grid :is(.po-desk-highlight--review, .po-missing-data-item--review) {
    box-shadow: inset 3px 0 0 var(--po-blue);
}

/* Property summary: label left, value right, on one line. */
.property-overview-main .report-overview-grid .po-property-summary-item {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.property-overview-main .report-overview-grid .po-property-summary-item span {
    font-size: 0.72rem;
    letter-spacing: 0.06em;
}

.property-overview-main .report-overview-grid .po-property-summary-item strong {
    font-size: 0.9rem;
    font-weight: 650;
    text-align: right;
}

/* Desk study highlights: title and status on one line, the note under, detail folded. */
.property-overview-main .report-overview-grid .po-desk-highlight {
    gap: 6px;
    padding-top: 12px;
    padding-bottom: 12px;
}

.property-overview-main .report-overview-grid .po-desk-highlight h4 {
    font-size: 0.9rem;
    font-weight: 700;
}

.property-overview-main .report-overview-grid .po-desk-highlight > p {
    font-size: 0.82rem;
    line-height: 1.45;
    color: var(--survai-secondary-strong);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.property-overview-main .report-overview-grid .po-desk-highlight details {
    border: 0;
    padding: 0;
    margin: 0;
}

.property-overview-main .report-overview-grid .po-desk-highlight details summary {
    font-size: 0.74rem;
    font-weight: 700;
    color: var(--survai-blue);
}

.property-overview-main .report-overview-grid :is(.po-missing-data-item) strong {
    font-size: 0.88rem;
}

.property-overview-main .report-overview-grid :is(.po-missing-data-item) p {
    margin: 3px 0 0;
    font-size: 0.8rem;
    line-height: 1.45;
    color: var(--survai-secondary-strong);
}

/* Documents: quiet rows with the counts as small caps. */
.property-overview-main .report-overview-grid .po-doc-cats {
    gap: 0;
}

.property-overview-main .report-overview-grid .po-doc-cat {
    padding: 10px 0;
    border: 0;
    border-bottom: 1px solid var(--survai-border-soft);
    border-radius: 0;
    background: transparent;
}

.property-overview-main .report-overview-grid :is(.po-weather-disclaimer) {
    margin-top: auto;
    padding-top: 12px;
}

/* 16f2. The ratings head stacks left like every other head (16's centring is for one-line heads). */
.property-overview-main .report-overview-grid .po-condition .condition-ratings-panel__head {
    align-items: flex-start;
    text-align: left;
}

/* 16f3. Map card: address and attribution on one quiet line, the orientation row compact, so the
   side stack (and with it the hero row) stays close to the hero's natural height. */
.property-overview-main .report-overview-grid .property-location-card--overview .property-location-meta {
    margin-top: 8px;
    gap: 4px 12px;
    font-size: 0.74rem;
}

.property-overview-main .report-overview-grid .property-location-card--overview .property-location-meta span:first-child {
    font-size: 0.8rem;
}

.property-overview-main .report-overview-grid .property-location-card--overview .property-location-orientation {
    margin-top: 10px;
    padding-top: 10px;
}

.property-overview-main .report-overview-grid .property-location-orientation .output-orientation-facing {
    margin: 0;
    padding: 8px 10px;
    border-radius: 10px;
}

.property-overview-main .report-overview-grid .property-location-orientation .output-orientation-facing .save-state:empty {
    display: none;
}

/* 16f4. The job sheet in two columns: six rows of label-over-value that share the photo's height,
   every value on one line. */
.property-overview-main .report-overview-grid .po-hero .po-job-sheet {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 28px;
}

.property-overview-main .report-overview-grid .po-hero .po-job-sheet > div {
    padding: 10px 0 9px;
}

.property-overview-main .report-overview-grid .po-hero .po-job-sheet dd [data-po-detail="client_email"] {
    font-size: 0.86rem;
    word-break: normal;
    overflow-wrap: anywhere;
}

/* 16f5. KPI values fit their tile on one line; a date is a value, not a headline. */
/* 16h. Phone: the KPI cards two-up keep their card surface; the sheet is two columns of rows. */
@media (max-width: 720px) {
    .property-overview-main .report-overview-grid .po-hero .po-job-sheet {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0 20px;
    }

    /* Phone title row: the reference on its own line, the two actions a full-width pair under it. */
    .property-overview-main .report-overview-grid .po-hero .po-hero-top {
        align-items: stretch;
    }

    .property-overview-main .report-overview-grid .po-hero .po-hero-detail-actions {
        flex: 1 1 100%;
        display: flex;
        gap: 8px;
        margin-left: 0;
    }

    .property-overview-main .report-overview-grid .po-hero .po-hero-detail-actions > .btn,
    .property-overview-main .report-overview-grid .po-hero .po-hero-detail-actions > form {
        flex: 1 1 0;
        min-width: 0;
    }

    .property-overview-main .report-overview-grid .po-hero .po-hero-detail-actions > form > .btn {
        width: 100%;
        justify-content: center;
    }

    .property-overview-main .report-overview-grid .po-hero .po-hero-actions .btn {
        width: 100%;
        justify-content: center;
    }

    .property-overview-main .report-overview-grid .po-property-summary-grid,
    .property-overview-main .report-overview-grid .po-desk-highlight-grid,
    .property-overview-main .report-overview-grid .po-missing-data-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (min-width: 721px) and (max-width: 1180px) {
    .property-overview-main .report-overview-grid .po-missing-data-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* ==========================================================================
   Report overview Sprift layout (surveyor, 29 Sep 2026: "make it look like this as much as
   possible in respect of layout ... the property details section and the map layout where it is
   almost like a page background ... i want the screenshot to become the new survai property
   overview page" and "ensure all colouring is survai branded").

   The page is one section, .po-sprift (property_overview_sprift_render.php), bled to the edges of
   the main panel:
     BAND   navy strip under the workspace header: survey type and reference over the address, the
            key facts as icon + value, the actions (Regenerate desk study, Clone, Settings)
     LEFT   the details panel, white, in reading order: the photo pair · area 01 (the address with
            Edit, the facts, the survey; M73a, assets/css/property-overview-areas.css) · the uploader
            · area 02 (progress, ratings, missing details; M73b) · Key Details (planning, environment) · then every
            other card the overview had (desk study, legal, next steps, summary report, documents)
     RIGHT  the map as the page background: sticky under the header, the height of the viewport,
            branded tiles and pin, the layer legend floating along its bottom, zoom bottom right
   >= 1181px as above · <= 1180px one column: band, the map (fixed height), then the panel. Colours
   are tokens only; the band and map tokens (--survai-band-*, --survai-map-*) are defined with the
   brand tokens and redefined for dark mode, so nothing here needs a dark override.
   ========================================================================== */

.property-overview-main .report-overview-grid > .po-primary > .po-sprift {
    /* --po-sprift-header (the fixed workspace header's bottom edge), --po-sprift-pin (the same
       edge as a sticky offset), --po-sprift-band (the band's height) and --po-sprift-gap (the
       space between the header and this section) are measured by initPropertyOverviewShell in
       assets/js/app.js; the fallbacks hold until it runs. */
    order: -130;
    grid-column: 1 / -1;
    display: grid;
    gap: 0;
    min-width: 0;
    /* Edge to edge, as Sprift's map is (surveyor, 30 Sep 2026: "there's a large gap on the
       right-hand side"): the page's wrappers cap their children at 100%, which left the panel's
       right padding empty beside the map; the section's width takes both paddings back. */
    width: calc(100% + 2 * var(--app-main-padding, 36px));
    max-width: none;
    margin: calc(-1 * var(--po-sprift-gap, 0px)) calc(-1 * var(--app-main-padding, 36px)) 0;
}

/* The panel keeps document order: the page's older per-card order rules must not reorder it. */
.property-overview-main .report-overview-grid .po-sprift .po-sprift-left > * {
    order: 0;
}

/* Band: the workspace header's second row on this page (workflow_render_report_workspace_topbar
   takes it as topbar_row_html), in the place the stage buttons hold on the other pages. The
   actions only, from the left where the stage buttons sit; the address stays in the header's
   title row and the key facts under the property photo (surveyor, 30 Sep 2026). Neutral since
   3 Oct 2026: the header's own surface, charcoal text and outlined pills (the --survai-band-*
   tokens), so the row reads like the stage tabs it replaces. The buttons sit on the left, over the
   property photo (owner, 9 Oct 2026; on the right from 3 Oct), with the header row's padding. */
.report-workspace-header .po-sprift-band {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 8px 12px;
    min-height: 50px;
    /* The header row's own inline padding, so the first button starts where the title above does; 6px
       above and below keeps the row at the Report page menu row's 50px, so both headers end at the
       same line (surveyor, 4 Oct 2026). No padding below, as the menu row has none, so the words sit
       on the same line as its tabs (M126). */
    padding: 6px clamp(16px, 2vw, 30px) 0;
    border-top: 1px solid var(--survai-band-chip-border);
    background: var(--survai-band-bg);
    color: var(--survai-band-text);
}

:is(.property-overview-main .report-overview-grid .po-sprift, .report-workspace-header .po-sprift-band) .po-sprift-facts {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 20px;
    margin: 0;
    padding: 0;
    list-style: none;
}

:is(.property-overview-main .report-overview-grid .po-sprift, .report-workspace-header .po-sprift-band) .po-sprift-fact {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--survai-band-text);
    font-size: 0.95rem;
    font-weight: 650;
    line-height: 1.2;
    white-space: nowrap;
}

:is(.property-overview-main .report-overview-grid .po-sprift, .report-workspace-header .po-sprift-band) .po-sprift-fact__icon {
    display: inline-flex;
    color: var(--survai-band-icon);
}

:is(.property-overview-main .report-overview-grid .po-sprift, .report-workspace-header .po-sprift-band) .po-icon {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

.report-workspace-header .po-sprift-band__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 2px;
}

.report-workspace-header .po-sprift-band__actions form,
.report-workspace-header .po-sprift-band__actions .po-hero-street-view-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0;
}

.report-workspace-header .po-sprift-band__actions .po-desk-study-regenerate-status {
    flex: 1 1 100%;
    margin: 0;
    font-size: 0.72rem;
    text-align: left;
}

/* Words, not pills, like the Report pages in output.php's banner (M126, owner, 19 Oct 2026); the
   header's own restatement (.workspace-topbar.report-workspace-header) carries the rest. */
.report-workspace-header .po-sprift-band__action,
.report-workspace-header .po-sprift-band__actions .po-desk-study-regenerate {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 38px;
    padding: 0 11px;
    border: 0;
    border-radius: 8px 8px 0 0;
    background: transparent;
    color: var(--survai-text-secondary);
    box-shadow: none;
    font: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
}

.report-workspace-header .po-sprift-band__action:hover,
.report-workspace-header .po-sprift-band__action:focus-visible,
.report-workspace-header .po-sprift-band__actions .po-desk-study-regenerate:hover,
.report-workspace-header .po-sprift-band__actions .po-desk-study-regenerate:focus-visible {
    background: var(--survai-neutral-hover);
    color: var(--survai-text);
}

/* The menu row's phone inset (.report-workspace-nav.workspace-stage-nav, 899px and under), so the
   first word starts where the Report page's first tab does (M126). */
@media (max-width: 899px) {
    .report-workspace-header .po-sprift-band {
        padding: 6px 10px 0;
    }
}

/* Body: the panel and the map */
.property-overview-main .report-overview-grid .po-sprift .po-sprift-body {
    display: grid;
    grid-template-columns: minmax(400px, 38%) minmax(0, 1fr);
    align-items: start;
    min-width: 0;
}

.property-overview-main .report-overview-grid .po-sprift .po-sprift-left {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
    padding: 20px 22px 36px var(--app-main-padding, 36px);
    border-right: 1px solid var(--survai-border);
    background: var(--survai-card);
}

.property-overview-main .report-overview-grid .po-sprift .po-sprift-right {
    position: sticky;
    top: calc(var(--po-sprift-pin, 142px) + var(--po-sprift-band, 0px));
    height: calc(100vh - var(--po-sprift-header, 142px) - var(--po-sprift-band, 0px));
    min-width: 0;
}

/* Photos: the cover (or Street View) and the aerial still, side by side */
.property-overview-main .report-overview-grid .po-sprift .po-sprift-photos {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    min-width: 0;
}

.property-overview-main .report-overview-grid .po-sprift .po-sprift-photos--pair {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.property-overview-main .report-overview-grid .po-sprift .po-sprift-photo {
    position: relative;
    min-width: 0;
    margin: 0;
    aspect-ratio: 4 / 3;
    border-radius: 12px;
    overflow: hidden;
    background: var(--survai-ink-surface);
}

.property-overview-main .report-overview-grid .po-sprift .po-sprift-photos:not(.po-sprift-photos--pair) .po-sprift-photo {
    aspect-ratio: 16 / 9;
}

.property-overview-main .report-overview-grid .po-sprift .po-hero-media {
    width: 100%;
    max-width: 100%;
    height: 100%;
    margin: 0;
    aspect-ratio: auto;
    border-radius: 0;
}

.property-overview-main .report-overview-grid .po-sprift .po-sprift-aerial-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.property-overview-main .report-overview-grid .po-sprift .po-hero-source-label {
    background: var(--survai-band-bg);
    color: var(--survai-band-text);
}

.property-overview-main .report-overview-grid .po-sprift .po-sprift-photos__notes {
    grid-column: 1 / -1;
    display: grid;
    gap: 4px;
    min-width: 0;
}

.property-overview-main .report-overview-grid .po-sprift .po-sprift-photos__notes:empty {
    display: none;
}

.property-overview-main .report-overview-grid .po-sprift .po-sprift-photos__notes .po-hero-attribution,
.property-overview-main .report-overview-grid .po-sprift .po-sprift-photos__notes .po-hero-warning,
.property-overview-main .report-overview-grid .po-sprift .po-sprift-photos__notes .po-hero-admin-status {
    margin: 0;
    padding: 0;
    font-size: 0.72rem;
    line-height: 1.4;
}

/* Title: the address with Edit beside it, the facts in one line beneath */
.property-overview-main .report-overview-grid .po-sprift .po-sprift-title {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 4px;
}

.property-overview-main .report-overview-grid .po-sprift .po-sprift-title__copy {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.property-overview-main .report-overview-grid .po-sprift .po-sprift-title__address {
    margin: 0;
    color: var(--survai-text-strong);
    font-size: 1.15rem;
    font-weight: 750;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.property-overview-main .report-overview-grid .po-sprift .po-sprift-facts--line {
    gap: 4px 0;
}

.property-overview-main .report-overview-grid .po-sprift .po-sprift-facts--line .po-sprift-fact {
    color: var(--survai-text-secondary);
    font-size: 0.9rem;
    white-space: normal;
}

.property-overview-main .report-overview-grid .po-sprift .po-sprift-facts--line .po-sprift-fact + .po-sprift-fact::before {
    content: "";
    display: inline-block;
    width: 5px;
    height: 5px;
    margin: 0 10px;
    border-radius: 1px;
    background: var(--survai-muted-cool);
}

.property-overview-main .report-overview-grid .po-sprift .po-sprift-edit {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 7px;
    min-height: 38px;
    padding: 0 16px;
    border: 1px solid var(--survai-band-chip-border);
    border-radius: 999px;
    background: var(--survai-band-chip-bg);
    color: var(--survai-band-text);
    font: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
}

/* Hover and focus take the neutral hover wash (the band's chip hover tokens); the keyboard
   focus also draws a ring outside the pill. */
.property-overview-main .report-overview-grid .po-sprift .po-sprift-edit:hover,
.property-overview-main .report-overview-grid .po-sprift .po-sprift-edit:focus-visible {
    border-color: var(--survai-band-chip-hover-border);
    background: var(--survai-band-chip-hover-bg);
}

.property-overview-main .report-overview-grid .po-sprift .po-sprift-edit:focus-visible {
    outline: 2px solid var(--survai-blue);
    outline-offset: 2px;
}

/* The rest of the overview's cards, stacked in the panel */
.property-overview-main .report-overview-grid .po-sprift .po-sprift-left > .sai-report-card {
    width: 100%;
    min-width: 0;
}

/* Cards lay out for the panel's own width (surveyor, 30 Sep 2026: "all of the cards are poorly
   collapsed and are like really elongated"). The panel is 38% of the page on desktop (about
   500–680px) and the full width below 1181px; the older dashboard rules placed the split's cards
   into the page's twelve-column grid (grid-column: 1 / 7, 7 / -1 …), which inside the panel
   became six implicit tracks and a 50px-wide legal card with its text one letter a line, and the
   Condition Ratings kept five columns whatever the width. The panel is a size container: one
   column of cards by default, two only when the panel itself is wide. */
.property-overview-main .report-overview-grid .po-sprift .po-sprift-left {
    container: po-panel / inline-size;
}

.property-overview-main .report-overview-grid .po-sprift .po-sprift-left .po-missing-data-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

/* The dashboard's tablet rules span tiles across its own tracks (grid-column: span 2); in an
   auto-fit grid a span makes phantom empty columns. Every tile takes one cell. */
.property-overview-main .report-overview-grid .po-sprift .po-sprift-left .po-missing-data-grid > *,
.property-overview-main .report-overview-grid .po-sprift .po-sprift-left .condition-rating-summary-grid > * {
    grid-column: auto;
}

/* Condition Ratings: tiles that wrap to the width and stay compact, never five slivers */
.property-overview-main .report-overview-grid .po-sprift .po-sprift-left .condition-rating-summary-grid {
    grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
    gap: 10px;
}

.property-overview-main .report-overview-grid .po-sprift .po-sprift-left .condition-rating-summary-card {
    min-height: 0;
    gap: 8px;
    padding: 14px 8px 16px;
    border-radius: 14px;
    box-shadow: none;
}

.property-overview-main .report-overview-grid .po-sprift .po-sprift-left .condition-rating-summary-badge {
    width: 44px;
    height: 44px;
    font-size: 0.9rem;
}

.property-overview-main .report-overview-grid .po-sprift .po-sprift-left .condition-rating-summary-label {
    font-size: 0.64rem;
}

.property-overview-main .report-overview-grid .po-sprift .po-sprift-left .condition-rating-summary-card strong {
    font-size: 1.7rem;
}

.property-overview-main .report-overview-grid .po-sprift .po-sprift-left .po-upload-column .report-site-media-unified-card {
    border-radius: 12px;
}

/* The map as the page background */
.property-overview-main .report-overview-grid .po-sprift .po-sprift-right .property-location-card {
    position: relative;
    display: block;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: var(--survai-map-land);
    box-shadow: none;
    overflow: hidden;
}

.property-overview-main .report-overview-grid .po-sprift .po-sprift-right .property-location-card__head,
.property-overview-main .report-overview-grid .po-sprift .po-sprift-right .property-location-meta {
    display: none;
}

.property-overview-main .report-overview-grid .po-sprift .property-location-map[data-property-location-fluid] {
    position: absolute;
    inset: 0;
    height: auto;
    min-height: 0;
    border: 0;
    border-radius: 0;
    /* The map's own land colour while it loads: light in both themes, as the map is. */
    background: var(--survai-map-land);
}

.property-overview-main .report-overview-grid .po-sprift .po-sprift-right .property-location-empty {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    gap: 8px;
    text-align: center;
}

.property-overview-main .report-overview-grid .po-sprift .property-location-card--overview .survai-map-base,
.property-overview-main .report-overview-grid .po-sprift .property-location-card--overview .property-location-static-fallback img {
    filter: var(--survai-map-tile-filter);
}

.property-overview-main .report-overview-grid .po-sprift .property-location-card--overview .property-pin__body {
    fill: var(--survai-map-pin);
}

.property-overview-main .report-overview-grid .po-sprift .property-location-card--overview .leaflet-bar {
    border: 1px solid var(--survai-border);
    border-radius: 12px;
    box-shadow: var(--survai-shadow);
    overflow: hidden;
}

.property-overview-main .report-overview-grid .po-sprift .property-location-card--overview .leaflet-bar a {
    width: 44px;
    height: 44px;
    border-bottom-color: var(--survai-border);
    background: var(--survai-card);
    color: var(--survai-text-strong);
    font-size: 1.3rem;
    line-height: 44px;
}

.property-overview-main .report-overview-grid .po-sprift .property-location-card--overview .leaflet-bar a:hover,
.property-overview-main .report-overview-grid .po-sprift .property-location-card--overview .leaflet-bar a:focus-visible {
    background: var(--survai-bg-soft);
    color: var(--survai-logo-blue);
}

.property-overview-main .report-overview-grid .po-sprift .property-location-card--overview .leaflet-bottom.leaflet-right .leaflet-control-zoom {
    margin: 0 14px 14px 0;
}

.property-overview-main .report-overview-grid .po-sprift .property-location-card--overview .leaflet-popup-content-wrapper,
.property-overview-main .report-overview-grid .po-sprift .property-location-card--overview .leaflet-popup-tip {
    background: var(--survai-card);
    color: var(--survai-text);
}

.property-overview-main .report-overview-grid .po-sprift .property-location-card--overview .leaflet-control-attribution {
    background: var(--survai-card);
    color: var(--survai-secondary);
    font-size: 0.64rem;
}

.property-overview-main .report-overview-grid .po-sprift .property-location-card--overview .leaflet-control-attribution a {
    color: var(--survai-logo-blue);
}

/* The page's global svg { max-width: 100% } would collapse Leaflet's polygon SVG. */
.property-overview-main .report-overview-grid .po-sprift .property-location-map .leaflet-pane > svg {
    max-width: none;
    max-height: none;
}

/* Floating over the map: the orientation compass chip top left (surveyor, 30 Sep 2026: "shrink
   it to a compass chip like sprift"), recentre bottom left, the legend along the bottom. The
   chip is a round map control like the recentre button; its arrow turns to the recorded
   front-facing bearing (--compass-deg, set on the button) and its badge carries the
   abbreviation. A click opens the shared selector beside it. */
.property-overview-main .report-overview-grid .po-sprift .po-sprift-right .property-location-orientation {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 500;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    max-width: min(360px, calc(100% - 28px));
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
}

.property-overview-main .report-overview-grid .po-sprift .po-sprift-right .property-location-compass {
    position: relative;
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    min-height: 0;
    padding: 0;
    border: 1px solid var(--survai-border);
    border-radius: 50%;
    background: var(--survai-card);
    color: var(--survai-navy-ink);
    box-shadow: var(--survai-shadow);
    cursor: pointer;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}

.property-overview-main .report-overview-grid .po-sprift .po-sprift-right .property-location-compass:hover,
.property-overview-main .report-overview-grid .po-sprift .po-sprift-right .property-location-compass:focus-visible,
.property-overview-main .report-overview-grid .po-sprift .po-sprift-right .property-location-orientation.is-open .property-location-compass {
    border-color: var(--survai-logo-blue);
    outline: none;
    box-shadow: 0 0 0 3px var(--survai-tint-dbeafe);
}

.property-overview-main .report-overview-grid .po-sprift .po-sprift-right .property-location-compass__rose {
    width: 26px;
    height: 26px;
    max-width: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.property-overview-main .report-overview-grid .po-sprift .po-sprift-right .property-location-compass__arrow {
    transform: rotate(var(--compass-deg, 0deg));
    transform-origin: 12px 12px;
    transition: transform 220ms ease;
}

.property-overview-main .report-overview-grid .po-sprift .po-sprift-right .property-location-compass__arrow-head {
    fill: var(--survai-logo-blue);
    stroke: var(--survai-logo-blue);
}

.property-overview-main .report-overview-grid .po-sprift .po-sprift-right .property-location-compass__arrow-tail {
    fill: var(--survai-card);
}

.property-overview-main .report-overview-grid .po-sprift .po-sprift-right .property-location-compass.is-unset {
    color: var(--survai-muted);
}

.property-overview-main .report-overview-grid .po-sprift .po-sprift-right .property-location-compass.is-unset .property-location-compass__arrow-head {
    fill: var(--survai-border-mid);
    stroke: var(--survai-border-mid);
}

.property-overview-main .report-overview-grid .po-sprift .po-sprift-right .property-location-compass__abbr {
    position: absolute;
    right: -5px;
    bottom: -5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 19px;
    height: 19px;
    padding: 0 4px;
    border: 2px solid var(--survai-card);
    border-radius: 999px;
    background: var(--survai-strong-surface);
    color: var(--survai-on-brand);
    font-size: 0.56rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    line-height: 1;
}

.property-overview-main .report-overview-grid .po-sprift .po-sprift-right .property-location-compass.is-unset .property-location-compass__abbr {
    border-color: var(--survai-border-mid);
    background: var(--survai-card);
    color: var(--survai-text);
}

/* The selector: hidden behind the chip, a card beside it while open */
.property-overview-main .report-overview-grid .po-sprift .po-sprift-right .property-location-orientation .output-orientation-facing {
    display: none;
    flex: 1 1 auto;
    min-width: 0;
    max-width: 300px;
    margin: 0;
    padding: 10px 12px;
    border: 1px solid var(--survai-border);
    border-radius: 12px;
    background: var(--survai-card);
    box-shadow: var(--survai-shadow);
}

.property-overview-main .report-overview-grid .po-sprift .po-sprift-right .property-location-orientation.is-open .output-orientation-facing {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
}

/* The label over a full-width selector (surveyor, 20 Oct 2026: on the phone the box ran out of the
   card and the sentences under it were cut off at its edge). Side by side and unwrappable, the
   label and selector were ~290px against the card's ~276px, and the grid's auto column grew to
   that width, pushing every line under it past the card too. */
.property-overview-main .report-overview-grid .po-sprift .po-sprift-right .property-location-orientation .output-orientation-facing label {
    display: grid;
    gap: 4px;
    min-width: 0;
    white-space: normal;
}

.property-overview-main .report-overview-grid .po-sprift .po-sprift-right .property-location-orientation .output-orientation-facing select {
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

.property-overview-main .report-overview-grid .po-sprift .po-sprift-right .property-location-orientation .output-orientation-facing > .form-note {
    display: none;
}

.property-overview-main .report-overview-grid .po-sprift .po-sprift-right .property-location-orientation.is-open .output-orientation-facing > .output-orientation-facing__derived {
    display: block;
    font-size: 0.72rem;
    line-height: 1.35;
}

.property-overview-main .report-overview-grid .po-sprift .po-sprift-right .property-location-orientation.is-open .output-orientation-facing > .output-orientation-facing__derived[hidden] {
    display: none;
}

/* The chip's automatic state (orientation_detection_service.php): a dashed ring says the map
   set this and the surveyor has not confirmed it yet; the arrow turns while a reading runs. */
.property-overview-main .report-overview-grid .po-sprift .po-sprift-right .property-location-compass.is-auto {
    outline: 2px dashed var(--survai-logo-blue);
    outline-offset: 2px;
}

@keyframes po-compass-searching {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.property-overview-main .report-overview-grid .po-sprift .po-sprift-right .property-location-compass.is-detecting .property-location-compass__arrow {
    animation: po-compass-searching 1.6s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
    .property-overview-main .report-overview-grid .po-sprift .po-sprift-right .property-location-compass.is-detecting .property-location-compass__arrow {
        animation: none;
        opacity: 0.45;
    }
}

/* What the map read, under the selector: one sentence, its reasons, and the actions it allows. */
.property-overview-main .report-overview-grid .po-sprift .po-sprift-right .property-location-orientation .output-orientation-detection {
    display: grid;
    gap: 6px;
    margin-top: 2px;
    padding-top: 8px;
    border-top: 1px solid var(--survai-border-soft);
    font-size: 0.74rem;
    line-height: 1.4;
    color: var(--survai-secondary-slate);
}

.property-overview-main .report-overview-grid .po-sprift .po-sprift-right .property-location-orientation .output-orientation-detection.is-applied .output-orientation-detection__summary,
.property-overview-main .report-overview-grid .po-sprift .po-sprift-right .property-location-orientation .output-orientation-detection.is-confirmed .output-orientation-detection__summary {
    color: var(--survai-text);
    font-weight: 600;
}

.property-overview-main .report-overview-grid .po-sprift .po-sprift-right .property-location-orientation .output-orientation-detection__notes {
    margin: 0;
    padding-left: 16px;
    font-size: 0.7rem;
}

.property-overview-main .report-overview-grid .po-sprift .po-sprift-right .property-location-orientation .output-orientation-detection__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.property-overview-main .report-overview-grid .po-sprift .po-sprift-right .property-location-orientation .output-orientation-detection__actions .btn {
    min-height: 32px;
    padding: 4px 12px;
    font-size: 0.74rem;
}

.property-overview-main .report-overview-grid .po-sprift .po-sprift-right .property-location-orientation .output-orientation-detection__actions .btn[hidden] {
    display: none;
}

.property-overview-main .report-overview-grid .po-sprift .po-sprift-right .property-location-orientation .output-orientation-detection__use {
    gap: 0;
}

.property-overview-main .report-overview-grid .po-sprift .property-location-fab {
    position: absolute;
    left: 14px;
    bottom: 14px;
    z-index: 500;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid var(--survai-border);
    border-radius: 50%;
    background: var(--survai-card);
    color: var(--survai-logo-blue);
    box-shadow: var(--survai-shadow);
    cursor: pointer;
}

.property-overview-main .report-overview-grid .po-sprift .property-location-fab svg {
    width: 20px;
    height: 20px;
}

/* The layer legend along the map's bottom edge wears the report tools dock's skin (surveyor,
   30 Sep 2026: "formatted like the toolbar on the output page, the same colours for the bar and
   the glyphs, fully responsive"): a white pill, one 44px circular blue icon button per layer,
   the name as a tooltip. A layer that is switched on fills its circle blue and shows its map
   colour as a swatch at the circle's foot; the property's own areas keep the red flag at the top.
   The pill scrolls sideways when the map is narrower than its buttons. */
/* The pill spans the map between the recentre button (left) and the zoom control (right), so
   every glyph is in view (surveyor, 30 Sep 2026: "span the map so that we can see more of the
   glyphs"); the buttons share its width. */
.property-overview-main .report-overview-grid .po-sprift .property-location-legend {
    position: absolute;
    left: 68px;
    right: 68px;
    bottom: 14px;
    z-index: 500;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.property-overview-main .report-overview-grid .po-sprift .property-location-legend__items {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
    width: 100%;
    max-width: 100%;
    min-height: 60px;
    padding: 0 12px;
    border: 1px solid var(--survai-border);
    border-radius: 999px;
    background: var(--survai-card);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.18);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
}

.property-overview-main .report-overview-grid .po-sprift .property-location-legend__items::-webkit-scrollbar {
    display: none;
}

.property-overview-main .report-overview-grid .po-sprift .property-location-legend__item {
    position: relative;
    display: inline-flex;
    /* Share the pill's width; never below a 52px tap target (then the pill scrolls). */
    flex: 1 1 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    width: auto;
    min-width: 52px;
    min-height: 60px;
    padding: 6px;
    border-radius: 999px;
    color: var(--survai-blue);
    text-align: center;
    cursor: pointer;
}

.property-overview-main .report-overview-grid .po-sprift .property-location-legend__item input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    opacity: 0;
}

.property-overview-main .report-overview-grid .po-sprift .property-location-legend__item:hover .property-location-legend__icon,
.property-overview-main .report-overview-grid .po-sprift .property-location-legend__item:has(input:focus-visible) .property-location-legend__icon {
    background: var(--survai-tint-eef4ff);
    box-shadow: 0 8px 20px rgba(27, 90, 249, 0.25);
    transform: translateY(-1px);
}

/* A keyboard focus shows as a ring, not only the hover tint. */
.property-overview-main .report-overview-grid .po-sprift .property-location-legend__item:has(input:focus-visible) {
    outline: 2px solid var(--survai-logo-blue);
    outline-offset: 1px;
}

.property-overview-main .report-overview-grid .po-sprift .property-location-legend__item.is-empty {
    color: var(--survai-border-mid);
    cursor: default;
}

.property-overview-main .report-overview-grid .po-sprift .property-location-legend__item.is-empty:hover .property-location-legend__icon {
    background: var(--survai-card);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.16);
    transform: none;
}

.property-overview-main .report-overview-grid .po-sprift .property-location-legend__icon {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 2px solid currentColor;
    border-radius: 999px;
    background: var(--survai-card);
    color: inherit;
    font-style: normal;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.16);
    transition: background 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.property-overview-main .report-overview-grid .po-sprift .property-location-legend__icon svg {
    width: 24px;
    height: 24px;
    color: inherit;
}

/* The name is the tooltip (the item's title), as on the tools dock. */
.property-overview-main .report-overview-grid .po-sprift .property-location-legend__label {
    display: none;
}

/* Switched on: a filled blue circle with a white glyph (--survai-on-brand, white in both
   themes, as on the dock), the layer's map colour as a swatch. */
.property-overview-main .report-overview-grid .po-sprift .property-location-legend__item:has(input:checked) .property-location-legend__icon {
    background: var(--survai-blue);
    color: var(--survai-on-brand);
}

.property-overview-main .report-overview-grid .po-sprift .property-location-legend__item:has(input:checked) .property-location-legend__icon::after {
    content: "";
    position: absolute;
    right: -4px;
    bottom: -4px;
    width: 12px;
    height: 12px;
    border: 2px solid var(--survai-card);
    border-radius: 50%;
    background: var(--survai-legend-swatch, var(--survai-blue));
}

.property-overview-main .report-overview-grid .po-sprift .property-location-legend__item--flood { --survai-legend-swatch: var(--survai-map-layer-flood); }
.property-overview-main .report-overview-grid .po-sprift .property-location-legend__item--title-extent { --survai-legend-swatch: var(--survai-map-layer-title-extent); }
.property-overview-main .report-overview-grid .po-sprift .property-location-legend__item--title-boundaries { --survai-legend-swatch: var(--survai-map-layer-title-boundaries); }
.property-overview-main .report-overview-grid .po-sprift .property-location-legend__item--conservation-area { --survai-legend-swatch: var(--survai-map-layer-conservation-area); }
.property-overview-main .report-overview-grid .po-sprift .property-location-legend__item--article-4 { --survai-legend-swatch: var(--survai-map-layer-article-4); }
.property-overview-main .report-overview-grid .po-sprift .property-location-legend__item--tree-preservation-zone { --survai-legend-swatch: var(--survai-map-layer-tree-preservation-zone); }
.property-overview-main .report-overview-grid .po-sprift .property-location-legend__item--green-belt { --survai-legend-swatch: var(--survai-map-layer-green-belt); }
.property-overview-main .report-overview-grid .po-sprift .property-location-legend__item--aonb { --survai-legend-swatch: var(--survai-map-layer-aonb); }
.property-overview-main .report-overview-grid .po-sprift .property-location-legend__item--frontage { --survai-legend-swatch: var(--survai-map-layer-frontage); }

/* On the circle itself (the buttons are wider than their circles now that they share the pill). */
.property-overview-main .report-overview-grid .po-sprift .property-location-legend__item.is-at-property .property-location-legend__icon::before {
    content: "";
    position: absolute;
    top: -4px;
    right: -4px;
    width: 12px;
    height: 12px;
    border: 2px solid var(--survai-card);
    border-radius: 50%;
    background: var(--survai-red);
}

.property-overview-main .report-overview-grid .po-sprift .property-location-legend__status {
    margin: 0;
    max-width: 100%;
    padding: 3px 12px;
    border-radius: 999px;
    background: var(--survai-card);
    color: var(--survai-muted);
    font-size: 0.62rem;
    line-height: 1.35;
    text-align: center;
    box-shadow: var(--survai-shadow);
}

/* HM Land Registry's licence for the Boundaries layer: the status line's look, several lines long. */
.property-overview-main .report-overview-grid .po-sprift .property-location-legend__status--licence {
    border-radius: 10px;
}

.property-overview-main .report-overview-grid .po-sprift .property-location-legend__status[hidden] {
    display: none;
}

/* Narrow desktop and tablet: one column, the map first under the band */
@media (max-width: 1180px) {
    .property-overview-main .report-overview-grid .po-sprift .po-sprift-body {
        grid-template-columns: minmax(0, 1fr);
    }

    .property-overview-main .report-overview-grid .po-sprift .po-sprift-right {
        position: static;
        order: -1;
        height: 440px;
    }

    .property-overview-main .report-overview-grid .po-sprift .po-sprift-left {
        padding: 18px var(--app-main-padding, 24px) 32px;
        border-right: 0;
    }
}

/* Phone */
@media (max-width: 720px) {
    /* The facts are in the panel below; the header row keeps only the actions. */
    .report-workspace-header .po-sprift-band {
        grid-template-columns: minmax(0, 1fr);
    }

    .report-workspace-header .po-sprift-band__actions {
        justify-content: flex-start;
    }

    .property-overview-main .report-overview-grid .po-sprift .po-sprift-right {
        height: 360px;
    }

    .property-overview-main .report-overview-grid .po-sprift .po-sprift-title {
        flex-wrap: wrap;
    }

    /* Phones: the pill takes the map's width; the recentre button and the zoom control rise
       above it. */
    .property-overview-main .report-overview-grid .po-sprift .property-location-legend {
        left: 10px;
        right: 10px;
    }

    .property-overview-main .report-overview-grid .po-sprift .property-location-legend__items {
        gap: 2px;
        padding: 0 8px;
    }

    .property-overview-main .report-overview-grid .po-sprift .property-location-fab {
        bottom: 90px;
    }

    .property-overview-main .report-overview-grid .po-sprift .property-location-card--overview .leaflet-bottom.leaflet-right .leaflet-control-zoom {
        margin: 0 10px 90px 0;
    }

    .property-overview-main .report-overview-grid .po-sprift .property-location-legend__status {
        display: none;
    }

    .property-overview-main .report-overview-grid .po-sprift .po-sprift-right .property-location-orientation {
        max-width: calc(100% - 28px);
    }
}

/* ==========================================================================
   Dashboard layout (surveyor, 28 Sep 2026: "fix the layout and ensure it works in all views
   such as desktop and mobile view and tablet ... a premium dashboard using the existing colours")

   One 12-column grid per section, cards placed by width class (.ops-span-4/5/7), rows sized by
   content: the script-driven masonry (8px rows, spans measured after paint) left holes and
   mismatched heights, and the KPI strip was a horizontal scroller hidden below 920px. Widths:
     >= 1100px  as classed (4/4/4, 5/7, 7/5 ...); Compact 3 across; Ultra 4 across
     768-1099   two columns; wide cards (table, ratings, map) full width
     <= 767     one column; KPI tiles two across
   Colours are the existing tokens; only the layout changes.
   ========================================================================== */
body.ops-dashboard-page .main-panel.ops-dashboard {
    display: grid;
    align-content: start;
    gap: 22px;
}

body.ops-dashboard-page .main-panel.ops-dashboard > .alert {
    margin: 0;
}

/* KPI strip: a wrapping grid of tiles, never a scroller, on every width. */
body.ops-dashboard-page .main-panel.ops-dashboard > section.ops-kpi-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin: 0;
    padding: 0;
    overflow: visible;
    scroll-snap-type: none;
}

body.ops-dashboard-page .ops-kpi-grid > .ops-kpi-card {
    flex: none;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    align-content: center;
    gap: 14px;
    min-height: 104px !important;
    padding: 16px 18px !important;
}

body.ops-dashboard-page .ops-kpi-grid > .ops-kpi-card .ops-kpi-card__value {
    font-size: clamp(1.9rem, 2.2vw, 2.6rem) !important;
    line-height: 1;
    white-space: nowrap;
}

/* A worded value ("3.0 hrs", "Not available") stacks above its label at a reading size. */
body.ops-dashboard-page .ops-kpi-grid > .ops-kpi-card--text {
    grid-template-columns: minmax(0, 1fr);
    align-content: center;
    gap: 8px;
}

body.ops-dashboard-page .ops-kpi-grid > .ops-kpi-card--text .ops-kpi-card__value {
    font-size: 1.1rem !important;
    letter-spacing: -0.01em !important;
    line-height: 1.2;
    white-space: normal;
    overflow-wrap: normal;
    word-break: keep-all;
}

body.ops-dashboard-page .ops-kpi-grid > .ops-kpi-card .ops-kpi-card__body {
    display: grid;
    gap: 6px;
    min-width: 0;
}

body.ops-dashboard-page .ops-kpi-grid > .ops-kpi-card .ops-kpi-card__label {
    font-size: 0.8rem;
    line-height: 1.25;
}

/* Card sections: a 12-column grid, rows as tall as their content, cards level with each other. */
body.ops-dashboard-page .ops-dashboard .ops-grid,
body.ops-dashboard-page .ops-dashboard .ops-grid--primary,
body.ops-dashboard-page .ops-dashboard .ops-grid--secondary,
body.ops-dashboard-page .ops-dashboard .ops-grid--secondary:nth-of-type(4),
body.ops-dashboard-page .ops-dashboard .ops-grid--secondary:nth-of-type(5) {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    grid-auto-rows: auto;
    grid-auto-flow: row dense;
    align-items: stretch;
    gap: 22px;
    margin: 0;
}

body.ops-dashboard-page .ops-dashboard .ops-grid > .ops-card {
    grid-column: span 6;
    grid-row: auto !important;
    min-width: 0;
    margin: 0;
}

body.ops-dashboard-page .ops-dashboard .ops-grid > .ops-span-4 { grid-column: span 4; }
body.ops-dashboard-page .ops-dashboard .ops-grid > .ops-span-5 { grid-column: span 5; }
body.ops-dashboard-page .ops-dashboard .ops-grid > .ops-span-7 { grid-column: span 7; }

/* Card width setting (Customize): Compact three across, Ultra four across. */
body.ops-dashboard-page .ops-dashboard.is-cards-compact .ops-grid > .ops-card { grid-column: span 4; }
body.ops-dashboard-page .ops-dashboard.is-cards-ultra .ops-grid > .ops-card { grid-column: span 3; }

/* Card anatomy: head, then one block of content, the link never crowding the title. */
body.ops-dashboard-page .ops-dashboard .ops-grid > .ops-card > .ops-card-head {
    flex-wrap: wrap;
    align-items: flex-start;
    row-gap: 6px;
}

body.ops-dashboard-page .ops-dashboard .ops-grid > .ops-card > .ops-card-head h2 {
    font-size: 1.05rem;
    line-height: 1.25;
}

body.ops-dashboard-page .ops-dashboard .ops-grid > .ops-card > .ops-card-head .ops-card-link {
    white-space: nowrap;
}

body.ops-dashboard-page .ops-dashboard .ops-grid > .ops-card > .ops-empty {
    margin: 14px 0 0;
    color: var(--survai-secondary-slate);
}

/* Condition ratings inside a dashboard card: the pills wrap to the card, not a fixed five. */
body.ops-dashboard-page .ops-dashboard .ops-grid > .ops-card.condition-ratings-panel {
    gap: 14px;
    border-radius: var(--card-radius) !important;
}

body.ops-dashboard-page .ops-dashboard .ops-grid > .ops-card .condition-ratings-panel__head h2 {
    font-size: 1.05rem;
}

body.ops-dashboard-page .ops-dashboard .ops-grid > .ops-card .condition-ratings-panel__head p {
    font-size: 0.85rem;
    color: var(--survai-secondary-slate);
}

body.ops-dashboard-page .ops-dashboard .ops-grid > .ops-card .condition-rating-summary-grid {
    grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
    gap: 10px;
}

body.ops-dashboard-page .ops-dashboard .ops-grid > .ops-card .condition-rating-summary-card {
    min-height: 0;
    gap: 8px;
    padding: 14px 8px 12px;
    box-shadow: none;
}

body.ops-dashboard-page .ops-dashboard .ops-grid > .ops-card .condition-rating-summary-badge {
    width: 44px;
    height: 44px;
    font-size: 0.85rem;
}

body.ops-dashboard-page .ops-dashboard .ops-grid > .ops-card .condition-rating-summary-label {
    font-size: 0.62rem;
    line-height: 1.15;
}

body.ops-dashboard-page .ops-dashboard .ops-grid > .ops-card .condition-rating-summary-card strong {
    font-size: 1.6rem;
}

/* The team table scrolls sideways inside its card rather than being clipped. */
body.ops-dashboard-page .ops-dashboard .ops-grid > .ops-card > .ops-team-table {
    max-width: 100%;
    overflow-x: auto;
}

/* Tablet: two columns; the wide cards take the row. */
@media (max-width: 1099px) {
    body.ops-dashboard-page .ops-dashboard .ops-grid > .ops-card,
    body.ops-dashboard-page .ops-dashboard.is-cards-compact .ops-grid > .ops-card,
    body.ops-dashboard-page .ops-dashboard.is-cards-ultra .ops-grid > .ops-card {
        grid-column: span 6;
    }

    /* The ratings panel keeps its five pills on one row; the table and the map fit a half. */
    body.ops-dashboard-page .ops-dashboard .ops-grid > .ops-card.condition-ratings-panel,
    body.ops-dashboard-page .ops-dashboard .ops-grid > .ops-card:nth-child(3):last-child {
        grid-column: span 12;
    }

    body.ops-dashboard-page .main-panel.ops-dashboard > section.ops-kpi-grid {
        grid-template-columns: repeat(auto-fill, minmax(176px, 1fr));
        gap: 12px;
    }

    /* The team table fits a half-width card: five columns, no forced minimum width. */
    body.ops-dashboard-page .ops-dashboard .ops-grid > .ops-card > .ops-team-table .ops-team-row {
        grid-template-columns: minmax(96px, 1.4fr) repeat(4, minmax(46px, 0.6fr));
        gap: 6px;
        min-width: 0;
        font-size: 0.72rem;
    }
}

/* Phone: one column, KPI tiles two across, tighter card padding. */
@media (max-width: 767px) {
    body.ops-dashboard-page .main-panel.ops-dashboard {
        gap: 16px;
    }

    body.ops-dashboard-page .ops-dashboard .ops-grid {
        gap: 16px;
    }

    body.ops-dashboard-page .ops-dashboard .ops-grid > .ops-card,
    body.ops-dashboard-page .ops-dashboard .ops-grid > .ops-card.ops-span-wide,
    body.ops-dashboard-page .ops-dashboard.is-cards-compact .ops-grid > .ops-card,
    body.ops-dashboard-page .ops-dashboard.is-cards-ultra .ops-grid > .ops-card {
        grid-column: span 12;
    }

    body.ops-dashboard-page .main-panel.ops-dashboard > section.ops-kpi-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    body.ops-dashboard-page .ops-kpi-grid > .ops-kpi-card {
        grid-template-columns: minmax(0, 1fr);
        justify-items: start;
        gap: 6px;
        padding: 14px 14px 12px !important;
        text-align: left;
    }

    body.ops-dashboard-page .ops-kpi-grid > .ops-kpi-card .ops-kpi-card__value {
        font-size: 1.6rem !important;
    }

    body.ops-dashboard-page .ops-kpi-grid > .ops-kpi-card--text .ops-kpi-card__value {
        font-size: 1rem !important;
    }

    body.ops-dashboard-page .ops-kpi-grid > .ops-kpi-card .ops-kpi-card__label {
        font-size: 0.74rem;
    }
}

/* ==========================================================
   Final Check (final-check.php; docs/final-check/FINAL_CHECK.md)
   The user's "Final Check" board, 23 Sep 2026. Everything is scoped under
   .final-check-page. The global button/input/anchor/label rules above carry
   !important (pill radius, blue links, 100% wide 46px inputs, muted label
   spans), so the few properties they force are re-set here with !important.
   Mobile first: one column under 900px, 44px tap targets, no sideways scroll.
   ========================================================== */
.final-check-page {
    --fc-ink: #14181C;
    --fc-text: #2B3138;
    --fc-body: #3E464E;
    --fc-muted: #5A6570;
    --fc-faint: #8A8578;
    --fc-line: #E2E0D9;
    --fc-line-strong: #D6D2C6;
    --fc-surface: #F4F3EF;
    --fc-accent: #0E5C52;
    --fc-accent-deep: #0A413A;
    box-sizing: border-box;
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 20px 0 32px;
    color: var(--fc-ink);
    -webkit-font-smoothing: antialiased;
}

.final-check-page *,
.final-check-page *::before,
.final-check-page *::after {
    box-sizing: border-box;
}

.final-check-page [hidden] {
    display: none !important;
}

.final-check-page del {
    background: #EBA9A9;
    color: #5C1213;
    text-decoration: line-through;
    text-decoration-thickness: 1px;
    border-radius: 3px;
    padding: 0 2px;
}

.final-check-page ins {
    background: #9BD3C3;
    color: #08332D;
    text-decoration: none;
    border-radius: 3px;
    padding: 0 2px;
}

/* ---- head ---- */
.final-check-head {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.final-check-crumbs {
    font-size: 12px;
    letter-spacing: 0.02em;
    color: #7C8894;
    overflow-wrap: anywhere;
}

/* :not(.btn) lifts this above the global a:not(.btn) blue link rule. */
.final-check-page .final-check-crumbs a:not(.btn) {
    color: #7C8894 !important;
    text-decoration: none;
}

.final-check-page .final-check-crumbs a:not(.btn):hover {
    color: var(--fc-accent) !important;
    text-decoration: underline;
}

.final-check-page .final-check-title {
    margin: 8px 0 0;
    font-size: 32px !important;
    font-weight: 600;
    letter-spacing: -0.01em !important;
    line-height: 1.1;
    color: var(--fc-ink) !important;
}

.final-check-page .final-check-lead {
    margin: 8px 0 0;
    max-width: 620px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--fc-muted) !important;
}

.final-check-head__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.final-check-head__must {
    font-size: 13px;
    font-weight: 600;
    color: #9E2A2B;
}

/* ---- buttons ---- */
.final-check-page .final-check-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    min-width: 44px;
    padding: 10px 16px;
    border: 1px solid var(--fc-line-strong);
    border-radius: 999px !important;
    background: #FFFFFF !important;
    color: var(--fc-text) !important;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none !important;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: none;
    transition: background 150ms ease, border-color 150ms ease;
}

.final-check-page .final-check-btn:focus-visible,
.final-check-page .final-check-chip:focus-visible,
.final-check-page .final-check-reason:focus-visible,
.final-check-page .final-check-option:focus-within {
    outline: 2px solid var(--fc-accent);
    outline-offset: 2px;
}

.final-check-page .final-check-btn:disabled {
    opacity: 0.6;
    cursor: progress;
}

.final-check-page .final-check-btn--primary,
.final-check-page .final-check-head__actions a.final-check-btn--primary {
    border-color: var(--fc-accent);
    background: var(--fc-accent) !important;
    color: #FFFFFF !important;
    padding-inline: 20px;
}

.final-check-page .final-check-btn--primary:hover,
.final-check-page .final-check-head__actions a.final-check-btn--primary:hover {
    border-color: var(--fc-accent-deep);
    background: var(--fc-accent-deep) !important;
    color: #FFFFFF !important;
}

.final-check-page .final-check-btn--secondary {
    color: var(--fc-body) !important;
}

.final-check-page .final-check-btn--secondary:hover {
    border-color: #B9B5A9;
    background: #FBFAF7 !important;
}

.final-check-page .final-check-btn--quiet {
    border-color: transparent;
    background: transparent !important;
    color: #8A5A00 !important;
    padding-inline: 12px;
}

.final-check-page .final-check-btn--quiet:hover {
    background: #FBF4E6 !important;
}

.final-check-page .final-check-btn--small {
    font-size: 13px;
    padding: 9px 16px;
}

.final-check-page .final-check-btn--applied {
    border-color: #A9CCB8;
    color: #1C5C3B !important;
}

.final-check-page .final-check-btn--reported {
    border-color: #DCC58A;
    color: #6B4600 !important;
}

/* ---- layout ---- */
.final-check-workspace {
    margin-top: 20px;
}

.final-check-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.final-check-main {
    min-width: 0;
}

.final-check-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.final-check-page .final-check-chip {
    min-height: 44px;
    padding: 9px 15px;
    border: 1px solid var(--fc-line-strong);
    border-radius: 999px !important;
    background: #FFFFFF !important;
    color: var(--fc-body) !important;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.final-check-page .final-check-chip.is-active {
    border-color: var(--fc-ink);
    background: var(--fc-ink) !important;
    color: #FFFFFF !important;
}

.final-check-banner {
    margin-top: 14px;
    padding: 13px 16px;
    border: 1px solid #D3DDE4;
    border-radius: 10px;
    background: #EEF2F5;
    color: #40566B;
    font-size: 14px;
    line-height: 1.5;
}

.final-check-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 16px;
}

.final-check-empty,
.final-check-end {
    padding: 18px 20px;
    border: 1px dashed var(--fc-line-strong);
    border-radius: 12px;
    text-align: center;
    font-size: 13px;
    color: var(--fc-faint);
}

.final-check-empty[data-final-check-scanning] {
    border-style: solid;
    border-color: var(--fc-line);
    background: #FFFFFF;
    color: var(--fc-muted);
}

/* ---- card ---- */
.final-check-card {
    min-width: 0;
    padding: 18px 16px;
    border: 1px solid #DEDBD1;
    border-radius: 14px;
    background: #FFFFFF;
    box-shadow: 0 1px 2px rgba(20, 24, 28, 0.04);
}

.final-check-card.is-resolved {
    border-color: #E8E6DE;
    box-shadow: none;
    --fc-ink: var(--fc-body);
}

.final-check-card__head {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.final-check-card__heading {
    flex: 1 1 auto;
    min-width: 0;
}

.final-check-pill {
    flex-shrink: 0;
    padding: 6px 11px;
    border: 1px solid;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
    white-space: nowrap;
}

.final-check-pill--must {
    border-color: #E9CCCC;
    background: #FBEFEF;
    color: #9E2A2B;
}

.final-check-pill--advisory {
    border-color: #EAD9AF;
    background: #FBF4E6;
    color: #8A5A00;
}

.final-check-pill--polish {
    border-color: #D3DDE4;
    background: #EEF2F5;
    color: #40566B;
}

.final-check-card__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 9px;
    min-width: 0;
}

.final-check-card__category {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--fc-muted);
}

.final-check-card__sep {
    display: inline-block;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: #B9B5A9;
}

.final-check-card__rule {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px;
    color: var(--fc-faint);
    overflow-wrap: anywhere;
}

.final-check-card__where {
    font-size: 12px;
    color: var(--fc-muted);
    overflow-wrap: anywhere;
}

.final-check-page .final-check-card__title {
    margin: 7px 0 0;
    font-size: 19px !important;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: -0.005em !important;
    color: var(--fc-ink) !important;
    overflow-wrap: anywhere;
}

.final-check-page .final-check-card__why {
    margin: 12px 0 0;
    font-size: 14px;
    line-height: 1.6;
    color: var(--fc-body) !important;
}

/* ---- before / becomes ---- */
.final-check-compare {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
}

.final-check-compare__box {
    min-width: 0;
    padding: 13px 16px;
    border: 1px solid #E8E6DE;
    border-left: 3px solid #C4BFB0;
    border-radius: 8px;
    background: #FBFAF7;
}

.final-check-compare__box--after {
    border-color: #C7E0D9;
    border-left-color: var(--fc-accent);
    background: #F0F7F5;
}

.final-check-compare__label,
.final-check-eyebrow {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--fc-faint);
}

.final-check-compare__box--after .final-check-compare__label {
    color: var(--fc-accent);
}

.final-check-page .final-check-compare__text {
    margin: 7px 0 0;
    font-size: 15px;
    line-height: 1.6;
    color: var(--fc-text) !important;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.final-check-page .final-check-compare__box--after .final-check-compare__text {
    color: var(--fc-ink) !important;
}

.final-check-page .final-check-compare__text--empty {
    font-style: italic;
    color: var(--fc-muted) !important;
}

.final-check-page .final-check-compare__rating,
.final-check-page .final-check-compare__note {
    margin: 8px 0 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--fc-body) !important;
}

/* ---- options ---- */
.final-check-options {
    margin-top: 16px;
}

.final-check-options .final-check-eyebrow {
    font-size: 11px;
    letter-spacing: 0.08em;
    color: var(--fc-muted);
}

.final-check-options__list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 9px;
}

.final-check-page .final-check-option {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    min-height: 44px;
    padding: 13px 15px;
    border: 1px solid var(--fc-line);
    border-radius: 10px;
    background: #FFFFFF;
    color: var(--fc-ink);
    font-weight: 400;
    text-align: left;
    cursor: pointer;
}

.final-check-page .final-check-option--static {
    cursor: default;
}

.final-check-page .final-check-option.is-chosen {
    border: 1.5px solid var(--fc-accent);
    background: #F4FAF8;
}

/* The native radio stays for keyboard and screen readers, sized 18px and
   laid over the drawn dot (the global input rule would stretch it to a
   46px-high, full-width box). */
.final-check-page .final-check-option__radio {
    position: absolute;
    top: 13px;
    left: 15px;
    width: 18px !important;
    height: 18px !important;
    min-height: 0 !important;
    max-width: 18px;
    margin: 0;
    padding: 0 !important;
    opacity: 0;
    cursor: pointer;
}

.final-check-option__dot {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin-top: 1px;
    border: 1.5px solid #C4BFB0;
    border-radius: 50%;
    background: #FFFFFF;
}

.final-check-option.is-chosen .final-check-option__dot,
.final-check-option__radio:checked + .final-check-option__dot {
    border: 5px solid var(--fc-accent);
}

.final-check-page .final-check-option__text {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
}

.final-check-page .final-check-option__label {
    display: block;
    font-size: 14px !important;
    font-weight: 600;
    color: var(--fc-ink) !important;
}

.final-check-page .final-check-option__detail {
    display: block;
    margin-top: 3px;
    font-size: 13px !important;
    font-weight: 400;
    line-height: 1.5;
    color: var(--fc-muted) !important;
}

.final-check-page .final-check-option__kind {
    flex-shrink: 0;
    padding: 4px 9px;
    border-radius: 5px;
    background: #F0EEE7;
    font-size: 11px !important;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--fc-muted) !important;
}

/* ---- actions ---- */
.final-check-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 18px;
}

.final-check-actions__spacer {
    flex: 1 1 auto;
}

.final-check-actions__note {
    font-size: 12px;
    color: var(--fc-faint);
}

.final-check-page .final-check-locked-note {
    margin: 16px 0 0;
    font-size: 13px;
    color: #40566B !important;
}

/* ---- report error ---- */
.final-check-report {
    margin-top: 14px;
    padding: 16px;
    border: 1px solid #EAD9AF;
    border-radius: 10px;
    background: #FBF4E6;
}

.final-check-report__title {
    font-size: 14px;
    font-weight: 600;
    color: #6B4600;
}

.final-check-page .final-check-report__note {
    margin: 6px 0 0;
    font-size: 13px;
    line-height: 1.55;
    color: #6B4600 !important;
}

.final-check-report__reasons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.final-check-page .final-check-reason {
    min-height: 44px;
    padding: 10px 14px;
    border: 1px solid #DCC58A;
    border-radius: 999px !important;
    background: #FFFFFF !important;
    color: #6B4600 !important;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.final-check-page .final-check-reason--cancel {
    border-color: transparent;
    background: transparent !important;
    color: var(--fc-muted) !important;
}

/* ---- resolved states ---- */
.final-check-state {
    margin-top: 14px;
    padding: 12px 16px;
    border: 1px solid;
    border-radius: 10px;
}

.final-check-state__row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}

.final-check-state__label {
    min-width: 0;
    font-size: 14px;
}

.final-check-state--applied {
    border-color: #C2DCCB;
    background: #EFF6F1;
}

.final-check-state--applied .final-check-state__label {
    font-weight: 600;
    color: #1C5C3B;
}

.final-check-page .final-check-state__text {
    margin: 10px 0 0;
    font-size: 15px;
    line-height: 1.6;
    color: var(--fc-ink) !important;
    white-space: pre-line;
    overflow-wrap: anywhere;
}

.final-check-page .final-check-state__text--rating {
    font-size: 13px;
    font-weight: 600;
}

.final-check-state__note {
    margin-top: 9px;
    font-size: 12px;
    color: #4A7A5E;
}

.final-check-state--skipped {
    border-color: var(--fc-line);
    background: #F5F4F0;
}

.final-check-state--skipped .final-check-state__label {
    color: var(--fc-muted);
}

.final-check-state--reported {
    border-color: #EAD9AF;
    background: #FBF4E6;
}

.final-check-state--reported .final-check-state__label {
    color: #6B4600;
}

.final-check-state--stale {
    border-color: #D3DDE4;
    background: #EEF2F5;
}

.final-check-state--stale .final-check-state__label {
    color: #40566B;
}

/* ---- side column ---- */
/* Phone: the side's panels join the board column so the scan summary leads (M32); the desktop rule restores the flex column. */
.final-check-side {
    display: contents;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}

.final-check-panel--scan {
    order: -1;
}

.final-check-panel {
    padding: 20px;
    border: 1px solid var(--fc-line);
    border-radius: 12px;
    background: #FFFFFF;
}

.final-check-panel .final-check-eyebrow {
    font-size: 11px;
    letter-spacing: 0.08em;
    color: var(--fc-muted);
}

.final-check-panel--dark {
    border-color: var(--fc-ink);
    background: var(--fc-ink);
    color: #E8E6DE;
}

.final-check-panel--dark .final-check-eyebrow {
    color: #9AA3AB;
}

.final-check-page .final-check-panel__lead {
    margin: 8px 0 0;
    font-size: 13px;
    line-height: 1.55;
    color: var(--fc-muted) !important;
}

.final-check-page .final-check-panel--dark .final-check-panel__lead {
    line-height: 1.6;
    color: #E8E6DE !important;
}

.final-check-page .final-check-panel__foot {
    margin: 14px 0 0;
    font-size: 12px;
    color: var(--fc-faint) !important;
}

.final-check-page .final-check-panel__foot:empty {
    display: none;
}

.final-check-score {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-top: 10px;
}

.final-check-score__value {
    font-size: 42px;
    font-weight: 600;
    line-height: 1;
    color: var(--fc-ink);
}

.final-check-score__of {
    font-size: 15px;
    color: var(--fc-muted);
}

.final-check-bar {
    height: 8px;
    margin-top: 14px;
    overflow: hidden;
    border-radius: 999px;
    background: #EDEBE4;
}

.final-check-bar__fill {
    height: 8px;
    border-radius: 999px;
    background: var(--fc-accent);
}

.final-check-tally {
    display: flex;
    flex-direction: column;
    gap: 9px;
    margin-top: 16px;
}

.final-check-tally__row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.final-check-tally__dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 50%;
}

.final-check-tally__dot--must { background: #9E2A2B; }
.final-check-tally__dot--advisory { background: #B8860B; }
.final-check-tally__dot--polish { background: #40566B; }

.final-check-tally__label {
    flex: 1 1 auto;
    font-size: 13px;
    color: var(--fc-body);
}

.final-check-tally__count {
    font-size: 13px;
    font-weight: 700;
    color: var(--fc-ink);
}

.final-check-log {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 14px;
}

.final-check-log__entry {
    min-width: 0;
    padding: 11px 13px;
    border: 1px solid #EDEBE4;
    border-radius: 8px;
    background: #FBFAF7;
}

.final-check-log__entry.is-undone {
    opacity: 0.7;
}

.final-check-log__entry.is-undone .final-check-log__what {
    text-decoration: line-through;
}

.final-check-log__entry--rule .final-check-btn {
    margin-top: 10px;
}

.final-check-log__ref {
    font-size: 12px;
    font-weight: 700;
    color: var(--fc-ink);
}

.final-check-log__ref--mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    overflow-wrap: anywhere;
}

.final-check-log__what {
    margin-top: 3px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--fc-muted);
    overflow-wrap: anywhere;
}

.final-check-log__when {
    margin-top: 4px;
    font-size: 11px;
    color: var(--fc-faint);
}

.final-check-log__when:empty {
    display: none;
}

.final-check-log__empty {
    padding: 14px 13px;
    border: 1px dashed var(--fc-line);
    border-radius: 14px;
    font-size: 12px;
    color: var(--fc-faint);
}

.final-check-page.is-busy .final-check-workspace {
    cursor: progress;
}

/* Phones: the Apply row stacks its note under the buttons. */
@media (max-width: 520px) {
    .final-check-card__head {
        flex-direction: column;
        gap: 10px;
    }

    .final-check-actions__spacer {
        display: none;
    }

    .final-check-actions__note {
        flex-basis: 100%;
    }

    .final-check-page .final-check-option__kind {
        display: none;
    }
}

/* Desktop: the board's two columns and its larger type. */
@media (min-width: 901px) {
    .final-check-page {
        padding: 26px 44px 28px;
        border-radius: 18px;
        background: var(--fc-surface);
    }

    .final-check-head {
        flex-direction: row;
        align-items: flex-start;
        gap: 24px;
    }

    .final-check-head__text {
        flex: 1 1 auto;
        min-width: 0;
    }

    .final-check-head__actions {
        flex-shrink: 0;
        justify-content: flex-end;
        max-width: 360px;
        padding-top: 6px;
    }

    .final-check-page .final-check-title {
        font-size: 38px !important;
    }

    .final-check-workspace {
        margin-top: 22px;
    }

    .final-check-layout {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 318px;
        align-items: start;
        gap: 28px;
    }

    .final-check-side {
        display: flex;
        position: sticky;
        top: 16px;
    }

    .final-check-list {
        margin-top: 20px;
    }

    .final-check-card {
        padding: 20px 22px;
    }

    .final-check-page .final-check-card__title {
        font-size: 21px !important;
    }
}
/* end Final Check */

/* ==========================================================
   Progress overlay shell (surveyor, 3 Oct 2026: "Implement the approved
   Survai progress overlay consistently across the entire site").
   assets/js/survai-progress-overlay.js builds one of these per page and
   keeps it mounted; since M59 the card inside is the report processing
   card's sheet (the svrpm rules above and report-processing-card.css).
   Colours come from tokens only.
   ========================================================== */
.survai-progress-overlay {
    position: fixed;
    inset: 0;
    z-index: 10080;
    display: grid;
    place-items: center;
    padding: 20px;
    padding-top: calc(20px + env(safe-area-inset-top, 0px));
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    box-sizing: border-box;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.survai-progress-overlay[hidden] {
    display: none;
}

.survai-progress-overlay__backdrop {
    position: fixed;
    inset: 0;
    background: rgba(23, 23, 23, 0.42);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

html[data-theme="dark"] .survai-progress-overlay__backdrop {
    background: rgba(0, 0, 0, 0.6);
}

.survai-progress-overlay__dialog {
    position: relative;
    width: 100%;
    max-width: 640px;
    margin: auto;
    outline: none;
}

/* Focus parks on the dialog while a task runs (nothing else to focus); the card
   itself is not a control, so it draws no ring. The buttons keep theirs. */
.survai-progress-overlay__dialog:focus-visible {
    outline: none;
}

/* Short screens (a phone on its side): less padding round the card. */
@media (max-height: 600px) {
    .survai-progress-overlay {
        padding-top: calc(10px + env(safe-area-inset-top, 0px));
        padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    }

    .survai-progress-overlay__controls {
        margin-top: 8px;
    }
}

/* A tap outside the card does not close it; the card's sheet gives a small nudge
   (.svrpm__sheet.is-nudged) so the surveyor sees it is still there and where its buttons are. */
@keyframes survaiProgressNudge {
    0%, 100% { transform: scale(1); }
    40% { transform: scale(1.015); }
    70% { transform: scale(0.995); }
}

.survai-progress-overlay__controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 14px;
}

.survai-progress-overlay__controls[hidden] {
    display: none;
}

.survai-progress-overlay__control {
    min-width: 128px;
}

/* .btn sets display, which would beat the hidden attribute. */
.survai-progress-overlay__control[hidden] {
    display: none;
}

/* The page behind the overlay must not scroll; the overlay itself scrolls on
   short screens so the controls stay reachable. */
body.survai-progress-overlay-open {
    overflow: hidden;
}

/* Short screens (a phone in landscape, a split-screen tablet): the card is
   taller than the viewport, so it is pinned to the top and the whole overlay
   scrolls. */
@media (max-height: 960px) {
    .survai-progress-overlay {
        place-items: start center;
    }
}

/* ==========================================================
   Write report gate (surveyor, 6 Oct 2026: once the report has been written,
   writing it again needs the scope chosen and the word typed). The shell
   above gives it the backdrop, centring and scroll lock; this is the card.
   Tokens only, so dark mode follows by itself. report_write_gate.php /
   assets/js/report-write-gate.js.
   ========================================================== */
.svwg__dialog {
    max-width: 480px;
}

.svwg__card {
    display: grid;
    gap: 14px;
    padding: 22px 20px;
    border: 1px solid var(--survai-border-ink);
    border-radius: 18px;
    background: var(--survai-card);
    color: var(--survai-text);
    box-shadow: 0 22px 54px rgba(15, 23, 42, 0.22);
}

.svwg__title {
    margin: 0;
    font-size: 18px;
    line-height: 1.3;
    font-weight: 700;
    color: var(--survai-text-strong);
}

.svwg__confirm {
    display: grid;
    gap: 14px;
}

.svwg__confirm[hidden],
.svwg__blocked[hidden] {
    display: none;
}

.svwg__copy {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: var(--survai-text-secondary);
}

.svwg__word {
    font-weight: 700;
    color: var(--survai-text-strong);
}

.svwg__options {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
    border: 0;
    min-width: 0;
}

.svwg__legend {
    padding: 0;
    margin-bottom: 2px;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--survai-text-soft);
}

/* The global label rule is a bold grid (style.css "label {"); these are
   labels too, so each sets its own layout and weight. */
.svwg__option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    border: 1px solid var(--survai-border-soft);
    border-radius: 12px;
    background: var(--survai-bg-soft);
    color: var(--survai-text);
    font-weight: 400;
    cursor: pointer;
}

.svwg__option:has(input:checked) {
    border-color: var(--survai-blue);
    background: var(--survai-bg-tint);
}

.svwg__option.is-unavailable {
    opacity: 0.55;
    cursor: not-allowed;
}

.svwg__option input {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin: 2px 0 0;
    accent-color: var(--survai-blue);
}

.svwg__option-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.svwg__option-copy strong {
    font-size: 14px;
    line-height: 1.35;
    font-weight: 600;
    color: var(--survai-text-strong);
}

.svwg__option-copy small {
    font-size: 12.5px;
    line-height: 1.4;
    font-weight: 400;
    color: var(--survai-text-soft);
}

.svwg__field {
    display: grid;
    gap: 6px;
}

.svwg__label {
    display: block;
    font-size: 13px;
    font-weight: 400;
    color: var(--survai-text-secondary);
}

.svwg__label strong {
    display: inline;
    font-weight: 700;
    color: var(--survai-text-strong);
}

.svwg__input {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 1px solid var(--survai-border);
    border-radius: 10px;
    background: var(--survai-bg);
    color: var(--survai-text);
    font: inherit;
    font-size: 16px; /* iOS does not zoom a 16px field */
}

.svwg__input:focus-visible {
    outline: 2px solid var(--survai-blue);
    outline-offset: 1px;
}

/* Stays in the flow even when empty: a live region that is display:none
   until it has text is not announced. */
.svwg__status {
    margin: 0;
    min-height: 1.2em;
    font-size: 13px;
    color: var(--survai-text-soft);
}

.svwg__blocked {
    display: grid;
    gap: 10px;
}

.svwg__hint[hidden] {
    display: none;
}

.svwg__controls {
    margin-top: 0;
    justify-content: flex-end;
}

/* Not yet confirmed, not waiting: the button is plainly off. */
.svwg__controls .btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

@media (max-width: 600px) {
    .svwg__card {
        padding: 18px 16px;
        border-radius: 16px;
    }

    .svwg__controls {
        justify-content: stretch;
    }

    .svwg__controls .survai-progress-overlay__control {
        flex: 1 1 0;
    }
}

/* ==========================================================
   Neutral workspace chrome (surveyor, 3 Oct 2026: "Update the existing
   Survai interface to match the attached design"). Structure for the
   wide report-workspace sidebar with its Workspace / Reporting groups,
   the black wordmark, the compact stage tabs, the labelled action bar
   at the top of the Output page, white section cards on the pale
   workspace, and the scroll clearance under the floating dock. Colours
   come from the tokens only. Nothing here reaches the rendered report
   preview, the PDF stylesheets or print.
   ========================================================== */

/* The wordmark is entirely black, including the "AI" (dark mode: white). The
   PNG keeps its proportions; only its ink is changed. */
.brand-logo-sidebar,
.brand-logo-header,
.mobile-menu-toggle__logo {
    filter: brightness(0);
}

html[data-theme="dark"] .brand-logo-sidebar,
html[data-theme="dark"] .brand-logo-header,
html[data-theme="dark"] .mobile-menu-toggle__logo {
    filter: brightness(0) invert(1);
}

/* --- Sidebar brand: the full Survai wordmark, left, in every rail (surveyor, 3 Oct 2026:
   one sidebar in every mode; "the logo is quite big ... Make it thirty percent smaller":
   40px became 28px). In expanded mode the header shows a menu icon instead, see .workspace-expanded-brand. --- */
.sidebar {
    --sidebar-brand-justify: flex-start;
}

/* Written at the weight of the older rail logo locks (".sidebar .sidebar-brand
   img.brand-logo-sidebar { height: auto !important }" and the 420px rail rule), which
   otherwise drew the wordmark 35px tall on the reports, dashboard and Settings rails. */
.sidebar .sidebar-brand img.brand-logo-sidebar--wordmark,
.sidebar.sidebar--workspace .sidebar-brand img.brand-logo-sidebar {
    width: auto !important;
    max-width: none !important;
    height: 28px !important;
    max-height: 28px !important;
    margin: 0 0 0 6px !important;
}

/* --- Report workspace sidebar: two labelled groups, log out at the foot --- */

.sidebar.sidebar--workspace .sidebar-nav-group {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.sidebar.sidebar--workspace .sidebar-nav-group + .sidebar-nav-group {
    margin-top: 10px;
    padding-top: 12px;
    border-top: 1px solid var(--survai-border);
}

.sidebar.sidebar--workspace .sidebar-nav-group__label {
    margin: 0 0 6px;
    padding: 0 12px;
    color: var(--survai-text-muted);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    line-height: 1.2;
    text-transform: uppercase;
}

/* Outline icons at a consistent weight beside their labels. */
body .sidebar.sidebar--workspace .sidebar-nav-icon svg {
    stroke-width: 1.7;
}

body .sidebar.sidebar--workspace .sidebar-nav a .sidebar-nav-icon,
body .sidebar.sidebar--workspace .sidebar-nav a .sidebar-nav-label {
    color: var(--survai-sidebar-ink);
}

body .sidebar.sidebar--workspace .sidebar-nav a:hover:not(.active),
body .sidebar.sidebar--workspace .sidebar-nav a:focus-visible:not(.active) {
    background: var(--sidebar-hover-bg);
}

.sidebar.sidebar--workspace .sidebar-footer {
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--survai-border);
}

.sidebar.sidebar--workspace .sidebar-logout-form {
    width: 100%;
}


/* Phones: the drawer is the same wide sidebar. */
@media (max-width: 900px) {
    body.has-mobile-sidebar .sidebar.sidebar--workspace {
        width: min(var(--survai-workspace-sidebar-width), calc(100vw - 48px));
        max-width: min(var(--survai-workspace-sidebar-width), calc(100vw - 48px));
    }
}

/* --- Header: compact stage tabs instead of full-width pills --- */
.workspace-topbar.report-workspace-header .report-workspace-nav.workspace-stage-nav {
    justify-content: flex-start;
    gap: 2px;
    padding-block: 6px 0;
    border-top: 1px solid var(--survai-border);
}

.workspace-topbar.report-workspace-header .workspace-stage-nav__item {
    flex: 0 0 auto;
}

.workspace-topbar.report-workspace-header .workspace-stage-nav .workspace-stage-nav__stage,
.workspace-topbar.report-workspace-header .workspace-stage-nav__item .workspace-stage-nav__stage {
    flex: 0 0 auto;
    width: auto;
    min-height: 38px;
    gap: 6px;
    padding: 0 11px;
    border-radius: 8px 8px 0 0;
    font-size: 0.85rem;
    font-weight: 500;
}

/* The bar's Dictate button opens the voice assistant on the Output page, so the
   header does not show the launcher twice. The assistant's panel is unaffected. */
body.output-report-page .report-workspace-header .survai-voice-assistant__launcher {
    display: none;
}

/* --- Output page: labelled action bar above the report --- */
.output-action-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 4px;
    margin: 0 0 18px;
    padding: 8px 10px;
    border: 1px solid var(--survai-border);
    border-radius: 14px;
    background: var(--survai-surface);
}

.output-action-bar__group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

.output-action-bar__group--primary {
    margin-left: auto;
    gap: 10px;
}

.output-action-bar__separator {
    width: 1px;
    height: 24px;
    margin: 0 8px;
    background: var(--survai-border);
}

.output-action-bar__button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 12px;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: var(--survai-text);
    font: inherit;
    font-size: 0.92rem;
    font-weight: 550;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}

.output-action-bar__button:hover,
.output-action-bar__button:focus-visible {
    background: var(--survai-neutral-hover);
    color: var(--survai-text);
    text-decoration: none;
    outline: none;
}

.output-action-bar__button:focus-visible {
    box-shadow: var(--survai-focus);
}

.output-action-bar__button[aria-expanded="true"],
.output-action-bar__button[aria-pressed="true"] {
    background: var(--survai-brand-soft);
    color: var(--survai-brand);
}

.output-action-bar__icon,
.output-action-bar__caret {
    display: inline-flex;
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    align-items: center;
    justify-content: center;
    color: inherit;
}

.output-action-bar__caret {
    width: 14px;
    flex-basis: 14px;
    margin-left: -2px;
}

.output-action-bar__icon svg,
.output-action-bar__caret svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.output-action-bar__button--secondary {
    border-color: var(--survai-border);
    background: var(--survai-surface);
    padding-inline: 16px;
}

.output-action-bar__button--secondary:hover,
.output-action-bar__button--secondary:focus-visible {
    border-color: var(--survai-border);
    background: var(--survai-neutral-hover);
}

.output-action-bar__button--primary,
.output-action-bar__button--primary:hover,
.output-action-bar__button--primary:focus-visible {
    border-color: var(--survai-brand);
    background: var(--survai-brand);
    color: var(--btn-primary-ink);
    padding-inline: 18px;
    font-weight: 650;
}

.output-action-bar__button--primary:hover,
.output-action-bar__button--primary:focus-visible {
    border-color: var(--survai-brand-hover);
    background: var(--survai-brand-hover);
}

/* The QC gate keeps its meaning on the bar as on the dock: the picker still
   opens, the title explains, the button reads as held back. */
.output-action-bar__button--primary.is-pdf-qc-gated {
    opacity: 0.72;
}

@media (max-width: 760px) {
    .output-action-bar {
        gap: 4px 2px;
        padding: 6px;
    }

    .output-action-bar__separator {
        display: none;
    }

    .output-action-bar__button {
        min-height: 40px;
        padding: 0 10px;
        font-size: 0.86rem;
    }

    .output-action-bar__group--primary {
        width: 100%;
        margin-left: 0;
        justify-content: flex-end;
        padding-top: 4px;
        border-top: 1px solid var(--survai-border);
    }
}

@media (max-width: 480px) {
    .output-action-bar__button:not(.output-action-bar__button--primary):not(.output-action-bar__button--secondary) .output-action-bar__label {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0 0 0 0);
        white-space: nowrap;
    }

    .output-action-bar__button:not(.output-action-bar__button--primary):not(.output-action-bar__button--secondary) {
        position: relative;
        min-width: 40px;
        justify-content: center;
        padding: 0 8px;
    }
}

/* --- Output page: white section cards on the pale workspace --- */
body.output-report-page .output-workspace-shell .output-preview-card {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

body.output-report-page .output-workspace-shell .output-preview-card > .section-head,
body.output-report-page .output-workspace-shell .output-preview-card > header {
    padding: 0 4px 14px;
}

body.output-report-page .output-section-list {
    gap: 14px;
}

body.output-report-page .output-main-section-content .output-section,
body.output-report-page .output-section-list > .output-section {
    border: 1px solid var(--survai-border);
    border-radius: 16px;
    padding: 16px 18px 18px;
    background: var(--survai-surface);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

body.output-report-page .output-main-section-content .output-section:first-child,
body.output-report-page .output-section-list > .output-section:first-child {
    border-top: 1px solid var(--survai-border);
    padding-top: 16px;
}

@media (hover: hover) {
    body.output-report-page .output-main-section-content .output-section.is-collapsed,
    body.output-report-page .output-section-list > .output-section.is-collapsed {
        padding-bottom: 16px;
        margin-bottom: 0;
    }

    body.output-report-page .output-main-section-content .output-section.is-collapsed:hover,
    body.output-report-page .output-section-list > .output-section.is-collapsed:hover {
        background-color: var(--survai-neutral-hover);
    }
}

body.output-report-page .output-section-text,
body.output-report-page .section-text {
    border-color: var(--survai-border);
}

/* ==========================================================
   Section layout (surveyor, 3 Oct 2026: "I want these titles placed
   outside of these boxes ... the boxes will just be containing the text
   and the buttons for approval and copying"; "the chevrons should be
   placed in the same location as the section titles"). Every editable
   section card on the Output page ([data-section-card]: the report
   sections, the Executive Summary, the Surveyor's Overall Assessment, the
   desk-study sections, the Fixed Text blocks and the Extension
   Feasibility routes) draws no surface of its own: its title row sits on
   the page with the chevron at the end of that same row, and the one
   bordered box (.output-section-box, a field surface) holds the text and
   its action buttons. Photos, cost tables, notes and previews follow the
   box on the page. The lists' wrappers (.output-preview-card) are no
   longer .card either (output.php, output_workspace_helpers.php), so
   they draw nothing. Nothing here reaches the rendered report preview,
   the PDF or print.
   ========================================================== */

/* The scroller never scrolls sideways: the hidden tooltips on the round
   glyph buttons (.output-icon-action::after) hang past the right edge of the
   box's action row and widened it by a few pixels at every width (the phone
   pass below 640px already clipped it). */
body.output-report-page .main-panel {
    overflow-x: hidden;
}

/* The card: no border, fill or shadow. The 1px border stays, transparent,
   so the chapter headings' 19px inset and chevron alignment (above) still
   measure against it. */
body.output-report-page .output-main-section-content .output-section,
body.output-report-page .output-section-list > .output-section,
body.output-report-page .output-main-section-content .output-section:first-child,
body.output-report-page .output-section-list > .output-section:first-child,
body.output-report-page [data-section-card] {
    border-color: transparent;
    border-radius: 16px;
    padding: 8px 0 14px;
    background: transparent;
    box-shadow: none;
}

@media (hover: hover) {
    body.output-report-page .output-main-section-content .output-section.is-collapsed,
    body.output-report-page .output-section-list > .output-section.is-collapsed,
    body.output-report-page [data-section-card].is-collapsed {
        padding-bottom: 8px;
        margin-bottom: 0;
    }
}

/* The title row on the page: inset like the box's text, the chevron (the
   last control) at the end of the same row. */
body.output-report-page [data-section-card] > header {
    display: flex;
    align-items: center;
    padding-inline: 18px;
}

body.output-report-page [data-section-card] > header > div:first-child {
    flex: 1 1 auto;
    min-width: 0;
}

body.output-report-page [data-section-card] > header .section-head-actions {
    flex: 0 1 auto;
    width: auto;
    margin-left: auto;
}

/* The photo album's title row and its chevron line up with the sections'. */
body.output-report-page .output-workspace-shell .output-preview-card > .section-head,
body.output-report-page .output-workspace-shell .output-preview-card > header {
    padding: 0 19px 14px;
}

body.output-report-page #photo-album > .section-head .section-head-actions .collapse-toggle {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    flex: 0 0 44px;
    border: 1px solid rgba(148, 163, 184, 0.34);
    border-radius: 999px;
    background: var(--survai-bg);
}

/* The box: a field surface holding the text and its buttons. */
body.output-report-page .output-section-box {
    position: relative;
    display: grid;
    gap: 0;
    min-width: 0;
    border: 1px solid var(--field-border-color);
    border-radius: var(--field-radius);
    background: var(--field-bg);
    box-shadow: var(--field-shadow);
    transition: border-color 140ms ease, box-shadow 140ms ease;
}

/* The focus ring moves from the text to the box (typing, not the buttons). */
body.output-report-page .output-section-box:has(textarea:focus) {
    border-color: var(--field-focus-border);
    box-shadow: var(--field-focus-ring);
}

/* The text inside draws no box of its own. Written at the weight of the
   shared field rules (body:not(...) textarea, !important). */
body.output-report-page:not(.login-body):not(.survaicam-page):not(.capture-mode-body) .output-section-box textarea,
body.output-report-page:not(.login-body):not(.survaicam-page):not(.capture-mode-body) .output-section-box textarea:focus {
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    background-color: transparent !important;
    box-shadow: none !important;
    outline: none !important;
    min-height: 180px;
    resize: none;
    padding: 16px 18px 10px !important;
}

body.output-report-page .output-section-box > .workflow-section-text-editor {
    gap: 0;
    min-width: 0;
}

/* The styled-text overlay (output-text-format-bar.js) sits over the textarea;
   the box is the surface now, so it paints none of its own. Its padding is
   written here too: the script copies the textarea's padding once, at mount,
   and the phone value below differs, so a resize across 760px would otherwise
   leave the styled glyphs a few pixels off the caret. */
body.output-report-page .output-section-box .output-inline-editor__view {
    background: transparent;
    padding: 16px 18px 10px !important;
}

/* Page-level content between the title row and the box (the Fixed Text cards'
   notes, the template blocks' variant tabs, the note under a form) shares the
   title's inset; the box and the photo strip keep the card's edge. */
body.output-report-page [data-section-card] > [data-section-collapsible] > .form-note,
body.output-report-page [data-section-card] > [data-section-collapsible] > .template-block-variant-tabs {
    padding-inline: 18px;
}

/* The hidden tooltip of the last button in the box's row would hang past the
   box (and the panel) centred; it hangs leftward instead. */
body.output-report-page .output-section-box .output-section-actions > .output-icon-action:last-child::after {
    left: auto;
    right: 0;
    transform: translate(0, 4px);
}

body.output-report-page .output-section-box .output-section-actions > .output-icon-action:last-child:hover::after,
body.output-report-page .output-section-box .output-section-actions > .output-icon-action:last-child:focus-visible::after {
    transform: translate(0, 0);
}

/* The read-only desk-study body is the box itself. */
body.output-report-page .output-desk-study-body.output-section-box {
    display: block;
    min-height: 0;
    padding: 16px 18px;
    color: var(--survai-text);
}

/* The buttons: the box's own bottom row, under a hairline. */
body.output-report-page .output-section-box > .output-section-footer-actions,
body.output-report-page .output-section-box > .output-section-actions,
body.output-report-page .output-section-box > .output-section-form-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px 10px;
    margin: 0;
    padding: 8px 12px 12px;
    border-top: 1px solid var(--field-border-color);
}

/* Phones: the controls never shrink below their 44px glyphs (a flex-end
   scroller put its overflow on the unreachable start side and sliced the
   first control on 50 of 51 collapsed rows, review of 3 Oct 2026). The title
   keeps at least 45% of the row and wraps; an open card's chevron sits on the
   title row, and a collapsed row whose quick-actions do not fit beside the
   title drops them under it, right-aligned, as before this pass. */
@media (max-width: 760px) {
    body.output-report-page [data-section-card] > header {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        padding-inline: 18px;
    }

    body.output-report-page [data-section-card] > header > div:first-child {
        flex: 1 1 0;
        width: auto;
        min-width: 45%;
        max-width: none;
    }

    body.output-report-page [data-section-card] > header .section-head-actions {
        flex: 0 0 auto;
        width: auto;
        max-width: 100%;
        margin-left: auto;
        align-self: center;
    }

    /* Collapsed rows: the chevron keeps its place at the end of the title row
       (surveyor: "the chevrons should be placed in the same location as the
       section titles"); the quick actions a collapsed row shows (cost, listen,
       proof, rating) do not fit beside a title on a phone, so they take a
       second row of the header, right-aligned. The actions wrapper stops being
       a box (display: contents; no script measures it) so its children can sit
       on the header's two rows; the header's ::after is the line break. */
    body.output-report-page [data-section-card].is-collapsed > header {
        justify-content: flex-end;
    }

    body.output-report-page [data-section-card].is-collapsed > header > div:first-child {
        order: 0;
        flex: 1 1 0;
        min-width: 0;
    }

    body.output-report-page [data-section-card].is-collapsed > header .section-head-actions {
        display: contents;
    }

    body.output-report-page [data-section-card].is-collapsed > header .section-head-actions > .collapse-toggle {
        order: 1;
    }

    body.output-report-page [data-section-card].is-collapsed > header::after {
        content: "";
        order: 2;
        flex: 1 1 100%;
        height: 0;
    }

    body.output-report-page [data-section-card].is-collapsed > header .section-head-actions > :not(.collapse-toggle) {
        order: 3;
    }

    body.output-report-page .output-section-box .output-inline-editor__view {
        padding: 14px 14px 8px !important;
    }

    body.output-report-page:not(.login-body):not(.survaicam-page):not(.capture-mode-body) .output-section-box textarea,
    body.output-report-page:not(.login-body):not(.survaicam-page):not(.capture-mode-body) .output-section-box textarea:focus {
        padding: 14px 14px 8px !important;
    }

    body.output-report-page .output-section-box > .output-section-footer-actions,
    body.output-report-page .output-section-box > .output-section-actions,
    body.output-report-page .output-section-box > .output-section-form-actions {
        padding: 6px 8px 10px;
    }
}

/* The floating dock is fixed over the scroller: the last card needs room to
   scroll clear of it (the dock is 60px tall on desktop, a 52px launcher that
   opens to a pill on phones). */
body.output-report-page .main-panel {
    padding-bottom: calc(var(--app-main-padding) + 84px + env(safe-area-inset-bottom, 0px));
    scroll-padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px));
}


/* Phone drawer: the same wordmark as the desktop rail (the drawer is the full 232px rail), not
   the square glyph the older drawer rules swap in. */
@media (max-width: 900px) {
    body.has-mobile-sidebar .sidebar .sidebar-brand::before {
        display: none !important;
        content: none !important;
    }

    body.has-mobile-sidebar .sidebar .sidebar-brand img.brand-logo-sidebar--wordmark {
        display: block !important;
        width: auto !important;
        height: 28px !important;
        max-height: 28px !important;
        margin: 0 0 0 6px;
    }
}

/* ==========================================================
   Report pages in the banner (surveyor, 3 Oct 2026: "all of the
   options in the drop-down underneath report can go in the banner
   next to report, so that they can be quickly selected without
   having to hover"). workspace_nav_grouped.php renders Report and
   its pages as one group of direct buttons between the Overview and
   Advanced menus. The group scrolls sideways when the row is too
   narrow (a laptop with the rail open, a phone), so the two menus
   outside it are never clipped; its scrollbar is hidden and the
   current button is scrolled into view on load.
   ========================================================== */
.workspace-topbar.report-workspace-header .workspace-stage-nav__flat-group {
    display: flex;
    flex: 0 1 auto;
    align-items: center;
    gap: 2px;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.workspace-topbar.report-workspace-header .workspace-stage-nav__flat-group::-webkit-scrollbar {
    display: none;
}

.workspace-topbar.report-workspace-header .workspace-stage-nav__flat-group .workspace-stage-nav__item--flat {
    flex: 0 0 auto;
}

.workspace-topbar.report-workspace-header .workspace-stage-nav__flat-group .workspace-stage-nav__flat-link {
    white-space: nowrap;
}

/* When the group does scroll, a soft fade at the clipped edge says there is more. */
.workspace-topbar.report-workspace-header .workspace-stage-nav__flat-group.is-clipped-end {
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent);
}

.workspace-topbar.report-workspace-header .workspace-stage-nav__flat-group.is-clipped-start {
    -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 28px), transparent);
    mask-image: linear-gradient(to left, #000 calc(100% - 28px), transparent);
}

.workspace-topbar.report-workspace-header .workspace-stage-nav__flat-group.is-clipped-start.is-clipped-end {
    -webkit-mask-image: linear-gradient(to right, transparent, #000 28px, #000 calc(100% - 28px), transparent);
    mask-image: linear-gradient(to right, transparent, #000 28px, #000 calc(100% - 28px), transparent);
}

/* The stage wrappers carry .is-active too, and the site-wide .is-active badge tint painted a
   pale blue field behind the current stage in the banner and in the overview rail. */
.workspace-stage-nav .workspace-stage-nav__item.is-active {
    background: transparent !important;
    color: inherit !important;
}

/* Eleven tabs share the row, so the banner is text only (the rail keeps its icons) and a
   stage that still opens a menu (Advanced; Overview is a link since 9 Oct 2026) has a chevron. */
.workspace-topbar.report-workspace-header .workspace-stage-nav .workspace-stage-nav__stage .workspace-stage-subnav__icon {
    display: none !important;
}

.workspace-topbar.report-workspace-header .workspace-stage-nav__item[data-stage-menu] > .workspace-stage-nav__stage.report-workspace-nav__link::after {
    content: "" !important;
    display: block !important;
    position: static !important;
    width: 6px !important;
    height: 6px !important;
    flex: 0 0 6px;
    margin: -3px 0 0 2px;
    border-radius: 0 !important;
    opacity: 1 !important;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    background: transparent !important;
    transform: rotate(45deg);
}

/* ==========================================================
   Output page: main-section headings (surveyor, 3 Oct 2026: "the
   section titles ... are literally touching the edges of the
   container ... the collapse buttons ... are breaching the border").
   The heading starts where the section titles inside the cards
   start (the card's 18px padding plus its 1px border), and its
   chevron is centred on the same line as the cards' round collapse
   buttons (19px in, then half of the 44px button less half of the
   11px chevron: 16px more), inside the container.
   ========================================================== */
body.output-report-page .output-main-section-toggle {
    padding-inline: 19px;
}

body.output-report-page .output-main-section-chevron {
    margin-inline-end: 16px;
}

/* Phone menu button (surveyor, 3 Oct 2026): it shows the full wordmark since the logo change,
   so the mark is drawn at a wordmark's height inside the 45px button rather than 45px tall,
   which made the button 226px wide and squeezed the report address in the header row. */
@media (max-width: 900px) {
    body.has-mobile-sidebar .mobile-menu-toggle--brand .mobile-menu-toggle__logo {
        width: auto;
        height: 22px;
        max-height: 22px;
        max-width: 96px;
    }
}

/* ==========================================================
   Pop-ups in dark mode (surveyor, 3 Oct 2026: "ensure that all pop-up
   overlays have a dark mode feature so when we set the site in dark
   mode the background to the pop-up becomes dark with a slight white
   border to create a shadow effect on the screen ... the text within
   that pop-up overlay to be suitably coloured e.g. white"). The panels
   already read the card and text tokens, and their slate and navy-alpha
   edges became border tokens; this gives every modal, drawer, popover,
   menu and toast the same faint white edge with a soft glow, and
   neutral black backdrops in place of the navy tints. The progress
   pop-ups are the report processing card's sheet since M59
   (the svrpm rules); the PDF activity drawer in
   assets/css/pdf-activity-queue.css.
   ========================================================== */
html[data-theme="dark"] .output-room-modal__panel,
html[data-theme="dark"] .output-image-editor-modal__panel,
html[data-theme="dark"] .survai-regen-notes-modal__card,
html[data-theme="dark"] .keyword-regen-modal__card,
html[data-theme="dark"] .smart-annotation-dialog,
html[data-theme="dark"] .po-details-modal__card,
html[data-theme="dark"] .po-crop-modal__dialog,
html[data-theme="dark"] .pwa-install-dialog,
html[data-theme="dark"] .report-documents-modal__panel,
html[data-theme="dark"] .image-manager-modal__dialog,
html[data-theme="dark"] .image-manager-bulk-edit-modal__panel,
html[data-theme="dark"] .image-delete-dialog__panel,
html[data-theme="dark"] .siex__card,
html[data-theme="dark"] .siex__crop-confirm,
html[data-theme="dark"] .street-view-editor-modal__content {
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04), 0 28px 80px rgba(0, 0, 0, 0.6);
}

html[data-theme="dark"] .street-view-editor-modal__content {
    color: var(--survai-text);
}

/* Floating panels, menus and popovers. */
html[data-theme="dark"] .survai-find-replace__panel,
html[data-theme="dark"] .survai-voice-assistant__panel,
html[data-theme="dark"] .workspace-stage-dropdown,
html[data-theme="dark"] .po-cover-edit-panel,
html[data-theme="dark"] .survai-regen-menu,
html[data-theme="dark"] .image-manager-filter-panel,
html[data-theme="dark"] .image-manager-settings-panel,
html[data-theme="dark"] .reports-page .report-row__menu-panel,
html[data-theme="dark"] .report-workspace-header__display-options .output-image-display-grid,
html[data-theme="dark"] .ops-notification-panel,
html[data-theme="dark"] .image-manager-card__info-popover,
html[data-theme="dark"] .image-manager-card__ai-popover,
html[data-theme="dark"] .report-status-pill-menu,
html[data-theme="dark"] .condition-rating-picker {
    border-color: rgba(255, 255, 255, 0.14);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04), 0 18px 45px rgba(0, 0, 0, 0.55);
}

/* The section cost popover dims the page with its own shadow ring: kept, neutral. */
html[data-theme="dark"] .output-section-cost-popover {
    border-color: rgba(255, 255, 255, 0.14);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04), 0 28px 70px rgba(0, 0, 0, 0.55), 0 0 0 100vmax rgba(0, 0, 0, 0.45);
}

/* Toasts: a dark card with the state in the text, not a translucent tint. The
   global .is-success rule is !important, so these are too. */
html[data-theme="dark"] .report-builder-notice,
html[data-theme="dark"] .report-builder-notice.is-success {
    color: var(--survai-text) !important;
    background: var(--survai-card) !important;
    border-color: rgba(255, 255, 255, 0.14) !important;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04), 0 18px 50px rgba(0, 0, 0, 0.55);
}

html[data-theme="dark"] .report-builder-notice.is-error {
    color: #ff9d93 !important;
    background: #2c1513 !important;
    border-color: #6a2f2a !important;
}

html[data-theme="dark"] .output-workspace-status-toast,
html[data-theme="dark"] .output-workspace-status-toast.is-loading,
html[data-theme="dark"] .output-workspace-status-toast.is-success,
html[data-theme="dark"] .output-workspace-status-toast.is-error {
    background: var(--survai-card) !important;
    border-color: rgba(255, 255, 255, 0.14) !important;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04), 0 18px 50px rgba(0, 0, 0, 0.55);
}

html[data-theme="dark"] .output-workspace-status-toast.is-loading {
    color: var(--survai-text) !important;
}

html[data-theme="dark"] .output-workspace-status-toast.is-success {
    color: #86d6a6 !important;
}

html[data-theme="dark"] .output-workspace-status-toast.is-error {
    color: var(--survai-ink-991b1b) !important;
}

/* The voice assistant's active scope chip: the global .is-active tint left blue
   text on a blue tint; the chip is brand blue with white text. */
html[data-theme="dark"] .survai-voice-assistant__scope.is-active {
    background: var(--survai-brand) !important;
    border-color: var(--survai-brand) !important;
    color: var(--survai-brand-ink) !important;
}

/* Keyword pills: a faint white ring and the text colour. */
html[data-theme="dark"] .keyword-regen-pill {
    border-color: rgba(255, 255, 255, 0.18);
    color: var(--survai-text);
}

/* Backdrops: neutral black, never navy. */
html[data-theme="dark"] .output-room-modal__backdrop,
html[data-theme="dark"] .output-image-editor-modal__backdrop,
html[data-theme="dark"] .survai-regen-notes-modal__overlay,
html[data-theme="dark"] .keyword-regen-modal__overlay,
html[data-theme="dark"] .po-details-modal__overlay,
html[data-theme="dark"] .po-crop-modal__backdrop,
html[data-theme="dark"] .pwa-install-modal-backdrop,
html[data-theme="dark"] .image-manager-bulk-edit-modal,
html[data-theme="dark"] .image-delete-dialog,
html[data-theme="dark"] .smart-annotation-modal,
html[data-theme="dark"] body.has-mobile-sidebar .mobile-menu-overlay {
    background: rgba(0, 0, 0, 0.6);
}

html[data-theme="dark"] .street-view-editor-modal::backdrop,
html[data-theme="dark"] .rating-sections-modal::backdrop,
html[data-theme="dark"] .desk-study-address-dialog::backdrop {
    background: rgba(0, 0, 0, 0.6);
}

/* Tooltips: the same dark surface with a faint white edge; the white text stays. */
html[data-theme="dark"] .output-icon-action::after,
html[data-theme="dark"] .workspace-tool-button:hover::after,
html[data-theme="dark"] .workspace-tool-button:focus-visible::after,
html[data-theme="dark"] .workspace-topbar .workspace-fullscreen-toggle:hover::after,
html[data-theme="dark"] .workspace-topbar .workspace-fullscreen-toggle:focus-visible::after {
    border-color: rgba(255, 255, 255, 0.16);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.5);
}

/* Map marker pop-ups (dashboard and coverage map): Leaflet's white bubble carried
   the dark theme's white text. The property overview had its own scoped rule;
   this one covers every map. */
html[data-theme="dark"] .leaflet-popup-content-wrapper,
html[data-theme="dark"] .leaflet-popup-tip {
    background: var(--survai-card);
    color: var(--survai-text);
}

html[data-theme="dark"] .leaflet-popup-content-wrapper {
    border: 1px solid rgba(255, 255, 255, 0.14);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04), 0 18px 45px rgba(0, 0, 0, 0.55);
}

html[data-theme="dark"] .leaflet-popup-close-button {
    color: var(--survai-text-soft);
}

/* Pull-to-refresh pill, idle: the dark surface; the ready and refreshing states keep
   their brand blue. */
html[data-theme="dark"] .pwa-pull-refresh-indicator:not(.is-ready):not(.is-refreshing) {
    background: rgba(38, 38, 38, 0.94);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.5);
}

/* --- Main and Settings sidebars: labelled groups added in Settings → Menu Builder.
       Matches the report workspace rail's groups; only drawn when a super admin adds a
       headed section, so the standard sidebars are unaffected. --- */

.sidebar .sidebar-nav-group--arranged {
    display: grid;
    gap: 2px;
    min-width: 0;
    margin-top: 10px;
    padding-top: 12px;
    border-top: 1px solid var(--survai-border);
}

.sidebar .sidebar-nav-group--arranged .sidebar-nav-group__label {
    margin: 0 0 6px;
    padding: 0 12px;
    color: var(--survai-text-muted);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    line-height: 1.2;
    text-transform: uppercase;
}

/* --- Map legend info pop-ups (surveyor, 3 Oct 2026: "info modals when we hover over the items").
       One card above the legend strip, placed over the hovered or focused item by
       initPropertyLocationLegendInfo() in app.js; the arrow points at the item. --- */

.property-location-legend-info {
    position: absolute;
    left: 0;
    bottom: 0;
    z-index: 650;
    display: grid;
    gap: 6px;
    width: max-content;
    max-width: min(300px, calc(100vw - 32px));
    padding: 12px 14px 13px;
    border: 1px solid var(--survai-border);
    border-radius: 14px;
    background: var(--survai-card);
    color: var(--survai-text);
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.22);
    text-align: left;
    pointer-events: none;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 140ms ease, transform 140ms ease;
}

.property-location-legend-info[hidden] {
    display: none;
}

.property-location-legend-info.is-visible {
    opacity: 1;
    transform: none;
}

.property-location-legend-info::after {
    content: "";
    position: absolute;
    left: var(--legend-info-arrow-x, 50%);
    bottom: -7px;
    width: 12px;
    height: 12px;
    border-right: 1px solid var(--survai-border);
    border-bottom: 1px solid var(--survai-border);
    background: var(--survai-card);
    transform: translateX(-50%) rotate(45deg);
}

.property-location-legend-info__title {
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--survai-text);
}

.property-location-legend-info__status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    justify-self: start;
    padding: 3px 9px 3px 8px;
    border-radius: 999px;
    background: var(--survai-neutral-hover);
    color: var(--survai-text-secondary);
    font-size: 0.74rem;
    font-weight: 600;
    line-height: 1.3;
}

.property-location-legend-info__status::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.85;
}

.property-location-legend-info__status--on {
    background: var(--survai-brand-soft);
    color: var(--survai-blue);
}

.property-location-legend-info__status--alert {
    background: rgba(239, 68, 68, 0.12);
    color: var(--survai-red);
}

.property-location-legend-info__status--muted {
    color: var(--survai-text-muted);
}

.property-location-legend-info__note {
    margin: 0;
    color: var(--survai-text-secondary);
    font-size: 0.82rem;
    line-height: 1.45;
}

html[data-theme="dark"] .property-location-legend-info {
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.5);
}

html[data-theme="dark"] .property-location-legend-info__status--on {
    background: var(--survai-tint-f2f4f7);
    color: var(--survai-text-strong);
}

@media (prefers-reduced-motion: reduce) {
    .property-location-legend-info {
        transition: none;
    }
}

/* ==========================================================================
   Report workspace pages fit the phone and never move sideways, on the
   website and in the app alike (surveyor, 7 Oct 2026: "on the mobile app the
   pages are not fitting correctly and when you swipe left and right the page
   can move around the screen").

   On these pages html and body are pinned and main.main-panel is the
   scroller. Its overflow-y: auto turns an unset overflow-x into auto, so on
   Media Manager, Documents & Files and Lifecycle (and Transcript above
   640px) one child a pixel too wide let the whole page slide under the
   finger, and the app's native sideways lock never reaches that box: WebKit
   gives a scrolling <main> its own scroll view. Clip it here, once, for
   every page that has the workspace rail. The overview's own
   `overflow-x: clip` stays; beside overflow-y: auto it computes to hidden,
   the same value. app.js (initWorkspaceMainPanelSidewaysLock) puts back a
   sideways offset that script or a caret reveal can still give a clipped
   box.
   ========================================================================== */
@media (max-width: 900px) {
    body:has(.sidebar--workspace) .main-panel {
        overflow-x: hidden;
        overscroll-behavior-x: none;
    }

    /* The strips that scroll sideways on purpose keep doing so, but a swipe
       that reaches their end stops there instead of chaining on to the page.
       (The stage-tab strip and the overview's map legend already contain.) */
    .output-workspace-tabs,
    .transcript-document-carousel,
    .transcript-site-uploads-scroll,
    .table-wrap,
    .room-table-wrap,
    .image-manager-bulk-toolbar,
    .survai-image-action-dock {
        overscroll-behavior-x: contain;
    }
}

/* Transcript page, Site uploads, on a phone: each upload becomes a card and
   each cell a labelled line (the label is the cell's data-label, set in
   transcript-workspace.php). The 1480px nine-column table panned sideways
   inside its box, broke the ID into a column of single digits and made every
   row a screen tall (the notes box also picked up the main editor's 44vh
   phone height). Desktop and tablet keep the table exactly as it was. */
@media (max-width: 640px) {
    .transcript-site-uploads-scroll {
        max-height: none;
        min-height: 0;
        overflow: visible;
        border: 0;
        border-radius: 0;
        background: none;
    }

    .transcript-site-uploads-table {
        display: block;
        width: 100%;
        min-width: 0;
    }

    /* Each card names its own cells, so the column headings go. */
    .transcript-site-uploads-table thead {
        display: none;
    }

    .transcript-site-uploads-table tbody {
        display: grid;
        gap: 10px;
    }

    .transcript-site-uploads-table tr.transcript-site-upload-row {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 10px 12px;
        padding: 12px;
        border: 1px solid var(--survai-border);
        border-radius: 12px;
        background: var(--survai-card);
    }

    .transcript-site-uploads-table tbody td {
        display: block;
        min-width: 0;
        padding: 0;
        border-bottom: 0;
    }

    /* The label is the column heading, so it reads the table heading tokens
       (light and Carbon dark). */
    .transcript-site-uploads-table tbody td::before {
        content: attr(data-label);
        display: block;
        margin-bottom: 3px;
        color: var(--table-head-ink);
        font-size: var(--table-head-font-size);
        font-weight: var(--table-head-font-weight);
        line-height: 1.3;
        letter-spacing: var(--table-head-tracking);
        text-transform: uppercase;
    }

    /* The filename heads the card; ID, Type, Size and Uploaded sit two to a
       line; the rest take the full width. */
    .transcript-site-uploads-table td.transcript-su-col-file {
        order: -1;
    }

    .transcript-site-uploads-table td.transcript-su-col-file,
    .transcript-site-uploads-table td.transcript-su-col-status,
    .transcript-site-uploads-table td.transcript-su-col-transcript,
    .transcript-site-uploads-table td.transcript-su-col-notes,
    .transcript-site-uploads-table td.transcript-su-col-actions {
        grid-column: 1 / -1;
        min-width: 0;
    }

    .transcript-site-uploads-table .transcript-site-upload-filename {
        max-width: 100%;
        white-space: normal;
        overflow-wrap: anywhere;
        font-weight: 700;
    }

    .transcript-site-uploads-table .transcript-su-col-status .transcript-site-upload-row-hint {
        display: block;
        margin-top: 4px;
    }

    .transcript-site-uploads-table .transcript-site-upload-table-ta {
        min-width: 0;
    }

    .transcript-site-uploads-table textarea.transcript-site-upload-table-ta {
        min-height: 72px;
    }

    .transcript-site-uploads-table .transcript-site-upload-actions-stack {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        gap: 8px;
        min-width: 0;
    }
}

/* ==========================================================================
   Carbon dark: what the tokens cannot reach (surveyor, 7 Oct 2026: "copy all of the
   colours, the branding colours from the marketing site for the dark setting, so that
   the same colour scheme is across the entire app").

   In dark the brand is the marketing site's light button: an off-white fill (#f2f2f0,
   hover #d4d4d0) with charcoal ink (#151515), and there is no blue. These rules give
   every control that hard-codes a blue fill or white ink on a brand fill the same
   treatment, and only in dark: each one is the light rule's selector behind
   html[data-theme="dark"], with !important wherever the light rule has it. Light mode
   is untouched. Neutral overlays (tooltips, notifications, the assistant header) take
   Carbon's raised surface, #262626 with a #303030 edge, as the marketing menus do.
   Map pins and layers, EPC bands, chart data and photo-editor pens keep their colours.
   ========================================================================== */

/* -- Primary actions and selected states: off-white fill, charcoal ink -- */
html[data-theme="dark"] .reports-page .reports-density__btn[aria-pressed="true"],
html[data-theme="dark"] .template-block-variant-tab.is-active,
html[data-theme="dark"] .keyword-regen-pill.is-selected,
html[data-theme="dark"] .report-type-badge--level-2,
html[data-theme="dark"] .output-section-add-cost__count,
html[data-theme="dark"] .survai-image-action-dock__badge,
html[data-theme="dark"] .survai-output-action-dock__badge,
html[data-theme="dark"] .defect-badge--source-manual,
html[data-theme="dark"] .survai-voice-assistant__bubble--user,
html[data-theme="dark"] .survai-voice-assistant__mic,
html[data-theme="dark"] .survai-voice-assistant__send,
html[data-theme="dark"] .survai-voice-assistant.is-conversing .survai-voice-assistant__launcher,
html[data-theme="dark"] .siex__save,
html[data-theme="dark"] .siex__nav:hover,
html[data-theme="dark"] .siex__nav:focus-visible,
html[data-theme="dark"] .output-room-modal__nav:hover,
html[data-theme="dark"] .output-room-modal__nav:focus-visible,
html[data-theme="dark"] .transcript-mic-button.is-active,
html[data-theme="dark"] .image-manager-filter-button:hover,
html[data-theme="dark"] .image-manager-filter-button:focus-visible,
html[data-theme="dark"] .image-manager-filter-button[aria-expanded="true"],
html[data-theme="dark"] .survai-image-ai-label-btn:hover,
html[data-theme="dark"] .survai-image-ai-label-btn:focus-visible,
html[data-theme="dark"] .output-section.is-section-regenerating.is-collapsed::after,
html[data-theme="dark"] .output-section.is-section-regenerating:not(.is-collapsed) .output-section-box::after,
html[data-theme="dark"] .pwa-pull-refresh-indicator.is-ready,
html[data-theme="dark"] .pwa-pull-refresh-indicator.is-refreshing {
    border-color: var(--survai-brand);
    background: var(--survai-brand);
    color: var(--survai-brand-ink);
    box-shadow: none;
}

html[data-theme="dark"] .siex__save:hover {
    background: var(--survai-brand-hover);
}

html[data-theme="dark"] .transcript-mic-button.is-active svg {
    stroke: var(--survai-brand-ink);
}

html[data-theme="dark"] .siex__tool.is-active {
    background: var(--survai-brand) !important;
    color: var(--survai-brand-ink) !important;
}

html[data-theme="dark"] .site-media-processing-toast-wrap .site-media-processing-toast,
html[data-theme="dark"] .report-site-media-unified-browse-btn {
    background: var(--survai-brand);
    color: var(--survai-brand-ink) !important;
    box-shadow: var(--survai-shadow);
}

html[data-theme="dark"] .report-site-media-unified-browse-btn svg {
    color: var(--survai-brand-ink) !important;
}

/* Fills that read the brand tokens already turn off-white; their ink is a white literal. */
html[data-theme="dark"] .pill-toggle .pill-input:checked + .pill-label,
html[data-theme="dark"] .sort-settings-option:has(input:checked) .sort-settings-option__icon,
html[data-theme="dark"] .output-icon-action.is-speech-playing,
html[data-theme="dark"] .output-icon-action.is-speech-playing:hover,
html[data-theme="dark"] .output-icon-action.is-speech-playing:focus-visible,
html[data-theme="dark"] .room-area-pill.is-added,
html[data-theme="dark"] .room-area-pill:disabled,
html[data-theme="dark"] .room-area-pill.is-added::after,
html[data-theme="dark"] .progress-dock-btn--primary,
html[data-theme="dark"] .image-manager-tab strong,
html[data-theme="dark"] .image-manager-filter-trigger strong {
    color: var(--survai-brand-ink);
}

html[data-theme="dark"] .room-area-pill.is-added::after {
    background: rgba(21, 21, 21, 0.12);
}

html[data-theme="dark"] body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .output-room-generation-head .btn-primary,
html[data-theme="dark"] body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .output-room-generation-head .btn-primary:hover,
html[data-theme="dark"] body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .output-room-generation-head .btn-primary:focus-visible,
html[data-theme="dark"] [class*="primary-btn"],
html[data-theme="dark"] [class*="create-survey"],
html[data-theme="dark"] [class*="primary-btn"]:hover,
html[data-theme="dark"] [class*="create-survey"]:hover,
html[data-theme="dark"] button[style*="--survai-blue"],
html[data-theme="dark"] a[style*="--survai-blue"],
html[data-theme="dark"] .btn[style*="--survai-blue"] {
    color: var(--survai-brand-ink) !important;
}

/* Inline blue the stylesheet cannot recolour (style="background:#2563eb" and the like),
   and the blue-named helper classes: off-white with charcoal ink, as everywhere else. */
html[data-theme="dark"] button[style*="#2563eb"],
html[data-theme="dark"] a[style*="#2563eb"],
html[data-theme="dark"] .btn[style*="#2563eb"],
html[data-theme="dark"] button[style*="#1b5af9"],
html[data-theme="dark"] a[style*="#1b5af9"],
html[data-theme="dark"] .btn[style*="#1b5af9"],
html[data-theme="dark"] button[style*="#1d4ed8"],
html[data-theme="dark"] a[style*="#1d4ed8"],
html[data-theme="dark"] .btn[style*="#1d4ed8"],
html[data-theme="dark"] [class*="blue-btn"],
html[data-theme="dark"] [class*="blue-button"],
html[data-theme="dark"] [class*="blue-action"],
html[data-theme="dark"] [class*="action-blue"] {
    background: var(--survai-brand) !important;
    border-color: var(--survai-brand) !important;
    color: var(--survai-brand-ink) !important;
}

/* Ticks, radios and the photo-select check: the fill turns off-white, the mark charcoal. */
html[data-theme="dark"] .report-settings-page .image-labelling-setting-options input[type="radio"] {
    accent-color: var(--survai-brand);
}

html[data-theme="dark"] .output-image-select-control input:checked + span,
html[data-theme="dark"] :is(.media-manager-panel .image-manager-card--grid, .survai-photo-tile) .photo-select-check input:checked + span {
    border-color: var(--survai-brand);
    background: var(--survai-brand);
    color: var(--survai-brand-ink);
}

/* Progress fills: the bar is the brand, so it is off-white. */
html[data-theme="dark"] body.knowledge-base-page .knowledge-base-progress span,
html[data-theme="dark"] .knowledge-base-upload .knowledge-base-progress span {
    background: var(--survai-brand);
}

/* A document-type square is an icon, not an action: a tone tile with ink. */
html[data-theme="dark"] .transcript-document-icon {
    background: var(--survai-tint-f2f4f7);
    color: var(--survai-text);
}

/* The compass letter sits on the strong grey surface, not on a brand fill. */
html[data-theme="dark"] .property-overview-main .report-overview-grid .po-sprift .po-sprift-right .property-location-compass__abbr {
    color: var(--survai-text);
}

/* -- Neutral overlays: Carbon's raised surface, white text kept by the tooltip standard -- */
html[data-theme="dark"] .workspace-stage-subnav__tooltip,
html[data-theme="dark"] .survai-notification,
html[data-theme="dark"] .survai-notification-success,
html[data-theme="dark"] .survai-notification-info,
html[data-theme="dark"] .survai-notification-loading,
html[data-theme="dark"] .survai-voice-assistant__head {
    border: 1px solid var(--survai-border);
    background: var(--survai-ink-surface);
    background-color: var(--survai-ink-surface);
    box-shadow: var(--survai-shadow-hover);
}

html[data-theme="dark"] .survai-notification-error {
    border: 1px solid #6a2f2a;
    background-color: #2c1513;
}

html[data-theme="dark"] .survai-voice-assistant__head {
    color: var(--survai-text);
    border-width: 0 0 1px;
}

/* Notices: success in Carbon's green, information as a raised panel. */
html[data-theme="dark"] .alert-success {
    color: #86d6a6;
    background: #13261b;
    border: 1px solid #2f5a40;
}

html[data-theme="dark"] .alert-info {
    color: var(--survai-text);
    background: var(--survai-ink-surface);
    border: 1px solid var(--survai-border);
}

/* ==========================================================================
   Carbon dark: the rest (focus rings, tints, pale borders, status, Final Check)
   (surveyor, 7 Oct 2026: "copy all of the colours, the branding colours from the
   marketing site for the dark setting, so that the same colour scheme is across the
   entire app").

   The literals the token block and the brand-fill pass above could not reach: blue focus
   rings, glows and pulses, low-alpha blue tints, pale slate and blue hairlines (they show
   as near-white lines on a dark page, the Reports list's row dividers among them), status
   edges, the page and main-panel gradients, and the Final Check board. Dark only; light
   mode is untouched.

   Each rule is the light rule's own selector list behind :where(html[data-theme="dark"]).
   :where() adds no weight, so a dark rule has exactly its light rule's specificity (and its
   !important) and, being last in the file, replaces only that declaration: a hover,
   drag-over, checked or error rule that out-ranks the base rule in light still out-ranks
   it in dark, and the earlier dark rules keep winning where they already did. Borders change
   colour only, never width or style. Where a light rule loses to a stronger one (the report
   header's ink guard) the dark rule names that context instead. Map pins and layers, EPC
   band fills, chart data and on-photo controls keep their colours.
   ========================================================================== */

/* Page: a flat graphite main panel. The light main-panel rules paint a blue halo and a
   card-to-page gradient with !important, so in dark the panel's top band was the card grey
   (the seam under the app's native bar). The phone rule keeps its own copy because its first
   selector also matches the output page. (The body itself is already flat: the !important
   body rule near the top of the file out-ranks the later body gradient.) */
:where(html[data-theme="dark"]) body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body):not(.output-report-page) .main-panel,
:where(html[data-theme="dark"]) body.dashboard-body .main-panel,
:where(html[data-theme="dark"]) body.ops-dashboard-page .main-panel,
:where(html[data-theme="dark"]) body.survey-workflow-surface .main-panel,
:where(html[data-theme="dark"]) body.progress-page .main-panel {
    background: var(--survai-page-bg) !important;
}

@media (max-width: 900px) {
    :where(html[data-theme="dark"]) body:not(.login-body):not(.survaicam-page):not(.capture-mode-body):not(.pdf-viewer-body) .main-panel,
    :where(html[data-theme="dark"]) body.dashboard-body .main-panel,
    :where(html[data-theme="dark"]) body.ops-dashboard-page .main-panel,
    :where(html[data-theme="dark"]) body.survey-workflow-surface .main-panel,
    :where(html[data-theme="dark"]) body.progress-page .main-panel {
        background: var(--survai-page-bg) !important;
    }
}

/* Global status utilities (all !important in light): Carbon's status tones. The active and
   assigned state is a tone surface with the ink colour, as Carbon has no blue. */
:where(html[data-theme="dark"]) .status-completed,
:where(html[data-theme="dark"]) .is-success {
    background: #13261b !important;
    color: #86d6a6 !important;
}

:where(html[data-theme="dark"]) .status-assigned,
:where(html[data-theme="dark"]) .status-in-progress,
:where(html[data-theme="dark"]) .is-active {
    background: var(--survai-bg-tint) !important;
    color: var(--survai-text) !important;
}

:where(html[data-theme="dark"]) .is-warning {
    background: #2a2111 !important;
    color: #f0c56e !important;
}

:where(html[data-theme="dark"]) .is-danger,
:where(html[data-theme="dark"]) .status-overdue {
    background: #2c1513 !important;
    color: #ff9d93 !important;
}

/* Two controls whose active state is a brand fill (the brand-fill pass above gives them
   charcoal ink): the !important utility would paint them the tone surface under that ink,
   and the transcript microphone's icon vanished. Like the voice scope chip, they out-rank it. */
html[data-theme="dark"] .transcript-mic-button.is-active,
html[data-theme="dark"] .template-block-variant-tab.is-active {
    background: var(--survai-brand) !important;
    color: var(--survai-brand-ink) !important;
}

/* Hover and open states: Carbon's hover grey, not a blue wash. The coverage filters' own
   dark rule has no !important and loses to the light one, so this one carries it. */
:where(html[data-theme="dark"]) table tr:hover td,
:where(html[data-theme="dark"]) .wizard-documents-table tbody tr:hover {
    background: var(--survai-neutral-hover) !important;
}

:where(html[data-theme="dark"]) .output-repair-catalog__option:hover,
:where(html[data-theme="dark"]) .output-repair-catalog__option:focus-visible,
:where(html[data-theme="dark"]) .output-repair-catalog__option.is-active {
    background: var(--survai-neutral-hover);
}

:where(html[data-theme="dark"]) .reports-filter-status__option:hover {
    background: var(--survai-neutral-hover);
}

:where(html[data-theme="dark"]) .ops-dashboard-layout-toggle:hover,
:where(html[data-theme="dark"]) .ops-dashboard-customize.is-open .ops-dashboard-layout-toggle {
    border-color: var(--field-border-color);
    background: var(--survai-neutral-hover);
}

:where(html[data-theme="dark"]) .ops-dashboard-dropzone.is-dashboard-drag-over {
    box-shadow: inset 0 0 0 1px var(--field-border-color);
}

:where(html[data-theme="dark"]) .report-workspace-nav__link:hover,
:where(html[data-theme="dark"]) .report-workspace-nav__link:focus-visible {
    background: var(--survai-neutral-hover);
}

:where(html[data-theme="dark"]) tbody tr:hover {
    background: var(--survai-neutral-hover) !important;
}

:where(html[data-theme="dark"]) .ops-dashboard-customize-btn:hover:not(:disabled),
:where(html[data-theme="dark"]) .ops-dashboard-dropzone.is-dashboard-drag-over {
    border-color: var(--field-border-color) !important;
    background: var(--survai-neutral-hover) !important;
}

:where(html[data-theme="dark"]) .ops-dashboard-draggable.is-dashboard-dragging {
    border-color: var(--survai-brand) !important;
    box-shadow: var(--survai-shadow) !important;
}

:where(html[data-theme="dark"]) .ops-coverage-filters button:hover,
:where(html[data-theme="dark"]) .ops-coverage-filters button.is-active,
:where(html[data-theme="dark"]) .tab.is-active {
    border-color: var(--survai-border-mid) !important;
    background: var(--survai-neutral-hover) !important;
    color: var(--survai-text) !important;
}

:where(html[data-theme="dark"]) .survai-regen-menu__item:hover,
:where(html[data-theme="dark"]) .survai-regen-menu__item:focus-visible {
    background: var(--survai-neutral-hover);
}

/* Focus rings and selected outlines: the off-white focus colour (--survai-focus), drawn at the
   light rule's own width. */
:where(html[data-theme="dark"]) .reports-page .reports-order-by select:focus-visible {
    outline-color: var(--survai-brand);
}

:where(html[data-theme="dark"]) .reports-page .reports-density__btn:focus-visible {
    outline-color: var(--survai-brand);
}

:where(html[data-theme="dark"]) .photo-review-item.is-selected {
    box-shadow: 0 0 0 2px var(--survai-brand);
}

:where(html[data-theme="dark"]) .output-room-observations-editor:focus {
    border-color: var(--survai-brand);
    box-shadow: 0 0 0 3px rgba(242, 242, 240, 0.25);
}

:where(html[data-theme="dark"]) .condition-rating-summary-card:focus-visible {
    outline-color: var(--survai-brand);
}

:where(html[data-theme="dark"]) .output-embedded-image.is-selected .output-image-surface img {
    outline-color: var(--survai-brand);
}

:where(html[data-theme="dark"]) [data-condition-rating-badge]:focus-visible {
    outline-color: var(--survai-brand);
}

@media (max-width: 900px) {
    :where(html[data-theme="dark"]) body.has-mobile-sidebar .mobile-menu-toggle--brand:focus-visible {
        outline-color: var(--survai-brand);
    }
}

:where(html[data-theme="dark"]) .ops-dashboard .ops-grid > .ops-card .ops-donut-block--chart:focus-visible {
    outline-color: var(--survai-brand);
}

:where(html[data-theme="dark"]) .ops-kpi-grid > .ops-card .ops-donut-block--chart:focus-visible {
    outline-color: var(--survai-brand);
}

:where(html[data-theme="dark"]) .progress-page .workflow-photo-link:focus-visible {
    outline-color: var(--survai-brand);
}

:where(html[data-theme="dark"]) .report-documents-modal__select:has(input:checked) {
    border-color: var(--survai-brand);
}

:where(html[data-theme="dark"]) .section-album-modal .section-album-card.is-selected {
    border-color: var(--survai-brand);
    box-shadow: 0 0 0 2px rgba(242, 242, 240, 0.35);
}

:where(html[data-theme="dark"]) .progress-media-item.is-selected,
:where(html[data-theme="dark"]) .progress-video-item.is-selected,
:where(html[data-theme="dark"]) .evidence-upload-item.is-selected,
:where(html[data-theme="dark"]) .evidence-video-item.is-selected,
:where(html[data-theme="dark"]) .supporting-document-item.is-selected,
:where(html[data-theme="dark"]) .workflow-photo-roll figure.is-selected {
    outline-color: var(--survai-brand);
    box-shadow: var(--survai-shadow) !important;
}

:where(html[data-theme="dark"]) .image-manager-selection-box {
    border-color: var(--survai-brand);
    background: rgba(242, 242, 240, 0.12);
}

:where(html[data-theme="dark"]) .svrpm__play:focus-visible,
:where(html[data-theme="dark"]) .svrpm__sheet .survai-progress-action-dock__action:focus-visible,
:where(html[data-theme="dark"]) .svrpm__sheet .survai-progress-overlay__control:focus-visible {
    box-shadow: 0 0 0 3px var(--survai-brand);
}

:where(html[data-theme="dark"]) .keyword-regen-preview {
    border-left-color: var(--survai-brand);
}

:where(html[data-theme="dark"]) .legal-templates-option:has(input:checked) {
    border-color: var(--survai-brand);
}

:where(html[data-theme="dark"]) .survai-dictate__button:focus-visible {
    outline-color: var(--survai-brand);
}

/* Hover edges: the control border (#7d7d79), and no blue glow (Carbon lifts with a black
   shadow or not at all). */
:where(html[data-theme="dark"]) .sort-settings-option:hover {
    border-color: var(--field-border-color);
}

:where(html[data-theme="dark"]) .output-section-costs__add:hover {
    border-color: var(--field-border-color);
}

:where(html[data-theme="dark"]) .template-block-variant-tab:hover {
    border-color: var(--field-border-color);
}

:where(html[data-theme="dark"]) .workspace-epc-chip:hover {
    border-color: var(--field-border-color);
}

:where(html[data-theme="dark"]) .po-date-edit-button:hover,
:where(html[data-theme="dark"]) .po-date-edit-button:focus-visible {
    border-color: var(--field-border-color);
    box-shadow: var(--survai-shadow);
}

:where(html[data-theme="dark"]) .image-manager-icon-button:hover,
:where(html[data-theme="dark"]) .image-manager-icon-button:focus-visible {
    border-color: var(--field-border-color);
    box-shadow: none;
}

:where(html[data-theme="dark"]) .image-manager-tab:hover,
:where(html[data-theme="dark"]) .image-manager-tab:focus-visible,
:where(html[data-theme="dark"]) .image-manager-tab.is-active {
    border-color: var(--field-border-color);
    box-shadow: none;
}

:where(html[data-theme="dark"]) .image-manager-filter-trigger:hover,
:where(html[data-theme="dark"]) .image-manager-filter-trigger:focus-visible,
:where(html[data-theme="dark"]) .image-manager-filter-trigger[aria-expanded="true"],
:where(html[data-theme="dark"]) .image-manager-filter-trigger.is-active {
    border-color: var(--field-border-color);
    box-shadow: none;
}

:where(html[data-theme="dark"]) .image-manager-settings-options label:hover,
:where(html[data-theme="dark"]) .image-manager-settings-options label:focus-within {
    border-color: var(--field-border-color);
    box-shadow: none;
}

:where(html[data-theme="dark"]) .siex__filters button:hover {
    border-color: var(--field-border-color);
}

:where(html[data-theme="dark"]) .siex__tool:hover {
    color: var(--survai-text);
}

:where(html[data-theme="dark"]) .survai-dictate__button:hover {
    border-color: var(--field-border-color);
}

:where(html[data-theme="dark"]) .survai-dictate__button.is-listening {
    border-color: #ff9d93;
}

:where(html[data-theme="dark"]) .transcript-readable.is-expanded,
:where(html[data-theme="dark"]) textarea.transcript-workspace-editor.is-expanded {
    border-color: var(--field-border-color);
}

/* -- Selected and dragging states: off-white edge on a tone surface, black lift. -- */
:where(html[data-theme="dark"]) body.knowledge-base-page .knowledge-base-dropzone.is-dragover,
:where(html[data-theme="dark"]) .knowledge-base-upload .knowledge-base-dropzone.is-dragover {
    border-color: var(--survai-brand);
    box-shadow: var(--survai-shadow);
}

:where(html[data-theme="dark"]) .sort-settings-option:has(input:checked) {
    background: var(--survai-bg-tint);
    box-shadow: inset 0 0 0 1px var(--survai-brand), var(--survai-shadow);
}

:where(html[data-theme="dark"]) .sort-settings-option:has(input:focus-visible) {
    box-shadow: var(--survai-focus);
}

:where(html[data-theme="dark"]) .transcript-document-card.is-selected {
    border-color: var(--survai-brand);
    background: var(--survai-bg-tint);
}

/* Blue tints become Carbon's tone surface (#2f2f2f); icon squares keep an ink glyph.
   A blue hairline on the same element goes to the divider. */
:where(html[data-theme="dark"]) .ops-kpi-card .ops-line-icon,
:where(html[data-theme="dark"]) .transcript-document-icon {
    background: var(--survai-bg-tint) !important;
    color: var(--survai-text) !important;
}

:where(html[data-theme="dark"]) body.knowledge-base-page .knowledge-base-dropzone__icon,
:where(html[data-theme="dark"]) .knowledge-base-upload .knowledge-base-dropzone__icon {
    background: var(--survai-bg-tint);
}

:where(html[data-theme="dark"]) body.knowledge-base-page .knowledge-base-selected-file,
:where(html[data-theme="dark"]) .knowledge-base-upload .knowledge-base-selected-file {
    background: var(--survai-bg-tint);
}

:where(html[data-theme="dark"]) body.knowledge-base-page .knowledge-base-type-pill {
    background: var(--survai-bg-tint);
}

:where(html[data-theme="dark"]) .report-status-pill-menu__option.is-selected {
    background: var(--survai-bg-tint);
}

:where(html[data-theme="dark"]) .ai-terminology-chip {
    border-color: var(--survai-border);
    background: var(--survai-bg-tint);
}

:where(html[data-theme="dark"]) .output-repair-modal__existing {
    border-color: var(--survai-border);
    background: var(--survai-bg-tint);
}

:where(html[data-theme="dark"]) .section-regenerate-status {
    border-color: var(--survai-border);
    background: var(--survai-bg-tint);
}

:where(html[data-theme="dark"]) .report-site-media-unified-head__icon {
    background: var(--survai-bg-tint);
}

:where(html[data-theme="dark"]) .report-site-media-unified-zone__icon {
    background: var(--survai-bg-tint);
}

:where(html[data-theme="dark"]) .report-site-media-unified-feature__icon {
    background: var(--survai-bg-tint);
}

:where(html[data-theme="dark"]) .property-location-empty__icon {
    background: var(--survai-bg-tint);
}

:where(html[data-theme="dark"]) .survai-professional-notice__label {
    background: var(--survai-bg-tint);
}

:where(html[data-theme="dark"]) .transcript-site-upload-status {
    background: var(--survai-bg-tint);
    color: var(--survai-text-soft);
}

:where(html[data-theme="dark"]) .transcript-site-upload-row.status-failed .transcript-site-upload-status,
:where(html[data-theme="dark"]) .transcript-site-upload-row.status-failed_terminal .transcript-site-upload-status,
:where(html[data-theme="dark"]) .transcript-site-upload-row.status-failed_retryable .transcript-site-upload-status {
    background: #2c1513;
    color: #ff9d93;
}

:where(html[data-theme="dark"]) .transcript-site-upload-row.status-completed .transcript-site-upload-status {
    background: #13261b;
    color: #86d6a6;
}

:where(html[data-theme="dark"]) .transcript-site-upload-row-hint--ok {
    color: #86d6a6;
}

:where(html[data-theme="dark"]) .transcript-site-upload-row-hint--error {
    color: #ff9d93;
}

:where(html[data-theme="dark"]) .transcript-site-upload-row.status-transcribing .transcript-site-upload-status,
:where(html[data-theme="dark"]) .transcript-site-upload-row.status-pending_cloud_transcription .transcript-site-upload-status,
:where(html[data-theme="dark"]) .transcript-site-upload-row.status-aws_transcribe_processing .transcript-site-upload-status {
    background: var(--survai-bg-tint);
    color: var(--survai-text-soft);
}

:where(html[data-theme="dark"]) .transcript-site-upload-row.status-pending .transcript-site-upload-status,
:where(html[data-theme="dark"]) .transcript-site-upload-row.status-pending_audio_extraction .transcript-site-upload-status,
:where(html[data-theme="dark"]) .transcript-site-upload-row.status-extracting_audio .transcript-site-upload-status,
:where(html[data-theme="dark"]) .transcript-site-upload-row.status-queued .transcript-site-upload-status,
:where(html[data-theme="dark"]) .transcript-site-upload-row.status-processing .transcript-site-upload-status,
:where(html[data-theme="dark"]) .transcript-site-upload-row.status-uploaded .transcript-site-upload-status {
    background: var(--survai-bg-tint);
    color: var(--survai-text-secondary);
}

:where(html[data-theme="dark"]) .transcript-mic-button {
    border-color: var(--field-border-color);
    background: var(--survai-bg-tint);
}

:where(html[data-theme="dark"]) .transcript-mic-button svg {
    stroke: var(--survai-text);
}

:where(html[data-theme="dark"]) .transcript-recording-status {
    background: var(--survai-bg-tint);
}

:where(html[data-theme="dark"]) .transcript-recording-card.status-transcribing .transcript-recording-status {
    background: var(--survai-bg-tint);
}

:where(html[data-theme="dark"]) .po-hero-placeholder {
    background: var(--survai-bg-tint);
}

:where(html[data-theme="dark"]) .po-heritage-indicator--neutral {
    background: var(--survai-bg-tint);
    color: var(--survai-text);
}

:where(html[data-theme="dark"]) .po-heritage-grade {
    background: var(--survai-bg-tint);
    color: var(--survai-text);
}

:where(html[data-theme="dark"]) .po-act-icon {
    background: var(--survai-bg-tint);
}

:where(html[data-theme="dark"]) .po-act-icon--ok {
    color: #86d6a6;
    background: #13261b;
}

:where(html[data-theme="dark"]) .po-act-icon--warn {
    color: #f0c56e;
    background: #2a2111;
}

:where(html[data-theme="dark"]) .po-act-icon--err {
    color: #ff9d93;
    background: #2c1513;
}

:where(html[data-theme="dark"]) .image-manager-filter-option strong {
    background: var(--survai-bg-tint);
}

:where(html[data-theme="dark"]) .media-manager-media-thumb {
    background: var(--survai-bg-tint);
}

:where(html[data-theme="dark"]) .media-manager-media-thumb--video {
    background: var(--survai-page-bg);
}

:where(html[data-theme="dark"]) .media-manager-audio-card__icon {
    background: var(--survai-bg-tint);
}

/* -- Panels that layered a blue wash over a gradient: one flat Carbon surface. -- */
:where(html[data-theme="dark"]) body.knowledge-base-page .knowledge-base-dropzone,
:where(html[data-theme="dark"]) .knowledge-base-upload .knowledge-base-dropzone {
    background: var(--survai-bg-soft);
}

:where(html[data-theme="dark"]) .ai-global-rules-panel {
    background: var(--survai-bg-soft);
}

:where(html[data-theme="dark"]) .ai-terminology-panel {
    background: var(--survai-card);
}

:where(html[data-theme="dark"]) .ops-dashboard-layout-toggle {
    background: var(--survai-card);
}

:where(html[data-theme="dark"]) .property-location-map {
    background: var(--survai-bg-soft);
}

:where(html[data-theme="dark"]) .property-location-static-fallback__panel {
    background: var(--survai-card);
}

:where(html[data-theme="dark"]) .survai-professional-notice {
    border-color: var(--survai-border);
    background: var(--survai-card);
}

/* Photo surfaces still painted light while a picture loads (the loading skeleton was
   bright white blocks). background-image keeps the skeleton's shimmer sizing. */
:where(html[data-theme="dark"]) .section-thumb img {
    background: var(--survai-bg-tint);
}

:where(html[data-theme="dark"]) .image-manager-skeleton-grid span {
    border-color: var(--survai-border);
    background-image: linear-gradient(90deg, var(--survai-card), var(--survai-bg-tint), var(--survai-card));
}

:where(html[data-theme="dark"]) .image-manager-card .image-manager-thumb > .image-manager-photo-image,
:where(html[data-theme="dark"]) .image-manager-card .image-manager-thumb > img[data-photo-preview-img],
:where(html[data-theme="dark"]) .image-manager-card .image-manager-thumb > img {
    background: var(--survai-bg-soft);
}

:where(html[data-theme="dark"]) .image-manager-thumb-placeholder {
    background: var(--survai-bg-tint);
}

/* Brand fills and data bars without ink: off-white. A draft is not a brand state, so its
   dot is the subtle grey. */
:where(html[data-theme="dark"]) .status-dot--assigned {
    background: var(--survai-brand);
}

:where(html[data-theme="dark"]) .report-status-pill.report-status-pill--workspace-dot.status-assigned::after {
    background: var(--survai-brand);
}

:where(html[data-theme="dark"]) .report-status-pill.report-status-pill--workspace-dot.status-draft::after {
    background: var(--survai-text-muted);
}

/* No white ring round the dot on the charcoal header (M55, owner: "not have any white ring around it
   in dark mode"); light keeps its 1px white ring, unseen on the white header. */
:where(html[data-theme="dark"]) .report-status-pill.report-status-pill--workspace-dot::after {
    box-shadow: none;
}

:where(html[data-theme="dark"]) .ops-action-row--low .ops-action-dot {
    background: var(--survai-text-secondary);
}

:where(html[data-theme="dark"]) .kpi-bar-track {
    background: var(--survai-bg-tint);
}

:where(html[data-theme="dark"]) .kpi-bar-fill {
    background: var(--survai-brand);
}

/* Pale slate and blue hairlines: the divider (#303030) on surfaces, the control border
   (#7d7d79) on dashed drop zones and hover edges. Only the colour changes; widths and styles
   stay the light rule's. A state rule that out-ranks the base rule in light still does. */
:where(html[data-theme="dark"]) .reports-page .report-row {
    border-bottom-color: var(--survai-border);
}

:where(html[data-theme="dark"]) .media-dropzone {
    border-color: var(--field-border-color);
}

:where(html[data-theme="dark"]) .media-file-item.status-uploading,
:where(html[data-theme="dark"]) .media-file-item.status-transcribing,
:where(html[data-theme="dark"]) .media-file-item.status-selected {
    border-color: var(--survai-border);
}

:where(html[data-theme="dark"]) .pill-toggle .pill-label:hover {
    border-color: var(--field-border-color);
}

:where(html[data-theme="dark"]) .transcription-progress-panel {
    border-color: var(--survai-border);
}

:where(html[data-theme="dark"]) .processing-panel {
    border-color: var(--survai-border);
}

:where(html[data-theme="dark"]) .queue-processing {
    border-color: var(--survai-border);
}

:where(html[data-theme="dark"]) .upload-dropzone {
    border-color: var(--field-border-color);
}

:where(html[data-theme="dark"]) .photo-dropzone {
    border-color: var(--field-border-color);
}

:where(html[data-theme="dark"]) .sort-settings-option__indicator {
    border-color: var(--field-border-color);
}

:where(html[data-theme="dark"]) .output-section-costs__add {
    border-color: var(--survai-border);
}

:where(html[data-theme="dark"]) .template-list a.active,
:where(html[data-theme="dark"]) .template-list a:hover {
    border-color: var(--field-border-color);
}

:where(html[data-theme="dark"]) .template-block-drag-handle {
    border-color: var(--survai-border);
}

:where(html[data-theme="dark"]) .room-area-pill:hover:not(:disabled),
:where(html[data-theme="dark"]) .room-area-pill:focus-visible:not(:disabled) {
    border-color: var(--field-border-color);
}

:where(html[data-theme="dark"]) .room-area-pill.is-added:hover,
:where(html[data-theme="dark"]) .room-area-pill.is-added:focus-visible {
    background: var(--survai-brand-hover);
    border-color: var(--survai-brand-hover);
}

:where(html[data-theme="dark"]) .wizard-progress button:hover,
:where(html[data-theme="dark"]) .wizard-progress button:focus-visible,
:where(html[data-theme="dark"]) .wizard-progress button.active,
:where(html[data-theme="dark"]) .wizard-progress a:hover,
:where(html[data-theme="dark"]) .wizard-progress a:focus-visible,
:where(html[data-theme="dark"]) .wizard-progress a.active {
    border-color: var(--field-border-color);
}

:where(html[data-theme="dark"]) .document-master-dropzone {
    border-color: var(--field-border-color);
}

:where(html[data-theme="dark"]) .template-composer-row {
    border-color: var(--survai-border);
}

:where(html[data-theme="dark"]) .video-grid-actions .filter-btn {
    border-color: var(--field-border-color);
}

:where(html[data-theme="dark"]) .video-card {
    border-color: var(--survai-border);
}

:where(html[data-theme="dark"]) .video-action-btn {
    border-color: var(--field-border-color);
}

:where(html[data-theme="dark"]) .video-grid-empty {
    border-color: var(--field-border-color);
}

:where(html[data-theme="dark"]) .ops-team-row {
    border-bottom-color: var(--survai-border);
}

:where(html[data-theme="dark"]) .ops-diary-row,
:where(html[data-theme="dark"]) .ops-activity-row,
:where(html[data-theme="dark"]) .ops-today-row {
    border-bottom-color: var(--survai-border);
}

:where(html[data-theme="dark"]) .ops-insight-row {
    border-bottom-color: var(--survai-border);
}

:where(html[data-theme="dark"]) .ops-quick-actions a {
    border-color: var(--survai-border);
}

:where(html[data-theme="dark"]) .lifecycle-toolbar {
    border-top-color: var(--survai-border);
}

:where(html[data-theme="dark"]) .lifecycle-cost-summary div {
    border-color: var(--survai-border);
}

:where(html[data-theme="dark"]) .lifecycle-cost-chart {
    border-color: var(--survai-border);
}

:where(html[data-theme="dark"]) .lifecycle-forecast-event {
    border-color: var(--survai-border);
}

:where(html[data-theme="dark"]) .lifecycle-forecast-disclaimer {
    border-top-color: var(--survai-border);
}

:where(html[data-theme="dark"]) .lifecycle-update-panel {
    border-top-color: var(--survai-border);
}

:where(html[data-theme="dark"]) .kpi-metric-card {
    border-color: var(--survai-border);
}

:where(html[data-theme="dark"]) .kpi-mini-metrics > div {
    border-color: var(--survai-border);
}

:where(html[data-theme="dark"]) .kpi-dashboard .table-wrap {
    border-color: var(--survai-border);
}

:where(html[data-theme="dark"]) .kpi-list li {
    border-bottom-color: var(--survai-border);
}

:where(html[data-theme="dark"]) .desk-output-select-all-row {
    border-color: var(--survai-border);
}

:where(html[data-theme="dark"]) .desk-output-switch__slider {
    background: var(--survai-border-mid);
}

:where(html[data-theme="dark"]) .desk-output-field-list {
    border-color: var(--survai-border);
}

:where(html[data-theme="dark"]) .desk-output-field-list__item {
    border-bottom-color: var(--survai-border);
}

:where(html[data-theme="dark"]) .image-manager-filter-trigger {
    border-color: var(--survai-border);
}

:where(html[data-theme="dark"]) .image-manager-view-controls {
    border-color: var(--survai-border);
}

:where(html[data-theme="dark"]) .image-manager-bulk-toolbar {
    border-color: var(--survai-border);
}

:where(html[data-theme="dark"]) .image-manager-bulk-toolbar__group {
    border-left-color: var(--survai-border);
}

:where(html[data-theme="dark"]) .siex__nav {
    border-color: var(--survai-border);
}

:where(html[data-theme="dark"]) .siex__side-analyse {
    border-color: var(--survai-border) !important;
}

:where(html[data-theme="dark"]) .defect-audit-panel {
    border-color: var(--survai-border);
}

:where(html[data-theme="dark"]) .defect-register-card {
    border-color: var(--survai-border);
}

:where(html[data-theme="dark"]) .defect-evidence-chip {
    border-color: var(--survai-border);
}

:where(html[data-theme="dark"]) .defect-register-card__reassign {
    border-top-color: var(--survai-border);
}

:where(html[data-theme="dark"]) .keyword-management-group {
    border-color: var(--survai-border);
}

:where(html[data-theme="dark"]) .keyword-management-tag--locked {
    border-color: var(--field-border-color);
}

:where(html[data-theme="dark"]) .output-room-modal__nav {
    border-color: var(--survai-border);
}

/* Status edges and inks: Carbon's success, warning and error lines, in light source order
   so a variant still follows its base. */
:where(html[data-theme="dark"]) .media-file-item.status-completed {
    border-color: #2f5a40;
}

:where(html[data-theme="dark"]) .media-file-item.status-failed {
    border-color: #6a2f2a;
}

:where(html[data-theme="dark"]) .voice-note-item.is-offline {
    border-color: #5c4720;
}

:where(html[data-theme="dark"]) .voice-note-item.is-synced {
    border-color: #2f5a40;
}

:where(html[data-theme="dark"]) .transcription-progress-panel.is-complete {
    border-color: #2f5a40;
}

:where(html[data-theme="dark"]) .transcription-progress-panel.is-error {
    border-color: #6a2f2a;
}

:where(html[data-theme="dark"]) .transcription-next-actions {
    border-color: #2f5a40;
}

:where(html[data-theme="dark"]) .queue-completed {
    border-color: #2f5a40;
}

:where(html[data-theme="dark"]) .queue-failed {
    border-color: #6a2f2a;
}

:where(html[data-theme="dark"]) .photo-review-item.status-matched,
:where(html[data-theme="dark"]) .photo-review-item.status-annotated {
    border-color: #2f5a40;
}

:where(html[data-theme="dark"]) .photo-review-item.status-failed {
    border-color: #6a2f2a;
}

:where(html[data-theme="dark"]) .wizard-progress button.complete,
:where(html[data-theme="dark"]) .wizard-progress a.complete {
    border-color: #2f5a40;
}

:where(html[data-theme="dark"]) .wizard-progress button.complete span,
:where(html[data-theme="dark"]) .wizard-progress a.complete span {
    color: #13261b;
}

:where(html[data-theme="dark"]) .wizard-disclosure.has-validation-error {
    border-color: #6a2f2a;
}

:where(html[data-theme="dark"]) .workspace-header-badge--segment {
    border-color: #2f5a40;
}

:where(html[data-theme="dark"]) .defect-audit-finding {
    border-color: #6a2f2a;
    border-left-color: #ff9d93;
}

:where(html[data-theme="dark"]) .defect-audit-finding--warning {
    border-color: #5c4720;
    border-left-color: #f0c56e;
}

:where(html[data-theme="dark"]) .defect-badge--source-rule {
    color: var(--survai-text);
}

:where(html[data-theme="dark"]) .defect-badge--confidence-high {
    color: #86d6a6;
}

:where(html[data-theme="dark"]) .defect-badge--confidence-limited {
    color: #ff9d93;
}

/* -- Progress lights: Carbon's status colours, off-white while writing. (The play button's corner
   light is gone, M55: its glyph takes the state colours through the tokens.) -- */
:where(html[data-theme="dark"]) .svrpm-menu__fill {
    background: var(--survai-brand);
}

:where(html[data-theme="dark"]) .svrpm-light {
    background: var(--survai-text-muted);
}

:where(html[data-theme="dark"]) .svrpm-light.is-completed {
    background: #86d6a6;
    box-shadow: 0 0 0 3px rgba(134, 214, 166, 0.16);
}

:where(html[data-theme="dark"]) .svrpm-light.is-processing {
    background: var(--survai-brand);
    box-shadow: 0 0 0 3px rgba(242, 242, 240, 0.18);
}

:where(html[data-theme="dark"]) .svrpm-light.is-failed {
    background: #ff9d93;
    box-shadow: 0 0 0 3px rgba(255, 157, 147, 0.16);
}

:where(html[data-theme="dark"]) .svrpm-light.is-pending {
    background: var(--survai-text-muted);
    box-shadow: 0 0 0 3px rgba(162, 162, 157, 0.16);
}

:where(html[data-theme="dark"]) .svrpm-light.is-retrying {
    background: #f0c56e;
    box-shadow: 0 0 0 3px rgba(240, 197, 110, 0.16);
}

/* Pulses and the processing swirl: a keyframe cannot be scoped to a theme, so dark mode
   runs Carbon copies of the four blue ones (named *Carbon) and the swirl ring is off-white.
   The output page's freeze of the ring (!important) still wins. */
:where(html[data-theme="dark"]) .workspace-stage-subnav__pulse {
    background: var(--survai-brand);
    box-shadow: 0 0 0 0 rgba(242, 242, 240, 0.55);
    animation-name: survaiSubnavPulseCarbon;
}

@keyframes survaiSubnavPulseCarbon {
    0% { box-shadow: 0 0 0 0 rgba(242, 242, 240, 0.55); }
    70% { box-shadow: 0 0 0 7px rgba(242, 242, 240, 0); }
    100% { box-shadow: 0 0 0 0 rgba(242, 242, 240, 0); }
}

:where(html[data-theme="dark"]) .survai-voice-assistant.is-wake-listening .survai-voice-assistant__launcher {
    animation-name: survaiWakePulseCarbon;
}

@keyframes survaiWakePulseCarbon {
    0%, 100% { box-shadow: 0 0 0 0 rgba(242, 242, 240, 0.35); }
    50% { box-shadow: 0 0 0 9px rgba(242, 242, 240, 0); }
}

:where(html[data-theme="dark"]) .survai-voice-assistant.is-conversing .survai-voice-assistant__launcher {
    animation-name: survaiConversePulseCarbon;
}

@keyframes survaiConversePulseCarbon {
    0%, 100% { box-shadow: 0 0 0 0 rgba(242, 242, 240, 0.45); }
    50% { box-shadow: 0 0 0 10px rgba(242, 242, 240, 0); }
}

/* Read-aloud highlight, text selection and the styled editor's caret: the off-white brand
   with charcoal ink, and a caret in the text colour (it was near-black on the dark editor). */
:where(html[data-theme="dark"]) .output-inline-editor.is-styled textarea {
    caret-color: var(--survai-text);
}

:where(html[data-theme="dark"]) .is-speaking-word {
    background: var(--survai-brand);
    box-shadow: 0 0 0 1px var(--survai-brand);
    color: var(--survai-brand-ink);
}

:where(html[data-theme="dark"]) .section-text::selection,
:where(html[data-theme="dark"]) .room-text::selection {
    background: var(--survai-brand);
    color: var(--survai-brand-ink);
}

/* -- Ticks and radios: the off-white brand (the browser draws a dark mark on it). -- */
:where(html[data-theme="dark"]) .output-accommodation-check input {
    accent-color: var(--survai-brand);
}

:where(html[data-theme="dark"]) .reports-filter-status .reports-filter-status__option input[type="checkbox"] {
    accent-color: var(--survai-brand);
}

:where(html[data-theme="dark"]) .ops-notification-sound-toggle input {
    accent-color: var(--survai-brand);
}

:where(html[data-theme="dark"]) .report-documents-modal__offer input {
    accent-color: var(--survai-brand);
}

:where(html[data-theme="dark"]) .output-repair-visibility-toggle input[type="checkbox"] {
    accent-color: var(--survai-brand);
}

:where(html[data-theme="dark"]) .transcript-toggle-row input,
:where(html[data-theme="dark"]) .transcript-recording-check input,
:where(html[data-theme="dark"]) .transcript-document-card input {
    accent-color: var(--survai-brand);
}

:where(html[data-theme="dark"]) .property-location-map-toggle input[type='checkbox'] {
    accent-color: var(--survai-brand);
}

:where(html[data-theme="dark"]) .media-manager-transcription-select input {
    accent-color: var(--survai-brand);
}

:where(html[data-theme="dark"]) .image-manager-settings-options input[type="radio"] {
    accent-color: var(--survai-brand);
}

:where(html[data-theme="dark"]) .reinstatement-valuation-card .reinstatement-valuation-form__include input[type="checkbox"] {
    accent-color: var(--survai-brand);
}

/* EPC bands keep their fills; C, D and E are light bands, so they take charcoal ink (the
   light rule's ink token turns white in dark). In the report header the ink guard forces the
   text colour onto every <strong> with !important, so the header copy names that context.
   The chip's score is an <em> the guard misses. */
:where(html[data-theme="dark"]) .po-epc-rating-badge--c {
    color: #151515;
}

:where(html[data-theme="dark"]) .po-epc-rating-badge--d {
    color: #151515;
}

:where(html[data-theme="dark"]) .po-epc-rating-badge--e {
    color: #151515;
}

html[data-theme="dark"] .workspace-topbar.report-workspace-header .workspace-epc-chip__badge.po-epc-rating-badge--c,
html[data-theme="dark"] .workspace-topbar.report-workspace-header .workspace-epc-chip__badge.po-epc-rating-badge--d,
html[data-theme="dark"] .workspace-topbar.report-workspace-header .workspace-epc-chip__badge.po-epc-rating-badge--e {
    color: #151515 !important;
}

:where(html[data-theme="dark"]) .workspace-epc-chip__score {
    color: var(--survai-text-secondary);
}

/* -- Image editor backdrop: neutral black, not a navy tint. -- */
:where(html[data-theme="dark"]) .siex {
    background: rgba(0, 0, 0, 0.6);
}

/* Final Check is a light island: its own --fc-* tokens plus literal cream surfaces and
   dark status inks. The tokens take Carbon values (ink, body, muted, divider, control border,
   sunken board, off-white accent); the literals follow in the light rules' order. Rules that
   a later light variant out-ranks by order alone (the primary, quiet and cancel buttons, the
   "becomes" box, the dark side panel) restate that variant after the base. White ink on the
   accent or ink fill becomes charcoal. */
:where(html[data-theme="dark"]) .final-check-page {
    --fc-ink: var(--survai-text);
    --fc-text: var(--survai-text);
    --fc-body: var(--survai-text-soft);
    --fc-muted: var(--survai-text-secondary);
    --fc-faint: var(--survai-text-muted);
    --fc-line: var(--survai-border);
    --fc-line-strong: var(--field-border-color);
    --fc-surface: var(--survai-bg-soft);
    --fc-accent: var(--survai-brand);
    --fc-accent-deep: var(--survai-brand-hover);
}

:where(html[data-theme="dark"]) .final-check-page del {
    background: #7d2b25;
    color: #ffe8e4;
}

:where(html[data-theme="dark"]) .final-check-page ins {
    background: #276140;
    color: #f2fff6;
}

:where(html[data-theme="dark"]) .final-check-crumbs {
    color: var(--survai-text-muted);
}

:where(html[data-theme="dark"]) .final-check-head__must {
    color: #ff9d93;
}

:where(html[data-theme="dark"]) .final-check-page .final-check-btn {
    background: var(--survai-card) !important;
}

:where(html[data-theme="dark"]) .final-check-page .final-check-btn--primary,
:where(html[data-theme="dark"]) .final-check-page .final-check-head__actions a.final-check-btn--primary {
    background: var(--fc-accent) !important;
    color: var(--survai-brand-ink) !important;
}

:where(html[data-theme="dark"]) .final-check-page .final-check-btn--primary:hover,
:where(html[data-theme="dark"]) .final-check-page .final-check-head__actions a.final-check-btn--primary:hover {
    color: var(--survai-brand-ink) !important;
}

/* The head's "Issue report" button is a link, and the dark link rule (!important, near the
   token block) out-ranks every Final Check rule, which left off-white text on the off-white
   fill. This selector repeats enough of that rule to out-rank it. */
html[data-theme="dark"] body:not(.login-body) .final-check-page .final-check-head__actions a.final-check-btn.final-check-btn--primary:not(.btn) {
    color: var(--survai-brand-ink) !important;
}

:where(html[data-theme="dark"]) .final-check-page .final-check-btn--secondary:hover {
    border-color: var(--field-border-color);
    background: var(--survai-neutral-hover) !important;
}

:where(html[data-theme="dark"]) .final-check-page .final-check-btn--quiet {
    background: transparent !important;
    color: #f0c56e !important;
}

:where(html[data-theme="dark"]) .final-check-page .final-check-btn--quiet:hover {
    background: #2a2111 !important;
}

:where(html[data-theme="dark"]) .final-check-page .final-check-btn--applied {
    border-color: #2f5a40;
    color: #86d6a6 !important;
}

:where(html[data-theme="dark"]) .final-check-page .final-check-btn--reported {
    border-color: #5c4720;
    color: #f0c56e !important;
}

:where(html[data-theme="dark"]) .final-check-page .final-check-chip {
    background: var(--survai-card) !important;
}

:where(html[data-theme="dark"]) .final-check-page .final-check-chip.is-active {
    color: var(--survai-brand-ink) !important;
}

:where(html[data-theme="dark"]) .final-check-banner {
    border-color: var(--survai-border);
    background: var(--survai-bg-tint);
    color: var(--survai-text-secondary);
}

:where(html[data-theme="dark"]) .final-check-empty[data-final-check-scanning] {
    background: var(--survai-card);
}

:where(html[data-theme="dark"]) .final-check-card {
    border-color: var(--survai-border);
    background: var(--survai-card);
}

:where(html[data-theme="dark"]) .final-check-card.is-resolved {
    border-color: var(--survai-border);
}

:where(html[data-theme="dark"]) .final-check-pill--must {
    border-color: #6a2f2a;
    background: #2c1513;
    color: #ff9d93;
}

:where(html[data-theme="dark"]) .final-check-pill--advisory {
    border-color: #5c4720;
    background: #2a2111;
    color: #f0c56e;
}

:where(html[data-theme="dark"]) .final-check-pill--polish {
    border-color: var(--survai-border);
    background: var(--survai-bg-tint);
    color: var(--survai-text-secondary);
}

:where(html[data-theme="dark"]) .final-check-card__sep {
    background: var(--survai-text-muted);
}

:where(html[data-theme="dark"]) .final-check-compare__box {
    border-color: var(--survai-border);
    border-left-color: var(--survai-border-mid);
    background: var(--survai-bg-soft);
}

:where(html[data-theme="dark"]) .final-check-compare__box--after {
    border-color: #2f5a40;
    border-left-color: var(--fc-accent);
    background: #13261b;
}

:where(html[data-theme="dark"]) .final-check-page .final-check-option {
    background: var(--survai-card);
}

:where(html[data-theme="dark"]) .final-check-page .final-check-option.is-chosen {
    background: #13261b;
}

:where(html[data-theme="dark"]) .final-check-option__dot {
    border-color: var(--field-border-color);
    background: var(--survai-page-bg);
}

:where(html[data-theme="dark"]) .final-check-page .final-check-option__kind {
    background: var(--survai-bg-tint);
}

:where(html[data-theme="dark"]) .final-check-page .final-check-locked-note {
    color: var(--survai-text-secondary) !important;
}

:where(html[data-theme="dark"]) .final-check-report {
    border-color: #5c4720;
    background: #2a2111;
}

:where(html[data-theme="dark"]) .final-check-report__title {
    color: #f0c56e;
}

:where(html[data-theme="dark"]) .final-check-page .final-check-report__note {
    color: #f0c56e !important;
}

:where(html[data-theme="dark"]) .final-check-page .final-check-reason {
    border-color: #5c4720;
    background: var(--survai-card) !important;
    color: #f0c56e !important;
}

:where(html[data-theme="dark"]) .final-check-page .final-check-reason--cancel {
    border-color: transparent;
    background: transparent !important;
    color: var(--fc-muted) !important;
}

:where(html[data-theme="dark"]) .final-check-state--applied {
    border-color: #2f5a40;
    background: #13261b;
}

:where(html[data-theme="dark"]) .final-check-state--applied .final-check-state__label {
    color: #86d6a6;
}

:where(html[data-theme="dark"]) .final-check-state__note {
    color: #86d6a6;
}

:where(html[data-theme="dark"]) .final-check-state--skipped {
    background: var(--survai-bg-tint);
}

:where(html[data-theme="dark"]) .final-check-state--reported {
    border-color: #5c4720;
    background: #2a2111;
}

:where(html[data-theme="dark"]) .final-check-state--reported .final-check-state__label {
    color: #f0c56e;
}

:where(html[data-theme="dark"]) .final-check-state--stale {
    border-color: var(--survai-border);
    background: var(--survai-bg-tint);
}

:where(html[data-theme="dark"]) .final-check-state--stale .final-check-state__label {
    color: var(--survai-text-secondary);
}

:where(html[data-theme="dark"]) .final-check-panel {
    background: var(--survai-card);
}

:where(html[data-theme="dark"]) .final-check-panel--dark {
    border-color: var(--survai-border);
    background: var(--survai-bg-soft);
    color: var(--survai-text-soft);
}

:where(html[data-theme="dark"]) .final-check-panel--dark .final-check-eyebrow {
    color: var(--survai-text-muted);
}

:where(html[data-theme="dark"]) .final-check-page .final-check-panel--dark .final-check-panel__lead {
    color: var(--survai-text-soft) !important;
}

:where(html[data-theme="dark"]) .final-check-bar {
    background: var(--survai-bg-tint);
}

:where(html[data-theme="dark"]) .final-check-tally__dot--must {
    background: #ff9d93;
}

:where(html[data-theme="dark"]) .final-check-tally__dot--advisory {
    background: #f0c56e;
}

:where(html[data-theme="dark"]) .final-check-tally__dot--polish {
    background: var(--survai-text-secondary);
}

:where(html[data-theme="dark"]) .final-check-log__entry {
    border-color: var(--survai-border);
    background: var(--survai-bg-soft);
}

/* Review notes on the Carbon pass (7 Oct 2026): the one navy button left on a Carbon page,
   and the overview's own blue token. */
:where(html[data-theme="dark"]) .video-grid-actions .upload-btn {
    border-color: var(--survai-border);
    background: var(--survai-ink-surface);
}

:where(html[data-theme="dark"]) .property-overview-main {
    --po-blue: var(--survai-brand);
}
