/* ── Design tokens (Structory brand) ─────────────────────────────────────── */
:root {
    /* Raw brand palette */
    --structory-navy:        #0B1D3A;
    --structory-slate:       #1C2E4A;
    --structory-teal:        #10BCB6;   /* ACCENT ONLY — lines, icons, nodes, borders, big type */
    --structory-teal-strong: #0B7D74;   /* INTERACTIVE — buttons/links, white text passes AA (~5:1) */
    --structory-teal-dark:   #085C55;   /* hover/pressed */
    --structory-green:       #10B981;   /* success indicator fills/dots (use sparingly) */
    --structory-light-grey:  #E6EBF1;
    --structory-paper:       #F7F9FB;
    --structory-muted:       #64748B;

    /* Primary = vivid brand teal (owner preference: bright over strict AA —
       white-on-teal is ~3:1, acceptable for bold button text; the deep teal
       stays as hover/pressed and for small teal-on-white text). */
    --color-primary:        #10BCB6;
    --color-primary-dark:   #0DA197;
    --color-primary-light:  #DDF6F4;              /* teal tint for active states / badges */
    --color-primary-ring:   rgba(16, 188, 182, 0.30);

    /* Brand wordmark + action fills. Action is a lively teal gradient. */
    --gradient-brand:        linear-gradient(135deg, #0B1D3A 0%, #10BCB6 100%);
    --gradient-action:       linear-gradient(135deg, #17C3BD 0%, #10BCB6 55%, #0C948E 100%);
    --gradient-action-hover: linear-gradient(135deg, #10BCB6 0%, #0C948E 55%, #0B7D74 100%);

    /* Warnings / errors keep red + amber (brief: red/orange only for warnings) */
    --color-danger:         #dc2626;
    --color-danger-light:   #fef2f2;
    --color-danger-border:  #fecaca;

    /* Success = brand green, darkened slightly so text/badges are legible */
    --color-success:        #0F8F63;
    --color-success-light:  #E7F8F0;
    --color-success-border: #A7E8CC;

    --color-warning:        #ca8a04;
    --color-warning-light:  #fefce8;
    --color-warning-border: #fde68a;

    /* Roadmap "planned" state — remapped off purple to keep the palette tight.
       If you need 3 visually distinct roadmap states, restore a purple here. */
    --color-purple:         #1C2E4A;
    --color-purple-light:   #E6EBF1;

    --color-text-primary:   #0B1D3A;   /* navy */
    --color-text-secondary: #475569;
    --color-text-muted:     #64748B;

    --color-surface:        #FFFFFF;
    --color-bg:             #F7F9FB;   /* paper */
    --color-border:         #E6EBF1;   /* light grey */
    --color-border-light:   #F1F5F9;

    --radius-sm:  6px;
    --radius-md:  10px;
    --radius-lg:  14px;
    --radius-pill: 999px;

    /* Navy-tinted shadows read more cohesive than pure black */
    --shadow-sm:  0 1px 2px rgba(11, 29, 58, 0.05);
    --shadow-md:  0 1px 4px rgba(11, 29, 58, 0.06), 0 1px 2px rgba(11, 29, 58, 0.04);
    --shadow-lg:  0 4px 12px rgba(11, 29, 58, 0.08), 0 2px 4px rgba(11, 29, 58, 0.05);
    --shadow-xl:  0 8px 24px rgba(11, 29, 58, 0.08), 0 2px 8px rgba(11, 29, 58, 0.05);

    --transition: 0.18s ease;
}

/* ── Dark mode ───────────────────────────────────────────────────────────── */
/* Must come after :root — same specificity (0,1,0), so order decides the winner */
[data-theme="dark"] {
    /* On a navy canvas the teal brightens further */
    --color-primary:        #2DD4CE;
    --color-primary-dark:   #16B3AD;
    --color-primary-light:  rgba(45, 212, 206, 0.16);
    --color-primary-ring:   rgba(45, 212, 206, 0.35);

    --gradient-brand:        linear-gradient(135deg, #E6EBF1 0%, #2DD4CE 100%);
    --gradient-action:       linear-gradient(135deg, #2DD4CE 0%, #16B3AD 55%, #10BCB6 100%);
    --gradient-action-hover: linear-gradient(135deg, #45E2DC 0%, #2DD4CE 55%, #16B3AD 100%);

    --color-danger-light:   #450a0a;
    --color-danger-border:  #991b1b;
    --color-success:        #10B981;
    --color-success-light:  rgba(16, 185, 129, 0.14);
    --color-success-border: #0F5C43;
    --color-warning-light:  #3d2000;
    --color-warning-border: #92400e;
    --color-purple:         #93A4C0;
    --color-purple-light:   rgba(28, 46, 74, 0.6);

    --color-text-primary:   #F1F5F9;
    --color-text-secondary: #A3B1C6;
    --color-text-muted:     #64748B;

    --color-surface:        #14243F;   /* navy-slate surface */
    --color-bg:             #0B1D3A;   /* navy canvas */
    --color-border:         #26385A;
    --color-border-light:   #1C2E4A;

    --shadow-sm:  0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md:  0 1px 4px rgba(0, 0, 0, 0.5), 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-lg:  0 4px 12px rgba(0, 0, 0, 0.6), 0 2px 4px rgba(0, 0, 0, 0.5);
    --shadow-xl:  0 8px 24px rgba(0, 0, 0, 0.6), 0 2px 8px rgba(0, 0, 0, 0.5);
}

/* ── Reset ───────────────────────────────────────────────────────────────── */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.hidden {
    display: none !important;
}

body {
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    background: var(--color-bg);
    color: var(--color-text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── Auth ────────────────────────────────────────────────────────────────── */
.auth-card {
    background: var(--color-surface);
    padding: 2.75rem 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    border: 1px solid var(--color-border);
    width: 100%;
    max-width: 420px;
    position: relative;
    overflow: hidden;
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-brand);
}

.auth-card h1 {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.3rem;
    color: var(--color-text-primary);
}

.auth-card p {
    color: var(--color-text-secondary);
    margin-bottom: 1.75rem;
    font-size: 0.9rem;
}

/* ── Tabs ────────────────────────────────────────────────────────────────── */
.tabs {
    display: flex;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--color-border);
    gap: 0.25rem;
}

.tab {
    flex: 1;
    padding: 0.55rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--color-text-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color var(--transition), border-color var(--transition);
}

.tab.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
    font-weight: 600;
}

.tab:hover:not(.active) {
    color: var(--color-text-secondary);
}

/* ── Address Autocomplete ────────────────────────────────────────────────── */
.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    list-style: none;
    margin: 3px 0 0;
    padding: 0.25rem;
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
}

.autocomplete-dropdown.hidden {
    display: none;
}

.autocomplete-item {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    cursor: pointer;
    color: var(--color-text-primary);
    border-radius: var(--radius-sm);
}

.autocomplete-item:hover {
    background: var(--color-primary-light);
    color: var(--color-primary);
}

/* ── Form elements ───────────────────────────────────────────────────────── */
.form-group {
    margin-bottom: 1rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-row-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1rem;
}

label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 0.35rem;
    color: var(--color-text-secondary);
    letter-spacing: 0.01em;
}

input,
select {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.925rem;
    font-family: inherit;
    background: var(--color-surface);
    color: var(--color-text-primary);
    transition: border-color var(--transition), box-shadow var(--transition);
}

input[type="checkbox"],
input[type="radio"] {
    width: auto;
    padding: 0;
    border: none;
    border-radius: 0;
    background: none;
    box-shadow: none;
    transition: none;
    flex-shrink: 0;
}

input::placeholder {
    color: var(--color-text-muted);
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-ring);
}

input[type="checkbox"]:focus,
input[type="radio"]:focus {
    outline: revert;
    box-shadow: none;
    border-color: initial;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
    width: 100%;
    padding: 0.65rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
    margin-top: 0.5rem;
    letter-spacing: -0.01em;
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background: var(--gradient-action);
    color: white;
    box-shadow: 0 1px 3px rgba(16, 188, 182, 0.35);
}

.btn-primary:hover {
    background: var(--gradient-action-hover);
    box-shadow: 0 2px 8px rgba(16, 188, 182, 0.4);
}

.btn-new {
    background: var(--gradient-action);
    color: white;
    padding: 0.55rem 1.2rem;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background var(--transition), box-shadow var(--transition);
    display: inline-flex;
    align-items: center;
    box-shadow: 0 1px 3px rgba(16, 188, 182, 0.35);
    letter-spacing: -0.01em;
}

.btn-new:hover {
    background: var(--gradient-action-hover);
    box-shadow: 0 2px 8px rgba(16, 188, 182, 0.4);
}

.btn-secondary {
    padding: 0.65rem 1.5rem;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    color: var(--color-text-secondary);
    transition: all var(--transition);
}

.btn-secondary:hover {
    background: var(--color-bg);
    border-color: #cbd5e1;
    color: var(--color-text-primary);
}

.btn-submit {
    padding: 0.65rem 1.5rem;
    background: var(--gradient-action);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition), box-shadow var(--transition);
    letter-spacing: -0.01em;
    box-shadow: 0 1px 3px rgba(16, 188, 182, 0.35);
}

.btn-submit:hover {
    background: var(--gradient-action-hover);
    box-shadow: 0 2px 8px rgba(16, 188, 182, 0.4);
}

.btn-delete {
    padding: 0.65rem 1.5rem;
    background: var(--color-surface);
    color: var(--color-danger);
    border: 1px solid var(--color-danger-border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-delete:hover {
    background: var(--color-danger-light);
}

.btn-open {
    width: 100%;
    padding: 0.5rem;
    background: var(--color-bg);
    color: var(--color-primary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    letter-spacing: -0.01em;
}

.btn-open:hover {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

/* Small inline action buttons */
.btn-duplicate-row,
.btn-edit-row {
    padding: 0.25rem 0.65rem;
    background: var(--color-surface);
    color: var(--color-primary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    margin-right: 0.35rem;
}

.btn-duplicate-row:hover,
.btn-edit-row:hover {
    background: var(--color-primary-light);
    border-color: var(--color-primary-ring);
    color: var(--color-primary);
}

.btn-delete-row {
    padding: 0.25rem 0.65rem;
    background: var(--color-surface);
    color: var(--color-danger);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-delete-row:hover {
    background: var(--color-danger-light);
    border-color: var(--color-danger-border);
}

.btn-properties-row {
    padding: 0.25rem 0.65rem;
    background: var(--color-surface);
    color: var(--color-purple);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-properties-row:hover {
    background: var(--color-purple-light);
    border-color: #ddd6fe;
}

.btn-toggle-row {
    padding: 0.25rem 0.65rem;
    background: var(--color-surface);
    color: var(--color-warning);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-toggle-row:hover {
    background: var(--color-warning-light);
    border-color: var(--color-warning-border);
}

.btn-logout {
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text-secondary);
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.83rem;
    font-family: inherit;
    font-weight: 500;
    transition: all var(--transition);
}

.btn-logout:hover {
    background: var(--color-bg);
    border-color: #cbd5e1;
    color: var(--color-text-primary);
}

/* ── Messages ────────────────────────────────────────────────────────────── */
.message {
    padding: 0.7rem 0.9rem;
    border-radius: var(--radius-sm);
    font-size: 0.855rem;
    margin-top: 1rem;
    display: none;
    line-height: 1.4;
}

.message.error {
    background: var(--color-danger-light);
    color: var(--color-danger);
    border: 1px solid var(--color-danger-border);
    display: block;
}

.message.success {
    background: var(--color-success-light);
    color: var(--color-success);
    border: 1px solid var(--color-success-border);
    display: block;
}

/* ── Auth flash (prominent banner at top of auth card) ──────────────────── */
.auth-flash {
    display: none;
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.45;
    margin-bottom: 1.25rem;
    border-left: 4px solid transparent;
}
.auth-flash ul { margin: 0.25rem 0 0; padding-left: 1.25rem; }
.auth-flash.error {
    display: block;
    background: var(--color-danger-light);
    color: var(--color-danger);
    border: 1px solid var(--color-danger-border);
    border-left-width: 4px;
    animation: auth-flash-in 0.18s ease-out;
}
.auth-flash.success {
    display: block;
    background: var(--color-success-light);
    color: var(--color-success);
    border: 1px solid var(--color-success-border);
    border-left-width: 4px;
    animation: auth-flash-in 0.18s ease-out;
}
@keyframes auth-flash-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Navbar ──────────────────────────────────────────────────────────────── */
.navbar {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: 0 1.75rem;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 200;
    box-shadow: var(--shadow-sm);
}

.navbar-brand {
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: -0.02em;
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.navbar-user {
    font-size: 0.83rem;
    color: var(--color-text-secondary);
    font-weight: 500;
}

.navbar-nav {
    display: flex;
    gap: 0.15rem;
}

.nav-link {
    color: var(--color-text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.nav-link:hover {
    background: var(--color-bg);
    color: var(--color-text-primary);
}

.nav-link.active {
    background: var(--color-primary-light);
    color: var(--color-primary);
    font-weight: 600;
}

/* ── Nav dropdown ────────────────────────────────────────────────────────── */
.nav-dropdown-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
    font-family: inherit;
    font-weight: 500;
    color: var(--color-text-secondary);
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.nav-dropdown-btn:hover {
    background: var(--color-bg);
    color: var(--color-text-primary);
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    background: var(--color-surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 160px;
    z-index: 300;
    padding: 0.35rem;
    border: 1px solid var(--color-border);
}

.nav-dropdown:hover .nav-dropdown-menu {
    display: block;
}

.nav-dropdown-item {
    display: block;
    padding: 0.45rem 0.75rem;
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.nav-dropdown-item:hover {
    background: var(--color-bg);
    color: var(--color-text-primary);
}

/* ── Page layout ─────────────────────────────────────────────────────────── */
.page {
    padding: 2rem;
    max-width: 1600px;
    width: 100%;
    margin: 0 auto;
    flex: 1;
    box-sizing: border-box;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.75rem;
}

.page-header h2 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--color-text-primary);
    letter-spacing: -0.02em;
    padding-left: 0.75rem;
    position: relative;
}

.page-header h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--gradient-brand);
    border-radius: 2px;
}

.page-header-actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

/* ── Cards ───────────────────────────────────────────────────────────────── */
.project-card,
.detail-card,
.calc-section,
.beams-section,
.results-card,
.dashboard-section,
.table-card,
.form-card,
.stat-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-md);
}

/* Project cards */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
}

.project-card {
    padding: 1.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    transition: box-shadow var(--transition), border-color var(--transition), transform var(--transition);
}

.project-card:hover {
    box-shadow: var(--shadow-lg);
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

.project-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.project-card h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-text-primary);
    letter-spacing: -0.01em;
}

.project-card-meta {
    font-size: 0.83rem;
    color: var(--color-text-secondary);
}

.project-card-footer {
    margin-top: 0.5rem;
}

/* Status badges */
.status-badge {
    font-size: 0.72rem;
    padding: 0.2rem 0.65rem;
    border-radius: var(--radius-pill);
    font-weight: 600;
    text-transform: capitalize;
    letter-spacing: 0.01em;
}

.status-active {
    background: var(--color-success-light);
    color: var(--color-success);
}

.status-complete {
    background: var(--color-primary-light);
    color: var(--color-primary);
}

.status-on-hold {
    background: var(--color-warning-light);
    color: var(--color-warning);
}

.status-waiting {
    background: var(--color-purple-light);
    color: var(--color-purple);
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--color-text-muted);
}

.empty-state p {
    margin-bottom: 1rem;
}

/* ── Form cards ──────────────────────────────────────────────────────────── */
.form-card {
    padding: 2rem;
    max-width: 700px;
}

.form-card--full {
    max-width: none;
    overflow-x: auto;
}

.form-card h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--color-border-light);
    letter-spacing: -0.01em;
}

.form-card-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.form-card-title:hover {
    color: var(--color-primary);
}

.form-card--collapsed {
    padding: 0.6rem 1.25rem;
}

.form-card--collapsed .form-card-title {
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
}

.form-card-chevron {
    font-size: 0.65rem;
    color: var(--color-text-secondary);
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.form-card-title:hover .form-card-chevron {
    color: var(--color-primary);
}

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

/* ── Detail / info cards ─────────────────────────────────────────────────── */
.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1.75rem;
}

.detail-card {
    padding: 1.4rem;
}

.detail-card h3 {
    font-size: 0.875rem;
    color: var(--color-text-primary);
    margin-bottom: 1rem;
    padding-bottom: 0.65rem;
    border-bottom: 1px solid var(--color-border-light);
    font-weight: 700;
    letter-spacing: -0.01em;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0;
    font-size: 0.855rem;
    border-bottom: 1px solid var(--color-border-light);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-label {
    color: var(--color-text-muted);
}

.detail-value {
    color: var(--color-text-primary);
    font-weight: 500;
}

/* ── Inline pill group (Status / Stage / Date / Updated on one line) ────── */
.detail-inline-group {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: flex-start;
}

.detail-inline-item {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    flex: 1;
    min-width: 0;
}

.detail-inline-item .detail-label {
    font-size: 0.75rem;
}

/* ── Map ─────────────────────────────────────────────────────────────────── */
.map-card {
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    grid-row: span 2;
}

.detail-status-card {
    grid-column: span 2;
}

.detail-status-card .status-badge {
    font-size: 0.855rem;
    padding: 0.25rem 0.85rem;
}

#project-map {
    flex: 1;
    min-height: 180px;
    width: 100%;
    border-radius: var(--radius-md);
}

.leaflet-top,
.leaflet-bottom {
    z-index: 400;
}

.map-no-location {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    margin: 0;
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

/* ── Static map image (project-detail) ───────────────────────────────────────
   The project-detail map is a single HERE Map Image (one request per view), not
   an interactive tiled map. It shows a Standard/Satellite toggle + a centred pin
   and links through to the interactive overview map (/projects/map). */
#project-map.map-static {
    position: relative;
    flex: 1;
    overflow: hidden;
    cursor: pointer;
}
.map-static-link {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 180px;
}
.map-static-img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 180px;
    object-fit: cover;
}
/* Pin centred on the image — the image is centred on the project's exact
   coordinates, so the fixed centre marks the location precisely. */
.map-static-pin {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 14px;
    height: 14px;
    margin: -7px 0 0 -7px;
    border-radius: 50%;
    background: var(--color-primary);
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
    pointer-events: none;
}
.map-style-toggle {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}
.map-style-btn {
    border: none;
    padding: 0.3rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.92);
    color: var(--color-text-secondary);
    cursor: pointer;
}
.map-style-btn + .map-style-btn {
    border-left: 1px solid var(--color-border);
}
.map-style-btn.active {
    background: var(--color-primary);
    color: #fff;
}
#project-map.map-static-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 180px;
}
#project-map.map-static-fallback .map-static-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    color: var(--color-primary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
}

/* ── Calculator tabs ─────────────────────────────────────────────────────── */
.calc-section {
    padding: 1.5rem;
}

.calc-tabs {
    margin-bottom: 1.5rem;
}

.calc-tabs .tab {
    flex: 0 0 auto;
    padding: 0.5rem 1.25rem;
}

.tab-panel.hidden {
    display: none;
}

.tab-count {
    display: inline-block;
    min-width: 1.25rem;
    padding: 0 0.35rem;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.35rem;
    background: #e5e7eb;
    color: #374151;
    border-radius: 9999px;
    text-align: center;
    margin-left: 0.35rem;
    vertical-align: middle;
}

.tab.active .tab-count {
    background: var(--color-primary-light);
    color: var(--color-primary);
}

/* ── Beams table section ─────────────────────────────────────────────────── */
.beams-section {
    padding: 1.5rem;
}

.beams-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.7rem;
    border-bottom: 1px solid var(--color-border-light);
}

.beams-section-header h3 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--color-text-primary);
    letter-spacing: -0.01em;
}

/* ── Floating bulk-selection toolbar ────────────────────────────────────── */
.bulk-selection-bar {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #1e293b;
    color: #f8fafc;
    border-radius: 10px;
    padding: 0.6rem 1rem;
    box-shadow: 0 4px 24px rgba(0,0,0,0.28);
    z-index: 500;
    white-space: nowrap;
    font-size: 0.875rem;
}
.bulk-bar-count {
    font-weight: 600;
    color: #94a3b8;
    min-width: 6rem;
}
.bulk-bar-divider {
    width: 1px;
    height: 1.25rem;
    background: #334155;
    flex-shrink: 0;
}
.bulk-bar-select {
    font-size: 0.82rem;
    padding: 0.25rem 0.5rem;
    border: 1px solid #475569;
    border-radius: 6px;
    background: #0f172a;
    color: #f8fafc;
    cursor: pointer;
}
.bulk-bar-btn {
    font-size: 0.82rem;
    padding: 0.25rem 0.75rem;
    background: #10BCB6;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
}
.bulk-bar-btn:hover { background: #0DA197; }
.bulk-bar-btn-danger {
    font-size: 0.82rem;
    padding: 0.25rem 0.75rem;
    background: #dc2626;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
}
.bulk-bar-btn-danger:hover { background: #b91c1c; }
.bulk-bar-btn-ghost {
    font-size: 0.82rem;
    padding: 0.25rem 0.5rem;
    background: transparent;
    color: #94a3b8;
    border: none;
    cursor: pointer;
}
.bulk-bar-btn-ghost:hover { color: #f8fafc; }

/* ── Beams/Columns table column widths ───────────────────────────────────── */
table.beams-table {
    table-layout: fixed;
}
table.beams-table .col-beam-check   { width: 2rem; }
table.beams-table .col-beam-name    { width: 8rem; }
table.beams-table .col-beam-group   { width: 7rem; }
table.beams-table .col-beam-type    { width: 7rem; }
table.beams-table .col-beam-grade   { width: 6rem; }
table.beams-table .col-beam-size    { width: 5.5rem; }
table.beams-table .col-beam-lam     { width: 5.5rem; }
table.beams-table .col-beam-length  { width: 5.5rem; }
table.beams-table .col-beam-ratio   { width: 4.5rem; }
table.beams-table .col-beam-status  { width: 5.5rem; }
table.beams-table .col-beam-actions { width: 3rem; }
table.beams-table td.action-cell    { white-space: nowrap; }
table.beams-table tr.row-selected td { background: var(--color-primary-light); }

/* ── Tables ──────────────────────────────────────────────────────────────── */
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

th {
    text-align: left;
    padding: 0.6rem 0.75rem;
    color: var(--color-text-muted);
    font-weight: 600;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--color-border);
}

td {
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid var(--color-border-light);
    color: var(--color-text-primary);
}

tr:last-child td {
    border-bottom: none;
}

tr:hover td {
    background: var(--color-bg);
    cursor: pointer;
}

/* ── Beam layout ─────────────────────────────────────────────────────────── */
.beam-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: start;
}

/* ── Results panel ───────────────────────────────────────────────────────── */
.results-card {
    padding: 1.5rem;
    position: sticky;
    top: 1.5rem;
}

.results-card h3 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: 1rem;
    padding-bottom: 0.7rem;
    border-bottom: 1px solid var(--color-border-light);
    letter-spacing: -0.01em;
}

.result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--color-border-light);
    font-size: 0.855rem;
}

.result-row:last-child {
    border-bottom: none;
}

.result-label {
    color: var(--color-text-secondary);
}

.result-value {
    font-weight: 600;
    color: var(--color-text-primary);
}

.pass-badge {
    font-size: 0.72rem;
    padding: 0.2rem 0.65rem;
    border-radius: var(--radius-pill);
    font-weight: 700;
}

.pass {
    background: var(--color-success-light);
    color: var(--color-success);
}

.fail {
    background: var(--color-danger-light);
    color: var(--color-danger);
}

.pass-badge.warning {
    background: var(--color-warning-light);
    color: var(--color-warning);
}

.overall-result {
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    text-align: center;
    font-weight: 700;
    font-size: 0.9rem;
}

.overall-pass {
    background: var(--color-success-light);
    color: var(--color-success);
    border: 1px solid var(--color-success-border);
}

.overall-fail {
    background: var(--color-danger-light);
    color: var(--color-danger);
    border: 1px solid var(--color-danger-border);
}

.overall-warning {
    background: var(--color-warning-light);
    color: var(--color-warning);
    border: 1px solid var(--color-warning-border);
    margin-top: 1rem;
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    text-align: center;
    font-weight: 700;
    font-size: 0.9rem;
}

.results-placeholder {
    text-align: center;
    padding: 2rem;
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

.section-properties {
    background: var(--color-bg);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    margin-bottom: 1rem;
    font-size: 0.8rem;
    display: flex;
    gap: 1rem;
    justify-content: space-around;
}

.section-prop {
    text-align: center;
}

.section-prop-value {
    font-weight: 700;
    color: var(--color-text-primary);
    font-size: 0.9rem;
}

.section-prop-label {
    color: var(--color-text-muted);
    font-size: 0.72rem;
}

/* ── Footer ──────────────────────────────────────────────────────────────── */
.footer {
    background: var(--color-surface);
    border-top: 1px solid var(--color-border);
    box-shadow: 0 -1px 3px rgba(0,0,0,0.04), 0 -1px 2px rgba(0,0,0,0.03);
    color: var(--color-text-muted);
    padding: 0.85rem 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.8rem;
    margin-top: auto;
}

.footer-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-legal {
    font-size: 0.72rem;
    color: var(--color-text-muted);
    border-top: 1px solid var(--color-border-light);
    padding-top: 0.5rem;
    line-height: 1.5;
}

/* ── Stats cards ─────────────────────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    padding: 1.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    border-left: 3px solid var(--color-border);
}

.stat-card-label {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.stat-card-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-text-primary);
    line-height: 1;
    letter-spacing: -0.03em;
}

.stat-card-sub {
    font-size: 0.78rem;
    color: var(--color-text-muted);
}

.stat-card.stat-overdue .stat-card-value { color: var(--color-danger); }
.stat-card.stat-active  .stat-card-value { color: var(--color-success); }

.stat-card.stat-active  { border-left-color: var(--color-success); }
.stat-card.stat-overdue { border-left-color: var(--color-danger); }
.stat-card.stat-primary { border-left-color: var(--color-primary); }
.stat-card.stat-complete{ border-left-color: var(--color-purple); }

/* Position-based fallbacks — work regardless of cached HTML */
.stats-grid .stat-card:nth-child(1) { border-left-color: var(--color-primary); }
.stats-grid .stat-card:nth-child(4) { border-left-color: var(--color-purple); }

/* ── Dashboard ───────────────────────────────────────────────────────────── */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    width: 100%;
}

.dashboard-section {
    padding: 1.4rem;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.7rem;
    border-bottom: 1px solid var(--color-border-light);
}

.section-header h3 {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--color-text-primary);
    letter-spacing: -0.01em;
}

.section-link {
    font-size: 0.83rem;
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
}

.section-link:hover {
    text-decoration: underline;
}

.dashboard-project-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--color-border-light);
    font-size: 0.855rem;
    cursor: pointer;
    transition: background var(--transition);
    border-radius: var(--radius-sm);
    margin: 0 -0.25rem;
    padding-left: 0.25rem;
    padding-right: 0.25rem;
}

.dashboard-project-row:last-child {
    border-bottom: none;
}

.dashboard-project-row:hover {
    background: var(--color-bg);
}

.dashboard-project-ref {
    font-weight: 600;
    color: var(--color-text-primary);
}

.dashboard-project-client {
    color: var(--color-text-secondary);
    font-size: 0.78rem;
}

.overdue-date {
    color: var(--color-danger);
    font-size: 0.78rem;
    font-weight: 600;
}

/* ── To-Do rows (shared: dashboard + project-detail) ────────────────────── */
.wb-todo-row {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.65rem 0;
    border-bottom: 1px solid var(--color-border-light);
    transition: background var(--transition);
}
.wb-todo-row:last-child { border-bottom: none; }
.wb-todo-row:hover { background: var(--color-bg); }

.wb-todo-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.wb-todo-title {
    flex: 1;
    font-size: 0.855rem;
    color: var(--color-text-primary);
    font-weight: 500;
    line-height: 1.4;
    word-break: break-word;
}

.wb-todo-desc {
    font-size: 0.76rem;
    color: var(--color-text-secondary);
    line-height: 1.35;
    white-space: pre-wrap;
    word-break: break-word;
}

.wb-todo-completed .wb-todo-title {
    text-decoration: line-through;
    color: var(--color-text-muted);
}

.wb-todo-completed .wb-todo-desc {
    color: var(--color-text-muted);
}

.wb-todo-deadline {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    white-space: nowrap;
    padding-top: 1px;
    font-variant-numeric: tabular-nums;
}

.wb-todo-deadline-overdue {
    color: var(--color-danger);
    font-weight: 600;
}

.wb-todo-badge {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-pill);
    background: var(--color-primary-light);
    color: var(--color-primary);
    white-space: nowrap;
    letter-spacing: 0.01em;
}

.wb-todo-empty {
    padding: 1.4rem 1.1rem;
    font-size: 0.82rem;
    color: var(--color-text-muted);
    text-align: center;
}

/* ── Table card & toolbar ────────────────────────────────────────────────── */
.table-card {
    padding: 1.5rem;
    width: 100%;
}

.table-toolbar {
    margin-bottom: 1rem;
    display: flex;
    gap: 1rem;
    align-items: center;
}

.search-input {
    padding: 0.55rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-family: inherit;
    width: 320px;
    background: var(--color-surface);
    color: var(--color-text-primary);
    transition: border-color var(--transition), box-shadow var(--transition);
}

.search-input::placeholder {
    color: var(--color-text-muted);
}

.search-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-ring);
}

/* ── Sortable headers ────────────────────────────────────────────────────── */
.sortable {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.sortable:hover {
    color: var(--color-primary);
}

.sortable.sort-asc .sort-icon::after  { content: ' ↑'; }
.sortable.sort-desc .sort-icon::after { content: ' ↓'; }
.sort-icon { color: #cbd5e1; font-size: 0.72rem; }
.sortable.sort-asc .sort-icon,
.sortable.sort-desc .sort-icon { color: var(--color-primary); }

/* ── Overdue indicator ───────────────────────────────────────────────────── */
.overdue-indicator {
    display: inline-block;
    background: var(--color-danger);
    color: white;
    font-size: 0.62rem;
    font-weight: 700;
    padding: 0.12rem 0.45rem;
    border-radius: var(--radius-pill);
    margin-left: 0.5rem;
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* ── Status text variants ────────────────────────────────────────────────── */
.status-display {
    font-weight: 700;
    font-size: 1rem;
}

.status-text-active   { color: var(--color-success); }
.status-text-on-hold  { color: var(--color-warning); }
.status-text-complete { color: var(--color-primary); }
.status-text-waiting  { color: var(--color-purple); }

/* ── Construction stage badges ───────────────────────────────────────────── */
.stage-quotation {
    background: var(--color-border-light);
    color: var(--color-text-secondary);
}
.stage-design {
    background: var(--color-primary-light);
    color: var(--color-primary);
}
.stage-preliminary {
    background: var(--color-purple-light);
    color: var(--color-purple);
}
.stage-construction-certification {
    background: var(--color-warning-light);
    color: var(--color-warning);
}
.stage-construction {
    background: var(--color-success-light);
    color: var(--color-success);
}
.stage-complete {
    background: #f0fdfa;
    color: #0d9488;
}
@media (prefers-color-scheme: dark) {
    .stage-complete { background: #042f2e; color: #2dd4bf; }
}

/* ── Stage chip dots ─────────────────────────────────────────────────────── */
.pa-dot-stage-quotation                  { background: var(--color-text-muted); }
.pa-dot-stage-design                     { background: var(--color-primary); }
.pa-dot-stage-preliminary                { background: var(--color-purple); }
.pa-dot-stage-construction-certification { background: var(--color-warning); }
.pa-dot-stage-construction               { background: var(--color-success); }
.pa-dot-stage-complete                   { background: #0d9488; }

/* ── Design check colour utilities ───────────────────────────────────────── */
.ratio-pass    { color: var(--color-success); font-weight: 600; }
.ratio-warning { color: var(--color-warning); font-weight: 600; }
.ratio-fail    { color: var(--color-danger);  font-weight: 600; }

.check-pass    { color: var(--color-success); font-weight: 700; }
.check-fail    { color: var(--color-danger);  font-weight: 700; }
.check-warning { color: var(--color-warning); font-weight: 700; }

/* ── Deadline badges ─────────────────────────────────────────────────────── */
.deadline-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--color-border-light);
    font-size: 0.855rem;
    cursor: pointer;
    transition: background var(--transition);
    border-radius: var(--radius-sm);
    margin: 0 -0.25rem;
    padding-left: 0.25rem;
    padding-right: 0.25rem;
}

.deadline-row:last-child { border-bottom: none; }

.deadline-row:hover { background: var(--color-bg); }

.deadline-days {
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.2rem 0.65rem;
    border-radius: var(--radius-pill);
}

.deadline-soon   { background: var(--color-warning-light); color: var(--color-warning); }
.deadline-urgent { background: var(--color-danger-light);  color: var(--color-danger); }
.deadline-ok     { background: var(--color-success-light); color: var(--color-success); }

/* ── Admin tabs ──────────────────────────────────────────────────────────── */
.admin-tabs {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--color-border);
}

.admin-tab {
    padding: 0.55rem 1.2rem;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    cursor: pointer;
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--color-text-muted);
    font-weight: 600;
    transition: all var(--transition);
}

.admin-tab.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

.admin-tab:hover {
    color: var(--color-text-primary);
}

/* ── Checkbox grid ───────────────────────────────────────────────────────── */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--color-bg);
    border-radius: var(--radius-sm);
    border: 1px solid var(--color-border);
    max-height: 200px;
    overflow-y: auto;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.855rem;
    color: var(--color-text-primary);
}

.checkbox-item input[type="checkbox"] {
    width: auto;
    cursor: pointer;
}

/* ── Sizes layout ────────────────────────────────────────────────────────── */
.sizes-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    align-items: start;
}

/* ── DSM input tables ────────────────────────────────────────────────────── */
.dsm-subsection {
    margin-bottom: 1.25rem;
}

.dsm-subsection-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.4rem;
}

.dsm-subsection-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-text-primary);
}

.dsm-sign-hint {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    font-weight: 400;
    margin-left: 0.25rem;
}

.btn-add-row {
    font-size: 0.78rem;
    padding: 0.22rem 0.65rem;
    border: 1px solid var(--color-primary);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--color-primary);
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition), color var(--transition);
}

.btn-add-row:hover {
    background: var(--color-primary);
    color: white;
}

.dsm-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.dsm-table thead tr {
    background: var(--color-bg);
}

.dsm-table th {
    text-align: left;
    padding: 0.35rem 0.5rem;
    font-size: 0.73rem;
    font-weight: 600;
    color: var(--color-text-muted);
    border-bottom: 1px solid var(--color-border);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.dsm-table td {
    padding: 0.3rem 0.4rem;
    border-bottom: 1px solid var(--color-border-light);
    vertical-align: middle;
}

.dsm-input, .dsm-name {
    width: 100%;
    padding: 0.3rem 0.4rem;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-size: 0.85rem;
    font-family: inherit;
    box-sizing: border-box;
    background: var(--color-surface);
    color: var(--color-text-primary);
}

.dsm-input:focus, .dsm-name:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px var(--color-primary-ring);
}

.dsm-select {
    width: 100%;
    min-width: 4.5rem;
    padding: 0.3rem 0.4rem;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-size: 0.85rem;
    font-family: inherit;
    background: var(--color-surface);
    color: var(--color-text-primary);
}

.dsm-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px var(--color-primary-ring);
}

.btn-remove-row {
    background: none;
    border: none;
    color: #ef4444;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0 0.3rem;
    line-height: 1;
    transition: color var(--transition);
}

.btn-remove-row:hover {
    color: #b91c1c;
}

/* ── DSM results ─────────────────────────────────────────────────────────── */
.dsm-results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    margin-top: 0.4rem;
}

.dsm-results-table th {
    text-align: right;
    padding: 0.3rem 0.4rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--color-text-muted);
    border-bottom: 1px solid var(--color-border);
    background: var(--color-bg);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.dsm-results-table th:first-child,
.dsm-results-table td:first-child {
    text-align: left;
}

.dsm-results-table td {
    text-align: right;
    padding: 0.28rem 0.4rem;
    border-bottom: 1px solid var(--color-border-light);
    color: var(--color-text-secondary);
    font-variant-numeric: tabular-nums;
}

.dsm-value-down { color: var(--color-danger); }
.dsm-value-up   { color: var(--color-success); }

.dsm-note {
    font-size: 0.72rem;
    color: var(--color-text-muted);
    margin-top: 0.75rem;
    font-style: italic;
}

/* ── Admin table ─────────────────────────────────────────────────────────── */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

.admin-table th {
    text-align: left;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--color-border);
}

.admin-table td {
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid var(--color-border-light);
    vertical-align: middle;
}

.admin-table tr:last-child td {
    border-bottom: none;
}

.admin-table tr:hover td {
    background: var(--color-bg);
}

/* ── Generic badge ───────────────────────────────────────────────────────── */
.badge {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.15rem 0.55rem;
    border-radius: var(--radius-pill);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.badge-uls     { background: var(--color-primary-light); color: var(--color-primary); }
.badge-sls     { background: var(--color-success-light); color: var(--color-success); }
.badge-active  { background: var(--color-success-light); color: var(--color-success); }
.badge-inactive{ background: var(--color-bg); color: var(--color-text-muted); border: 1px solid var(--color-border); }
.badge-other   { background: var(--color-purple-light); color: var(--color-purple); }
.badge-featured{ background: var(--color-warning-light); color: var(--color-warning); }

/* ── Section title rows ──────────────────────────────────────────────────── */
.section-title-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 1rem 0 0.6rem;
}

.section-title-text {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--color-text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.section-title-rule {
    flex: 1;
    height: 1px;
    background: var(--color-border);
}

/* ── Limit-state badges ──────────────────────────────────────────────────── */
.ls-badge {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    padding: 0.2rem 0.65rem;
    border-radius: var(--radius-pill);
    flex-shrink: 0;
}

.ls-uls {
    background: var(--color-primary-light);
    color: var(--color-primary);
    border: 1px solid var(--color-primary-ring);
}

.ls-sls {
    background: var(--color-success-light);
    color: var(--color-success);
    border: 1px solid var(--color-success-border);
}

/* ── Activate / deactivate row buttons ───────────────────────────────────── */
.btn-activate-row,
.btn-deactivate-row {
    font-size: 0.75rem;
    font-family: inherit;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    border: 1px solid var(--color-border);
    cursor: pointer;
    transition: all var(--transition);
}

.btn-activate-row {
    background: var(--color-success-light);
    color: var(--color-success);
    border-color: var(--color-success-border);
}

.btn-activate-row:hover {
    background: #dcfce7;
}

.btn-deactivate-row {
    background: var(--color-surface);
    color: var(--color-text-secondary);
}

.btn-deactivate-row:hover {
    background: var(--color-bg);
}

/* ── Error pages ─────────────────────────────────────────────────────────── */
.error-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-bg);
    padding: 2rem;
}

.error-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 3rem 2.5rem;
    text-align: center;
    max-width: 460px;
    width: 100%;
    box-shadow: var(--shadow-xl);
}

.error-code {
    font-size: 5rem;
    font-weight: 800;
    color: var(--color-text-primary);
    line-height: 1;
    margin-bottom: 0.5rem;
    letter-spacing: -0.04em;
}

.error-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 0.75rem;
    letter-spacing: -0.01em;
}

.error-message {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    line-height: 1.6;
    margin-bottom: 2rem;
}

.error-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ── Navbar user dropdown ────────────────────────────────────────────────── */
.nav-user-dropdown {
    position: relative;
}

.nav-user-btn {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: none;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.875rem;
    font-family: inherit;
    font-weight: 500;
    color: var(--color-text-secondary);
    padding: 0.3rem 0.75rem;
    transition: all var(--transition);
    white-space: nowrap;
}

.nav-user-btn:hover {
    background: var(--color-bg);
    color: var(--color-text-primary);
    border-color: #cbd5e1;
}

.nav-user-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: var(--color-surface);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    min-width: 180px;
    z-index: 300;
    padding: 0.35rem;
    border: 1px solid var(--color-border);
}

.nav-user-dropdown.open .nav-user-menu {
    display: block;
}

.nav-dropdown-divider {
    height: 1px;
    background: var(--color-border);
    margin: 0.25rem 0;
}

.nav-dropdown-item-btn {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    color: var(--color-danger);
}

.nav-dropdown-item-btn:hover {
    background: var(--color-danger-light);
    color: var(--color-danger);
}

/* ── Settings page ───────────────────────────────────────────────────────── */
.settings-layout {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 680px;
}

.settings-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem 1.5rem;
    padding: 1rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border-light);
    border-radius: var(--radius-sm);
    margin-bottom: 1.25rem;
}

.settings-info-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.2rem;
}

.settings-info-value {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text-primary);
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
}

.settings-row + .settings-row {
    border-top: 1px solid var(--color-border-light);
}

.settings-row-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 0.15rem;
}

.settings-row-desc {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

/* ── Toggle switch ───────────────────────────────────────────────────────── */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    flex-shrink: 0;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--color-border);
    border-radius: 24px;
    transition: background var(--transition);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: transform var(--transition);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--color-primary);
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(20px);
}

.toggle-switch input:focus-visible + .toggle-slider {
    box-shadow: 0 0 0 3px var(--color-primary-ring);
}

/* ── Footer links ─────────────────────────────────────────────────────────── */
.footer-links {
    display: flex;
    align-items: center;
    gap: 0;
}

.footer a,
.footer-links a {
    color: var(--color-text-muted);
    text-decoration: none;
    transition: color var(--transition);
}

.footer a:hover,
.footer-links a:hover {
    color: var(--color-text-secondary);
}

.footer-sep {
    margin: 0 0.5rem;
}

/* ── Registration checkbox ────────────────────────────────────────────────── */
.terms-check {
    margin-top: 0.25rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.875rem;
    font-weight: 400;
    letter-spacing: normal;
    margin-bottom: 0;
    color: var(--color-text-secondary);
    cursor: pointer;
    line-height: 1.5;
}

.checkbox-label input[type="checkbox"] {
    flex-shrink: 0;
    cursor: pointer;
}

.checkbox-label a {
    color: var(--color-primary);
    text-decoration: none;
}

.checkbox-label a:hover {
    text-decoration: underline;
}

/* ── Legal pages (Terms / Privacy) ───────────────────────────────────────── */
.legal-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--color-bg);
}

.legal-header {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
}

.legal-header .brand {
    font-weight: 700;
    color: var(--color-primary);
    text-decoration: none;
    font-size: 1.05rem;
}

.legal-header .back-link {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    text-decoration: none;
    margin-left: auto;
}

.legal-header .back-link:hover {
    color: var(--color-text-primary);
}

.legal-content {
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    padding: 3rem 2rem 1.5rem;
    flex: 1;
}

.legal-content h1 {
    font-size: 1.9rem;
    font-weight: 700;
    color: var(--color-text-primary);
    margin-bottom: 0.4rem;
}

.legal-meta {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--color-border);
}

.legal-body {
    color: var(--color-text-secondary);
    line-height: 1.8;
}

.legal-body h2 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-top: 2rem;
    margin-bottom: 0.5rem;
}

.legal-body p,
.legal-body li {
    margin-bottom: 0.85rem;
}

.legal-body ul,
.legal-body ol {
    padding-left: 1.5rem;
}

.legal-accept {
    max-width: 800px;
    width: 100%;
    margin: 0 auto 3rem;
    padding: 0 2rem;
}

.legal-accept-panel {
    background: var(--color-primary-light);
    border: 1px solid var(--color-primary);
    border-radius: var(--radius-md);
    padding: 1.5rem;
}

.legal-accept-panel h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-text-primary);
    margin-bottom: 1rem;
}

.legal-accept-check {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    cursor: pointer;
    line-height: 1.5;
}

.legal-accept-check input[type="checkbox"] {
    margin-top: 2px;
    flex-shrink: 0;
    cursor: pointer;
}

.legal-accept-check a {
    color: var(--color-primary);
    text-decoration: none;
}

.legal-accept-check a:hover {
    text-decoration: underline;
}

.legal-accepted-panel {
    background: var(--color-success-light);
    border: 1px solid var(--color-success-border);
    border-radius: var(--radius-md);
    padding: 1.1rem 1.5rem;
    color: var(--color-success);
    font-size: 0.9rem;
}

/* ── Terms acceptance gate ────────────────────────────────────────────────── */
.terms-gate-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.terms-gate-modal {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 2.25rem 2.5rem;
    max-width: 520px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.terms-gate-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--color-text-primary);
    margin: 0 0 0.75rem;
}

.terms-gate-body {
    font-size: 0.92rem;
    color: var(--color-text-secondary);
    margin: 0 0 1.25rem;
    line-height: 1.6;
}

.terms-gate-links {
    display: flex;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
    font-size: 0.88rem;
}

.terms-gate-links a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
}

.terms-gate-links a:hover {
    text-decoration: underline;
}

.terms-gate-check {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    font-size: 0.9rem;
    color: var(--color-text-primary);
    cursor: pointer;
    margin-bottom: 1.25rem;
    line-height: 1.5;
}

.terms-gate-check input[type="checkbox"] {
    margin-top: 0.15rem;
    flex-shrink: 0;
}

.terms-gate-error {
    font-size: 0.85rem;
    color: var(--color-danger, #dc2626);
    margin-bottom: 1rem;
}

.terms-gate-btn {
    width: 100%;
}

/* ── Global loading bar ───────────────────────────────────────────────────── */
#loading-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 10000;
    pointer-events: none;
    display: none;
    background: linear-gradient(90deg,
        var(--color-primary) 0%,
        #5EEAD4 50%,
        var(--color-primary) 100%);
    background-size: 200% 100%;
    animation: loading-shimmer 1.2s linear infinite;
}
#loading-bar.active { display: block; }
@keyframes loading-shimmer {
    0%   { background-position: 200% center; }
    100% { background-position: -200% center; }
}



/* ── Area Loads card + shared stack builder (spec 0006) ───────────────────── */
.area-loads-card .area-load-list { display:flex; flex-direction:column; gap:0.5rem; }
.area-load-item {
    display:flex; align-items:center; gap:0.9rem;
    padding:0.6rem 0.8rem; border:1px solid var(--color-border);
    border-radius:var(--radius-sm); background:var(--color-surface); cursor:pointer;
}
.area-load-item:hover { border-color:var(--color-primary); background:var(--color-primary-light); }
.area-load-item canvas { flex:0 0 auto; border:1px solid var(--color-border-light); border-radius:4px; }
.area-load-item .al-name { font-weight:600; color:var(--color-text-primary); }
.area-load-item .al-totals { font-size:0.8rem; color:var(--color-text-secondary); }
.area-load-item .al-actions { margin-left:auto; display:flex; gap:0.4rem; }

/* Modal shell */
.alb-modal {
    display:none; position:fixed; inset:0; z-index:1100;
    background:rgba(0,0,0,0.45); align-items:center; justify-content:center;
}
.alb-dialog {
    background:var(--color-surface); border-radius:var(--radius-lg);
    width:92%; max-width:900px; max-height:92vh; overflow-y:auto;
    box-shadow:0 8px 32px rgba(0,0,0,0.2); padding:1.5rem;
}
.alb-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:1rem; }
.alb-header h3 { margin:0; font-size:1.15rem; }
.alb-meta { display:flex; gap:1rem; margin-bottom:1rem; }
.alb-meta .form-group { flex:1; }
.alb-body { display:flex; gap:1.25rem; }
.alb-dead { flex:1 1 60%; min-width:0; }
.alb-diagram { flex:0 0 240px; }
.alb-section-title {
    display:flex; align-items:center; justify-content:space-between;
    font-size:0.8rem; font-weight:700; text-transform:uppercase; letter-spacing:0.04em;
    color:var(--color-text-secondary); margin-bottom:0.5rem;
}
.alb-total { font-size:0.95rem; font-weight:700; color:var(--color-primary); text-transform:none; letter-spacing:0; }
.alb-add-row { display:flex; gap:0.5rem; margin-bottom:0.6rem; }
.alb-add-row select { flex:1; padding:0.4rem 0.55rem; border:1px solid var(--color-border); border-radius:var(--radius-sm); }
.alb-layers { display:flex; flex-direction:column; gap:0.4rem; }
.alb-empty { color:var(--color-text-muted); font-size:0.85rem; padding:0.75rem 0; text-align:center; }
.alb-layer {
    display:flex; align-items:flex-end; gap:0.4rem; flex-wrap:wrap;
    padding:0.45rem 0.55rem; border:1px solid var(--color-border-light);
    border-radius:var(--radius-sm); background:var(--color-bg);
}
.alb-layer input, .alb-layer select { padding:0.3rem 0.45rem; border:1px solid var(--color-border); border-radius:4px; font-size:0.85rem; }
.alb-l-name { flex:1 1 120px; min-width:80px; }
.alb-l-thick, .alb-l-kpa { width:64px; }
.alb-l-color { width:34px; padding:0 !important; height:30px; }
.alb-l-pattern { width:110px; }
.alb-l-meta { font-size:0.75rem; color:var(--color-text-muted); align-self:center; }
.alb-field { display:flex; flex-direction:column; gap:0.15rem; }
.alb-field label { font-size:0.68rem; color:var(--color-text-muted); }
.alb-l-ctrls { display:flex; gap:0.2rem; margin-left:auto; align-self:center; }
.alb-icon-btn {
    border:1px solid var(--color-border); background:var(--color-surface);
    border-radius:4px; width:26px; height:26px; cursor:pointer; font-size:0.85rem; line-height:1;
}
.alb-icon-btn:hover { background:var(--color-border-light); }
.alb-icon-btn.alb-del { color:var(--color-danger); border-color:var(--color-danger-border); }
.alb-diagram canvas { display:block; width:100%; height:auto; border:1px solid var(--color-border); border-radius:var(--radius-sm); background:#fff; }
.alb-imposed { margin-top:1rem; }
.alb-imposed-row { display:flex; align-items:flex-end; gap:0.4rem; margin-bottom:0.35rem; }
.alb-imposed-row input { padding:0.3rem 0.45rem; border:1px solid var(--color-border); border-radius:4px; font-size:0.85rem; }
.alb-imposed-row input[type=text] { flex:1; }
.alb-footer { display:flex; justify-content:flex-end; gap:0.6rem; margin-top:1.25rem; }
@media (max-width:720px) {
    .alb-body { flex-direction:column; }
    .alb-diagram { flex-basis:auto; }
}

/* Inline mount — standalone /calculators/area-load scratch page (spec 0009).
   Renders the shared builder in-flow instead of as an overlay modal. */
.alb-modal.alb-inline {
    display:block; position:static; inset:auto; z-index:auto; background:none;
    align-items:initial; justify-content:initial;
}
.alb-modal.alb-inline .alb-dialog {
    width:auto; max-width:none; max-height:none; overflow:visible;
    box-shadow:none; padding:0;
}

/* ── Structory logo lockup (navbar / footer / headers) ────────────────────── */
.structory-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}
.structory-logo svg {
    width: 26px;
    height: 26px;
    flex-shrink: 0;
    /* document outline follows text colour so it inverts in dark mode;
       the teal accents stay fixed in the inline SVG. */
    color: var(--structory-navy);
}
[data-theme="dark"] .structory-logo svg { color: var(--structory-light-grey); }
.structory-logo-word {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: var(--gradient-brand);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Footer variant: lockup + tagline + version */
.footer-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
}
.footer-brand .structory-logo svg { width: 20px; height: 20px; }
.footer-brand .structory-logo-word { font-size: 0.9rem; }
.footer-tagline {
    color: var(--color-text-muted);
    font-size: 0.75rem;
}
.footer-version {
    color: var(--color-text-muted);
    font-size: 0.72rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-pill);
    padding: 0.05rem 0.5rem;
}
@media (max-width: 640px) {
    .footer-tagline { display: none; }
}

/* ── Structory report/UI components (brand Part B) ─────────────────────────
   Screen-only components — flexbox is fine here. Do NOT copy these into the
   WeasyPrint PDF templates; print CSS there must avoid flex/grid. */

/* Report section banner */
.report-banner {
    display: flex;
    align-items: stretch;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}
.report-banner-icon {
    background: var(--structory-navy);
    color: #fff;
    width: 64px;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
[data-theme="dark"] .report-banner-icon {
    background: var(--structory-slate);
}
.report-banner-icon svg { width: 26px; height: 26px; }
.report-banner-content {
    position: relative;
    flex: 1;
    padding: 0.9rem 1.25rem 0.9rem 1.5rem;
    /* faint structural line texture */
    background-image: repeating-linear-gradient(
        90deg, rgba(11,29,58,0.03) 0 1px, transparent 1px 22px);
}
.report-banner-content::before {
    content: "";
    position: absolute;
    left: 0; top: 0;
    width: 6px; height: 100%;
    background: var(--color-primary);
}
.report-banner-content h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-text-primary);
}
.report-banner-content p {
    margin: 0.15rem 0 0;
    font-size: 0.85rem;
    color: var(--color-text-secondary);
}

/* Divider / section strip (numbered — only where order carries meaning) */
.divider-strip {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 0.85rem 1.15rem;
}
.divider-strip-num {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-primary);
    font-variant-numeric: tabular-nums;
    min-width: 1.75rem;
}
.divider-strip-body { flex: 1; }
.divider-strip-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-text-primary);
}
.divider-strip-desc {
    font-size: 0.82rem;
    color: var(--color-text-secondary);
}
.divider-strip-action {
    color: var(--color-primary);
    display: inline-flex;
    align-items: center;
}

/* Callout cards (AI Insight / Recommendation / Information) */
.callout-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-left: 4px solid var(--color-primary);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    padding: 0.9rem 1.1rem;
}
.callout-card-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-primary);
    margin-bottom: 0.35rem;
}
.callout-card-label svg { width: 15px; height: 15px; }
.callout-card-body {
    font-size: 0.88rem;
    line-height: 1.55;
    color: var(--color-text-secondary);
}
.callout-card--recommendation {
    border-left-color: var(--structory-green);
}
.callout-card--recommendation .callout-card-label { color: var(--color-success); }
.callout-card--info {
    border-left-color: var(--structory-slate);
}
.callout-card--info .callout-card-label { color: var(--structory-slate); }
[data-theme="dark"] .callout-card--info { border-left-color: var(--color-text-muted); }
[data-theme="dark"] .callout-card--info .callout-card-label { color: var(--color-text-secondary); }

/* Status cards (design check / max deflection / total load) */
.status-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.6rem;
}
.status-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 0.9rem 1.1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}
.status-card-icon {
    width: 34px; height: 34px;
    border-radius: var(--radius-sm);
    background: var(--color-primary-light);
    color: var(--color-primary);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.status-card-icon svg { width: 18px; height: 18px; }
.status-card-body { flex: 1; min-width: 0; }
.status-card-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-muted);
}
.status-card-value {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--color-text-primary);
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}
.status-card-delta { font-size: 0.78rem; font-weight: 600; }
.status-card-delta.is-up   { color: var(--color-success); }
.status-card-delta.is-down { color: var(--color-danger); }

/* Outcome modifiers for the design-check card */
.status-card--pass .status-card-icon  { background: var(--color-success-light); color: var(--color-success); }
.status-card--pass .status-card-value { color: var(--color-success); }
.status-card--warn .status-card-icon  { background: var(--color-warning-light); color: var(--color-warning); }
.status-card--warn .status-card-value { color: var(--color-warning); }
.status-card--fail .status-card-icon  { background: var(--color-danger-light); color: var(--color-danger); }
.status-card--fail .status-card-value { color: var(--color-danger); }
