/* ---------------------------------------------------------------------- */
/* Design tokens — the onboarding design's shell (dsg-3eaaa1a0f3d6 r1,     */
/* screen-01-client-gallery-a): navy sidebar #101826, primary accent       */
/* #0E7CB8 (tuned blue, AA on white and navy), cool-grey canvas #EEF1F4,   */
/* white cards. Amber/red stay reserved for semantic states (validation,   */
/* vacancy).                                                                */
/* ---------------------------------------------------------------------- */
:root {
    --sa-color-bg: #eef1f4;
    --sa-color-surface: #ffffff;
    --sa-color-surface-alt: #f6f8fa;
    --sa-color-border: #d9dfe6;
    --sa-color-border-strong: #c3cbd6;

    --sa-color-nav: #101826;
    --sa-color-nav-line: #212b3d;
    --sa-color-nav-text: #c7cedc;

    /* True CAD black (owner hotfix 2026-11-06): the floor plan/validation/import-problems canvas, on screen
       only — print (print.css .sa-print-bg-svg) stays white-on-paper and is untouched by this. */
    --sa-color-cad-canvas: #0b0b0b;

    --sa-color-text: #101826;
    --sa-color-text-muted: #3c4658;
    --sa-color-text-faint: #8993a6;

    --sa-color-primary: #0e7cb8;
    --sa-color-primary-hover: #0c699c;
    --sa-color-primary-soft: rgba(14, 124, 184, 0.14);
    --sa-color-link: #2f6fed;

    --sa-color-success: #1f7a4d;
    --sa-color-success-soft: #dff2e7;
    --sa-color-warning: #a4650f;
    --sa-color-warning-soft: #fbf1e2;
    --sa-color-error: #c53030;
    --sa-color-error-soft: #fbeaea;
    --sa-color-info: #2f6fed;
    --sa-color-info-soft: #e6eefd;

    /* Pastel variants of StackAccess.Infrastructure.AreaTypes.AreaClassificationPalette's own per-category
       hue (owner 2026-11-09: "assign pastel variations of primary colors for each of our categories this way
       we can easily tell if any spaces are missing") — the solid fill White/ink floor-plan mode, print and
       their legends use instead of the black canvas's translucent .sa-cls-* wash. Kept in sync with that ONE
       C# palette by hand, same as the rgba values below already are; never a second mapping of its own. */
    --sa-pastel-office: #cfe0fb;
    --sa-pastel-storeretail: #c3ecef;
    --sa-pastel-industrial: #f6ddc0;
    --sa-pastel-parking: #dde1e8;
    --sa-pastel-service: #e4d7f7;
    --sa-pastel-common: #fbeeb3;
    --sa-pastel-amenity: #f9d4e4;
    --sa-pastel-ancillary: #ddd7f6;
    --sa-pastel-verticalpenetration: #c7cdd8;
    --sa-pastel-exclusion: #eceef2;
    --sa-pastel-interbuilding: #cdefdc;

    --sa-radius-sm: 6px;
    --sa-radius-md: 9px;
    --sa-radius-lg: 12px;

    /* Matches orchid.css's own $orchid-sidebar-w/$orchid-sidebar-w-collapsed/$orchid-header-h
       (docs/ui/OrchidTemplateMap.md §1.2 "Layout tokens") so worksheets.css/.sa-plan/.sa-review's
       viewport-height calc()s stay correct against the shell's real, current dimensions. */
    --sa-sidebar-width: 260px;
    --sa-sidebar-width-collapsed: 84px;
    --sa-topbar-height: 68px;

    --sa-shadow-card: 0 1px 2px rgba(16, 24, 38, 0.05);
    --sa-shadow-card-hover: 0 6px 16px rgba(16, 24, 38, 0.10), 0 2px 4px rgba(16, 24, 38, 0.06);

    --sa-font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    --sa-font-mono: ui-monospace, "SFMono-Regular", "Roboto Mono", Menlo, Consolas, monospace;
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    background: var(--sa-color-bg);
    color: var(--sa-color-text);
    font-family: var(--sa-font-family);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
    font-weight: 800;
    color: var(--sa-color-text);
    margin: 0 0 0.5rem 0;
    letter-spacing: normal; /* Orchid's typography tightens headings; product headings keep their spacing */
}

h1 {
    font-size: 1.5rem;
    line-height: 1.25;
    margin-bottom: 0;
}

h1:focus {
    outline: none;
}

a {
    color: var(--sa-color-link);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.sa-figure {
    font-family: var(--sa-font-mono);
    font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------------- */
/* App shell (docs/ui/OrchidTemplateMap.md §1.2/§5 step 2): the sidebar/header/footer/backdrop markup
   itself is now Orchid's (orchid-sidebar/orchid-header/orchid-footer/orchid-backdrop,
   wwwroot/orchid/orchid.css) — MainLayout.razor no longer emits sa-shell/sa-sidebar/sa-topbar/
   sa-nav-toggle/sa-scrim at all, so those rules were removed from here rather than left as dead CSS.
   What's left below is the portal's own addition on top of the vendored shell: the breadcrumb-row
   content width (.sa-content*, still rendered by PageFrame.razor, unchanged by this adoption so every
   existing page's content area keeps its exact prior width) and the worksheet-route sidebar rail
   (the same hover-to-expand behaviour the old .sa-shell-rail gave worksheet pages, re-targeted at the
   new shell's own classes). */
.sa-content {
    flex: 1;
    max-width: 1800px;
    width: 100%;
    padding: 30px 34px 56px 34px;
}

.sa-content-wide {
    max-width: none;
}

.sa-content-bleed {
    padding: 0;
    max-width: none;
}

/* Worksheet pages need the full 1440 width for the one-screen spreadsheet: the sidebar collapses to
   an icon rail and expands on hover/focus. MainLayout.razor puts the rail modifier on BOTH the
   <aside class="orchid-sidebar"> and the <div class="orchid-app"> (siblings in the markup, per
   Orchid's own shell structure — a descendant selector off one would never match the other) for
   worksheet/input-grid/inter-allocated routes; see the `rail` local in its @code block. */
@media (min-width: 992px) {
    .orchid-sidebar--rail {
        width: var(--sa-sidebar-width-collapsed, 84px);
        transition: width 140ms ease;
    }

    .orchid-sidebar--rail:hover,
    .orchid-sidebar--rail:focus-within {
        width: var(--sa-sidebar-width);
        box-shadow: 8px 0 24px rgba(16, 24, 38, 0.25);
    }

    .orchid-app--rail {
        margin-left: var(--sa-sidebar-width-collapsed, 84px);
    }

    .orchid-sidebar--rail:not(:hover):not(:focus-within) .orchid-brand__text,
    .orchid-sidebar--rail:not(:hover):not(:focus-within) .orchid-nav-section__label,
    .orchid-sidebar--rail:not(:hover):not(:focus-within) .orchid-nav__link span {
        display: none;
    }

    .orchid-sidebar--rail:not(:hover):not(:focus-within) .orchid-nav__link {
        justify-content: center;
        padding-inline: .5rem;
    }
}

/* ---------------------------------------------------------------------- */
/* Page header                                                             */
/* ---------------------------------------------------------------------- */
.sa-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
}

.sa-page-header h1 {
    font-size: 22px;
}

.sa-page-header p {
    color: var(--sa-color-text-muted);
    font-size: 13px;
    margin: 3px 0 0 0;
}

.sa-page-header-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* ---------------------------------------------------------------------- */
/* Detail cards (Admin/Plans, Account) — a labeled dt/dd summary block     */
/* inside a bordered card, shared by any page presenting a small set of    */
/* read-only facts.                                                        */
/* ---------------------------------------------------------------------- */
.sa-admin-plan {
    background: var(--sa-color-surface);
    border: 1px solid var(--sa-color-border);
    border-radius: var(--sa-radius-lg);
    box-shadow: var(--sa-shadow-card);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
}

.sa-admin-plan h2 {
    margin-bottom: 0.75rem;
}

.sa-admin-plan-key {
    color: var(--sa-color-text-faint);
    font-weight: 400;
    font-size: 0.85rem;
}

.sa-admin-plan-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.5rem 1.5rem;
    margin: 0 0 1.25rem 0;
}

.sa-admin-plan-meta div {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.sa-admin-plan-meta dt {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--sa-color-text-faint);
}

.sa-admin-plan-meta dd {
    margin: 0;
    color: var(--sa-color-text);
    font-weight: 600;
}

.sa-admin-table-scroll {
    overflow-x: auto;
}

.sa-admin-table {
    width: 100%;
    min-width: 640px; /* scroll (via .sa-admin-table-scroll) rather than squeeze columns unreadably narrow, e.g. on phone width */
    border-collapse: collapse;
}

.sa-admin-table th,
.sa-admin-table td {
    text-align: left;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--sa-color-border);
    font-size: 0.9rem;
    white-space: nowrap;
}

.sa-admin-table td:first-child {
    white-space: normal; /* the Feature name column may still legitimately wrap */
}

.sa-admin-table th {
    color: var(--sa-color-text-faint);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.03em;
}

.sa-admin-table code {
    overflow-wrap: anywhere;
}

@media (max-width: 640px) {
    .sa-admin-plan {
        padding: 1rem;
    }

    .sa-admin-table th,
    .sa-admin-table td {
        padding: 0.5rem 0.4rem;
    }
}

/* ---------------------------------------------------------------------- */
/* Buttons                                                                 */
/* ---------------------------------------------------------------------- */
.sa-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.7rem 1.25rem;
    border-radius: var(--sa-radius-md);
    border: 1px solid transparent;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 120ms ease, border-color 120ms ease;
}

.sa-btn:hover {
    text-decoration: none;
}

.sa-btn-primary {
    background: var(--sa-color-primary);
    color: #ffffff;
}

.sa-btn-primary:hover {
    background: var(--sa-color-primary-hover);
    color: #ffffff;
}

.sa-btn-primary:disabled {
    background: var(--sa-color-border-strong);
    cursor: not-allowed;
}

.sa-btn-secondary {
    background: var(--sa-color-surface);
    border-color: var(--sa-color-border);
    color: var(--sa-color-text);
}

.sa-btn-secondary:hover {
    background: var(--sa-color-surface-alt);
    color: var(--sa-color-text);
}

.sa-btn-danger {
    background: var(--sa-color-surface);
    border-color: var(--sa-color-error);
    color: var(--sa-color-error);
}

.sa-btn-danger:hover {
    background: var(--sa-color-error-soft);
    color: var(--sa-color-error);
}

/* ---------------------------------------------------------------------- */
/* Forms                                                                   */
/* ---------------------------------------------------------------------- */
.sa-form {
    max-width: 640px;
    background: var(--sa-color-surface);
    border: 1px solid var(--sa-color-border);
    border-radius: 16px;
    padding: 1.75rem 1.9rem 1.9rem 1.9rem;
}

.sa-field {
    margin-bottom: 1.25rem;
}

.sa-field label {
    display: block;
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--sa-color-text);
    margin-bottom: 0.35rem;
}

.sa-field .sa-hint {
    color: var(--sa-color-text-muted);
    font-size: 0.82rem;
    margin-top: 0.3rem;
}

.sa-field input:not([type]),
.sa-field input[type="text"],
.sa-field input[type="email"],
.sa-field input[type="tel"],
.sa-field input[type="number"],
.sa-field input[type="search"],
.sa-field input[type="date"],
.sa-field select,
.sa-field textarea {
    width: 100%;
    padding: 0.55rem 0.7rem;
    border: 1px solid var(--sa-color-border-strong);
    border-radius: var(--sa-radius-md);
    font-family: inherit;
    font-size: 0.92rem;
    color: var(--sa-color-text);
    background: var(--sa-color-surface);
}

.sa-field input:focus,
.sa-field select:focus,
.sa-field textarea:focus {
    outline: none;
    border-color: var(--sa-color-primary);
    box-shadow: 0 0 0 3px rgba(221, 106, 18, 0.16);
}

.sa-field input.invalid,
.sa-field select.invalid,
.sa-field textarea.invalid {
    border-color: var(--sa-color-error);
}

/* Number of floors (owner correction 2026-11-05): the one field every building needs, called out
   so it isn't missed the way a plain field lower in the form was. */
.sa-field-floors-prominent {
    padding: 0.9rem 1rem;
    border: 1px solid var(--sa-color-border-strong);
    border-radius: var(--sa-radius-md);
    background: var(--sa-color-surface-alt);
}

.sa-field-floors-prominent label {
    font-size: 1rem;
}

.validation-message {
    display: block;
    color: var(--sa-color-error);
    font-size: 0.82rem;
    margin-top: 0.3rem;
}

.sa-hint-inline {
    font-weight: 400;
    color: var(--sa-color-text-muted);
    font-size: 0.8rem;
}

/* Building create/settings (owner 2026-11-09 redo): one clean card instead of a photo column
   beside a stacked list of fields. */
.sa-building-card {
    max-width: 760px;
    background: var(--sa-color-surface);
    border: 1px solid var(--sa-color-border);
    border-radius: 16px;
    padding: 1.75rem 1.9rem 1.9rem 1.9rem;
    margin: 0;
}

.sa-building-photo {
    position: sticky;
    top: 1rem;
}

.sa-photo-drop {
    position: relative;
    aspect-ratio: 4 / 3;
    min-height: 280px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 2px dashed var(--sa-color-border-strong);
    border-radius: var(--sa-radius-lg);
    background: var(--sa-color-surface-alt);
    color: var(--sa-color-text-muted);
    text-align: center;
    transition: border-color 0.12s, background 0.12s;
}

.sa-photo-drop:hover,
.sa-photo-drop:focus-within,
.sa-photo-drop.is-dragover {
    border-color: var(--sa-color-primary);
    background: var(--sa-color-primary-soft);
}

.sa-photo-drop.has-photo {
    border-style: solid;
    border-color: var(--sa-color-border);
    background: var(--sa-color-text);
}

.sa-photo-drop img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.sa-photo-drop-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 1.5rem;
}

.sa-photo-drop-empty svg {
    color: var(--sa-color-primary);
    margin-bottom: 0.4rem;
}

.sa-photo-drop-empty strong {
    color: var(--sa-color-text);
    font-size: 1rem;
}

.sa-photo-drop-empty small {
    color: var(--sa-color-text-faint);
    margin-top: 0.4rem;
}

/* The real file input covers the whole box, invisible: a click opens the picker, a drop lands on it. */
.sa-photo-drop .sa-photo-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    font-size: 0;
}

.sa-photo-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.7rem;
}

.sa-photo-actions .sa-btn {
    cursor: pointer;
}

.sa-photo-preview-name {
    flex: 1;
    min-width: 0;
    font-size: 0.82rem;
    color: var(--sa-color-text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sa-photo-optional {
    text-align: center;
    margin-top: 0.6rem;
    font-size: 0.82rem;
    color: var(--sa-color-text-muted);
}

/* Photo upload progress: overlays the image area while a file is being read (Create + Edit building). */
.sa-photo-progress {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    background: rgba(16, 24, 38, 0.6);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
}

.sa-photo-progress-bar {
    width: 70%;
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.25);
    overflow: hidden;
}

.sa-photo-progress-bar > span {
    display: block;
    height: 100%;
    background: var(--sa-color-primary);
    transition: width 0.15s linear;
}

/* Upload errors render inside the photo box itself, not below it. */
.sa-photo-error-inline {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
    padding: 0.5rem 0.75rem;
    background: var(--sa-color-error-soft);
    color: var(--sa-color-error);
    font-size: 0.8rem;
    text-align: center;
}

.sa-field-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 6rem 8rem;
    gap: 0.9rem;
}

/* Name + Floors sit side by side once Owner round-2's "Label" field is gone. */
.sa-field-row-2 {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 10rem;
    gap: 0.9rem;
}

.sa-floors-readout {
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.sa-floors-readout .sa-figure {
    font-weight: 700;
    font-size: 1.05rem;
}

.sa-located {
    margin: -0.7rem 0 1.25rem 0;
    color: var(--sa-color-success);
}

/* Number of floors: a small box with the browser's up/down arrows, not a full-width field. */
.sa-field input[type="number"].sa-input-floors {
    width: 6.5rem;
}

/* Chrome only shows the arrows on hover; keep them visible so the box reads as a stepper. */
.sa-field input[type="number"].sa-input-floors::-webkit-inner-spin-button {
    opacity: 1;
}

/* Building create/settings redo (owner 2026-11-09): Client | Floors | Calculation method render as three
   equal, equally-prominent fields instead of one spinner standing out above plain rows. */
.sa-field-big label {
    font-size: 1rem;
    font-weight: 600;
}

.sa-field-big .form-control,
.sa-field-big .form-select {
    padding: 0.6rem 0.75rem;
    font-size: 1rem;
}

/* Everything that isn't essential to adding a building collapses behind one disclosure, closed by
   default, so the form reads as one clean card instead of a wall of "(optional)" fields. */
.sa-optional-details {
    margin-top: 0.5rem;
    border: 1px solid var(--sa-color-border);
    border-radius: var(--sa-radius-md);
    padding: 0.1rem 1rem;
}

.sa-optional-details > summary {
    cursor: pointer;
    padding: 0.75rem 0;
    font-weight: 600;
    color: var(--sa-color-text);
    list-style: none;
}

.sa-optional-details > summary::-webkit-details-marker {
    display: none;
}

.sa-optional-details > summary::before {
    content: "▸";
    display: inline-block;
    width: 1.1rem;
    color: var(--sa-color-text-muted);
}

.sa-optional-details[open] > summary::before {
    content: "▾";
}

.sa-optional-details-body {
    padding: 0.25rem 0 1rem 0;
}

.sa-optional-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.9rem 1rem;
}

.sa-optional-grid-full {
    grid-column: 1 / -1;
}

@media (max-width: 575.98px) {
    .sa-optional-grid {
        grid-template-columns: 1fr;
    }
}

/* Compact photo picker (Create/Settings): a small thumbnail beside a "Choose photo" action rather than
   a large drag/drop column competing with the form's own fields. */
.sa-building-photo-compact {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sa-building-photo-compact .sa-photo-drop {
    width: 72px;
    height: 72px;
    min-height: 0;
    aspect-ratio: 1 / 1;
    border-radius: var(--sa-radius-md);
    flex: none;
}

.sa-building-photo-compact .sa-photo-drop-empty {
    padding: 0;
    gap: 0;
}

.sa-building-photo-compact .sa-photo-drop-empty strong,
.sa-building-photo-compact .sa-photo-drop-empty span,
.sa-building-photo-compact .sa-photo-drop-empty small {
    display: none;
}

.sa-building-photo-compact .sa-photo-drop-empty svg {
    margin-bottom: 0;
    width: 28px;
    height: 28px;
}

.sa-building-photo-compact .sa-photo-actions,
.sa-building-photo-compact .sa-photo-optional {
    margin-top: 0;
}

.sa-building-photo-compact .sa-photo-optional {
    text-align: left;
}

.sa-autocomplete {
    position: relative;
}

.sa-autocomplete-list {
    position: absolute;
    z-index: 20;
    left: 0;
    right: 0;
    top: calc(100% + 4px);
    margin: 0;
    padding: 0.25rem;
    list-style: none;
    background: var(--sa-color-surface);
    border: 1px solid var(--sa-color-border-strong);
    border-radius: var(--sa-radius-md);
    box-shadow: 0 8px 24px rgba(16, 24, 38, 0.14);
    max-height: 18rem;
    overflow-y: auto;
}

.sa-autocomplete-list li {
    padding: 0.5rem 0.65rem;
    border-radius: var(--sa-radius-sm);
    font-size: 0.9rem;
    cursor: pointer;
}

.sa-autocomplete-list li:hover,
.sa-autocomplete-list li.active {
    background: var(--sa-color-primary-soft);
}

.sa-attribution a {
    color: inherit;
}

@media (max-width: 760px) {
    .sa-building-photo {
        position: static;
    }

    .sa-photo-drop {
        min-height: 220px;
    }

    .sa-field-row {
        grid-template-columns: 1fr 1fr;
    }

    .sa-field-row > .sa-field:first-child {
        grid-column: 1 / -1;
    }

    .sa-field-row-2 {
        grid-template-columns: minmax(0, 1fr);
    }
}

.sa-form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

/* Shared confirm-before-destructive-action modal (method change, floor/drawing removal) — same look as the
   building page's own Publish confirm, kept global here since several pages need it. */
.sa-modal-scrim { position: fixed; inset: 0; background: rgba(16, 24, 38, 0.5); z-index: 60; }
.sa-modal {
    position: fixed; z-index: 61; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow-y: auto;
    background: #fff; border-radius: 14px; padding: 24px 26px; box-shadow: 0 24px 60px rgba(16, 24, 38, 0.35);
}
.sa-modal p { color: var(--sa-color-text-muted); }
.sa-modal-warn { color: var(--sa-color-warning); font-weight: 700; }
.sa-modal ul { margin: 0.5rem 0; padding-left: 1.25rem; }
.sa-modal li { margin: 0.2rem 0; }

/* "Save as validation fixture" dialog (owner 2026-11-05): wider than the default .sa-modal so its
   worksheet-line/column/value row has room, and its per-row controls need their own compact styling
   rather than the full-width single-field layout .sa-field assumes. */
.sa-modal-wide { width: min(760px, calc(100vw - 32px)); }

.sa-fixture-expected-row {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) auto;
    gap: 0.6rem;
    align-items: center;
    margin-bottom: 0.6rem;
}

.sa-fixture-expected-row select,
.sa-fixture-expected-row input {
    width: 100%;
    padding: 0.5rem 0.6rem;
    border: 1px solid var(--sa-color-border-strong);
    border-radius: var(--sa-radius-md);
    font-family: inherit;
    font-size: 0.88rem;
    color: var(--sa-color-text);
    background: var(--sa-color-surface);
}

.sa-alert {
    padding: 0.75rem 1rem;
    border-radius: var(--sa-radius-md);
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
}

.sa-alert-error {
    background: var(--sa-color-error-soft);
    color: var(--sa-color-error);
    border: 1px solid rgba(197, 48, 48, 0.25);
}

.sa-alert-success {
    background: var(--sa-color-success-soft);
    color: var(--sa-color-success);
    border: 1px solid rgba(31, 138, 82, 0.25);
}

/* ---------------------------------------------------------------------- */
/* Lease status badge — shared by the building page's suite table and the */
/* Leases screens, so one status vocabulary renders identically everywhere */
/* ---------------------------------------------------------------------- */
.ov-status { margin-left: 8px; font-size: 10px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.ov-status-current { background: var(--sa-color-success-soft); color: var(--sa-color-success); }
.ov-status-monthtomonth { background: var(--sa-color-info-soft); color: var(--sa-color-info); }
.ov-status-future { background: var(--sa-color-warning-soft); color: var(--sa-color-warning); }
.ov-status-past { background: #e8ebf0; color: var(--sa-color-text-muted); }

.ov-lease-warnings { background: var(--sa-color-info-soft); border: 1px solid #a8c3ec; border-radius: 10px; padding: 12px 16px; margin-bottom: 16px; font-size: 13px; color: #1f3d5c; }
.ov-lease-warnings ul { margin: 6px 0 0; padding-left: 18px; }

/* ---------------------------------------------------------------------- */
/* Capped Load Factor badges — RENTABLE OF RECORD is capped for this suite */
/* (owner rule 2026-09-28), or its cap is not BOMA-compliant (spec 10 §8)  */
/* ---------------------------------------------------------------------- */
.ov-cap-badge { margin-left: 8px; font-size: 10px; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; padding: 2px 8px; border-radius: 999px; white-space: nowrap; background: var(--sa-color-info-soft); color: var(--sa-color-info); }
.ov-cap-badge-warn { background: var(--sa-color-warning-soft); color: var(--sa-color-warning); }

/* ---------------------------------------------------------------------- */
/* Data table card — the building page's suite table and the Leases       */
/* screens' lease table both render through this (one look, shared).      */
/* ---------------------------------------------------------------------- */
.ov-suites { background: #fff; border: 1px solid var(--sa-color-border); border-radius: 10px; box-shadow: var(--sa-shadow-card); padding: 0; overflow: hidden; }
.ov-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.ov-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 840px; }
.ov-table th { text-align: left; font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--sa-color-text-faint); padding: 9px 14px; background: var(--sa-color-surface-alt); border-top: 1px solid var(--sa-color-border); border-bottom: 1px solid var(--sa-color-border); white-space: nowrap; }
.ov-table td { padding: 9px 14px; border-bottom: 1px solid #edf0f3; vertical-align: middle; }
.ov-table .num { text-align: right; white-space: nowrap; }
.ov-table .ov-floor { font-weight: 800; white-space: nowrap; }
.ov-table tr.ov-floor-start td { border-top: 1px solid var(--sa-color-border-strong); }
.ov-table tbody tr:hover td { background: #fafbfc; }
.ov-table tfoot td { font-weight: 800; background: #f1f4f8; border-top: 2px solid var(--sa-color-border-strong); border-bottom: 0; }
.ov-none { color: var(--sa-color-text-faint); }

/* ---------------------------------------------------------------------- */
/* Empty state                                                             */
/* ---------------------------------------------------------------------- */
.sa-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 5rem 2rem;
    border: 1px dashed var(--sa-color-border-strong);
    border-radius: var(--sa-radius-lg);
    background: var(--sa-color-surface);
}

.sa-empty-state-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    margin-bottom: 1.25rem;
    border-radius: 50%;
    background: var(--sa-color-bg);
    color: var(--sa-color-text-faint);
}

.sa-empty-state h2 {
    margin-bottom: 0.5rem;
}

.sa-empty-state p {
    color: var(--sa-color-text-muted);
    max-width: 480px;
    margin: 0 0 1.5rem 0;
}

.sa-detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 480px) 1fr;
    gap: 2rem;
    align-items: start;
}

.sa-detail-photo {
    width: 100%;
    border-radius: var(--sa-radius-lg);
    border: 1px solid var(--sa-color-border);
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.sa-detail-facts {
    display: grid;
    gap: 1rem;
    margin: 0;
}

.sa-detail-facts dt {
    font-size: 0.78rem;
    color: var(--sa-color-text-faint);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0.15rem;
}

.sa-detail-facts dd {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
}

@media (max-width: 900px) {
    .sa-detail-grid {
        grid-template-columns: 1fr;
    }
}

.blazor-error-boundary {
    background: #c53030;
    padding: 1rem 1rem 1rem 1rem;
    color: white;
    border-radius: var(--sa-radius-md);
}

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

/* ---------------------------------------------------------------------- */
/* Gallery toolbar (search)                                                */
/* ---------------------------------------------------------------------- */
.sa-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.sa-search {
    flex: 1;
    max-width: 340px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--sa-color-surface);
    border: 1px solid var(--sa-color-border);
    border-radius: var(--sa-radius-md);
    padding: 9px 12px;
    color: var(--sa-color-text-faint);
}

.sa-search input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    font: inherit;
    font-size: 13px;
    color: var(--sa-color-text);
}

.sa-search:focus-within {
    border-color: var(--sa-color-primary);
}

.sa-no-match {
    color: var(--sa-color-text-muted);
}

/* Offline notice (js/offline-banner.js toggles body.sa-offline). */
.sa-offline-banner {
    display: none;
    position: sticky;
    top: 0;
    z-index: 50;
    background: #5c3d08;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 16px;
    text-align: center;
}

body.sa-offline .sa-offline-banner {
    display: block;
}

body.sa-offline [data-needs-online] {
    opacity: 0.5;
    pointer-events: none;
}

/* Sign-in/signed-out/not-invited/error pages now render on Orchid's own auth-shell/status-shell
   (wwwroot/orchid/pages/{auth,status}.css, Components/Layout/{SignInLayout,StatusLayout}.razor) — the
   old .sa-auth* classes they used are gone from every .razor file, so removed here too. */

/* ---------------------------------------------------------------------- */
/* Floors, drawing upload, validation and the interactive floor plan       */
/* (owner spec 2026-09-25).                                                */
/* ---------------------------------------------------------------------- */
.sa-step { display: inline-block; margin-right: 8px; padding: 1px 8px; border-radius: 999px; background: var(--sa-color-primary-soft); color: var(--sa-color-primary-hover); font-size: 12px; font-weight: 600; }
.sa-alert-list { margin: 0; padding-left: 18px; }

.sa-floors-toolbar { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; padding-bottom: 10px; border-bottom: 1px solid var(--sa-color-border); }
.sa-floors { background: var(--sa-color-surface); border: 1px solid var(--sa-color-border); border-radius: var(--sa-radius-lg); box-shadow: var(--sa-shadow-card); overflow: hidden; max-width: 880px; }
.sa-floors table.orchid-table td, .sa-floors table.orchid-table th { white-space: nowrap; }
.sa-floors table.orchid-table td:nth-child(1) { width: 110px; }
.sa-floors table.orchid-table td:nth-child(2) { width: auto; min-width: 160px; }
.sa-floors table.orchid-table td:nth-child(3) { width: 130px; }
.sa-floor-row input { width: 100%; padding: 7px 9px; border: 1px solid var(--sa-color-border-strong); border-radius: var(--sa-radius-sm); font: inherit; background: #fff; }
.sa-floor-row input:focus { outline: 2px solid var(--sa-color-primary-soft); border-color: var(--sa-color-primary); }
.sa-floor-actions { display: flex; gap: 4px; justify-content: flex-end; }
.sa-icon-btn { width: 30px; height: 30px; border: 1px solid var(--sa-color-border-strong); border-radius: var(--sa-radius-sm); background: #fff; color: var(--sa-color-text-muted); cursor: pointer; font: inherit; line-height: 1; }
.sa-icon-btn:hover:not(:disabled) { background: var(--sa-color-surface-alt); }
.sa-icon-btn:disabled { opacity: .35; cursor: default; }
.sa-icon-btn-danger:hover:not(:disabled) { background: var(--sa-color-error-soft); color: var(--sa-color-error); border-color: var(--sa-color-error); }

/* Upload table */
/* The real file input covers the whole .forms-drop box, invisible: a click opens the picker, a drop
   lands on it (same trick as .sa-photo-drop) — Orchid's own forms-drop markup (docs/ui/OrchidTemplateMap.md
   §1.2 forms-file-upload) supplies the visible chrome (border/background/icon), this just positions
   the real input over it. */
.forms-drop .sa-upload-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; font-size: 0; }
#upload-map tr[data-stage=rejected] td, #upload-map tr[data-stage=failed] td { background: var(--sa-color-error-soft); }
/* "14 of 22 processed" — the status line that replaced the second "Upload & process" press (owner test notes 2026-11-06). */
.sa-upload-summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin: 16px 0 12px; padding: 10px 14px; border: 1px solid var(--sa-color-border); border-radius: var(--sa-radius-lg); background: var(--sa-color-surface); font-size: 14px; }
.sa-upload-summary strong { font-size: 15px; }
.sa-upload-summary__part { color: var(--sa-color-text-faint); }
.sa-upload-summary__part::before { content: "·"; margin-right: 6px; }
.sa-upload-floor { font-weight: 600; white-space: nowrap; }
.sa-upload-code { margin-left: 6px; color: var(--sa-color-text-faint); font-size: 12px; white-space: nowrap; }
.sa-upload-file { min-width: 10rem; overflow-wrap: anywhere; }
#upload-map select { min-width: 9rem; }
/* Phones: the floor, file and status are what matter while uploading — size, spaces and validation wait for a wider screen. */
@media (max-width: 575.98px) {
  #upload-map th:nth-child(3), #upload-map td:nth-child(3),
  #upload-map th:nth-child(5), #upload-map td:nth-child(5),
  #upload-map th:nth-child(6), #upload-map td:nth-child(6) { display: none; }
  .sa-upload-file { min-width: 7rem; }
  #upload-map select { min-width: 7.5rem; }
}
.sa-table { width: 100%; border-collapse: collapse; background: var(--sa-color-surface); border: 1px solid var(--sa-color-border); border-radius: var(--sa-radius-lg); overflow: hidden; }
.sa-table th, .sa-table td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--sa-color-border); font-size: 14px; vertical-align: middle; }
.sa-table th { background: var(--sa-color-surface-alt); color: var(--sa-color-text-faint); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.sa-table tr:last-child td { border-bottom: 0; }
.sa-table select { padding: 6px 8px; border: 1px solid var(--sa-color-border-strong); border-radius: var(--sa-radius-sm); font: inherit; background: #fff; max-width: 100%; }
.sa-num { text-align: right; font-variant-numeric: tabular-nums; }
.sa-badge { display: inline-block; padding: 1px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.sa-badge-ok { background: var(--sa-color-success-soft); color: var(--sa-color-success); }
.sa-badge-warn { background: var(--sa-color-warning-soft); color: var(--sa-color-warning); }
.sa-badge-bad { background: var(--sa-color-error-soft); color: var(--sa-color-error); }
.sa-badge-info { background: var(--sa-color-info-soft); color: var(--sa-color-info); }
.sa-badge-muted { background: var(--sa-color-surface-alt); color: var(--sa-color-text-faint); border: 1px solid var(--sa-color-border); }

/* Floor plan: viewer + right-hand table. Wider than the old stacked list's 380px (owner 2026-11-09: Suite
   code / Area type / USF-NSF / RSF needs more room than a single-column list did), short of the Assign
   page's own 620px (.sa-assign-review below) since this table has no input/select widgets to fit. */
.sa-plan { display: grid; grid-template-columns: minmax(0, 1fr) 460px; gap: 16px; height: calc(100vh - var(--sa-topbar-height) - 128px); min-height: 460px; }
.sa-plan-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
/* Wraps onto further lines instead of a horizontal scrollbar (owner correction 2026-11-16: a 30+-floor
   building's scrollbar hid most of the floors; each pill is now just the short Floor.Code, so even a large
   building's full set wraps to a few short lines rather than the single very-wide row the old full-label
   pills needed a scrollbar for). */
.sa-plan-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.sa-plan-tab { flex: none; padding: 4px 11px; border: 1px solid var(--sa-color-border-strong); border-radius: 5px; background: #fff; color: var(--sa-color-text-muted); font-size: 13px; text-decoration: none; }
.sa-plan-tab.active { background: var(--sa-color-nav); color: #fff; border-color: var(--sa-color-nav); }
.sa-plan-tab.warn::after { content: " ●"; color: var(--sa-color-primary); }
/* Assign page only (Floorplan's own "warn" is validation-issue-based, unrelated): green once every space on
   the floor is assigned, amber while any remain — the colour the pills now carry instead of the removed
   second floor list (owner correction 2026-11-16). The open floor still reads as selected either way via the
   nav background below, with a matching inset ring so the state colour survives the selection colour. */
.sa-plan-tab.ok { border-color: var(--sa-color-success); color: var(--sa-color-success); background: var(--sa-color-success-soft); }
.sa-plan-tab.warn { border-color: var(--sa-color-warning); color: var(--sa-color-warning); background: var(--sa-color-warning-soft); }
.sa-plan-tab.active.ok, .sa-plan-tab.active.warn { color: #fff; }
.sa-plan-tab.active.ok { box-shadow: inset 0 0 0 2px var(--sa-color-success); }
.sa-plan-tab.active.warn { box-shadow: inset 0 0 0 2px var(--sa-color-warning); }
/* Quiet outlined badge (owner correction 2026-11-16: "the RSF badge is awkward, perhaps a blue outline is
   better") instead of the old solid-filled pill — blue outline, transparent fill, blue text, sized to sit at
   the same height as the pill's own text rather than visually outweighing it. Reused as-is on both the Floor
   plan and Assign pages' floor tabs (one CSS class, never a second copy of this badge). The active/selected
   tab's own dark nav background flips the outline to white instead of re-darkening it, so it stays readable
   against both the ordinary white pill and the active one. */
.sa-plan-tab-tick { display: inline-block; margin-left: 4px; padding: 0 5px; line-height: 1.5; border: 1px solid var(--sa-color-primary); border-radius: 4px; background: transparent; font-size: 10px; font-weight: 700; letter-spacing: 0.02em; color: var(--sa-color-primary); vertical-align: middle; }
.sa-plan-tab.active .sa-plan-tab-tick { border-color: #fff; color: #fff; background: transparent; }
.sa-plan-floor-rsf { font-size: 12px; color: var(--sa-color-text-faint); margin-top: 2px; }
.sa-viewer-wrap { position: relative; flex: 1; min-height: 0; border: 1px solid var(--sa-color-border); border-radius: var(--sa-radius-lg); background: var(--sa-color-cad-canvas); overflow: hidden; }
.sa-viewer { position: absolute; inset: 0; overflow: hidden; touch-action: none; cursor: grab; outline: none; background: var(--sa-color-cad-canvas); }
.sa-viewer.is-panning { cursor: grabbing; }
/* E3c: .sa-space-pan (floorplan-viewer.js's own Space-bar-held tracking) needs no cursor rule of its own - this
   read-only viewer already shows the Photoshop grab-hand cursor at rest (above) since a plain drag already
   pans it; the class exists only to suppress a stationary click's own select/hover while Space is held. */
/* White/ink floor-plan mode (owner 2026-11-09, PlanViewer's WhiteMode flag — a mode on the shared viewer, same
   pattern as sa-assign-mode above): white canvas instead of the black CAD-convention canvas, and the stacking
   order reversed so the coloured fills sit BELOW the CAD linework ("for best results the foreground colors
   should be drawn below the background in white background mode and print mode" — the same bottom-to-top
   order docs/Printing.md already fixed for print, applied here on screen). Both layers are absolutely
   positioned with no z-index elsewhere in this file, so z-index alone decides paint order regardless of DOM
   order; .sa-bg already carries pointer-events:none unconditionally, so putting it on top never blocks hover/
   selection from reaching the (still foreground, still interactive) spaces overlay underneath it. */
.sa-viewer.sa-white-mode { background: #fff; }
.sa-viewer:not(.sa-white-mode) .sa-bg { z-index: 1; }
.sa-viewer:not(.sa-white-mode) .sa-overlay { z-index: 2; }
.sa-viewer.sa-white-mode .sa-overlay { z-index: 1; }
.sa-viewer.sa-white-mode .sa-bg { z-index: 2; }
/* Every space's own outline (floorplan-viewer.js's syncOutlines mirror layer) always sits above the
   background too, in both modes (owner correction 2026-11-16: "polyline outlines are still intertwined with
   background" on the Floor plan page's White/ink mode, where the two rules above otherwise deliberately put
   the background above the ordinary spaces overlay so a pastel fill never hides linework drawn inside a
   space's own footprint). z-index 3 beats both rules above unconditionally (their max is 2) regardless of
   mode, so this needs no :not(.sa-white-mode)/.sa-white-mode split of its own. fill:none!important strips the
   mirror down to an outline only — the classification/pastel FILL stays exactly where the two rules above put
   it; only the stroke is ever drawn twice. */
.sa-viewer:not(.sa-white-mode) .sa-overlay.sa-overlay-outlines,
.sa-viewer.sa-white-mode .sa-overlay.sa-overlay-outlines { z-index: 3; pointer-events: none; }
/* pointer-events:none here, not !important: ".sa-overlay .sa-space{pointer-events:all}" below (needed so the
   REAL spaces stay clickable/hoverable) would otherwise win on these mirrored clones too via inheritance from
   the outer svg's own pointer-events:none, exactly the invisible-hit-target risk the highlight layer's own
   identically-shaped ".sa-overlay.sa-overlay-highlight .sa-space" rule already guards against below - one
   extra class keeps this selector the more specific of the two regardless of source order, same fix. */
.sa-overlay.sa-overlay-outlines .sa-space { fill: none !important; pointer-events: none; }
/* The hover/selection mirror layer (floorplan-viewer.js's syncHighlight) always wins, in both modes (owner
   correction 2026-11-16: the highlight must stay topmost even where white mode otherwise deliberately puts
   the background above the ordinary spaces overlay). Same specificity shape as the two rules above so the
   cascade, not source order alone, is what guarantees this stays true if either of them ever changes. */
.sa-viewer:not(.sa-white-mode) .sa-overlay.sa-overlay-highlight,
.sa-viewer.sa-white-mode .sa-overlay.sa-overlay-highlight { z-index: 5; pointer-events: none; }
/* ".sa-overlay .sa-space" below (its own pointer-events: all, needed so the REAL spaces stay clickable/
   hoverable) is higher specificity than the svg-level pointer-events:none above, so it would otherwise win
   on the mirrored clones too and silently turn this purely-visual top layer into a second, invisible hit
   target sitting over the real shapes — caught by a real pointer hover in Chromium landing on the clone
   instead of the original. One extra class makes this selector the more specific of the two regardless of
   source order. */
.sa-overlay.sa-overlay-highlight .sa-space { pointer-events: none; }
.sa-viewer-mode-toggle { width: auto !important; padding: 0 9px; font-size: 11px !important; font-weight: 600; white-space: nowrap; }
.sa-stage { position: absolute; inset: 0; }
.sa-bg { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; user-select: none; -webkit-user-drag: none; pointer-events: none; }
/* orchid.css's own "img, svg { max-width: 100% }" reset (App.razor loads it before app.css, but that rule's bare
   element selector is lower specificity than any class here) otherwise caps both layers to the viewer's own
   container width the instant a zoom-in pushes past "fit" — silently turning every zoom level past fit into a
   same-size redraw instead of the overflow-and-pan the rest of this file's math (fitScale/zoomAt's own 40x
   ceiling, non-scaling-stroke) is built around. Found while building the Assign-mode hover outline's own
   "4-5px at 100% zoom" sizing (owner correction 2026-11-09): scale 1 ("100% zoom") is bigger than "fit" for
   any container narrower than BASE_LONG_SIDE_PX (1600px, floorplan-viewer.js) — i.e. always — so without this
   override that exact zoom level was unreachable, in every mode, not only Assign's. */
.sa-bg, .sa-overlay { max-width: none; }
.sa-overlay { position: absolute; left: 0; top: 0; overflow: visible; }
.sa-overlay-markers { pointer-events: none; }
.sa-overlay-markers .sa-marker { pointer-events: all; cursor: pointer; }
.sa-tip { position: absolute; left: 0; top: 0; z-index: 3; padding: 3px 8px; border-radius: 5px; background: rgba(16,24,38,.92); border: 1px solid rgba(255,255,255,.22); color: #fff; font-size: 12px; pointer-events: none; white-space: nowrap; }
.sa-viewer-controls { position: absolute; right: 10px; top: 10px; z-index: 4; display: flex; flex-direction: column; gap: 4px; }
.sa-viewer-controls button { width: 32px; height: 32px; border: 1px solid var(--sa-color-border-strong); background: #fff; border-radius: 6px; cursor: pointer; font-size: 16px; }
.sa-viewer-legend { position: absolute; left: 10px; bottom: 10px; z-index: 4; background: rgba(255,255,255,.94); border: 1px solid var(--sa-color-border); border-radius: 8px; padding: 6px 10px; font-size: 12px; color: var(--sa-color-text-muted); display: flex; gap: 12px; flex-wrap: wrap; max-width: 90%; }
.sa-viewer-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }

/* Space polygons (interactive layer). Shapes are styled by class only — no inline handlers or styles.
   An unclassified space ("sa-untyped" — no AreaClassification/area type assigned yet; every space on the
   Validation review page, which has no classification concept at all) gets NO fill, only a thin neutral
   outline, so the CAD linework reads as drawn rather than wearing a colour wash (owner correction 2026-11-07:
   "there is a blue tint to the floor plans which should not be there (we work on colour assignments later)").
   The .sa-cls-* classification fills below are unchanged — that mapping is for later colour work, not this one. */
.sa-overlay .sa-space { fill: none; stroke: #8993a6; stroke-width: 1.2; vector-effect: non-scaling-stroke; cursor: pointer; pointer-events: all; }
.sa-overlay .sa-space.sa-untyped { fill: none; stroke: #8993a6; }
.sa-overlay .sa-space.sa-untyped.is-hover { fill: rgba(140, 150, 165, .14); stroke: #6b7280; stroke-width: 1.6; }
.sa-overlay .sa-space.sa-untyped.is-selected { fill: rgba(140, 150, 165, .22); stroke: #6b7280; stroke-width: 2; }
/* Printed plans (white page, Components/Pages/Print/FloorPlanPrint.razor) read the same neutral outline as a
   dark grey instead of the screen viewer's light grey (black --sa-color-cad-canvas) — same markup, scoped by
   which container it's sitting in. */
.sa-fp-plan-area .sa-overlay .sa-space.sa-untyped,
.sa-viewer.sa-white-mode .sa-overlay .sa-space.sa-untyped { stroke: #475467; }
.sa-overlay .sa-space[data-area-type] { fill: rgba(47, 111, 237, .30); }
/* One fill per AreaClassification (StackAccess.Infrastructure.AreaTypes.AreaClassificationPalette is the
   single source of truth for these colours — Office=blue and InterBuilding=green come straight from the
   BOMA standard's own colour-coded worked-example spreadsheets; the rest are a StackAccess extension). */
.sa-overlay .sa-space.sa-cls-office { fill: rgba(47, 111, 237, .50); stroke: #2f6fed; }
.sa-overlay .sa-space.sa-cls-storeretail { fill: rgba(0, 150, 170, .50); stroke: #00909f; }
.sa-overlay .sa-space.sa-cls-industrial { fill: rgba(166, 106, 46, .50); stroke: #a66a2e; }
.sa-overlay .sa-space.sa-cls-parking { fill: rgba(102, 112, 133, .44); stroke: #667085; }
.sa-overlay .sa-space.sa-cls-service { fill: rgba(125, 71, 196, .50); stroke: #7d47c4; }
.sa-overlay .sa-space.sa-cls-common { fill: rgba(166, 124, 0, .50); stroke: #a67c00; }
.sa-overlay .sa-space.sa-cls-amenity { fill: rgba(194, 65, 122, .50); stroke: #c2417a; }
.sa-overlay .sa-space.sa-cls-ancillary { fill: rgba(106, 90, 205, .50); stroke: #6a5acd; }
.sa-overlay .sa-space.sa-cls-verticalpenetration { fill: rgba(75, 85, 99, .44); stroke: #4b5563; }
.sa-overlay .sa-space.sa-cls-exclusion { fill: rgba(156, 163, 175, .40); stroke: #9ca3af; }
.sa-overlay .sa-space.sa-cls-interbuilding { fill: rgba(46, 139, 87, .50); stroke: #2e8b57; }
/* White/ink mode: the same classification keeps the same stroke hue, but the fill switches from the black
   canvas's translucent wash to the solid pastel (owner 2026-11-09) — print.css carries the identical rules
   for the print page, both reading the same --sa-pastel-* variables above so there is only one place either
   is ever changed. */
.sa-viewer.sa-white-mode .sa-overlay .sa-space.sa-cls-office { fill: var(--sa-pastel-office); stroke: #2f6fed; }
.sa-viewer.sa-white-mode .sa-overlay .sa-space.sa-cls-storeretail { fill: var(--sa-pastel-storeretail); stroke: #00909f; }
.sa-viewer.sa-white-mode .sa-overlay .sa-space.sa-cls-industrial { fill: var(--sa-pastel-industrial); stroke: #a66a2e; }
.sa-viewer.sa-white-mode .sa-overlay .sa-space.sa-cls-parking { fill: var(--sa-pastel-parking); stroke: #667085; }
.sa-viewer.sa-white-mode .sa-overlay .sa-space.sa-cls-service { fill: var(--sa-pastel-service); stroke: #7d47c4; }
.sa-viewer.sa-white-mode .sa-overlay .sa-space.sa-cls-common { fill: var(--sa-pastel-common); stroke: #a67c00; }
.sa-viewer.sa-white-mode .sa-overlay .sa-space.sa-cls-amenity { fill: var(--sa-pastel-amenity); stroke: #c2417a; }
.sa-viewer.sa-white-mode .sa-overlay .sa-space.sa-cls-ancillary { fill: var(--sa-pastel-ancillary); stroke: #6a5acd; }
.sa-viewer.sa-white-mode .sa-overlay .sa-space.sa-cls-verticalpenetration { fill: var(--sa-pastel-verticalpenetration); stroke: #4b5563; }
.sa-viewer.sa-white-mode .sa-overlay .sa-space.sa-cls-exclusion { fill: var(--sa-pastel-exclusion); stroke: #9ca3af; }
.sa-viewer.sa-white-mode .sa-overlay .sa-space.sa-cls-interbuilding { fill: var(--sa-pastel-interbuilding); stroke: #2e8b57; }
/* Auto-fix preview: geometry changed by the proposal keeps its green identity, outline only — no fill wash,
   same "no tint until there's something to report" rule as the rest of this change. */
.sa-overlay .sa-space.sa-fixed { fill: none; stroke: #1f7a4d; stroke-width: 1.6; }
.sa-overlay .sa-space.is-hover { fill: rgba(14, 124, 184, .30); stroke: #0e7cb8; stroke-width: 2; }
.sa-overlay .sa-space.is-selected { fill: rgba(14, 124, 184, .48); stroke: #0e7cb8; stroke-width: 3; stroke-dasharray: none; }

/* Assign page mode (owner correction 2026-11-09, PlanViewer's AssignMode flag — a mode on the shared viewer,
   never a second copy of it): no fills anywhere, spaces and the floor outline alike (that one is just another
   untyped/typed "sa-space" shape) — only the /floorplan viewer and print keep the classification fills above.
   Hover/selection becomes a THICK outline instead of a fill wash: yellow, or white when the space's own
   stroke is already a yellow/gold (only AreaClassification.Common's #a67c00 reads that way among the palette
   above) so the highlight stays visible against it. The outline is drawn in drawing user-space units (no
   vector-effect:non-scaling-stroke) so it scales with zoom, sized per drawing by --sa-assign-hover-outline-width
   (floorplan-viewer.js, computed from the viewer's own px-per-unit so it renders ~4-5px at scale 1). */
.sa-viewer.sa-assign-mode .sa-overlay .sa-space,
.sa-viewer.sa-assign-mode .sa-overlay .sa-space.sa-untyped,
.sa-viewer.sa-assign-mode .sa-overlay .sa-space.sa-untyped.is-hover,
.sa-viewer.sa-assign-mode .sa-overlay .sa-space.sa-untyped.is-selected,
.sa-viewer.sa-assign-mode .sa-overlay .sa-space.sa-cls-office,
.sa-viewer.sa-assign-mode .sa-overlay .sa-space.sa-cls-storeretail,
.sa-viewer.sa-assign-mode .sa-overlay .sa-space.sa-cls-industrial,
.sa-viewer.sa-assign-mode .sa-overlay .sa-space.sa-cls-parking,
.sa-viewer.sa-assign-mode .sa-overlay .sa-space.sa-cls-service,
.sa-viewer.sa-assign-mode .sa-overlay .sa-space.sa-cls-common,
.sa-viewer.sa-assign-mode .sa-overlay .sa-space.sa-cls-amenity,
.sa-viewer.sa-assign-mode .sa-overlay .sa-space.sa-cls-ancillary,
.sa-viewer.sa-assign-mode .sa-overlay .sa-space.sa-cls-verticalpenetration,
.sa-viewer.sa-assign-mode .sa-overlay .sa-space.sa-cls-exclusion,
.sa-viewer.sa-assign-mode .sa-overlay .sa-space.sa-cls-interbuilding,
.sa-viewer.sa-assign-mode .sa-overlay .sa-space.is-hover,
.sa-viewer.sa-assign-mode .sa-overlay .sa-space.is-selected { fill: none; }
/* One space outlined at a time: while something is hovered, a different selected space falls back to its own
   plain stroke (the container's sa-has-hover class, floorplan-viewer.js hover()). */
.sa-viewer.sa-assign-mode .sa-overlay .sa-space.is-hover,
.sa-viewer.sa-assign-mode:not(.sa-has-hover) .sa-overlay .sa-space.is-selected {
    stroke: #ffd400;
    stroke-width: var(--sa-assign-hover-outline-width, 3);
    vector-effect: none;
}
.sa-viewer.sa-assign-mode .sa-overlay .sa-space.sa-cls-common.is-hover,
.sa-viewer.sa-assign-mode:not(.sa-has-hover) .sa-overlay .sa-space.sa-cls-common.is-selected { stroke: #ffffff; }

.sa-overlay .sa-marker path { stroke: #e8392f; stroke-width: 3; fill: none; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.sa-overlay .sa-marker.is-selected path { stroke: #ff6b60; stroke-width: 5; }
/* Problem geometry outlined in red (owner correction 2026-11-07: "the actual problematic areas should be
   outlined in red") — the X marker above stays only as a fallback for a problem with no single piece of
   geometry to show (e.g. a stray non-polyline entity); when a region is drawn the X itself is omitted and only
   a transparent hit circle remains, so the outline is the one visual, still clickable at the same point. */
.sa-overlay .sa-marker .sa-problem-region { fill: rgba(232, 57, 47, .15); stroke: #e8392f; stroke-width: 2; vector-effect: non-scaling-stroke; }
.sa-overlay .sa-marker.is-selected .sa-problem-region { fill: rgba(232, 57, 47, .25); stroke-width: 3; }
.sa-overlay .sa-marker .sa-problem-gap-line { fill: none; stroke: #e8392f; stroke-width: 2; vector-effect: non-scaling-stroke; }
.sa-overlay .sa-marker .sa-problem-gap { fill: #e8392f; stroke: none; }

.sa-plan-side { display: flex; flex-direction: column; min-height: 0; background: var(--sa-color-surface); border: 1px solid var(--sa-color-border); border-radius: var(--sa-radius-lg); box-shadow: var(--sa-shadow-card); }
.sa-plan-side header { padding: 12px 14px; border-bottom: 1px solid var(--sa-color-border); }
.sa-plan-side h2 { margin: 0 0 2px; font-size: 16px; }
.sa-plan-side .sa-plan-total { font-size: 12px; color: var(--sa-color-text-faint); }
.sa-space-list { overflow: auto; flex: 1; }
.sa-space-item { padding: 9px 14px; border-bottom: 1px solid var(--sa-color-border); cursor: pointer; display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; }
.sa-space-item:hover, .sa-space-item.is-hover { background: var(--sa-color-surface-alt); }
.sa-space-item.is-selected { background: var(--sa-color-primary-soft); box-shadow: inset 3px 0 0 var(--sa-color-primary); }
.sa-space-item .sa-space-name { font-weight: 600; font-size: 14px; }
/* No suite code yet — showing the drawing's own label as a fallback, never a value in its own right. */
.sa-space-item .sa-space-name-unconfirmed { color: var(--sa-color-text-muted); font-weight: 400; font-style: italic; }
.sa-space-item .sa-space-area { font-variant-numeric: tabular-nums; color: var(--sa-color-text-muted); font-size: 13px; }
.sa-space-item select { grid-column: 1 / -1; width: 100%; padding: 6px 8px; border: 1px solid var(--sa-color-border-strong); border-radius: var(--sa-radius-sm); font: inherit; font-size: 13px; background: #fff; }
.sa-space-item select.untyped { border-color: var(--sa-color-warning); background: var(--sa-color-warning-soft); }
.sa-space-item .sa-space-name-input { grid-column: 1 / -1; font-weight: 600; font-size: 14px; border: 1px solid transparent; border-radius: var(--sa-radius-sm); padding: 3px 6px; background: transparent; font: inherit; }
.sa-space-item .sa-space-name-input:hover, .sa-space-item .sa-space-name-input:focus { border-color: var(--sa-color-border-strong); background: #fff; }
.sa-space-item .sa-space-item-badge-wide { grid-column: 1 / -1; justify-self: start; }
.sa-btn-small { padding: 3px 10px; font-size: 12px; grid-column: 1 / -1; justify-self: start; }
.sa-suggest-bar { margin-top: 8px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sa-suggest-bar label { font-size: 12px; color: var(--sa-color-text-muted); display: flex; align-items: center; gap: 6px; }
.sa-suggest-bar input[type="text"] { padding: 5px 8px; border: 1px solid var(--sa-color-border-strong); border-radius: var(--sa-radius-sm); font: inherit; font-size: 13px; }
.sa-plan-empty { padding: 20px; color: var(--sa-color-text-muted); }

/* Assign page: Suite code / Name / Area category / Net area table (docs/FeatureSpecs/09, assign page).
   table-layout: fixed with explicit per-column percentages (owner correction 2026-11-16, panel now ~30% of
   a normal desktop width instead of a fixed 620px) — otherwise the browser sizes an "auto" table's columns
   from its widest cell content, and a <select>'s widest *option* text counts toward that even though the
   select itself is told width:100%, which is exactly what forced a horizontal scrollbar at the narrower
   width. Fixed layout makes the three percentages below the one and only thing that decides column width. */
.sa-assign-side { min-width: 0; }
.sa-assign-table-wrap { overflow: auto; flex: 1; }
.sa-assign-table { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 13px; }
.sa-assign-table th:nth-child(1), .sa-assign-table td:nth-child(1) { width: 30%; }
.sa-assign-table th:nth-child(2), .sa-assign-table td:nth-child(2) { width: 48%; }
.sa-assign-table th:nth-child(3), .sa-assign-table td:nth-child(3) { width: 22%; }
.sa-assign-table th { position: sticky; top: 0; background: var(--sa-color-surface); text-align: left; padding: 7px 6px; border-bottom: 1px solid var(--sa-color-border-strong); font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: var(--sa-color-text-muted); }
.sa-assign-table td { padding: 6px; border-bottom: 1px solid var(--sa-color-border); vertical-align: top; overflow-wrap: break-word; }
.sa-assign-table tbody tr { cursor: pointer; }
.sa-assign-table tbody tr:hover, .sa-assign-table tbody tr.is-hover { background: var(--sa-color-surface-alt); }
.sa-assign-table tbody tr.is-selected { background: var(--sa-color-primary-soft); box-shadow: inset 3px 0 0 var(--sa-color-primary); }
.sa-assign-table tbody tr.is-unassigned td.sa-suite-code { color: var(--sa-color-warning); font-weight: 600; }
.sa-assign-table .sa-suite-code { font-variant-numeric: tabular-nums; }
.sa-assign-table .sa-suite-code-input { width: 100%; min-width: 0; box-sizing: border-box; border: 1px solid var(--sa-color-border-strong); border-radius: var(--sa-radius-sm); padding: 3px 6px; background: #fff; font: inherit; font-size: 13px; font-variant-numeric: tabular-nums; }
.sa-assign-table .sa-suite-code-input.is-missing { border-color: var(--sa-color-warning); background: var(--sa-color-warning-soft); }
.sa-assign-table .sa-suite-code-badge { display: inline-block; margin-top: 3px; font-size: 10px; }
/* Provenance only — the drawing's own text label, never a suite code value (owner correction 2026-11-09: "no
   defaults"). Wraps instead of staying on one line (owner correction 2026-11-16, narrower panel column) so a
   long hint never pushes the Suite code column wider than its fixed share. */
.sa-assign-table .sa-suite-code-hint { color: var(--sa-color-text-muted); font-size: 11px; margin-top: 3px; white-space: normal; overflow-wrap: break-word; }
.sa-assign-table select { width: 100%; min-width: 0; box-sizing: border-box; padding: 6px 4px; border: 1px solid var(--sa-color-border-strong); border-radius: var(--sa-radius-sm); font: inherit; font-size: 13px; background: #fff; }
.sa-assign-table select.untyped { border-color: var(--sa-color-warning); background: var(--sa-color-warning-soft); }
.sa-assign-table .sa-space-area { font-variant-numeric: tabular-nums; color: var(--sa-color-text-muted); }
.sa-assign-suggestion { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
@media (max-width: 980px) { .sa-assign-table th, .sa-assign-table td { padding: 6px; } }

/* Floor plan (read-only): Suite code / Area type / USF-or-NSF / RSF table — same row<->plan hover/select
   pattern and sticky header as the Assign page's own table above, read-only: no inputs, no select, no
   badges anywhere in it (owner 2026-11-09: "area type (not a pill.. make normal table)"). */
.sa-plan-table-wrap { overflow: auto; flex: 1; }
.sa-plan-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.sa-plan-table th { position: sticky; top: 0; background: var(--sa-color-surface); text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--sa-color-border-strong); font-size: 11px; text-transform: uppercase; letter-spacing: .03em; color: var(--sa-color-text-muted); }
.sa-plan-table td { padding: 7px 10px; border-bottom: 1px solid var(--sa-color-border); vertical-align: top; }
.sa-plan-table tbody tr { cursor: pointer; }
.sa-plan-table tbody tr:hover, .sa-plan-table tbody tr.is-hover { background: var(--sa-color-surface-alt); }
.sa-plan-table tbody tr.is-selected { background: var(--sa-color-primary-soft); box-shadow: inset 3px 0 0 var(--sa-color-primary); }
.sa-plan-table tbody tr.is-unassigned td.sa-suite-code { color: var(--sa-color-warning); font-weight: 600; }
.sa-plan-table .sa-suite-code { font-variant-numeric: tabular-nums; white-space: nowrap; }
.sa-plan-table .sa-area-type-unassigned { color: var(--sa-color-text-muted); font-style: italic; }
.sa-plan-table tfoot td { position: sticky; bottom: 0; background: var(--sa-color-surface); font-weight: 600; padding: 7px 10px; border-top: 1px solid var(--sa-color-border-strong); }
@media (max-width: 980px) { .sa-plan-table th, .sa-plan-table td { padding: 6px; } }

.ov-error { background: var(--sa-color-error-soft); border: 1px solid #e8b4b4; border-radius: var(--sa-radius-md); padding: 16px 18px; margin-bottom: 16px; }
.ov-error h2 { margin: 0 0 6px; font-size: 16px; color: var(--sa-color-error); }
.ov-error ul { margin: 8px 0 0; padding-left: 20px; }
.ov-error li { margin: 3px 0; }
.gsa-unassigned-list { list-style: none; margin: 10px 0 0; padding: 0; text-align: left; }
.gsa-unassigned-list li { padding: 4px 0; border-bottom: 1px solid var(--sa-color-border); }
@media (max-width: 980px) { .sa-plan { grid-template-columns: 1fr; height: auto; } .sa-viewer-wrap { height: 60vh; flex: none; } .sa-plan-side { max-height: 60vh; } }

/* Validation review */
.sa-review { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 16px; height: calc(100vh - var(--sa-topbar-height) - 160px); min-height: 460px; }
.sa-issue { display: grid; grid-template-columns: 22px 1fr; gap: 2px 8px; padding: 9px 14px; border-bottom: 1px solid var(--sa-color-border); cursor: pointer; }
.sa-issue:hover, .sa-issue.is-selected { background: var(--sa-color-error-soft); }
.sa-issue .sa-x { color: #d61f1f; font-weight: 800; grid-row: 1 / 3; }
.sa-issue .sa-issue-kind { font-weight: 600; font-size: 13px; }
.sa-issue .sa-issue-where { font-size: 12px; color: var(--sa-color-text-faint); font-variant-numeric: tabular-nums; }
.sa-change { padding: 9px 14px; border-bottom: 1px solid var(--sa-color-border); font-size: 13px; }
.sa-change strong { display: block; }
.sa-review-actions { display: flex; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--sa-color-border); flex-wrap: wrap; }
@media (max-width: 980px) { .sa-review { grid-template-columns: 1fr; height: auto; } }

/* Roughly 70/30, plan to panel (owner correction 2026-11-16: the old fixed 620px panel against a 1fr plan
   read as about 60/40 on a normal desktop width). minmax(0, 7fr) lets the plan shrink below its own content
   size instead of forcing the row wider; the panel's 320px floor keeps the table's inputs/select legible if
   the window is narrower than the breakpoint below needs. */
.sa-assign-review { grid-template-columns: minmax(0, 7fr) minmax(320px, 3fr); }
@media (max-width: 980px) { .sa-assign-review { grid-template-columns: 1fr; } }
.sa-hole-decisions { border-bottom: 1px solid var(--sa-color-border); }
.sa-hole-decision { padding: 10px 14px; border-top: 1px solid var(--sa-color-border); font-size: 13px; }
.sa-hole-decision p { margin: 0 0 6px; }
.sa-hole-decision .sa-review-actions { padding: 0; border-bottom: none; }
.sa-handle-decimal { font-size: 11px; color: var(--sa-color-text-faint); font-variant-numeric: tabular-nums; }
.sa-section-title { font-size: 16px; margin: 22px 0 10px; }

/* Overlap trim accordion (Validation.razor, owner 2026-11-12) - a flat list of rows, not a modal. */
.sa-overlap-decisions { border-bottom: 1px solid var(--sa-color-border); }
.sa-overlap-row { border-top: 1px solid var(--sa-color-border); font-size: 13px; }
.sa-overlap-header { display: flex; align-items: center; gap: 8px; padding: 10px 14px; cursor: pointer; }
.sa-overlap-row:hover .sa-overlap-header, .sa-overlap-row.is-expanded .sa-overlap-header { background: var(--sa-color-surface-muted, #f4f5f7); }
.sa-swatch { width: 10px; height: 10px; border-radius: 2px; display: inline-block; flex: none; }
.sa-overlap-choices { padding: 0 14px 10px; display: flex; flex-direction: column; gap: 10px; }
.sa-overlap-choice { padding: 8px 10px; border: 1px solid var(--sa-color-border); border-radius: var(--sa-radius-sm, 6px); }
.sa-overlap-choice.is-chosen { border-color: var(--sa-color-primary, #2563eb); }
.sa-overlap-choice p { margin: 6px 0 0; }

/* Face-group accordion (Validation.razor, owner decision 2026-11-13, hybrid planarize/polygonize). */
.sa-facegroup-decisions { border-bottom: 1px solid var(--sa-color-border); }
.sa-facegroup-row { border-top: 1px solid var(--sa-color-border); font-size: 13px; }
.sa-facegroup-header { display: flex; align-items: center; gap: 8px; padding: 10px 14px; cursor: pointer; }
.sa-facegroup-row:hover .sa-facegroup-header, .sa-facegroup-row.is-expanded .sa-facegroup-header { background: var(--sa-color-surface-muted, #f4f5f7); }
.sa-facegroup-choices { padding: 0 14px 10px; display: flex; flex-direction: column; gap: 8px; }
.sa-facegroup-face { display: flex; align-items: center; gap: 8px; }

/* guided repair (Validation.razor) and the per-building Import Problems screen */
.sa-guided-repair { border-bottom: 1px solid var(--sa-color-border); padding-bottom: 6px; }
.sa-guided-repair > p.sa-issue-where { padding: 0 14px 8px; margin: 0; }
.sa-guided-repair input[type="text"] { display: block; margin: 0 14px 10px; padding: 6px 10px; border: 1px solid var(--sa-color-border); border-radius: var(--sa-radius-sm, 6px); font-size: 13px; width: calc(100% - 28px); }
.sa-guided-repair > button { margin: 0 14px 10px; }
.sa-guided-problem { padding: 10px 14px; border-top: 1px solid var(--sa-color-border); font-size: 13px; }
.sa-guided-problem p { margin: 0 0 6px; }
.sa-guided-problem .sa-review-actions { padding: 0 0 6px; border-bottom: none; }
.sa-cad-guidance { color: var(--sa-color-text-faint); }

.sa-problem-floors { display: flex; flex-direction: column; gap: 18px; }
.sa-problem-floor { background: var(--sa-color-surface); border: 1px solid var(--sa-color-border); border-radius: var(--sa-radius-lg); box-shadow: var(--sa-shadow-card); overflow: hidden; }
.sa-problem-floor-header { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--sa-color-border); flex-wrap: wrap; }
.sa-problem-floor-header h2 { margin: 0; font-size: 16px; flex: 0 0 auto; }
.sa-problem-floor-header > a.sa-btn { margin-left: auto; }
.sa-problem-floor-body { display: grid; grid-template-columns: 280px 1fr; gap: 0; }
.sa-problem-thumb { position: relative; background: var(--sa-color-cad-canvas); border-right: 1px solid var(--sa-color-border); }
.sa-problem-thumb-layer { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.sa-problem-list { display: flex; flex-direction: column; }
.sa-problem { align-items: start; }
@media (max-width: 760px) { .sa-problem-floor-body { grid-template-columns: 1fr; } .sa-problem-thumb { aspect-ratio: 16 / 9 !important; border-right: none; border-bottom: 1px solid var(--sa-color-border); } }

/* legend swatches mirror the .sa-cls-* space fills */
.sa-viewer-legend i.sa-space { background: transparent; border: 1px solid #8993a6; }
.sa-viewer-legend i.sa-problem-outline { background: rgba(232, 57, 47, .15); border: 2px solid #e8392f; }
.sa-viewer-legend i.sa-cls-office { background: rgba(47,111,237,.45); border: 1px solid rgb(47,111,237); }
.sa-viewer-legend i.sa-cls-storeretail { background: rgba(0,150,170,.45); border: 1px solid rgb(0,150,170); }
.sa-viewer-legend i.sa-cls-industrial { background: rgba(166,106,46,.45); border: 1px solid rgb(166,106,46); }
.sa-viewer-legend i.sa-cls-parking { background: rgba(102,112,133,.45); border: 1px solid rgb(102,112,133); }
.sa-viewer-legend i.sa-cls-service { background: rgba(125,71,196,.45); border: 1px solid rgb(125,71,196); }
.sa-viewer-legend i.sa-cls-common { background: rgba(166,124,0,.45); border: 1px solid rgb(166,124,0); }
.sa-viewer-legend i.sa-cls-amenity { background: rgba(194,65,122,.45); border: 1px solid rgb(194,65,122); }
.sa-viewer-legend i.sa-cls-ancillary { background: rgba(106,90,205,.45); border: 1px solid rgb(106,90,205); }
.sa-viewer-legend i.sa-cls-verticalpenetration { background: rgba(75,85,99,.45); border: 1px solid rgb(75,85,99); }
.sa-viewer-legend i.sa-cls-exclusion { background: rgba(156,163,175,.45); border: 1px solid rgb(156,163,175); }
.sa-viewer-legend i.sa-cls-interbuilding { background: rgba(46,139,87,.45); border: 1px solid rgb(46,139,87); }
.sa-viewer-legend i.sa-untyped { background: transparent; border: 1px solid #8993a6; }
/* Legend swatches follow the active mode (owner 2026-11-09): White/ink mode (and print, print.css) show the
   same solid pastel the plan itself is filled with instead of the black canvas's translucent wash. A general
   sibling combinator, not a descendant one: PlanViewer.razor renders .sa-viewer-legend as ChildContent, a
   SIBLING of the .sa-viewer host div (both direct children of .sa-viewer-wrap), appended right after it in
   document order — never nested inside it. */
.sa-viewer.sa-white-mode ~ .sa-viewer-legend i.sa-cls-office { background: var(--sa-pastel-office); border-color: #2f6fed; }
.sa-viewer.sa-white-mode ~ .sa-viewer-legend i.sa-cls-storeretail { background: var(--sa-pastel-storeretail); border-color: #00909f; }
.sa-viewer.sa-white-mode ~ .sa-viewer-legend i.sa-cls-industrial { background: var(--sa-pastel-industrial); border-color: #a66a2e; }
.sa-viewer.sa-white-mode ~ .sa-viewer-legend i.sa-cls-parking { background: var(--sa-pastel-parking); border-color: #667085; }
.sa-viewer.sa-white-mode ~ .sa-viewer-legend i.sa-cls-service { background: var(--sa-pastel-service); border-color: #7d47c4; }
.sa-viewer.sa-white-mode ~ .sa-viewer-legend i.sa-cls-common { background: var(--sa-pastel-common); border-color: #a67c00; }
.sa-viewer.sa-white-mode ~ .sa-viewer-legend i.sa-cls-amenity { background: var(--sa-pastel-amenity); border-color: #c2417a; }
.sa-viewer.sa-white-mode ~ .sa-viewer-legend i.sa-cls-ancillary { background: var(--sa-pastel-ancillary); border-color: #6a5acd; }
.sa-viewer.sa-white-mode ~ .sa-viewer-legend i.sa-cls-verticalpenetration { background: var(--sa-pastel-verticalpenetration); border-color: #4b5563; }
.sa-viewer.sa-white-mode ~ .sa-viewer-legend i.sa-cls-exclusion { background: var(--sa-pastel-exclusion); border-color: #9ca3af; }
.sa-viewer.sa-white-mode ~ .sa-viewer-legend i.sa-cls-interbuilding { background: var(--sa-pastel-interbuilding); border-color: #2e8b57; }
.sa-viewer-legend i.sa-fixed { background: transparent; border: 1.5px solid #1f7a4d; }
/* Floating tooltip for the interactive charts (js/chart-tooltip.js). */
.sa-chart-tip {
    position: fixed; z-index: 80; pointer-events: none; opacity: 0; transition: opacity 0.08s ease;
    background: var(--sa-color-nav); color: #fff; font-size: 12px; font-weight: 600; line-height: 1.3;
    padding: 6px 10px; border-radius: 6px; max-width: 280px; box-shadow: 0 6px 18px rgba(16, 24, 38, 0.3);
}
.sa-chart-tip.on { opacity: 1; }

/* Printouts keep the area-classification colours on floor plans and charts. The rest of the print
   layout (page size, repeated headers, the fixed header/footer band) lives in print.css, loaded
   alongside this file on every printable screen. */
@media print {
    .sa-overlay .sa-space, .sa-viewer-legend i, .ov-pie-card svg, .ov-pie-card .sa-swatch { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

.sa-print-actions { display: inline-flex; align-items: center; gap: 8px; }

/* Client/firm logo upload (Components/Shared/LogoField.razor): the building-photo drop box, reshaped
   for a wide masthead logo — a short letterbox, the whole logo shown (never cropped) on white. */
.sa-logo-field { position: static; max-width: 560px; }
.sa-logo-field .sa-photo-drop { aspect-ratio: auto; min-height: 156px; padding: 12px; }
.sa-logo-field .sa-photo-drop.has-photo { background: #fff; }
.sa-logo-field .sa-photo-drop img { object-fit: contain; padding: 14px 20px; box-sizing: border-box; }
.sa-logo-field .sa-photo-drop-empty svg { width: 28px; height: 28px; }
.sa-logo-field .sa-photo-optional { text-align: left; }
.sa-print-actions-error { font-size: 12px; color: var(--sa-color-error, #c0392b); }
/* SP-P1a: visible progress while a PDF is being prepared, instead of a frozen page — paired with the
   "Preparing PDF… (Ns)" label (PrintActions.razor, StackPrintDialog.razor) that itself updates as the job is polled. */
.sa-print-actions-spinner {
    display: inline-block; width: 13px; height: 13px; border-radius: 50%;
    border: 2px solid currentColor; border-top-color: transparent; opacity: 0.7;
    animation: sa-print-actions-spin 0.8s linear infinite;
}
@keyframes sa-print-actions-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
    .sa-print-actions-spinner { animation: none; }
}
/* Phones: icon-only buttons, so the breadcrumb keeps its room in the top bar. */
@media (max-width: 640px) {
    .sa-print-actions { gap: 6px; }
    .sa-print-actions .sa-btn { padding-inline: 10px; }
    .sa-print-actions .sa-btn span { display: none; }
}

/* ---- Loading feedback (task tsk-b8c2bd2c75fe, docs/LoadingFeedback.md) ---------------------------------------------
   #sa-nav-progress: the thin bar across the top of the window while a page navigation (or a busy LoadingButton) is in
   flight — driven by wwwroot/js/loading-feedback.js. Indeterminate on purpose: it says "working", never a made-up percent. */
.sa-nav-progress {
    position: fixed;
    inset: 0 0 auto 0;
    height: 3px;
    z-index: 2000;
    overflow: hidden;
    pointer-events: none;
}

.sa-nav-progress__bar {
    height: 100%;
    width: 100%;
    opacity: 0;
    background: linear-gradient(90deg, transparent 0, var(--bs-primary, #0e7cb8) 30%, var(--bs-primary, #0e7cb8) 70%, transparent 100%);
    background-size: 40% 100%;
    background-repeat: no-repeat;
}

.sa-nav-progress__bar.is-active {
    opacity: 1;
    animation: sa-nav-progress-slide 1.1s ease-in-out infinite;
}

.sa-nav-progress__bar.is-done {
    opacity: 0;
    transition: opacity .25s ease-out;
}

@keyframes sa-nav-progress-slide {
    from { background-position: -40% 0; }
    to { background-position: 140% 0; }
}

@media (prefers-reduced-motion: reduce) {
    .sa-nav-progress__bar.is-active {
        animation: none;
        background-size: 100% 100%;
    }
}

@media print {
    .sa-nav-progress { display: none; }
}

/* LoadingButton: idle shows its label; busy (the server's .is-busy, or the browser's own [data-sa-pending] the instant it is
   clicked) shows the spinner and the busy label, and keeps the button's own colour rather than the grey of a disabled one. */
.sa-loading-btn__spinner,
.sa-loading-btn__busy {
    display: none;
}

.sa-loading-btn.is-busy .sa-loading-btn__spinner,
.sa-loading-btn.is-busy .sa-loading-btn__busy,
.sa-loading-btn[data-sa-pending] .sa-loading-btn__spinner,
.sa-loading-btn[data-sa-pending] .sa-loading-btn__busy {
    display: inline-block;
}

.sa-loading-btn.is-busy .sa-loading-btn__idle,
.sa-loading-btn[data-sa-pending] .sa-loading-btn__idle {
    display: none;
}

.sa-loading-btn.is-busy,
.sa-loading-btn[data-sa-pending] {
    cursor: progress;
    pointer-events: none;
}

.sa-btn-primary.sa-loading-btn.is-busy:disabled {
    background: var(--sa-color-primary);
}
