/* MasterCraftEstimate Color Palette & Component Styles */
:root {
    /* Product typography: platform-native UI faces stay crisp at tool-sized
       labels and avoid delaying the measurement canvas for a webfont. */
    --rs-font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --rs-font-mono: ui-monospace, "SFMono-Regular", "Cascadia Code", "Roboto Mono", Consolas, "Liberation Mono", monospace;
    --rs-type-caption: 0.75rem;
    --rs-type-label: 0.8125rem;
    --rs-type-control: 0.875rem;
    --rs-type-body: 0.9375rem;
    --rs-primary: #1B3A4B;
    --rs-primary-light: #2D5F7A;
    --rs-accent: #E8913A;
    --rs-accent-hover: #D47E2E;
    --rs-success: #2E7D32;
    --rs-warning: #F9A825;
    --rs-danger: #C62828;
    --rs-bg: #F4F6F8;
    --rs-card: #FFFFFF;
    --rs-border: #DDE3EA;
    --rs-text-primary: #1A1F2B;
    --rs-text-secondary: #5A6578;
    --rs-text-muted: #8E99A8;
    --rs-navbar-bg: #0d1117;
}

body {
    font-family: var(--rs-font-sans);
    background-color: var(--rs-bg);
    color: var(--rs-text-primary);
}

/* Navbar */
.rs-navbar {
    background-color: var(--rs-navbar-bg) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.rs-navbar .navbar-brand {
    color: #fff !important;
    font-size: 1.25rem;
}

.rs-navbar .nav-link {
    color: rgba(255, 255, 255, 0.8) !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: 4px;
    transition: background 0.2s, color 0.2s;
}

.rs-navbar .nav-link:hover,
.rs-navbar .nav-link.active {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.1);
}

.rs-navbar .dropdown-menu {
    border: 1px solid var(--rs-border);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.rs-navbar .dropdown-item.active,
.rs-navbar .dropdown-item:active {
    background: var(--rs-primary);
    color: #fff;
}

/* Cards */
.rs-card {
    background: var(--rs-card);
    border: 1px solid var(--rs-border);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.09);
}

/* Stat cards */
.rs-stat-card {
    background: var(--rs-card);
    border: 1px solid var(--rs-border);
    border-radius: 10px;
    padding: 1.25rem;
    text-align: center;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.09);
}

.rs-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.rs-stat-card .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--rs-primary);
}

.rs-stat-card .stat-label {
    font-size: 0.85rem;
    color: var(--rs-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Section title — replaces inline style="color: var(--rs-primary); font-weight: 600;" */
.rs-section-title {
    color: var(--rs-primary);
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

/* Status badges — WCAG AA contrast-compliant */
.badge-new { background-color: #546E7A; color: #fff; }
.badge-measured { background-color: #1565C0; color: #fff; }
.badge-estimated { background-color: #BF6000; color: #fff; }
.badge-contracted { background-color: #1B5E20; color: #fff; }
.badge-completed { background-color: var(--rs-primary); color: #fff; }

/* Same "Measured" stat number as .badge-measured — the dashboard used a
   different, unrelated blue (#2196F3) for the same status, a drift bug. */
.rs-stat-measured { color: #1565C0; }

/* Generic semantic badges — for statuses that aren't the project pipeline
   above (billing/subscription, DB health, migrations) but should share the
   same contrast-checked palette instead of raw Bootstrap bg-success/etc. */
.badge-rs-success { background-color: var(--rs-success); color: #fff; }
.badge-rs-danger { background-color: var(--rs-danger); color: #fff; }
.badge-rs-warning { background-color: #BF6000; color: #fff; }
.badge-rs-secondary { background-color: var(--rs-text-muted); color: #fff; }
.badge-rs-current { background-color: var(--rs-accent); color: #fff; }

/* Selectable option card — estimate tiers (EstimateBuilder.tsx) and billing
   plans (Billing.cshtml). Layers on top of Bootstrap's .card (kept for its
   flex/padding custom properties) to match the app's flat card language
   instead of Bootstrap's default border/radius/shadow. */
.rs-option-card {
    border: 1px solid var(--rs-border);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.09);
    overflow: hidden;
}

.rs-option-card .card-header {
    border-bottom: none;
}

.rs-option-card .card-footer {
    background: transparent;
    border-top: 1px solid var(--rs-border);
}

.rs-option-card.is-current {
    border-color: var(--rs-accent);
    box-shadow: 0 0 0 1px var(--rs-accent), 0 2px 8px rgba(0, 0, 0, 0.09);
}

/* Modal header — same navy-on-white treatment used by every "create/edit"
   modal (Products, New Project). Was a copy-pasted inline style x3. */
.rs-modal-header {
    background: var(--rs-primary);
    color: #fff;
}

/* Project status timeline (Projects/Details.cshtml) — triple-encodes state
   via icon shape + color + weight, not color alone. */
.rs-status-step.is-done .rs-status-icon { color: var(--rs-success); }
.rs-status-step.is-current { font-weight: 600; color: var(--rs-primary); }
.rs-status-step.is-current .rs-status-icon { color: var(--rs-accent); }
.rs-status-step.is-upcoming { color: var(--rs-text-muted); }

/* Feature card title (Index.cshtml) — replaces a repeated inline style. */
.rs-feature-title {
    color: var(--rs-accent);
    font-weight: 600;
}

/* Shared max-width containers — replace scattered inline max-width values
   repeated across Settings, Billing, and Admin pages. */
.rs-w-narrow { max-width: 600px; }
.rs-w-medium { max-width: 720px; }
.rs-w-wide { max-width: 900px; }

/* Accent button */
.btn-rs-accent {
    background-color: var(--rs-accent);
    border-color: var(--rs-accent);
    color: #fff;
}

.btn-rs-accent:hover {
    background-color: var(--rs-accent-hover);
    border-color: var(--rs-accent-hover);
    color: #fff;
}

/* Page header */
.rs-page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.rs-page-header h2 {
    font-weight: 700;
    color: var(--rs-primary);
    margin: 0;
}

/* Table styles */
.rs-table {
    background: var(--rs-card);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--rs-border);
}

.rs-table th {
    background: var(--rs-bg);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--rs-text-secondary);
    border-bottom: 2px solid var(--rs-border);
}

.rs-table td {
    vertical-align: middle;
}

.rs-table tbody tr:hover {
    background-color: rgba(27, 58, 75, 0.03);
}

.rs-table .col-numeric {
    text-align: right;
}

/* Active nav link */
.rs-navbar .nav-link.active {
    color: #fff !important;
    background: rgba(255, 255, 255, 0.15);
}

/* Responsive page header */
@media (max-width: 576px) {
    .rs-page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    .rs-stat-card .stat-value {
        font-size: 1.5rem;
    }
}

/* Mobile measure page: minimize header to maximize map space */
@media (max-width: 768px) {
    .rs-page-header {
        margin-bottom: 0.5rem;
    }
    .rs-page-header h2 {
        font-size: 1.1rem;
    }
}

/* Progress bar in pipeline */
.progress {
    background-color: var(--rs-bg);
    border-radius: 4px;
}

/* Toast notification */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1080;
}

/* Footer */
.footer {
    color: var(--rs-text-muted);
    font-size: 0.85rem;
    padding: 1rem 0;
}

/* Confirm modal — shared by the React ConfirmDialog and the vanilla
   showConfirm() helper so both render identically. z-index sits above
   MapTool's fixed overlays (1000) and Bootstrap toasts (1080). */
.confirm-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.confirm-modal {
    background: var(--rs-card);
    border-radius: 8px;
    padding: 24px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.confirm-modal-title {
    margin: 0 0 12px;
    color: var(--rs-primary);
    font-size: 1.15rem;
    font-weight: 600;
}

.confirm-modal-message {
    margin: 0 0 20px;
    font-size: 14px;
    color: var(--rs-text-secondary);
    white-space: pre-line;
}

.confirm-modal-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

/* "Evaluate Pitch" modal (StreetViewPitchModal.tsx). Shares
   .confirm-modal-backdrop for the dimmed background/dismiss-on-click, but
   needs a wider content box than .confirm-modal (400px) to hold a Street
   View panorama, so it gets its own content class. */
.streetview-pitch-modal {
    background: var(--rs-card);
    border-radius: 8px;
    padding: 20px;
    max-width: 640px;
    width: 92%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.streetview-pitch-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.streetview-pitch-modal-status {
    padding: 32px 8px;
    text-align: center;
    color: var(--rs-text-secondary);
    font-size: 14px;
}

/* Fixed-height viewport for the panorama + its trace overlay; both children
   are position:absolute/inset:0 within this. */
.streetview-pitch-modal-pano {
    position: relative;
    height: 420px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--rs-border);
    background: var(--rs-bg);
}

.streetview-pitch-modal-pano-el {
    position: absolute;
    inset: 0;
    /* Creates a stacking context so Street View's internal layers (which
       carry their own large z-indexes) can't out-hit-test the sibling trace
       overlay — without this, "Trace rake" drags reached the panorama and
       panned it instead of drawing (2026-07-16 bug). */
    z-index: 0;
}

/* pointer-events toggles between 'none' (armed=false — the panorama's own
   pan/zoom/click-to-go work normally) and 'auto' (armed=true — this layer
   captures the trace drag instead, per MapTool's own "tool active ->
   suppress underlying surface gestures" rule). */
.streetview-pitch-modal-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.streetview-pitch-modal-trace-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    /* Let pointer events fall through to the overlay div beneath. */
    pointer-events: none;
}

.streetview-pitch-modal-result {
    border: 1px solid var(--rs-border);
    border-radius: 6px;
    padding: 10px;
    margin-top: 10px;
    background: var(--rs-bg);
}

/* MapTool Select mode: forces a pointer cursor over Google's own map panes
   while hovering a hit-testable line/segment. Google's Maps SDK sets its own
   cursor (grab/default) directly on its internal .gm-style element, which
   normally wins over anything set on an ANCESTOR (cursor is resolved per
   element, not inherited-then-overridden) — this rule needs !important to
   beat that. Select mode does its own DOM-level hit-testing instead of a
   clickable Polyline (see MapTool.tsx's selectMode pointer effect), so
   nothing else establishes the pointer cursor for it. .mce-select-hover is
   toggled on the map wrapper div only while the cursor is within the hit
   threshold of a line/segment. */
.mce-select-hover .gm-style,
.mce-select-hover .gm-style > div {
    cursor: pointer !important;
}

/* 2026 application facelift -------------------------------------------------
   A light, blueprint-inspired shell built around the new blue/ink logo. These
   overrides intentionally preserve the established rs-* component API so the
   measure tool and server-rendered pages share one visual system. */
:root {
    --rs-primary: #123f76;
    --rs-primary-light: #286eb6;
    --rs-primary-dark: #0b294e;
    --rs-accent: #2375c9;
    --rs-accent-hover: #195fa9;
    --rs-success: #17845c;
    --rs-warning: #b96a13;
    --rs-danger: #c33d4a;
    --rs-bg: #f3f7fb;
    --rs-card: #ffffff;
    --rs-border: #d9e4ef;
    --rs-text-primary: #142231;
    --rs-text-secondary: #526579;
    --rs-text-muted: #7e90a3;
    --rs-navbar-bg: rgba(255, 255, 255, 0.96);
    --rs-shadow-sm: 0 1px 2px rgba(15, 50, 82, 0.05), 0 8px 24px rgba(15, 50, 82, 0.06);
    --rs-shadow-md: 0 16px 42px rgba(15, 50, 82, 0.12);
    --rs-radius: 14px;
}

html {
    background: var(--rs-bg);
}

body {
    font-family: var(--rs-font-sans);
    background:
        radial-gradient(circle at 12% 0%, rgba(35, 117, 201, 0.09), transparent 29rem),
        linear-gradient(180deg, #f9fbfd 0, var(--rs-bg) 28rem);
    color: var(--rs-text-primary);
    letter-spacing: -0.01em;
}

/* App shell and navigation */
.rs-navbar {
    min-height: 76px;
    background: var(--rs-navbar-bg) !important;
    border-bottom: 1px solid rgba(18, 63, 118, 0.11);
    box-shadow: 0 8px 30px rgba(15, 50, 82, 0.06);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    position: sticky;
    top: 0;
    z-index: 1030;
}

.rs-nav-inner {
    max-width: 1500px;
    padding-inline: clamp(1rem, 3vw, 3rem);
}

.rs-brand {
    width: 170px;
    height: 78px;
    padding: 0;
    margin-right: clamp(1rem, 3vw, 3rem);
    overflow: hidden;
    position: relative;
}

.rs-brand-crop {
    position: absolute;
    inset: 0;
    overflow: hidden;
    display: block;
}

.rs-brand-crop img {
    position: absolute;
    width: 170px;
    height: 170px;
    max-width: none;
    left: 0;
    top: -43px;
    padding: 0;
    object-fit: contain;
}

.rs-landing-logo {
    position: relative;
    width: min(100%, 640px);
    aspect-ratio: 2.07 / 1;
    margin: 0 auto 2rem;
    overflow: hidden;
}

.rs-landing-logo img {
    position: absolute;
    width: 110%;
    height: auto;
    max-width: none;
    top: -58%;
    left: -5%;
}

.rs-navbar .nav-link {
    color: var(--rs-text-secondary) !important;
    font-size: 0.88rem;
    font-weight: 700;
    padding: 0.65rem 0.9rem !important;
    border-radius: 10px;
}

.rs-navbar .nav-link:hover {
    color: var(--rs-primary) !important;
    background: #edf5fd;
}

.rs-navbar .nav-link.active {
    color: var(--rs-primary) !important;
    background: #e4f0fc;
    box-shadow: inset 0 0 0 1px rgba(35, 117, 201, 0.08);
}

.rs-navbar .dropdown-menu {
    padding: 0.5rem;
    border: 1px solid var(--rs-border);
    border-radius: 12px;
    box-shadow: var(--rs-shadow-md);
}

.rs-navbar .dropdown-item {
    border-radius: 8px;
    padding: 0.6rem 0.75rem;
    font-size: 0.88rem;
    font-weight: 600;
}

.rs-app-shell {
    max-width: 1500px;
    padding-inline: clamp(1rem, 3vw, 3rem);
}

.rs-main-content {
    padding-block: clamp(1.5rem, 3vw, 2.75rem) 2rem;
}

/* Typography and page headers */
.rs-page-header {
    gap: 1.5rem;
    margin-bottom: 1.75rem;
}

.rs-page-header h2 {
    color: var(--rs-primary-dark);
    font-size: clamp(1.65rem, 2vw, 2.15rem);
    font-weight: 800;
    letter-spacing: -0.045em;
}

.rs-page-header p {
    color: var(--rs-text-secondary) !important;
    margin-top: 0.35rem;
    font-size: 0.95rem;
}

.rs-section-title {
    color: var(--rs-primary-dark);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* Cards and surfaces */
.rs-card,
.rs-stat-card,
.rs-option-card {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(18, 63, 118, 0.11);
    border-radius: var(--rs-radius);
    box-shadow: var(--rs-shadow-sm);
}

.rs-card {
    overflow: hidden;
}

.rs-stat-card {
    padding: 1.5rem;
    text-align: left;
}

.rs-stat-card:hover {
    transform: translateY(-3px);
    border-color: rgba(35, 117, 201, 0.28);
    box-shadow: var(--rs-shadow-md);
}

.rs-stat-card .stat-value {
    color: var(--rs-primary);
    font-size: 2.15rem;
    font-weight: 800;
    letter-spacing: -0.05em;
}

.rs-stat-card .stat-label {
    color: var(--rs-text-secondary);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

/* Buttons */
.btn {
    min-height: 40px;
    border-radius: 8px;
    font-weight: 600;
    letter-spacing: 0;
    padding: 0.5rem 0.95rem;
    box-shadow: 0 1px 2px rgba(15, 35, 55, 0.08);
    transition: color 0.16s ease, border-color 0.16s ease,
                background-color 0.16s ease, box-shadow 0.16s ease;
}

.btn:focus-visible {
    outline: 2px solid rgba(35, 117, 201, 0.42);
    outline-offset: 2px;
    box-shadow: 0 1px 2px rgba(15, 35, 55, 0.08);
}

.btn:active,
.btn.active {
    box-shadow: inset 0 1px 2px rgba(10, 30, 50, 0.16) !important;
}

.btn-primary,
.btn-rs-accent {
    color: #fff;
    background: #174f87;
    border-color: #174875;
}

.btn-primary:hover,
.btn-rs-accent:hover {
    color: #fff;
    background: #123f70;
    border-color: #103962;
    box-shadow: 0 2px 5px rgba(15, 50, 82, 0.18);
}

.btn-outline-primary {
    color: var(--rs-primary);
    border-color: #9db9d3;
    background: #fff;
}

.btn-outline-primary:hover {
    color: var(--rs-primary-dark);
    background: #f1f6fb;
    border-color: #6f98bd;
    box-shadow: 0 2px 4px rgba(15, 50, 82, 0.1);
}

.btn-secondary {
    color: #26394c;
    background: #e8eef4;
    border-color: #ccd8e3;
}

.btn-secondary:hover {
    color: #172a3c;
    background: #dce6ef;
    border-color: #b8c8d7;
    box-shadow: 0 2px 4px rgba(15, 35, 55, 0.1);
}

.btn-outline-secondary {
    color: #526579;
    background: #fff;
    border-color: #bdcbd8;
}

.btn-outline-secondary:hover {
    color: #26394c;
    background: #f3f6f9;
    border-color: #98aabd;
    box-shadow: 0 2px 4px rgba(15, 35, 55, 0.08);
}

/* Forms */
.form-control,
.form-select {
    min-height: 44px;
    border-color: #cbd9e7;
    border-radius: 10px;
    color: var(--rs-text-primary);
    background-color: rgba(255, 255, 255, 0.9);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--rs-primary-light);
    box-shadow: 0 0 0 4px rgba(35, 117, 201, 0.12);
}

.form-label {
    color: var(--rs-text-secondary);
    font-weight: 700;
}

/* Tables */
.rs-table {
    border: 0;
    border-radius: 0;
    margin: 0;
}

.rs-table th {
    background: #f4f8fc;
    color: #5e7288;
    border-bottom: 1px solid var(--rs-border);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.085em;
    padding: 0.95rem 1rem;
}

.rs-table td {
    border-color: #e8eff6;
    padding: 1rem;
}

.rs-table tbody tr {
    transition: background-color 0.15s ease;
}

.rs-table tbody tr:hover {
    background: #f6faff;
}

.rs-table tbody tr:last-child td {
    border-bottom: 0;
}

.rs-table a strong {
    color: var(--rs-primary-dark);
    font-weight: 800;
}

/* Modals, alerts, pagination, footer */
.modal-content {
    border: 0;
    border-radius: 16px;
    box-shadow: 0 24px 70px rgba(7, 35, 65, 0.24);
    overflow: hidden;
}

.rs-modal-header {
    background: linear-gradient(135deg, var(--rs-primary), var(--rs-primary-dark));
    border: 0;
    padding: 1.15rem 1.35rem;
}

.modal-body,
.modal-footer {
    padding: 1.25rem 1.35rem;
}

.page-link {
    color: var(--rs-primary);
    border-color: var(--rs-border);
}

.page-item.active .page-link {
    background: var(--rs-primary);
    border-color: var(--rs-primary);
}

.footer {
    border-color: var(--rs-border) !important;
    background: rgba(255, 255, 255, 0.55);
    color: var(--rs-text-muted) !important;
}

.footer a {
    color: var(--rs-primary);
}

@media (max-width: 767.98px) {
    .rs-navbar {
        min-height: 66px;
    }

    .rs-brand {
        width: 150px;
        height: 68px;
    }

    .rs-brand-crop img {
        width: 150px;
        height: 150px;
        top: -38px;
    }

    .rs-navbar .navbar-collapse {
        padding: 0.75rem 0 0.5rem;
        border-top: 1px solid var(--rs-border);
    }

    .rs-main-content {
        padding-top: 1.25rem;
    }

    .rs-card {
        border-radius: 12px;
    }

    .rs-table th,
    .rs-table td {
        padding: 0.75rem;
    }
}

/* Anonymous landing page -------------------------------------------------- */
.rs-auth-hero {
    width: min(100%, 1320px);
    margin: 0 auto;
    padding: clamp(1rem, 3vw, 2.5rem) 0 3rem;
}

.rs-auth-hero-copy {
    position: relative;
    z-index: 3;
    max-width: 760px;
    margin: 0 auto;
    text-align: center;
}

.rs-auth-hero .rs-landing-logo {
    width: min(100%, 410px);
    margin-bottom: 0.35rem;
}

.rs-eyebrow {
    margin: 0 0 0.75rem;
    color: var(--rs-primary);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.rs-auth-hero h1 {
    margin: 0;
    color: #101820;
    font-size: clamp(2.45rem, 5vw, 4.75rem);
    font-weight: 700;
    letter-spacing: -0.062em;
    line-height: 0.98;
}

.rs-auth-lead {
    max-width: 650px;
    margin: 1.35rem auto 0;
    color: var(--rs-text-secondary);
    font-size: clamp(1rem, 1.4vw, 1.18rem);
    line-height: 1.6;
}

.rs-auth-actions {
    display: flex;
    justify-content: center;
    gap: 0.7rem;
    margin-top: 1.6rem;
}

.rs-auth-actions .btn {
    min-width: 126px;
}

.rs-promo-card {
    position: relative;
    isolation: isolate;
    display: grid;
    grid-template-columns: 1fr 1fr;
    height: clamp(420px, 46vw, 600px);
    margin-top: clamp(2rem, 4vw, 3.75rem);
    overflow: hidden;
    background: #eef2f5;
    border: 1px solid rgba(16, 47, 75, 0.14);
    border-radius: 18px;
    box-shadow: 0 28px 80px rgba(16, 35, 55, 0.15);
}

.rs-promo-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    z-index: 3;
    height: 16%;
    pointer-events: none;
    background: linear-gradient(to bottom, rgba(245, 246, 248, 0.92), transparent);
}

.rs-promo-panel {
    position: relative;
    min-width: 0;
    height: 100%;
    margin: 0;
    overflow: hidden;
    background: #edf1f4;
}

.rs-promo-panel img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.rs-promo-panel-measure img {
    object-position: 37% center;
    -webkit-mask-image: linear-gradient(to right, #000 0%, #000 76%, transparent 100%);
    mask-image: linear-gradient(to right, #000 0%, #000 76%, transparent 100%);
}

.rs-promo-panel-report img {
    object-position: 42% center;
    -webkit-mask-image: linear-gradient(to left, #000 0%, #000 76%, transparent 100%);
    mask-image: linear-gradient(to left, #000 0%, #000 76%, transparent 100%);
}

.rs-promo-panel figcaption {
    position: absolute;
    right: 1.25rem;
    bottom: 1.25rem;
    left: 1.25rem;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    width: fit-content;
    max-width: calc(100% - 2.5rem);
    padding: 0.7rem 0.9rem;
    color: #17222d;
    background: rgba(255, 255, 255, 0.88);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(16, 35, 55, 0.15);
    backdrop-filter: blur(16px) saturate(150%);
    -webkit-backdrop-filter: blur(16px) saturate(150%);
}

.rs-promo-panel-report figcaption {
    right: 1.25rem;
    left: auto;
}

.rs-promo-panel figcaption > span:last-child {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.rs-promo-panel figcaption strong {
    font-size: 0.88rem;
    font-weight: 600;
}

.rs-promo-panel figcaption small {
    margin-top: 0.1rem;
    color: var(--rs-text-secondary);
    font-size: 0.72rem;
}

.rs-promo-step {
    display: grid;
    width: 2rem;
    height: 2rem;
    flex: 0 0 auto;
    place-items: center;
    color: #fff;
    background: var(--rs-primary);
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 700;
}

.rs-promo-transition {
    position: absolute;
    inset: 0 auto 0 50%;
    z-index: 2;
    width: 18%;
    transform: translateX(-50%);
    pointer-events: none;
    background: linear-gradient(to right, transparent, rgba(245, 246, 248, 0.78), transparent);
}

.rs-auth-benefits {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: clamp(1rem, 3vw, 2.5rem);
    max-width: 1100px;
    margin: clamp(2rem, 4vw, 3.25rem) auto 0;
}

.rs-auth-benefits > div {
    display: flex;
    flex-direction: column;
    padding-top: 1rem;
    border-top: 1px solid var(--rs-border-strong);
}

.rs-auth-benefits strong {
    color: var(--rs-text-primary);
    font-size: 0.9rem;
    font-weight: 600;
}

.rs-auth-benefits span {
    margin-top: 0.4rem;
    color: var(--rs-text-secondary);
    font-size: 0.84rem;
    line-height: 1.55;
}

@media (max-width: 767.98px) {
    .rs-auth-hero {
        padding-top: 0.5rem;
    }

    .rs-auth-hero h1 {
        font-size: clamp(2.35rem, 12vw, 3.6rem);
    }

    .rs-auth-actions {
        flex-direction: column;
        padding-inline: 1rem;
    }

    .rs-promo-card {
        grid-template-columns: 1fr;
        height: auto;
        border-radius: 14px;
    }

    .rs-promo-panel {
        height: 340px;
    }

    .rs-promo-panel-measure img,
    .rs-promo-panel-report img {
        -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 82%, transparent 100%);
        mask-image: linear-gradient(to bottom, #000 0%, #000 82%, transparent 100%);
    }

    .rs-promo-panel-report img {
        -webkit-mask-image: linear-gradient(to top, #000 0%, #000 82%, transparent 100%);
        mask-image: linear-gradient(to top, #000 0%, #000 82%, transparent 100%);
    }

    .rs-promo-transition {
        inset: 50% 0 auto;
        width: auto;
        height: 16%;
        transform: translateY(-50%);
        background: linear-gradient(to bottom, transparent, rgba(245, 246, 248, 0.8), transparent);
    }

    .rs-promo-panel figcaption,
    .rs-promo-panel-report figcaption {
        right: 0.75rem;
        bottom: 0.75rem;
        left: 0.75rem;
        width: auto;
        max-width: none;
    }

    .rs-auth-benefits {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* Precision UI pass --------------------------------------------------------
   A quieter, sharper visual system: native typography, hairline borders,
   restrained depth, consistent geometry, and denser information surfaces. */
:root {
    --rs-primary: #135a98;
    --rs-primary-light: #2977b8;
    --rs-primary-dark: #102f4b;
    --rs-accent: #1769aa;
    --rs-accent-hover: #10578f;
    --rs-success: #18794e;
    --rs-warning: #a75b0b;
    --rs-danger: #b42332;
    --rs-bg: #f5f6f8;
    --rs-card: #ffffff;
    --rs-border: #dfe3e8;
    --rs-border-strong: #c8ced6;
    --rs-text-primary: #18212b;
    --rs-text-secondary: #53606d;
    --rs-text-muted: #7b8793;
    --rs-navbar-bg: rgba(255, 255, 255, 0.94);
    --rs-shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.04);
    --rs-shadow-md: 0 12px 32px rgba(16, 24, 40, 0.12);
    --rs-radius: 10px;
}

html {
    /* site.css used 14px below the tablet breakpoint, shrinking 15px body
       text to 13.125px. Keep the product scale stable on every viewport. */
    font-family: var(--rs-font-sans);
    font-size: 16px;
}

body {
    font-family: var(--rs-font-sans);
    font-size: var(--rs-type-body);
    line-height: 1.5;
    letter-spacing: 0;
    background: var(--rs-bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4,
h5,
h6,
button,
input,
select,
textarea {
    font-family: var(--rs-font-sans);
}

h1,
h2 {
    font-weight: 700;
}

h3,
h4,
h5,
h6 {
    font-weight: 600;
}

small,
.small {
    font-size: var(--rs-type-label);
    line-height: 1.4;
}

code,
kbd,
samp,
pre,
.font-monospace {
    font-family: var(--rs-font-mono) !important;
    font-variant-ligatures: none;
}

svg text {
    font-family: var(--rs-font-sans);
}

/* Measurements, money, quantities, and chart labels should not shift as
   values change. Lining tabular figures make dense comparisons scannable. */
#map-tool-root,
.rs-stat-card .stat-value,
.rs-table td.text-end,
.rs-table th.text-end,
.table td.text-end,
.table th.text-end,
input[type="number"] {
    font-variant-numeric: lining-nums tabular-nums;
}

::selection {
    background: rgba(19, 90, 152, 0.18);
}

a {
    color: var(--rs-primary);
    text-underline-offset: 2px;
}

a:hover {
    color: var(--rs-primary-dark);
}

button,
input,
select,
textarea {
    font: inherit;
    letter-spacing: 0;
}

/* Navigation */
.rs-navbar {
    min-height: 70px;
    border-bottom-color: rgba(16, 47, 75, 0.12);
    box-shadow: 0 1px 0 rgba(16, 24, 40, 0.02);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
}

.rs-navbar .nav-link {
    position: relative;
    border-radius: 7px;
    color: #465462 !important;
    font-size: var(--rs-type-control);
    font-weight: 600;
    padding: 0.52rem 0.78rem !important;
}

.rs-navbar .nav-link:hover {
    color: var(--rs-primary-dark) !important;
    background: #f0f3f6;
}

.rs-navbar .nav-link.active {
    color: var(--rs-primary-dark) !important;
    background: #e9f1f8;
    box-shadow: none;
}

.rs-navbar .dropdown-menu,
.dropdown-menu {
    padding: 0.35rem;
    border-color: var(--rs-border);
    border-radius: 10px;
    box-shadow: var(--rs-shadow-md);
}

.rs-navbar .dropdown-item,
.dropdown-item {
    border-radius: 6px;
    padding: 0.5rem 0.65rem;
    color: var(--rs-text-primary);
    font-size: var(--rs-type-control);
    font-weight: 500;
}

.dropdown-item:hover,
.dropdown-item:focus {
    color: var(--rs-text-primary);
    background: #f0f3f6;
}

/* Layout and type */
.rs-nav-inner,
.rs-app-shell {
    max-width: 1440px;
    padding-inline: clamp(1rem, 2.5vw, 2.5rem);
}

.rs-main-content {
    padding-block: clamp(1.25rem, 2.25vw, 2.1rem) 2rem;
}

/* Measurement context lives in the app bar on wide screens, keeping the
   workspace title visible without spending a full row above the map. */
.rs-measure-nav-context {
    position: absolute;
    top: 50%;
    left: 50%;
    display: none;
    align-items: center;
    gap: 0.8rem;
    max-width: min(38vw, 34rem);
    transform: translate(-50%, -50%);
    white-space: nowrap;
}

.rs-measure-nav-back {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    color: var(--rs-text-secondary);
    font-size: var(--rs-type-label);
    font-weight: 600;
    text-decoration: none;
}

.rs-measure-nav-back span {
    font-size: 1.15rem;
    line-height: 1;
}

.rs-measure-nav-back:hover {
    color: var(--rs-primary);
}

.rs-measure-nav-divider {
    width: 1px;
    height: 30px;
    background: var(--rs-border);
}

.rs-measure-nav-copy,
.rs-measure-mobile-copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.rs-measure-nav-copy strong {
    color: var(--rs-text-primary);
    font-size: var(--rs-type-control);
    font-weight: 600;
    line-height: 1.25;
}

.rs-measure-nav-copy > span {
    overflow: hidden;
    max-width: 28rem;
    color: var(--rs-text-muted);
    font-size: var(--rs-type-caption);
    line-height: 1.3;
    text-overflow: ellipsis;
}

.rs-measure-mobile-context {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.85rem;
}

.rs-measure-mobile-copy strong {
    color: var(--rs-text-primary);
    font-size: 1.05rem;
    font-weight: 600;
}

.rs-measure-mobile-copy > span {
    overflow: hidden;
    max-width: min(62vw, 30rem);
    color: var(--rs-text-muted);
    font-size: var(--rs-type-label);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rs-measure-page #map-tool-root {
    height: calc(100dvh - 140px);
    min-height: 640px;
}

.mce-annotator-shell {
    display: flex;
    min-height: 0;
    flex-direction: column;
}

/* The imagery source is a tool-level control, so it sits in the sidebar
   directly above the workflow rather than consuming a page-wide toolbar. */
.mce-imagery-control {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.mce-imagery-control label {
    margin: 0;
    color: var(--rs-text-primary);
    font-size: var(--rs-type-label);
    font-weight: 600;
}

.mce-imagery-control .form-select {
    width: 100%;
    min-height: 40px;
    font-size: var(--rs-type-control);
}

.mce-imagery-help {
    color: var(--rs-text-muted);
    font-size: var(--rs-type-caption);
    line-height: 1.35;
}

@media (min-width: 1200px) {
    .rs-measure-nav-context {
        display: flex;
    }

    .rs-measure-mobile-context {
        display: none;
    }
}

@media (min-width: 768px) and (max-width: 1199.98px) {
    .rs-measure-page #map-tool-root {
        height: calc(100dvh - 210px);
        min-height: 560px;
    }
}

.rs-page-header {
    gap: 1rem;
    margin-bottom: 1.35rem;
}

.rs-page-header h2 {
    color: var(--rs-text-primary);
    font-size: clamp(1.5rem, 1.8vw, 1.9rem);
    font-weight: 700;
    letter-spacing: -0.035em;
}

.rs-page-header p {
    margin-top: 0.25rem;
    color: var(--rs-text-secondary) !important;
    font-size: var(--rs-type-body);
}

.rs-section-title {
    color: var(--rs-text-primary);
    font-size: var(--rs-type-control);
    font-weight: 600;
    letter-spacing: -0.01em;
    text-transform: none;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--rs-text-primary);
    letter-spacing: -0.025em;
}

.text-muted {
    color: var(--rs-text-muted) !important;
}

/* Surfaces */
.rs-card,
.rs-stat-card,
.rs-option-card,
.card {
    background: var(--rs-card);
    border-color: var(--rs-border);
    border-radius: var(--rs-radius);
    box-shadow: var(--rs-shadow-sm);
}

.rs-stat-card {
    padding: 1.2rem;
}

.rs-stat-card:hover {
    transform: none;
    border-color: var(--rs-border-strong);
    box-shadow: 0 3px 10px rgba(16, 24, 40, 0.06);
}

.rs-stat-card .stat-value {
    color: var(--rs-text-primary);
    font-size: 1.85rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.04em;
}

.rs-stat-card .stat-label {
    color: var(--rs-text-secondary);
    font-size: var(--rs-type-label);
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
}

/* Controls */
.btn {
    min-height: 38px;
    border-radius: 7px;
    padding: 0.45rem 0.85rem;
    font-size: var(--rs-type-control);
    font-weight: 600;
    box-shadow: none;
    transition: background-color 0.14s ease, border-color 0.14s ease,
                color 0.14s ease, box-shadow 0.14s ease, transform 0.08s ease;
}

.btn-sm {
    min-height: 32px;
    padding: 0.3rem 0.65rem;
    font-size: var(--rs-type-label);
}

.btn-lg {
    min-height: 46px;
    padding: 0.65rem 1.05rem;
    font-size: 0.95rem;
}

.btn:hover {
    box-shadow: none;
}

.btn:active,
.btn.active {
    transform: translateY(1px);
    box-shadow: none !important;
}

.btn-primary,
.btn-rs-accent {
    background: var(--rs-primary);
    border-color: var(--rs-primary);
}

.btn-primary:hover,
.btn-rs-accent:hover {
    background: #104d83;
    border-color: #104d83;
    box-shadow: none;
}

.btn-danger {
    background: var(--rs-danger);
    border-color: var(--rs-danger);
}

.btn-danger:hover {
    background: #951c2a;
    border-color: #951c2a;
}

.btn-warning {
    color: #fff;
    background: var(--rs-warning);
    border-color: var(--rs-warning);
}

.btn-outline-danger {
    color: var(--rs-danger);
    border-color: #d8a4aa;
    background: #fff;
}

.btn-outline-danger:hover {
    color: #fff;
    background: var(--rs-danger);
    border-color: var(--rs-danger);
}

.btn-outline-primary,
.btn-outline-secondary {
    background: #fff;
}

.btn-outline-primary:hover,
.btn-outline-secondary:hover {
    box-shadow: none;
}

.btn-link {
    box-shadow: none;
}

.form-control,
.form-select {
    min-height: 40px;
    border-color: var(--rs-border-strong);
    border-radius: 7px;
    background-color: #fff;
    color: var(--rs-text-primary);
    font-size: var(--rs-type-body);
}

.form-control:hover,
.form-select:hover {
    border-color: #aeb7c2;
}

.form-control:focus,
.form-select:focus,
.form-check-input:focus {
    border-color: var(--rs-primary-light);
    box-shadow: 0 0 0 3px rgba(19, 90, 152, 0.12);
}

.form-label {
    margin-bottom: 0.35rem;
    color: #465462;
    font-size: var(--rs-type-label);
    font-weight: 600;
}

.form-text {
    color: var(--rs-text-muted);
    font-size: var(--rs-type-caption);
}

/* Data density */
.rs-table {
    font-size: var(--rs-type-control);
}

.table {
    color: var(--rs-text-primary);
    --bs-table-color: var(--rs-text-primary);
    --bs-table-border-color: #edf0f2;
}

.rs-table th {
    background: #f7f8fa;
    color: #64707d;
    border-bottom: 1px solid var(--rs-border);
    font-size: var(--rs-type-caption);
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    padding: 0.72rem 0.9rem;
}

.rs-table td {
    border-color: #edf0f2;
    padding: 0.78rem 0.9rem;
}

.rs-table tbody tr:hover {
    background: #f8fafc;
}

.rs-table a strong {
    color: var(--rs-text-primary);
    font-weight: 600;
}

code {
    color: #8a3352;
    background: #f4f1f3;
    border-radius: 5px;
    padding: 0.12em 0.35em;
}

hr {
    border-color: var(--rs-border);
    opacity: 1;
}

.badge {
    border-radius: 999px;
    padding: 0.35em 0.62em;
    font-size: 0.72em;
    font-weight: 600;
    letter-spacing: 0;
}

.progress {
    overflow: hidden;
    border-radius: 999px;
    background: #e9edf1;
}

/* Dialogs and feedback */
.modal-content,
.confirm-modal,
.streetview-pitch-modal {
    border: 1px solid rgba(16, 24, 40, 0.08);
    border-radius: 12px;
    box-shadow: 0 24px 64px rgba(16, 24, 40, 0.18);
}

.rs-modal-header {
    color: var(--rs-text-primary);
    background: #fff;
    border-bottom: 1px solid var(--rs-border);
    padding: 1rem 1.15rem;
}

.rs-modal-header .btn-close {
    filter: none;
}

.modal-body {
    padding: 1.1rem 1.15rem;
}

.modal-footer {
    gap: 0.4rem;
    padding: 0.85rem 1.15rem;
    background: #fafbfc;
    border-top-color: var(--rs-border);
}

.alert {
    border-radius: 8px;
    border-width: 1px;
    font-size: var(--rs-type-control);
}

.list-group-item {
    border-color: var(--rs-border);
    padding: 0.75rem 0.9rem;
}

.pagination {
    gap: 0.25rem;
}

.page-link {
    min-width: 34px;
    border-radius: 7px !important;
    border-color: var(--rs-border);
    color: var(--rs-text-secondary);
    text-align: center;
}

.page-item.active .page-link {
    background: var(--rs-primary);
    border-color: var(--rs-primary);
}

.toast {
    border: 1px solid var(--rs-border);
    border-radius: 10px;
    box-shadow: var(--rs-shadow-md);
}

@media (max-width: 767.98px) {
    body {
        font-size: 0.9375rem;
    }

    .rs-navbar {
        min-height: 64px;
    }

    .rs-main-content {
        padding-top: 1rem;
    }

    .rs-page-header {
        margin-bottom: 1rem;
    }

    .rs-card,
    .rs-stat-card,
    .rs-option-card {
        border-radius: 9px;
    }

    .rs-page-header > .d-flex {
        width: 100%;
        flex-wrap: wrap;
    }

    .rs-measure-mobile-context {
        gap: 0.65rem;
    }

    .rs-measure-mobile-copy > span {
        max-width: 55vw;
    }

    .rs-measure-page #map-tool-root {
        height: calc(100dvh - 170px);
        min-height: 460px;
    }

    .mce-imagery-control .form-select {
        min-height: 44px;
        font-size: 16px;
    }
}
