/* Imagination — Proxima design system, as applied in the Atlas Proxima mockup
   (AtlasDocumentIntelligence/dev-docs/ATLAS_PROXIMA_MOCKUP.html) and the style guide
   (VBI/STYLE_GUIDE.md). Use the tokens; never raw hex except status colours. */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* ─── Proxima design tokens ─── */
:root {
    --bg-primary:    #f8f9fc;
    --bg-primary-rgb: 248, 249, 252;
    --bg-secondary:  #ffffff;
    --bg-tertiary:   #f0f1f5;
    --bg-elevated:   #ffffff;
    --bg-glass:       rgba(0, 0, 0, 0.02);
    --bg-glass-hover: rgba(0, 0, 0, 0.04);

    --text-primary:   #1a1a2e;
    --text-secondary: #6b7084;
    --text-muted:     #9ca3b4;

    --accent:          #2fb383;
    --accent-glow:     rgba(47, 179, 131, 0.15);
    --accent-soft:     rgba(47, 179, 131, 0.08);
    --accent-gradient: linear-gradient(135deg, #2fb383, #34d399);
    --accent-wash:     radial-gradient(120% 100% at 0% 0%, rgba(47, 179, 131, 0.10) 0%, rgba(47, 179, 131, 0.00) 60%);

    --border:        rgba(0, 0, 0, 0.08);
    --border-subtle: rgba(0, 0, 0, 0.04);

    --radius-sm:    8px;
    --radius-md:   12px;
    --radius-lg:   16px;
    --radius-xl:   24px;
    --radius-full: 9999px;

    --shadow-sm:   0 1px 2px  rgba(0, 0, 0, 0.05);
    --shadow-md:   0 4px 16px rgba(0, 0, 0, 0.06);
    --shadow-lg:   0 8px 32px rgba(0, 0, 0, 0.08);
    --shadow-glow: 0 0 30px var(--accent-glow);

    --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);

    --scrollbar-thumb:       rgba(0, 0, 0, 0.18);
    --scrollbar-thumb-hover: rgba(0, 0, 0, 0.32);

    --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Consolas, monospace;

    /* Camera points in the plan: a second hue, so they never read as building (accent) or openings. */
    --camera:        #8b5cf6;
    --camera-strong: #7c3aed;
    --camera-soft:   rgba(139, 92, 246, 0.10);
    --camera-wash:   rgba(139, 92, 246, 0.18);
    --camera-line:   rgba(139, 92, 246, 0.45);

    /* Land cover on a landscape site, as the 3D scene tints it: data colours, kept together here. */
    --cover-woodland: #5f7a52;
    --cover-orchard:  #7f9a64;
    --cover-meadow:   #a9b77f;
    --cover-lawn:     #8fba72;
    --cover-field:    #c9b98a;
    --cover-garden:   #93ad7a;
    --cover-heath:    #b3a584;
    --cover-water:    #86aac2;
    --cover-wetland:  #8ea894;
    --cover-sand:     #e2d6b3;
    --cover-rock:     #a9a7a2;
    --cover-paved:    #c7c7c3;
    --cover-building: #bdb6ad;
    --cover-relief:   #ffffff;
    --cover-path:     #dccfae;
    --cover-road:     #8a8a87;
    --cover-wall:     #a39d93;
    --cover-fence:    #b3ada2;

    /* The lightbox is dark in both themes: a photograph is judged best against black. */
    --lightbox-bg:    rgba(10, 12, 16, 0.94);
    --lightbox-text:  #e6edf3;
    --lightbox-muted: rgba(230, 237, 243, 0.65);
    --lightbox-glass: rgba(255, 255, 255, 0.08);
    --lightbox-line:  rgba(255, 255, 255, 0.14);
}
[data-theme="dark"] {
    --bg-primary:    #0f1419;
    --bg-primary-rgb: 15, 20, 25;
    --bg-secondary:  #161b22;
    --bg-tertiary:   #1e242c;
    --bg-elevated:   #1a2028;
    --bg-glass:       rgba(255, 255, 255, 0.03);
    --bg-glass-hover: rgba(255, 255, 255, 0.06);

    --text-primary:   #e6edf3;
    --text-secondary: #9aa4b1;
    --text-muted:     #6b7280;

    --accent-glow: rgba(47, 179, 131, 0.28);
    --accent-soft: rgba(47, 179, 131, 0.14);

    --border:        rgba(255, 255, 255, 0.08);
    --border-subtle: rgba(255, 255, 255, 0.04);

    --shadow-sm: 0 1px 2px  rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.55);

    --scrollbar-thumb:       rgba(255, 255, 255, 0.18);
    --scrollbar-thumb-hover: rgba(255, 255, 255, 0.32);

    color-scheme: dark;
}

/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
    height: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: var(--text-primary);
    background: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.2s ease, color 0.2s ease;
}
* { scrollbar-width: thin; scrollbar-color: var(--scrollbar-thumb) transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border: 2px solid transparent;
    background-clip: padding-box;
    border-radius: 8px;
}
*::-webkit-scrollbar-thumb:hover { background: var(--scrollbar-thumb-hover); background-clip: padding-box; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1:focus, h1:focus-visible { outline: none; }
button { font-family: inherit; }
code, .mono { font-family: var(--font-mono); font-size: 12.5px; }

/* ─── App shell ─── */
.app-shell {
    display: flex;
    flex-direction: column;
    height: 100vh;
    min-height: 0;
}

/* ─── App bar ─── */
.appbar {
    display: flex;
    align-items: center;
    gap: 16px;
    height: 56px;
    padding: 0 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(20px);
    flex-shrink: 0;
    z-index: 50;
}
.appbar-leading, .appbar-trailing { display: flex; align-items: center; gap: 12px; }
.appbar-leading { color: inherit; }
.appbar-leading:hover { text-decoration: none; }
.appbar-center { flex: 1; display: flex; justify-content: center; }
.appbar-title  { font-weight: 600; font-size: 17px; letter-spacing: -0.015em; color: var(--text-primary); }
.app-icon { display: inline-block; flex-shrink: 0; }
.app-icon-sm { width: 28px; height: 28px; }
.app-icon-md { width: 36px; height: 36px; }
.app-icon-lg { width: 64px; height: 64px; }

@keyframes status-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }

/* Icon buttons */
.btn-icon {
    width: 36px; height: 36px;
    border-radius: var(--radius-sm);
    background: transparent;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    flex-shrink: 0;
}
.btn-icon:hover { color: var(--accent); background: var(--accent-soft); }
.btn-icon.danger:hover { color: #ef4444; background: rgba(239, 68, 68, 0.10); }

/* ─── Body layout ─── */
.app-body {
    flex: 1;
    min-height: 0;
    display: flex;
    overflow: hidden;
}

/* ─── Sidebar ─── */
.sidebar {
    width: 240px;
    flex-shrink: 0;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-subtle);
    overflow-y: auto;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
}
.sidebar nav { flex: 1; }
.sidebar-section { margin-bottom: 22px; }
.sidebar-section-label {
    font-weight: 500;
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 4px 12px 8px;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 13.5px;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    position: relative;
    min-width: 0;
}
.nav-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item:hover {
    color: var(--text-primary);
    background: var(--bg-glass-hover);
    text-decoration: none;
}
.nav-item.active {
    color: var(--accent);
    background: var(--accent-soft);
}
.nav-item svg { color: var(--text-muted); flex-shrink: 0; transition: color 0.12s ease; }
.nav-item:hover svg { color: var(--text-primary); }
.nav-item.active svg { color: var(--accent); }
.nav-item-count {
    margin-left: auto;
    font: 600 11px 'Inter', system-ui, sans-serif;
    color: var(--text-muted);
    background: var(--bg-tertiary);
    padding: 1px 7px;
    border-radius: var(--radius-full);
    font-variant-numeric: tabular-nums;
}
.nav-item.active .nav-item-count {
    color: var(--accent);
    background: rgba(47, 179, 131, 0.18);
}

/* ─── Main content ─── */
.main {
    position: relative;
    flex: 1;
    min-width: 0;
    overflow-y: auto;
    padding: 28px 32px 40px;
    background-color: var(--bg-primary);
    background-image: var(--accent-wash);
    background-repeat: no-repeat;
    background-size: 600px 400px;
}

.page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 22px;
}
.page-head-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.page-title { font-weight: 600; font-size: 26px; line-height: 1.3; letter-spacing: -0.02em; color: var(--text-primary); }
.page-sub   { font-size: 13.5px; color: var(--text-secondary); margin-top: 2px; }

/* ─── Breadcrumbs ─── */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.breadcrumbs a { color: var(--text-secondary); }
.breadcrumbs a:hover { color: var(--accent); text-decoration: none; }

/* ─── Buttons ─── */
.btn {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font: 500 13px/1 'Inter', system-ui, sans-serif;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: none;
    white-space: nowrap;
    text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary {
    background: var(--accent-gradient);
    color: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}
.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 14px var(--accent-glow), 0 2px 4px rgba(0, 0, 0, 0.06);
}
.btn-primary:active { transform: translateY(0); }
.btn-secondary {
    background: var(--bg-elevated);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}
.btn-secondary:hover { border-color: var(--text-secondary); color: var(--text-primary); }
.btn-danger {
    background: #ef4444;
    color: #fff;
}
.btn-danger:hover { box-shadow: 0 6px 14px rgba(239, 68, 68, 0.25); transform: translateY(-1px); }
.btn-sm { padding: 6px 10px; font-size: 12.5px; }

.btn:disabled,
.btn-icon:disabled {
    cursor: not-allowed;
    opacity: 0.5;
    pointer-events: none;
    transform: none;
}
.btn-primary:disabled {
    background: var(--bg-tertiary);
    color: var(--text-muted);
    box-shadow: none;
    opacity: 1;
}
.btn-secondary:disabled {
    color: var(--text-muted);
    border-color: var(--border-subtle);
    background: var(--bg-glass);
}
.btn .spinner {
    width: 14px;
    height: 14px;
    border-color: rgba(255, 255, 255, 0.4);
    border-top-color: #ffffff;
    border-width: 2px;
}
.btn-secondary .spinner { border-color: var(--accent-soft); border-top-color: var(--accent); }

/* ─── Cards ─── */
.panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px;
}
.panel + .panel { margin-top: 14px; }
.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}
.panel-title { font-weight: 600; font-size: 14px; color: var(--text-primary); }
.panel-sub   { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.grid-2 {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px;
}
@media (max-width: 1100px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }

/* Project cards */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}
.project-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    color: inherit;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.project-card:hover {
    text-decoration: none;
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}
.project-thumb {
    aspect-ratio: 16 / 10;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    overflow: hidden;
}
.project-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.project-thumb.plan img { object-fit: contain; background: #fff; padding: 8px; }
.project-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; }
.project-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.project-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 11.5px;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

/* Stat tiles */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 14px;
}
@media (max-width: 1200px) { .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.stat {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px 18px;
}
.stat-value {
    font-weight: 600;
    font-size: 22px;
    letter-spacing: -0.015em;
    font-variant-numeric: tabular-nums;
}
.stat-label { font-size: 12.5px; color: var(--text-secondary); margin-top: 2px; }

/* ─── Segmented control (used as tabs) ─── */
.segmented {
    display: inline-flex;
    gap: 2px;
    padding: 3px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
}
.segmented-option {
    padding: 5px 12px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font: 500 12.5px 'Inter', system-ui, sans-serif;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.segmented-option:hover:not(.selected):not(:disabled) { color: var(--text-primary); background: var(--bg-glass-hover); }
.segmented-option.selected {
    background: var(--bg-elevated);
    color: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.segmented-option:disabled { opacity: 0.45; cursor: not-allowed; }

/* ─── Wizard / stepper ─── */
.wizard {
    list-style: none;
    display: flex;
    align-items: flex-start;
    width: 100%;
    margin-bottom: 22px;
}
.wizard-step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
    color: var(--text-muted);
    font: 500 12.5px 'Inter', system-ui, sans-serif;
    text-align: center;
}
.wizard-step + .wizard-step::before {
    content: "";
    position: absolute;
    top: 13px;
    left: -50%;
    width: 100%;
    height: 2px;
    background: var(--border);
    z-index: 0;
}
.wizard-step.done + .wizard-step::before,
.wizard-step.active::before { background: var(--accent); }
.wizard-marker {
    position: relative;
    z-index: 1;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-elevated);
    border: 2px solid var(--border);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 12px;
    transition: var(--transition);
}
.wizard-step.done   .wizard-marker { background: var(--accent); border-color: var(--accent); color: #ffffff; }
.wizard-step.active .wizard-marker {
    border-color: var(--accent);
    color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
}
.wizard-step.done   { color: var(--text-secondary); }
.wizard-step.active { color: var(--accent); font-weight: 600; }

/* ─── Inputs ─── */
.field { display: flex; flex-direction: column; gap: 6px; }
.field + .field { margin-top: 14px; }
.field-label { font-size: 12.5px; font-weight: 500; color: var(--text-secondary); }
.field-hint  { font-size: 12.5px; line-height: 1.5; color: var(--text-muted); }
.field-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 14px;
}
.field-row .field + .field { margin-top: 0; }
@media (max-width: 800px) { .field-row { grid-template-columns: minmax(0, 1fr); } }

.input,
.textarea,
select.input {
    width: 100%;
    padding: 9px 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font: 400 14px/1.5 'Inter', system-ui, sans-serif;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input:focus,
.textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.input::placeholder, .textarea::placeholder { color: var(--text-muted); }
.textarea { resize: vertical; min-height: 84px; }

/* ─── Project type chooser ─── */
.type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 16px;
    max-width: 920px;
}
.type-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 24px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.type-card:hover { text-decoration: none; border-color: var(--accent); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.type-card:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.type-card-icon {
    width: 48px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    background: var(--accent-soft);
    color: var(--accent);
}
.type-card-title { font-weight: 600; font-size: 17px; letter-spacing: -0.01em; }
.type-card-body { font-size: 13.5px; line-height: 1.55; color: var(--text-secondary); }
.type-card-steps { list-style: none; display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--text-muted); }
.type-card-cta { display: inline-flex; align-items: center; gap: 6px; margin-top: auto; padding-top: 8px; font-weight: 500; font-size: 13.5px; color: var(--accent); }

/* ─── Dropzone ─── */
.dropzone {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 32px 24px;
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-glass);
    color: var(--text-secondary);
    text-align: center;
    cursor: pointer;
    transition: border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}
.dropzone:hover,
.dropzone:focus-within {
    border-color: var(--text-secondary);
    background: var(--bg-glass-hover);
}
.dropzone.dragover {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent);
    transform: scale(1.01);
}
.dropzone.has-file { border-style: solid; border-color: var(--accent); background: var(--accent-soft); }
/* The file input covers the whole zone at zero opacity, so the browser handles click and drop. */
.dropzone input[type="file"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}
.dropzone-icon  { color: var(--text-muted); margin-bottom: 6px; }
.dropzone.dragover .dropzone-icon,
.dropzone.has-file .dropzone-icon { color: var(--accent); }
.dropzone-title { font-weight: 600; font-size: 14px; color: var(--text-primary); }
.dropzone.dragover .dropzone-title { color: var(--accent); }
.dropzone-hint  { font-size: 12.5px; color: var(--text-muted); }

/* ─── Tables ─── */
.table-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}
.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13.5px;
}
.table thead th {
    text-align: left;
    padding: 10px 14px;
    font: 500 11px 'Inter', system-ui, sans-serif;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.table tbody td {
    padding: 10px 14px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-subtle);
    vertical-align: middle;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background-color 0.12s ease; }
.table tbody tr:hover { background: var(--bg-glass-hover); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .muted { color: var(--text-muted); }

/* ─── Status tags ─── */
.tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 8px;
    font-weight: 500;
    font-size: 11px;
    border-radius: var(--radius-full);
    letter-spacing: 0.02em;
    line-height: 1.6;
    white-space: nowrap;
}
.tag.success { color: #15803d; background: rgba(34, 197, 94, 0.14); }
.tag.warn    { color: #b45309; background: rgba(245, 158, 11, 0.18); }
.tag.error   { color: #b91c1c; background: rgba(239, 68, 68, 0.16); }
.tag.info    { color: var(--accent); background: var(--accent-soft); }
.tag.neutral { color: var(--text-secondary); background: var(--bg-tertiary); }
[data-theme="dark"] .tag.success { color: #86efac; }
[data-theme="dark"] .tag.warn    { color: #fbbf24; }
[data-theme="dark"] .tag.error   { color: #fca5a5; }
.tag .tag-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tag.pulse .tag-dot { animation: status-pulse 2s ease-in-out infinite; }

/* ─── Banner / inline alert ─── */
.banner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-elevated);
    border-left: 3px solid var(--accent);
    margin-bottom: 14px;
}
.banner-icon  { color: var(--accent); flex-shrink: 0; padding-top: 1px; }
.banner-body  { flex: 1; min-width: 0; }
.banner-title { font-weight: 600; font-size: 13.5px; color: var(--text-primary); margin-bottom: 2px; }
.banner-text  { font-size: 12.5px; color: var(--text-secondary); line-height: 1.55; }
.banner-info    { border-left-color: var(--accent); }   .banner-info    .banner-icon { color: var(--accent); }
.banner-success { border-left-color: #22c55e; }         .banner-success .banner-icon { color: #22c55e; }
.banner-warn    { border-left-color: #f59e0b; }         .banner-warn    .banner-icon { color: #f59e0b; }
.banner-error   { border-left-color: #ef4444; }         .banner-error   .banner-icon { color: #ef4444; }

/* ─── Snackbar / toast ─── */
.snackbar-stack {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 2000;
    pointer-events: none;
}
.snackbar {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 280px;
    max-width: min(560px, calc(100vw - 32px));
    padding: 10px 14px;
    background: var(--text-primary);
    color: var(--bg-elevated);
    border-radius: var(--radius-md);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18), 0 2px 6px rgba(0, 0, 0, 0.08);
    animation: snackbar-in 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}
.snackbar-icon { flex-shrink: 0; display: inline-flex; }
.snackbar.success .snackbar-icon { color: #22c55e; }
.snackbar.info    .snackbar-icon { color: var(--accent); }
.snackbar.warn    .snackbar-icon { color: #f59e0b; }
.snackbar.error   .snackbar-icon { color: #ef4444; }
.snackbar-msg { flex: 1; font-weight: 500; font-size: 13px; line-height: 1.45; }
@keyframes snackbar-in {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ─── Progress ─── */
.progress {
    position: relative;
    width: 100%;
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    width: 0;
    background: var(--accent-gradient);
    border-radius: var(--radius-full);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.progress-indeterminate .progress-bar {
    width: 35%;
    animation: progress-slide 1.4s cubic-bezier(0.65, 0, 0.35, 1) infinite;
}
@keyframes progress-slide {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(286%); }
}
.spinner {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    border: 2px solid var(--accent-soft);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spinner-rotate 0.9s linear infinite;
    display: inline-block;
    vertical-align: middle;
}
.spinner-lg { width: 28px; height: 28px; border-width: 3px; }
@keyframes spinner-rotate { to { transform: rotate(360deg); } }

/* Working state: the long wait while Claude reads a plan */
.working {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    padding: 48px 24px;
}
.working .progress { max-width: 360px; }
.working-title { font-weight: 600; font-size: 17px; letter-spacing: -0.01em; }
.working-body  { font-size: 13.5px; color: var(--text-muted); max-width: 440px; }

/* ─── Empty state ─── */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
    padding: 48px 24px;
    color: var(--text-secondary);
}
.empty-state-icon {
    width: 72px;
    height: 72px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
    margin-bottom: 4px;
}
.empty-state-title { font-weight: 600; font-size: 17px; color: var(--text-primary); letter-spacing: -0.01em; }
.empty-state-body {
    font-size: 13.5px;
    line-height: 1.55;
    max-width: 380px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

/* ─── Modals ─── */
.modal-backdrop {
    position: fixed; inset: 0;
    background: rgba(15, 23, 42, 0.45);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000;
    animation: modal-backdrop-in 0.18s ease-out;
}
@keyframes modal-backdrop-in { from { opacity: 0; } to { opacity: 1; } }
.modal-card {
    width: 460px;
    max-width: calc(100vw - 32px);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 22px 24px 18px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.22), 0 4px 12px rgba(0, 0, 0, 0.08);
    animation: modal-card-in 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes modal-card-in {
    from { opacity: 0; transform: scale(0.96) translateY(10px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-title   { margin: 0 0 10px; font-weight: 600; font-size: 17px; line-height: 1.3; letter-spacing: -0.01em; }
.modal-body    { margin: 0 0 22px; font-size: 14px; line-height: 1.55; color: var(--text-secondary); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }

/* ─── Plan & model ─── */
.plan-frame {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 320px;
}
.plan-frame img { max-width: 100%; max-height: 560px; display: block; }
.plan-frame iframe { width: 100%; height: 560px; border: none; }

.top-view {
    width: 100%;
    max-height: 560px;
    display: block;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.top-view .room      { fill: var(--accent-soft); stroke: none; }
.top-view .room-label { paint-order: stroke; stroke: var(--bg-primary); stroke-width: 0.08; stroke-linejoin: round;
                        fill: var(--text-secondary); font: 500 0.32px 'Inter', system-ui, sans-serif; text-anchor: middle; }
.top-view .room-area  { fill: var(--text-muted); font: 400 0.24px 'Inter', system-ui, sans-serif; text-anchor: middle; }
.top-view .wall      { stroke: var(--text-primary); stroke-linecap: square; }
.top-view .wall.interior { stroke: var(--text-secondary); }
.top-view .opening   { stroke-linecap: butt; }
.top-view .opening.window { stroke: #38bdf8; }
.top-view .opening.door   { stroke: #f59e0b; }
.top-view .camera .cone { fill: var(--camera-soft); stroke: var(--camera-line); stroke-width: 0.02; }
.top-view .camera .body { fill: var(--camera); stroke: var(--bg-elevated); stroke-width: 0.04; }
.top-view .camera.selected .cone { fill: var(--camera-wash); stroke: var(--camera); stroke-width: 0.04; }
.top-view .furniture rect { fill: var(--bg-elevated); stroke: var(--text-muted); stroke-width: 0.02; }
.top-view .furniture line { stroke: var(--text-secondary); stroke-width: 0.05; stroke-linecap: round; }
.top-view .furniture.rug rect { fill: var(--bg-tertiary); }

.furniture-panel { padding: 14px 20px; }
.furniture-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.furniture-status { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--text-secondary); }

/* ─── Toggle switch (style guide §5.11) ─── */
.toggle {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
    line-height: 1.4;
}
.toggle input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}
.toggle-track {
    position: relative;
    width: 36px;
    height: 20px;
    flex-shrink: 0;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.toggle-track::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    background: #ffffff;
    border-radius: 50%;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2), 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.toggle:hover .toggle-track                  { border-color: var(--text-secondary); }
.toggle input:checked + .toggle-track        { background: var(--accent); border-color: var(--accent); }
.toggle input:checked + .toggle-track::after { transform: translateX(16px); }
.toggle input:focus-visible + .toggle-track  { box-shadow: 0 0 0 3px var(--accent-soft); }
.toggle input:disabled ~ *                   { opacity: 0.5; cursor: not-allowed; }
.toggle-label { font-size: 14px; color: var(--text-primary); }
.toggle.toggle-row { display: flex; justify-content: space-between; width: 100%; }

.assumption-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.assumption-list li {
    display: flex;
    gap: 10px;
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
}
.assumption-list li svg { color: var(--text-muted); flex-shrink: 0; margin-top: 3px; }

/* ─── 3D scene ─── */
.scene-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 14px;
    align-items: start;
}
@media (max-width: 1100px) { .scene-layout { grid-template-columns: minmax(0, 1fr); } }
.viewer {
    position: relative;
    aspect-ratio: 3 / 2;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}
.viewer-canvas { position: absolute; inset: 0; }
.viewer-canvas canvas { width: 100%; height: 100%; display: block; }
.viewer-hint {
    position: absolute;
    left: 12px;
    bottom: 10px;
    font-size: 11.5px;
    color: var(--text-muted);
    background: rgba(var(--bg-primary-rgb), 0.75);
    padding: 2px 8px;
    border-radius: var(--radius-full);
    pointer-events: none;
}
.viewer-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-secondary);
}

.viewer-switch { position: absolute; top: 10px; right: 10px; }

/* ─── Landscape site ─── */
.site-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr);
    gap: 14px;
    align-items: start;
}
.site-layout .panel { margin-top: 0; }
.site-layout > div > .panel + .panel { margin-top: 14px; }
@media (max-width: 1100px) { .site-layout { grid-template-columns: minmax(0, 1fr); } }

.site-view {
    width: 100%;
    max-height: 640px;
    display: block;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.site-view .no-image { fill: var(--bg-tertiary); }
.site-view .feature, .editor-svg .feature, .editor-svg .draft {
    fill-opacity: 0.45;
    stroke: rgba(255, 255, 255, 0.75);
    stroke-linejoin: round;
    stroke-linecap: round;
}
.site-view .feature.line, .editor-svg .feature.line, .editor-svg .draft.line { fill: none; stroke-opacity: 0.85; }
.site-view .feature.designed, .editor-svg .feature.designed { fill-opacity: 0.7; stroke: var(--bg-elevated); }
.site-view .feature.line.designed, .editor-svg .feature.line.designed { stroke-opacity: 1; }
.site-view .feature-label, .editor-svg .feature-label {
    fill: #ffffff; font-family: 'Inter', system-ui, sans-serif; font-weight: 600; text-anchor: middle; pointer-events: none;
    paint-order: stroke; stroke: rgba(0, 0, 0, 0.55); stroke-width: 0.35em; stroke-linejoin: round;
}
.site-view .camera .cone { fill: var(--camera-soft); stroke: var(--camera-line); }
.site-view .camera .body { fill: var(--camera); stroke: var(--bg-elevated); }
.site-view .camera.selected .cone { fill: var(--camera-wash); stroke: var(--camera); }
.site-view .camera-label {
    fill: #ffffff; font-family: 'Inter', system-ui, sans-serif; font-weight: 600; text-anchor: middle; pointer-events: none;
    paint-order: stroke; stroke: var(--camera-strong); stroke-width: 0.3em; stroke-linejoin: round;
}

/* Feature tints, shared by the site plan and the site editor. Lines take the tint as their stroke. */
.ft-woodland, .ft-tree_line, .ft-tree { fill: var(--cover-woodland); }
.ft-orchard  { fill: var(--cover-orchard); }
.ft-meadow   { fill: var(--cover-meadow); }
.ft-lawn     { fill: var(--cover-lawn); }
.ft-field    { fill: var(--cover-field); }
.ft-garden   { fill: var(--cover-garden); }
.ft-heath    { fill: var(--cover-heath); }
.ft-water, .ft-stream { fill: var(--cover-water); }
.ft-wetland  { fill: var(--cover-wetland); }
.ft-sand     { fill: var(--cover-sand); }
.ft-rock     { fill: var(--cover-rock); }
.ft-paved    { fill: var(--cover-paved); }
.ft-building { fill: var(--cover-building); }
.ft-mound, .ft-hollow { fill: var(--cover-relief); }
.ft-hedge    { fill: var(--cover-woodland); }
.ft-path     { fill: var(--cover-path); }
.ft-road     { fill: var(--cover-road); }
.ft-wall     { fill: var(--cover-wall); }
.ft-fence    { fill: var(--cover-fence); }
.line.ft-tree_line, .line.ft-hedge { stroke: var(--cover-woodland); }
.line.ft-stream { stroke: var(--cover-water); }
.line.ft-path { stroke: var(--cover-path); }
.line.ft-road { stroke: var(--cover-road); }
.line.ft-wall { stroke: var(--cover-wall); }
.line.ft-fence { stroke: var(--cover-fence); }
.ft-mound { stroke-dasharray: 0.6% 0.4%; }
.ft-hollow { stroke-dasharray: 0.2% 0.3%; }

/* The map a site is chosen on. */
.picker-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(320px, 1fr);
    gap: 14px;
    align-items: start;
}
@media (max-width: 1100px) { .picker-layout { grid-template-columns: minmax(0, 1fr); } }
.picker-search { margin-bottom: 10px; min-height: 20px; font-size: 12.5px; color: var(--text-muted); }
/* Google's place search is a sealed component: only its box and the named parts can be styled.
   Dressed as a Proxima input (style guide §5.7). */
.picker-search gmp-place-autocomplete {
    display: block;
    width: 100%;
    color-scheme: light;
    background-color: var(--bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 14px;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.picker-search gmp-place-autocomplete:hover { border-color: var(--text-muted); }
.picker-search gmp-place-autocomplete:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.picker-search gmp-place-autocomplete::part(focus-ring) { display: none; }
.picker-search gmp-place-autocomplete::part(prediction-list) {
    margin-top: 6px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
}
.picker-search gmp-place-autocomplete::part(prediction-item) { font-family: 'Inter', system-ui, sans-serif; font-size: 13.5px; color: var(--text-primary); }
.picker-search gmp-place-autocomplete::part(prediction-item-selected) { background: var(--accent-soft); }
.picker-search gmp-place-autocomplete::part(prediction-item-match) { color: var(--accent); font-weight: 600; }
.picker-search gmp-place-autocomplete::part(prediction-item-icon) { color: var(--text-muted); }
.picker-map {
    position: relative;
    height: 520px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.picker-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.picker-readout { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 13px; color: var(--text-secondary); font-variant-numeric: tabular-nums; margin-left: auto; }

.view-list { display: flex; flex-direction: column; gap: 6px; }
.view-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    cursor: pointer;
    text-align: left;
    color: var(--text-primary);
    font: 500 13px 'Inter', system-ui, sans-serif;
    transition: border-color 0.12s ease, background-color 0.12s ease;
}
.view-item:hover { border-color: var(--accent); }
.view-item.selected { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.view-item svg { color: var(--text-muted); flex-shrink: 0; }
.view-item.selected svg { color: var(--accent); }
.view-item .view-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ─── Render gallery ─── */
.render-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 14px;
}
.render-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.render-image {
    position: relative;
    aspect-ratio: 3 / 2;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 12.5px;
    gap: 8px;
}
.render-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.render-image .render-switch {
    position: absolute;
    top: 10px;
    right: 10px;
}
/* Download sits on the photo, top-left, opposite the Render/Massing switch. */
.render-download {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    box-shadow: var(--shadow-sm);
    transition: color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}
.render-download:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-1px); }
.render-download:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.render-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.render-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.render-title { font-weight: 600; font-size: 13.5px; }
.render-prompt {
    font-size: 12px;
    line-height: 1.55;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.render-prompt.expanded { -webkit-line-clamp: unset; }
.render-prompt { cursor: pointer; border-radius: 4px; transition: color 0.12s ease; }
.render-prompt:hover { color: var(--text-primary); }
.render-prompt:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.render-prompt-edit { font-size: 12.5px; line-height: 1.55; min-height: 180px; }
.render-meta { font-size: 11.5px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.render-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.render-error { font-size: 12px; color: #ef4444; }

.render-links { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.render-links span { display: inline-flex; align-items: center; gap: 5px; }
.render-links svg { flex-shrink: 0; }

/* Room looks: one row per room — its reference photo, then the agreed description. */
.look-list { display: flex; flex-direction: column; }
.look-row {
    display: grid;
    grid-template-columns: 132px minmax(0, 1fr);
    gap: 14px;
    padding: 14px 0;
    border-top: 1px solid var(--border-subtle);
}
.look-row:last-child { padding-bottom: 0; }
.look-photo {
    position: relative;
    aspect-ratio: 3 / 2;
    align-self: start;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    overflow: hidden;
}
.look-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.look-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.look-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.look-text { font-size: 13px; line-height: 1.55; color: var(--text-secondary); }
.look-text.empty { color: var(--text-muted); }
@media (max-width: 700px) { .look-row { grid-template-columns: minmax(0, 1fr); } .look-photo { max-width: 220px; } }

/* The picture on a card is a button that opens the lightbox. */
.render-open {
    position: absolute;
    inset: 0;
    padding: 0;
    border: none;
    background: none;
    cursor: zoom-in;
}
.render-open img { transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); }
.render-open:hover img { transform: scale(1.02); }
.render-open:focus-visible { outline: none; box-shadow: inset 0 0 0 3px var(--accent); }
.render-image { overflow: hidden; }

/* ─── Lightbox ─── */
/* Colours come from the --lightbox-* tokens, which do not change with the theme. */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 400;
    display: flex;
    flex-direction: column;
    background: var(--lightbox-bg);
    color: var(--lightbox-text);
    animation: modal-backdrop-in 0.18s ease-out;
    outline: none;
}
.lightbox-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    flex-shrink: 0;
}
.lightbox-title { font-weight: 600; font-size: 15px; letter-spacing: -0.01em; }
.lightbox-count { font-size: 12.5px; color: var(--lightbox-muted); font-variant-numeric: tabular-nums; }
.lightbox .btn-icon { color: var(--lightbox-muted); }
.lightbox .btn-icon:hover { color: var(--lightbox-text); background: var(--lightbox-glass); }
.lightbox .segmented { background: var(--lightbox-glass); border-color: var(--lightbox-line); }
.lightbox .segmented-option { color: var(--lightbox-muted); }
.lightbox .segmented-option:hover:not(.selected) { color: var(--lightbox-text); background: var(--lightbox-glass); }
.lightbox .segmented-option.selected { background: var(--lightbox-line); color: var(--lightbox-text); border-color: transparent; box-shadow: none; }
.lightbox-stage {
    flex: 1;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 0 16px 24px;
}
.lightbox-image {
    max-width: 100%;
    max-height: 100%;
    min-width: 0;
    object-fit: contain;
    border-radius: var(--radius-sm);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
    animation: modal-card-in 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}
.lightbox-reading { position: relative; display: inline-block; line-height: 0; min-width: 0; }
.lightbox-reading .lightbox-image { max-width: calc(100vw - 160px); max-height: calc(100vh - 110px); display: block; }
.lightbox-note { line-height: 1.4; }
.lightbox-note {
    position: absolute;
    left: 50%;
    bottom: 16px;
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    background: var(--lightbox-bg);
    color: var(--lightbox-text);
    font-size: 12.5px;
    white-space: nowrap;
}
/* The photo with depth: a canvas three.js sizes to fit this box. */
.lightbox-parallax { flex: 1; align-self: stretch; min-width: 0; display: flex; align-items: center; justify-content: center; }
.parallax-canvas { border-radius: var(--radius-sm); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5); display: block; }
/* Before and after: the after photo with the before photo over it, cut off at the divider. */
.compare { position: relative; display: inline-block; line-height: 0; min-width: 0; border-radius: var(--radius-sm); overflow: hidden; box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5); }
.compare .lightbox-image { max-width: calc(100vw - 160px); max-height: calc(100vh - 110px); box-shadow: none; border-radius: 0; display: block; }
.compare-before { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; clip-path: inset(0 calc(100% - var(--split)) 0 0); }
.compare-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    left: var(--split);
    width: 2px;
    margin-left: -1px;
    background: var(--lightbox-text);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
.compare-handle::before {
    content: "";
    position: absolute;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--lightbox-text);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}
.compare-handle svg { position: relative; flex-shrink: 0; color: var(--lightbox-bg); margin: 0 -1px; }
.compare-label {
    position: absolute;
    top: 12px;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    background: var(--lightbox-bg);
    color: var(--lightbox-text);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    pointer-events: none;
}
.compare-label.before { left: 12px; }
.compare-label.after { right: 12px; }
.compare-range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.lightbox-nav {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 1px solid var(--lightbox-line);
    background: var(--lightbox-glass);
    color: var(--lightbox-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}
.lightbox-nav:hover { background: var(--lightbox-line); border-color: var(--lightbox-muted); }
.lightbox-nav:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-glow); }

/* ─── Plan editor (full screen) ─── */
.editor-screen {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    animation: modal-backdrop-in 0.18s ease-out;
}
.editor-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 56px;
    padding: 8px 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    flex-wrap: wrap;
}
.editor-bar-title { display: flex; align-items: center; gap: 12px; margin-right: 10px; min-width: 0; }
.editor-bar-sub {
    font-size: 13px;
    color: var(--text-muted);
    max-width: 220px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.btn-secondary.active { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.editor-hint {
    font-size: 12.5px;
    color: var(--text-muted);
    padding: 8px 20px;
    line-height: 1.5;
    border-bottom: 1px solid var(--border-subtle);
    background: var(--bg-secondary);
    flex-shrink: 0;
}
.editor-body { flex: 1; min-height: 0; display: flex; }
.editor-reference {
    width: min(32vw, 600px);
    flex-shrink: 0;
    padding: 16px;
    border-left: 1px solid var(--border);
    background: var(--bg-secondary);
    overflow: auto;
}
.editor-reference .plan-frame { min-height: 0; }
.editor-reference .plan-frame img { max-height: none; }
.editor-reference .plan-frame iframe { height: calc(100vh - 190px); }
.editor-section-title {
    margin: 20px 0 8px;
    font-weight: 500;
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.editor-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
}
.editor-check input { accent-color: var(--accent); width: 15px; height: 15px; }
.editor-surface {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    background: var(--bg-primary);
}
.editor-surface:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--accent-soft); }
.editor-svg {
    display: block;
    width: 100%;
    height: 100%;
    touch-action: none;
    user-select: none;
}
.editor-svg.tool-wall, .editor-svg.tool-room, .editor-svg.tool-camera { cursor: crosshair; }
.editor-svg.tool-furniture { cursor: copy; }
.editor-svg.tool-door, .editor-svg.tool-window { cursor: copy; }
.editor-svg .grid-line { stroke: var(--border); }
.editor-svg .room { fill: var(--accent-soft); cursor: pointer; transition: fill 0.12s ease; }
.editor-svg .room:hover { fill: rgba(47, 179, 131, 0.14); }
.editor-svg .room.selected { fill: rgba(47, 179, 131, 0.22); }
.editor-svg .wall { stroke: var(--text-primary); stroke-linecap: square; pointer-events: none; }
.editor-svg .wall.interior { stroke: var(--text-secondary); }
.editor-svg .wall.selected { stroke: var(--accent); }
.editor-svg .hit { stroke: transparent; cursor: pointer; }
.editor-svg .hit:hover { stroke: var(--accent-glow); }
.editor-svg .opening { stroke-linecap: butt; cursor: grab; }
.editor-svg .opening.window { stroke: #38bdf8; }
.editor-svg .opening.door { stroke: #f59e0b; }
.editor-svg .opening.selected { stroke: var(--accent); }
.editor-svg .room-label   { fill: var(--text-secondary); font-family: 'Inter', system-ui, sans-serif; font-weight: 500; text-anchor: middle; pointer-events: none; }
.editor-svg .room-area    { fill: var(--text-muted); font-family: 'Inter', system-ui, sans-serif; text-anchor: middle; pointer-events: none; }
.editor-svg .preview-label { fill: var(--accent); font-family: 'Inter', system-ui, sans-serif; font-weight: 600; text-anchor: middle; pointer-events: none; }
.editor-svg .handle { fill: var(--bg-elevated); stroke: var(--accent); stroke-width: 0.04; cursor: move; }
.editor-svg .handle:hover { fill: var(--accent); }
.editor-svg .handle.vertex { stroke: var(--camera); }
.editor-svg .furniture { cursor: grab; }
.editor-svg .furniture rect { fill: var(--bg-elevated); stroke: var(--text-muted); stroke-width: 0.02; }
.editor-svg .furniture .front { stroke: var(--text-secondary); stroke-linecap: round; }
.editor-svg .furniture.rug rect { fill: var(--bg-tertiary); stroke-dasharray: 0.08 0.06; }
.editor-svg .furniture:hover rect { stroke: var(--accent); }
.editor-svg .furniture.selected rect { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 0.04; }
.editor-svg .furniture.selected .front { stroke: var(--accent); }
/* Camera points. Violet, so they never read as part of the building (accent) or its openings. */
.editor-svg .camera .cone { fill: var(--camera-soft); stroke: var(--camera-line); stroke-width: 0.02; pointer-events: none; }
.editor-svg .camera.selected .cone { fill: var(--camera-wash); stroke: var(--camera); stroke-width: 0.03; }
.editor-svg .camera .body { fill: var(--camera); stroke: var(--bg-elevated); cursor: move; }
.editor-svg .camera .body:hover { fill: var(--camera-strong); }
.editor-svg .camera .lens { stroke: var(--camera); stroke-linecap: round; pointer-events: none; }
.editor-svg .camera .aim-line { stroke: var(--camera); stroke-dasharray: 0.1 0.08; pointer-events: none; }
.editor-svg .camera .handle.aim { stroke: var(--camera); cursor: crosshair; }
.editor-svg .camera .handle.aim:hover { fill: var(--camera); }
.editor-svg .camera-label {
    fill: var(--camera-strong); font-family: 'Inter', system-ui, sans-serif; font-weight: 600; text-anchor: middle; pointer-events: none;
    paint-order: stroke; stroke: var(--bg-primary); stroke-width: 0.06; stroke-linejoin: round;
}
[data-theme="dark"] .editor-svg .camera-label { fill: var(--camera); }
.editor-svg .preview { stroke: var(--accent); opacity: 0.6; stroke-linecap: square; pointer-events: none; }
.editor-svg .preview-room { fill: var(--accent-soft); stroke: var(--accent); stroke-width: 0.03; stroke-dasharray: 0.15 0.1; pointer-events: none; }
.editor-svg .cursor { fill: var(--accent); pointer-events: none; }
/* Site editor, isometric mode: three.js owns the canvas. */
.editor-surface { position: relative; }
.editor-surface .hidden { display: none; }
.editor-iso { position: absolute; inset: 0; background: var(--bg-tertiary); }
.editor-iso canvas { touch-action: none; cursor: grab; }
.editor-iso-tools {
    position: absolute;
    left: 14px;
    bottom: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}
/* The area picker fills the whole canvas: the map is the page, and cards float over it. */
.picker-screen { position: absolute; inset: 0; overflow: hidden; }
.picker-screen .picker-stage { position: absolute; inset: 0; }
.picker-screen .picker-map { height: 100%; border: none; border-radius: 0; }
.picker-screen .picker-3d { border-radius: 0; }
.picker-screen .picker-stage .viewer-overlay { z-index: 3; pointer-events: none; }
.picker-card {
    position: absolute;
    z-index: 5;
    padding: 14px 16px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}
.picker-card.hidden, .picker-top .hidden { display: none; }
/* Progress of the fetch and the reading, shown over the map it is happening on. */
.picker-progress {
    left: 50%;
    bottom: 16px;
    transform: translateX(-50%);
    width: min(460px, calc(100% - 32px));
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.picker-steps { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.picker-steps li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; align-items: start; }
.picker-step-mark {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1.5px solid var(--border);
    color: var(--text-muted);
}
.picker-steps li.done .picker-step-mark { background: var(--accent); border-color: var(--accent); color: var(--bg-elevated); }
.picker-steps li.active .picker-step-mark { border-color: transparent; }
.picker-step-title { display: block; font-weight: 500; font-size: 13.5px; color: var(--text-primary); }
.picker-steps li.todo .picker-step-title { color: var(--text-muted); }
.picker-step-sub { display: block; font-size: 12px; line-height: 1.5; color: var(--text-muted); }
.picker-progress-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.picker-top { top: 16px; left: 16px; width: min(420px, calc(100% - 32px)); display: flex; flex-direction: column; gap: 8px; }
.picker-top .breadcrumbs { margin-bottom: 0; }
.picker-top .picker-search { margin-bottom: 0; }
.picker-title { font-weight: 600; font-size: 17px; letter-spacing: -0.01em; }
.picker-side { top: 16px; right: 16px; width: 330px; max-height: calc(100% - 120px); overflow-y: auto; }
.picker-dock {
    left: 50%;
    bottom: 16px;
    transform: translateX(-50%);
    max-width: calc(100% - 32px);
    padding: 8px 12px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 16px;
}
.picker-group { display: flex; align-items: center; gap: 4px; }
.picker-group + .picker-group { padding-left: 16px; border-left: 1px solid var(--border); }
.picker-group-label { font-weight: 500; font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; margin-right: 4px; }
.picker-chip {
    display: inline-flex;
    align-items: center;
    height: 28px;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    background: var(--bg-elevated);
    overflow: hidden;
}
.picker-chip button { height: 100%; padding: 0 8px; border: none; background: none; color: var(--text-secondary); font: 500 12.5px 'Inter', system-ui, sans-serif; cursor: pointer; display: inline-flex; align-items: center; }
.picker-chip button + button { padding: 0 7px 0 4px; color: var(--text-muted); }
.picker-chip button:hover { color: var(--accent); }
.picker-chip.selected { border-color: var(--accent); background: var(--accent-soft); }
.picker-chip.selected button:first-child { color: var(--accent); }
.picker-size { width: 84px; height: 32px; padding: 4px 8px; }
.picker-times { font-size: 13px; color: var(--text-muted); }
.picker-dock .picker-readout { margin-left: 0; }
@media (max-width: 1100px) { .picker-side { top: auto; bottom: 120px; } }
/* The landscape workspace: the same full canvas, with our own isometric view of the site under the cards. */
.workspace-stage { position: absolute; inset: 0; background: var(--bg-tertiary); }
.workspace-stage canvas { touch-action: none; }
.workspace-stage .viewer-overlay { pointer-events: none; }
.workspace-top { top: 16px; left: 16px; width: min(400px, calc(100% - 32px)); display: flex; flex-direction: column; gap: 8px; }
.workspace-top .breadcrumbs { margin-bottom: 0; }
.workspace-top .segmented { align-self: flex-start; }
.workspace-title-row { display: flex; align-items: center; gap: 4px; }
.workspace-title-row .picker-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace-side {
    top: 16px;
    right: 16px;
    bottom: 16px;
    width: min(400px, calc(100% - 32px));
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.workspace-side .camera-preview { margin-top: 0; }
.workspace-side .field-row { margin-top: 0; }
.workspace-pair { display: flex; flex-wrap: wrap; gap: 10px 16px; }
.workspace-side { overflow-x: hidden; }
.workspace-dock { left: 16px; transform: none; max-width: calc(100% - 448px); }
.workspace-centre {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(420px, calc(100% - 32px));
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    text-align: center;
    padding: 24px;
}
.workspace-centre .progress { width: 100%; }
.workspace-block { display: flex; flex-direction: column; gap: 10px; padding-top: 14px; border-top: 1px solid var(--border-subtle); }
.workspace-block-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.workspace-block-title { font-weight: 600; font-size: 13.5px; color: var(--text-primary); }
.workspace-features { display: flex; flex-direction: column; }
.workspace-feature { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 13px; border-top: 1px solid var(--border-subtle); }
.workspace-feature:first-child { border-top: none; }
.workspace-feature-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace-swatch { width: 12px; height: 12px; flex-shrink: 0; border-radius: 3px; border: 1px solid var(--border); background-color: currentColor; }
/* The swatch takes its colour from the same land-cover classes the site plan uses, which set `fill`. */
.workspace-swatch.ft-woodland, .workspace-swatch.ft-tree_line, .workspace-swatch.ft-tree, .workspace-swatch.ft-hedge { color: var(--cover-woodland); }
.workspace-swatch.ft-orchard { color: var(--cover-orchard); }
.workspace-swatch.ft-meadow { color: var(--cover-meadow); }
.workspace-swatch.ft-lawn { color: var(--cover-lawn); }
.workspace-swatch.ft-field { color: var(--cover-field); }
.workspace-swatch.ft-garden { color: var(--cover-garden); }
.workspace-swatch.ft-heath { color: var(--cover-heath); }
.workspace-swatch.ft-water, .workspace-swatch.ft-stream { color: var(--cover-water); }
.workspace-swatch.ft-wetland { color: var(--cover-wetland); }
.workspace-swatch.ft-sand { color: var(--cover-sand); }
.workspace-swatch.ft-rock { color: var(--cover-rock); }
.workspace-swatch.ft-paved { color: var(--cover-paved); }
.workspace-swatch.ft-building { color: var(--cover-building); }
.workspace-swatch.ft-mound, .workspace-swatch.ft-hollow { color: var(--cover-relief); }
.workspace-swatch.ft-path { color: var(--cover-path); }
.workspace-swatch.ft-road { color: var(--cover-road); }
.workspace-swatch.ft-wall { color: var(--cover-wall); }
.workspace-swatch.ft-fence { color: var(--cover-fence); }
.workspace-palette { display: flex; flex-wrap: wrap; gap: 6px; }
.workspace-selected { background: var(--accent-soft); margin: 0 -16px; padding: 14px 16px; border-top: 1px solid var(--accent-glow); border-bottom: 1px solid var(--accent-glow); }
.workspace-selected .workspace-block-title { display: flex; align-items: center; gap: 8px; }
.workspace-remove:hover { color: #ef4444; border-color: #ef4444; }
.workspace-feature.selected { background: var(--accent-soft); box-shadow: -16px 0 0 var(--accent-soft), 16px 0 0 var(--accent-soft); }
.workspace-feature.removed .workspace-feature-name { text-decoration: line-through; color: var(--text-muted); cursor: default; }
.workspace-feature.removed .workspace-swatch { opacity: 0.4; }
.workspace-row-remove { width: 26px; height: 26px; opacity: 0; transition: opacity 0.12s ease; }
.workspace-feature:hover .workspace-row-remove, .workspace-row-remove:focus-visible { opacity: 1; }
.workspace-row-remove:hover { color: #ef4444; }
/* Renders as a photo album: the panel opens over the whole canvas, beside the title card. */
.album-backdrop { position: absolute; inset: 0; z-index: 4; background: var(--bg-primary); }
.workspace-side.album { left: 432px; width: auto; }
.album-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; }
.album-head .render-actions { margin: 0; }
.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; align-items: start; }
.album-photo { margin: 0; }
.album-photo .render-image { color: var(--text-muted); flex-direction: column; }
.album-compare {
    position: absolute;
    right: 10px;
    bottom: 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease;
}
.album-compare:hover { color: var(--accent); border-color: var(--accent); }
.album-busy {
    position: absolute;
    left: 10px;
    bottom: 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 12px;
}
@media (max-width: 1100px) { .workspace-side.album { left: 16px; top: 190px; height: auto; } }
.camera-name-row { display: flex; align-items: center; gap: 6px; }
.camera-name-row .input { flex: 1; min-width: 0; }
/* AI assist: a dialog with what was asked and answered, and a box for the next request. */
.assist-dialog { width: 520px; display: flex; flex-direction: column; gap: 12px; }
.assist-dialog .modal-title { display: flex; align-items: center; gap: 8px; margin: 0; }
.assist-dialog .assist-intro { margin: 0; }
.assist-dialog .assist-log { max-height: 320px; overflow-y: auto; padding-right: 4px; }
.assist-dialog .assist-form { flex-direction: column; align-items: stretch; }
.assist-dialog .modal-actions { align-items: center; }
.assist-undo { margin-right: auto; }
.assist-log { display: flex; flex-direction: column; gap: 6px; }
.assist-ask {
    align-self: flex-end;
    max-width: 88%;
    padding: 6px 10px;
    border-radius: var(--radius-md) var(--radius-md) 2px var(--radius-md);
    background: var(--accent-soft);
    color: var(--text-primary);
    font-size: 12.5px;
    line-height: 1.45;
}
.assist-reply { max-width: 94%; font-size: 12.5px; line-height: 1.5; color: var(--text-secondary); display: flex; gap: 8px; align-items: baseline; }
.assist-form { display: flex; gap: 10px; }
/* Auto design: a card that folds; the numbers are sliders. */
.design-card { gap: 0; }
.design-card-head {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 0;
    border: 0;
    background: none;
    color: var(--text-secondary);
    text-align: left;
    cursor: pointer;
}
.design-card-head:hover .workspace-block-title { color: var(--accent); }
.design-card-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.design-card-title .panel-sub { display: inline-flex; align-items: center; gap: 6px; }
.design-card-body { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.design-rationale {
    font-size: 12.5px;
    line-height: 1.55;
    color: var(--text-secondary);
    white-space: pre-line;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
}
.slider-group {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 12px 14px;
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    background: var(--bg-tertiary);
}
.slider-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px 10px; }
.slider-row .field-label { margin: 0; }
.slider-value {
    min-width: 42px;
    padding: 1px 8px;
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    font-size: 12.5px;
    font-weight: 600;
    text-align: center;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary);
}
.slider-note { grid-column: 1 / -1; font-size: 11.5px; color: var(--text-muted); }
.slider {
    grid-column: 1 / -1;
    width: 100%;
    height: 18px;
    margin: 0;
    background: transparent;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}
.slider:disabled { cursor: default; opacity: 0.55; }
.slider:focus-visible { outline: none; }
/* The track fills with the accent up to the value (Firefox draws that part itself). */
.slider::-webkit-slider-runnable-track {
    height: 6px;
    border-radius: 3px;
    background: linear-gradient(to right, var(--accent) 0 var(--fill, 0%), var(--border) var(--fill, 0%) 100%);
}
.slider::-moz-range-track { height: 6px; border-radius: 3px; background: var(--border); }
.slider::-moz-range-progress { height: 6px; border-radius: 3px; background: var(--accent); }
.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    margin-top: -6px;
    border-radius: 50%;
    background: var(--bg-elevated);
    border: 2px solid var(--accent);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
    transition: transform 0.12s ease;
}
.slider::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--bg-elevated);
    border: 2px solid var(--accent);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
}
.slider:hover::-webkit-slider-thumb, .slider:focus-visible::-webkit-slider-thumb { transform: scale(1.12); }
.slider:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px var(--accent-soft); }
/* A camera's prompt, read and tuned before the photo is made. */
.camera-prompt-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.camera-prompt .render-actions { margin-top: 8px; }
.picker-picked { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--camera-strong); font-weight: 500; }
.workspace-link { padding: 0; border: none; background: none; color: inherit; cursor: pointer; text-align: left; font-family: inherit; }
.workspace-link:hover { color: var(--accent); }
@media (max-width: 1100px) { .workspace-side { top: auto; height: 46%; } .workspace-dock { bottom: calc(46% + 28px); max-width: calc(100% - 32px); } }
/* The area picker's 3D view lies over the map; the map stays laid out underneath. */
.picker-stage { position: relative; }
.picker-3d { position: absolute; inset: 0; z-index: 2; border-radius: var(--radius-sm); overflow: hidden; background: var(--bg-tertiary); }
.picker-3d.hidden { display: none; }
.picker-3d gmp-map-3d { width: 100%; height: 100%; display: block; }
/* Site editor: features over the satellite image. */
.editor-svg.site-editor { background: var(--bg-tertiary); }
.editor-svg.site-editor.tool-select { cursor: grab; }
.editor-svg.site-editor.panning { cursor: grabbing; }
.editor-svg.site-editor.tool-area, .editor-svg.site-editor.tool-line, .editor-svg.site-editor.tool-tree { cursor: crosshair; }
.editor-svg .site-edge { fill: none; stroke: var(--bg-elevated); stroke-dasharray: 1% 0.6%; pointer-events: none; }
.editor-svg .feature { cursor: grab; transition: fill-opacity 0.12s ease; }
.editor-svg .feature:hover { fill-opacity: 0.6; }
.editor-svg .feature.line:hover { fill: none; }
.editor-svg .feature.selected { stroke: var(--accent) !important; stroke-width: 0.35% !important; fill-opacity: 0.75; }
.editor-svg .feature.line.selected { fill: none; fill-opacity: 1; stroke-width: inherit; }
.editor-svg .hit { fill: none; stroke: transparent; cursor: grab; }
.editor-svg .hit:hover { stroke: var(--accent-glow); }
.editor-svg .draft { pointer-events: none; fill-opacity: 0.35; stroke: var(--accent); stroke-dasharray: 0.5% 0.3%; }
.editor-svg .draft.line { stroke-opacity: 0.8; }
.editor-svg .draft-start { fill: var(--bg-elevated); stroke: var(--accent); pointer-events: none; }
.editor-svg .handle.mid { fill: var(--bg-elevated); stroke: var(--accent); cursor: copy; }
.editor-svg .handle.mid:hover { fill: var(--accent); }
.editor-svg .camera .handle.aim { stroke: var(--camera); }

.editor-properties {
    width: 340px;
    flex-shrink: 0;
    padding: 18px 20px;
    border-left: 1px solid var(--border);
    background: var(--bg-secondary);
    overflow-y: auto;
}
.editor-properties .field-row { margin-top: 12px; }
.editor-properties .segmented { align-self: flex-start; }
/* Reference photos on a building: small squares in a row, the last one adds. */
.photo-strip { display: flex; flex-wrap: wrap; gap: 8px; }
.photo-thumb, .photo-add {
    position: relative;
    width: 72px;
    height: 72px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    overflow: hidden;
    background: var(--bg-tertiary);
}
.photo-thumb a { display: block; width: 100%; height: 100%; }
.photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    cursor: pointer;
}
.photo-remove:hover { color: #ef4444; border-color: #ef4444; }
.photo-add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-style: dashed;
    color: var(--text-muted);
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}
.photo-add:hover, .photo-add:focus-within { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.photo-add.busy { pointer-events: none; }
.photo-add input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.camera-preview { margin-top: 18px; }
.camera-preview.hidden { display: none; }
.camera-preview { outline: none; }
.camera-preview-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; min-height: 30px; }
.camera-preview-head .field-label { margin: 0; white-space: nowrap; }
.camera-preview-busy { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-secondary); }
.camera-preview-render { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.camera-preview-tag { position: absolute; top: 10px; left: 10px; }
.camera-preview-open { position: absolute; inset: 0; padding: 0; border: 0; background: transparent; cursor: zoom-in; }
.camera-preview-open:focus-visible { outline: none; box-shadow: inset 0 0 0 3px var(--accent); }
.camera-preview-frame .render-switch { position: absolute; top: 10px; right: 10px; }
/* Opened larger: the same panel over the whole window, in the lightbox's colours. */
.workspace-side:has(.camera-preview.large) { z-index: 400; }
.camera-preview.large { margin: 0; padding: 12px 20px 24px; align-items: center; }
.camera-preview.large .camera-preview-head { width: 100%; gap: 12px; margin-bottom: 12px; flex-shrink: 0; }
.camera-preview.large .camera-preview-head .field-label { color: var(--lightbox-text); font-weight: 600; font-size: 15px; letter-spacing: -0.01em; }
.camera-preview.large .camera-preview-busy { color: var(--lightbox-muted); }
.camera-preview-keys { order: 3; margin-top: 10px; font-size: 12px; color: var(--lightbox-muted); flex-shrink: 0; }
.camera-preview.large .camera-preview-frame {
    width: min(100%, calc((100vh - 124px) * 1.5));
    margin: auto 0;
    border-color: var(--lightbox-line);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}
.camera-preview-frame {
    position: relative;
    aspect-ratio: 3 / 2;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.editor-properties .field + .field { margin-top: 12px; }
.editor-delete { margin-top: 16px; }
.editor-delete:hover { color: #ef4444; border-color: #ef4444; }
.editor-checks {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 12.5px;
    line-height: 1.5;
}
.editor-ok { display: flex; align-items: center; gap: 8px; color: #16a34a; }
.editor-problem { display: flex; gap: 8px; color: var(--text-secondary); }
.editor-problem svg { color: #f59e0b; flex-shrink: 0; margin-top: 2px; }
.toolbar-grow { flex: 1; }

/* Number inputs: no native spinners (style guide §5.7). */
.input-number { -moz-appearance: textfield; appearance: textfield; font-variant-numeric: tabular-nums; }
.input-number::-webkit-outer-spin-button,
.input-number::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.input:disabled { color: var(--text-muted); background: var(--bg-glass); cursor: not-allowed; }

/* ─── Definition list (settings, model facts) ─── */
.facts { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 8px 16px; font-size: 13.5px; }
.facts dt { color: var(--text-muted); }
.facts dd { color: var(--text-primary); min-width: 0; overflow-wrap: anywhere; }

/* ─── Section ─── */
.section { margin-top: 22px; }
.section-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 12px;
}
.section-title { font-weight: 600; font-size: 17px; letter-spacing: -0.01em; color: var(--text-primary); }

/* ─── Blazor chrome ─── */
#blazor-error-ui {
    display: none;
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translateX(-50%);
    z-index: 3000;
    padding: 10px 14px;
    gap: 12px;
    align-items: center;
    background: #ef4444;
    color: #fff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    font-size: 13px;
}
#blazor-error-ui a { color: #fff; font-weight: 600; text-decoration: underline; }
#blazor-error-ui .dismiss { cursor: pointer; }

/* prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ─── Sign-in ─── */
.auth-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    background: var(--bg-primary);
    background-image: var(--accent-wash);
}
.auth-card {
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 28px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}
.auth-card .field + .field { margin-top: 0; }
.auth-brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; color: var(--text-primary); }
.auth-title { font-weight: 600; font-size: 22px; letter-spacing: -0.02em; color: var(--text-primary); }
.auth-submit { justify-content: center; margin-top: 4px; }
.auth-link { font-size: 13px; color: var(--text-secondary); text-align: center; }
.auth-error {
    padding: 9px 12px;
    font-size: 13px;
    color: #b91c1c;
    background: rgba(239, 68, 68, 0.10);
    border-radius: var(--radius-sm);
}
.appbar-user {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    font: 500 13px 'Inter', system-ui, sans-serif;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
}
.appbar-user:hover { color: var(--text-primary); background: var(--bg-glass-hover); }

/* ─── Users ─── */
.users-add { grid-template-columns: repeat(3, minmax(0, 1fr)) auto; margin-top: 0; }
.users-add-action { justify-content: flex-end; }
@media (max-width: 800px) { .users-add { grid-template-columns: minmax(0, 1fr); } }
.users-handover { border-color: var(--accent); }
.users-table { margin-top: 14px; }
.users-password {
    display: inline-block;
    padding: 10px 14px;
    font: 500 18px var(--font-mono);
    letter-spacing: 0.04em;
    color: var(--text-primary);
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    user-select: all;
}
.users-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
