/* ── Khamo DEC design system (DEC palette: slate #36415A, deep green #123F36, teal #2A6B5C, sage #86A789, light green #B7D894) ───────────────────────────────────────────────────────────
   A copy of Khamo Commercial EPC's stylesheet (KhamoCert.Commercial.UI/wwwroot/css/khamo-commercial.css),
   so both products look the same: the KhamoCert forest-green brand. Keep the two in step.
   DEC-only additions are at the end. */

:root {
    --ink: #123F36;
    --forest: #2A6B5C;
    --jade: #86A789;
    --mint: #B7D894;
    --primary: #36415A;
    --sage: #86A789;
    --shell: #E8ECF1;
    --bg: #F4F6F8;
    --surface: #FFFFFF;
    --surface-2: #F7F9FA;
    --border: #D9DFE6;
    --border-strong: #BFC8D2;
    --text: #13221F;
    --muted: #5F716A;
    --faint: #8A9B94;
    --danger: #D14848;
    --danger-bg: #FCECEC;
    --warning: #B9871C;
    --warning-bg: #FBF3DF;
    --audit: #7A5BC4;
    --audit-bg: #F1ECFB;
    --info: #2F6FB0;
    --info-bg: #E8F1FA;
    --success: #2E8B57;
    --success-bg: #E6F4EC;

    /* EPC bands */
    --band-aplus: #00704A;
    --band-a: #008054;
    --band-b: #19B459;
    --band-c: #8DCE46;
    --band-d: #FFD500;
    --band-e: #FCAA65;
    --band-f: #EF8023;
    --band-g: #E9153B;

    --radius: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 2px rgba(9, 20, 19, .06);
    --shadow: 0 1px 3px rgba(9, 20, 19, .08), 0 4px 14px rgba(9, 20, 19, .05);
    --shadow-lg: 0 12px 40px rgba(9, 20, 19, .18);
    --font: "Outfit", "Segoe UI", system-ui, -apple-system, sans-serif;
    --mono: "Cascadia Code", "Consolas", monospace;
    --sidebar-w: 268px;
    --assistant-w: 330px;
    --topbar-h: 60px;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
    font-family: var(--font);
    font-size: 14.5px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}
a { color: var(--forest); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .5rem; font-weight: 600; line-height: 1.25; color: var(--ink); }
h1 { font-size: 1.55rem; }
/* Blazor focuses the page heading after navigation for screen readers; no visible box needed. */
h1:focus, h1:focus-visible { outline: none; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.02rem; }
h4 { font-size: .92rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
p { margin: 0 0 .75rem; }
small, .small { font-size: .85em; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono { font-family: var(--mono); font-size: .92em; }
.num { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }
.hidden { display: none !important; }

/* ── Shell ── */
.shell {
    display: grid;
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr) auto;
    grid-template-rows: var(--topbar-h) 1fr;
    grid-template-areas: "side top top" "side main assist";
    height: 100vh;
    overflow: hidden;
}
.shell.no-project { grid-template-columns: var(--sidebar-w) 1fr; grid-template-areas: "side top" "side main"; }

.sidebar {
    grid-area: side;
    background: var(--primary);
    color: #E3E7EE;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}
.brand {
    display: flex; align-items: center; gap: .65rem;
    padding: 1rem 1.1rem;
    height: var(--topbar-h);
    border-bottom: 1px solid rgba(255,255,255,.08);
}
.brand-mark {
    width: 34px; height: 34px; border-radius: 9px;
    background: linear-gradient(135deg, var(--mint), var(--jade));
    display: grid; place-items: center;
    color: var(--primary); font-weight: 700; font-size: 1rem;
}
.brand-name { font-weight: 600; font-size: .98rem; color: #fff; letter-spacing: .01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand > div:last-child { min-width: 0; }
.brand-sub { font-size: .72rem; color: var(--mint); opacity: .85; margin-top: -2px; }

/* The sidebar scrolls; without this its sections shrink below their content once the
   project steps no longer fit, and the progress bar ends up under the first step. */
.sidebar > * { flex-shrink: 0; }
.nav-section { padding: .9rem .7rem .3rem; }
.nav-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .09em; color: rgba(227, 231, 238,.55); padding: 0 .55rem .35rem; }
.nav-item {
    display: flex; align-items: center; gap: .65rem;
    padding: .5rem .6rem; margin-bottom: 2px;
    border-radius: var(--radius-sm);
    color: #E3E7EE; cursor: pointer; user-select: none;
    transition: background .12s;
}
.nav-item:hover { background: rgba(255,255,255,.07); text-decoration: none; color: #fff; }
.nav-item.active { background: rgba(183, 216, 148,.16); color: #fff; box-shadow: inset 3px 0 0 var(--mint); }
.nav-step {
    width: 22px; height: 22px; border-radius: 50%;
    display: inline-grid; place-items: center; flex: none;
    font-size: .72rem; font-weight: 600;
    background: rgba(255,255,255,.1); color: #E3E7EE;
}
.nav-item.done .nav-step { background: var(--jade); color: #fff; }
.nav-item .nav-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item .nav-count {
    font-size: .7rem; padding: 0 .4rem; border-radius: 99px; line-height: 1.5;
    background: rgba(209,72,72,.9); color: #fff;
}
.nav-item .nav-count.warn { background: rgba(212,168,67,.9); color: var(--ink); }
.nav-item .nav-count.muted { background: rgba(255,255,255,.12); color: #E3E7EE; }
/* Assessments tree under Projects: grouped by stage, like the zones tree. */
.nav-tree { margin: 0 0 .35rem 1.15rem; padding-left: .35rem; border-left: 1px dashed rgba(255,255,255,.16); }
.nav-tree-label { font-size: .63rem; text-transform: uppercase; letter-spacing: .08em; color: rgba(227, 231, 238,.5); padding: .5rem .5rem .2rem; }
.nav-tree-item { display: flex; align-items: center; gap: .45rem; padding: .3rem .5rem; border-radius: 6px; color: #E3E7EE; font-size: .85rem; text-decoration: none; min-width: 0; }
.nav-tree-item .nav-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-tree-item:hover { background: rgba(255,255,255,.07); color: #fff; text-decoration: none; }
.nav-tree-item.active { background: rgba(183, 216, 148,.16); color: #fff; box-shadow: inset 3px 0 0 var(--mint); font-weight: 500; }
.nav-tree-item.more { color: rgba(227, 231, 238,.6); font-size: .78rem; }
.nav-tree-item.stage { color: rgba(227, 231, 238,.8); }
.nav-tree-item .nav-count { font-size: .68rem; padding: 0 .4rem; border-radius: 99px; line-height: 1.5; }
.nav-tree-item .nav-count.muted { background: rgba(255,255,255,.12); color: #E3E7EE; }
.nav-tree-search { width: 100%; margin: .2rem 0 .3rem; padding: .32rem .55rem; border-radius: 6px; border: 1px solid rgba(255,255,255,.14);
    background: rgba(255,255,255,.06); color: #fff; font: inherit; font-size: .8rem; }
.nav-tree-search::placeholder { color: rgba(227, 231, 238,.45); }
.nav-tree-search:focus { outline: none; border-color: var(--mint); }
/* A lodged EPC: its input pages are locked with a disabled fieldset. */
.readonly-body { border: 0; padding: 0; margin: 0; min-width: 0; }
.readonly-body .input, .readonly-body select, .readonly-body textarea { background: var(--surface-2); color: var(--muted); }
.readonly-body button:disabled, .readonly-body label.btn { cursor: not-allowed; }
.readonly-body .segmented button:not(.on), .readonly-body .btn:disabled { opacity: .55; }
.readonly-banner { margin: 0 auto 1rem; max-width: 1200px; align-items: center; }
.band.mini { min-width: 1.45em; height: 1.35em; font-size: .66rem; border-radius: 4px; padding: 0 .3em; }
.sidebar-foot { margin-top: auto; padding: .9rem 1.1rem; font-size: .72rem; color: rgba(227, 231, 238,.55); border-top: 1px solid rgba(255,255,255,.08); }

.topbar {
    grid-area: top;
    display: flex; align-items: center; gap: .75rem;
    padding: 0 1.25rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    min-width: 0;
}
.topbar-title { display: flex; flex-direction: column; min-width: 0; }
.topbar-title .t1 { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-title .t2 { font-size: .78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-spacer { flex: 1; }
.save-state { font-size: .78rem; color: var(--muted); display: flex; align-items: center; gap: .35rem; white-space: nowrap; }
.save-state .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--success); }
.save-state.dirty .dot { background: var(--warning); }

.main { grid-area: main; overflow-y: auto; padding: 1.5rem 1.75rem 3rem; min-width: 0; }
.page { max-width: 1180px; margin: 0 auto; }
.page-wide { max-width: 1500px; }
.page-head { display: flex; align-items: flex-start; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.page-head .grow { flex: 1; min-width: 260px; }
.page-head p { color: var(--muted); margin: .2rem 0 0; max-width: 760px; }
.page-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }

/* ── Assistant panel ── */
.assistant {
    grid-area: assist;
    width: var(--assistant-w);
    background: var(--surface);
    border-left: 1px solid var(--border);
    overflow-y: auto;
    display: flex; flex-direction: column;
}
.assistant > * { flex-shrink: 0; }
.assistant-head { display: flex; align-items: center; gap: .5rem; padding: .85rem 1rem; border-bottom: 1px solid var(--border); font-weight: 600; color: var(--ink); }
.assistant-head .assistant-title { flex: 1; }
.assistant-toggle { width: 100%; background: none; border: 0; border-bottom: 1px solid var(--border); font: inherit; font-weight: 600; cursor: pointer; text-align: left; }
.assistant-toggle:hover { background: var(--surface-2); }
.assistant-body { padding: 1rem; display: flex; flex-direction: column; gap: 1rem; }
.steps-head { border-top: 1px solid var(--border); }
.assistant-tip { padding: 0 1rem 1rem; margin-top: auto; }
.assistant-tip:empty { display: none; }

/* The assessment's steps in the right-hand panel (light), or the left menu on narrow screens (dark). */
.steps-progress { padding: 0 .55rem .7rem; }
.steps-progress-text { margin-top: .3rem; color: rgba(227, 231, 238,.7); }
.steps-in-sidebar { display: none; }
.rail-steps { padding: .8rem .7rem .6rem; }
.rail-steps .steps-progress-text { color: var(--muted); }
/* Room between the progress bar and the first step, and between steps, so the highlight never touches. */
.rail-steps .steps-progress { padding-bottom: .9rem; margin-bottom: .5rem; border-bottom: 1px solid var(--border); }
.rail-steps .nav-item { margin-bottom: 3px; }
.rail-steps .progress { background: var(--surface-2); }
.rail-steps .progress > div { background: var(--jade); }
.rail-steps .nav-item { color: var(--text); }
.rail-steps .nav-item:hover { background: var(--surface-2); color: var(--ink); }
.rail-steps .nav-item.active { background: #eef4e6; color: var(--primary); box-shadow: inset 3px 0 0 var(--jade); font-weight: 500; }
.rail-steps .nav-step { background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); }
.rail-steps .nav-item.done .nav-step { background: var(--jade); color: #fff; border-color: var(--jade); }
.rail-steps .nav-item .icon { color: var(--muted); }
.rail-steps .nav-item.active .icon { color: var(--primary); }

/* ── Cards ── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: 1rem;
}
.card-head { display: flex; align-items: center; gap: .6rem; padding: .9rem 1.1rem; border-bottom: 1px solid var(--border); }
.card-head h3 { margin: 0; flex: 1; }
.card-head .sub { font-size: .8rem; color: var(--muted); font-weight: 400; }
.card-body { padding: 1.1rem; }
.card-body.tight { padding: .6rem .8rem; }
.card-foot { padding: .75rem 1.1rem; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); display: flex; gap: .5rem; justify-content: flex-end; }
.card.flat { box-shadow: none; }
.card.accent { border-top: 3px solid var(--jade); }
.card.clickable { cursor: pointer; transition: box-shadow .12s, transform .12s, border-color .12s; }
.card.clickable:hover { box-shadow: var(--shadow); border-color: var(--border-strong); transform: translateY(-1px); }

.grid { display: grid; gap: 1rem; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: .75rem; }
.split { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 1rem; align-items: start; }
/* Two panes that sit side by side when there is room and stack when there is not. */
.panes { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 1rem; align-items: start; }

/* ── Forms ── */
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .9rem 1rem; }
.form-grid .span-2 { grid-column: span 2; }
.form-grid .span-all { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.field-label { display: flex; align-items: center; gap: .35rem; font-size: .8rem; font-weight: 500; color: var(--muted); }
.field-label .req { color: var(--danger); }
.field-label .tip-btn { color: var(--faint); cursor: help; display: inline-flex; }
.field-label .tip-btn:hover { color: var(--jade); }
.field-hint { font-size: .75rem; color: var(--faint); }
.field-unit { font-size: .78rem; color: var(--faint); }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap .unit { position: absolute; right: .7rem; font-size: .78rem; color: var(--faint); pointer-events: none; }
.input-wrap .input.has-unit { padding-right: 3.6rem; }
.input-wrap .input.sm.has-unit { padding-right: 2.1rem; }
.input, select.input, textarea.input {
    width: 100%;
    font: inherit;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    padding: .5rem .7rem;
    min-height: 38px;
    transition: border-color .12s, box-shadow .12s;
}
.input:focus { outline: none; border-color: var(--jade); box-shadow: 0 0 0 3px rgba(42, 107, 92,.18); }
.input:disabled { background: var(--surface-2); color: var(--faint); }
.input.sm { min-height: 32px; padding: .3rem .5rem; font-size: .88rem; }
.field.has-error .input { border-color: var(--danger); }
.field.has-error .input:focus { box-shadow: 0 0 0 3px rgba(209,72,72,.15); }
.field.has-warning .input { border-color: var(--warning); }
.field-msg { font-size: .76rem; display: flex; gap: .3rem; align-items: flex-start; }
.field-msg.error { color: var(--danger); }
.field-msg.warning { color: var(--warning); }
.field-msg.audit { color: var(--audit); }
textarea.input { min-height: 80px; resize: vertical; }

.check { display: inline-flex; align-items: center; gap: .55rem; cursor: pointer; user-select: none; padding: .35rem 0; }
.check input { width: 17px; height: 17px; accent-color: var(--forest); margin: 0; }
.switch { position: relative; display: inline-flex; align-items: center; gap: .6rem; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; }
.switch .track { width: 36px; height: 20px; border-radius: 99px; background: var(--border-strong); position: relative; transition: background .15s; flex: none; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: left .15s; }
.switch input:checked + .track { background: var(--jade); }
.switch input:checked + .track::after { left: 18px; }
.switch input:focus-visible + .track { box-shadow: 0 0 0 3px rgba(42, 107, 92,.25); }

.segmented { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 3px; gap: 3px; flex-wrap: wrap; }
.segmented button { border: 0; background: transparent; font: inherit; font-size: .85rem; padding: .32rem .75rem; border-radius: 6px; cursor: pointer; color: var(--muted); }
.segmented button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); font-weight: 500; }

/* ── Buttons ── */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
    font: inherit; font-weight: 500; font-size: .9rem;
    padding: .5rem .95rem; min-height: 38px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
    background: var(--surface); color: var(--text);
    cursor: pointer; white-space: nowrap;
    transition: background .12s, border-color .12s, box-shadow .12s, transform .06s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--forest); border-color: var(--forest); color: #fff; }
.btn.primary:hover { background: var(--primary); }
.btn.accent { background: var(--mint); border-color: var(--mint); color: var(--primary); }
.btn.accent:hover { background: #a5cb7c; }
.btn.danger { color: var(--danger); border-color: #ebc2c2; }
.btn.danger:hover { background: var(--danger-bg); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { min-height: 30px; padding: .25rem .6rem; font-size: .82rem; }
.btn.icon { padding: .4rem; min-width: 34px; }
.btn.lg { min-height: 46px; padding: .7rem 1.3rem; font-size: 1rem; }
.btn.block { width: 100%; }

/* ── Chips & badges ── */
.chip { display: inline-flex; align-items: center; gap: .3rem; font-size: .75rem; font-weight: 500; padding: .12rem .55rem; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); color: var(--muted); white-space: nowrap; }
.chip.green { background: var(--success-bg); border-color: #bfe3cc; color: #1f6b41; }
.chip.red { background: var(--danger-bg); border-color: #f0c4c4; color: #a63232; }
.chip.amber { background: var(--warning-bg); border-color: #efd99c; color: #8a6312; }
.chip.purple { background: var(--audit-bg); border-color: #d8ccf3; color: #5b3fa3; }
.chip.blue { background: var(--info-bg); border-color: #c5daf0; color: #245a91; }
.chip.dark { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip.draft { background: #fff4e5; border-color: #f3c98b; color: #9a5a00; letter-spacing: .04em; text-transform: uppercase; font-size: .68rem; }

/* ── Tables ── */
.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-weight: 500; font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: .55rem .7rem; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
.table td { padding: .5rem .7rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.selectable { cursor: pointer; }
.table tr.selectable:hover td { background: #f5f8f1; }
.table tr.selected td { background: #eef4e6; }
.table td .input { min-height: 32px; padding: .28rem .5rem; font-size: .88rem; }
.table.compact td, .table.compact th { padding: .35rem .55rem; }
/* Long paths and identifiers wrap instead of pushing the card wider. */
.table td.mono { word-break: break-all; }

/* ── Envelope rows (two-line, so they fit a narrow editor column) ── */
.env-list { display: flex; flex-direction: column; gap: .5rem; }
.env-row { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); padding: .5rem .6rem; }
.env-row.error { border-color: #f0c4c4; background: #fffafa; }
.env-row:focus-within { border-color: var(--jade); box-shadow: 0 0 0 2px rgba(42, 107, 92,.12); }
.env-line1 { display: flex; align-items: center; gap: .45rem; }
.env-line1 .name { flex: 1; min-width: 90px; }
.env-line1 .area { width: 92px; }
.env-line1 .mult { width: 58px; }
.env-line2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: .4rem; margin-top: .4rem; padding-left: 36px; }
.env-line2 .construction { grid-column: span 2; }
.cap { font-size: .66rem; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); margin-bottom: 1px; }
.env-detail { margin-top: .5rem; padding: .6rem .6rem .4rem 36px; border-top: 1px dashed var(--border); }
.opening { display: grid; grid-template-columns: minmax(70px, 1fr) minmax(110px, 1.5fr) 64px 52px 56px 44px 28px; gap: .3rem; align-items: center; margin-bottom: .35rem; }
.opening.door { grid-template-columns: minmax(70px, 1fr) minmax(110px, 1.2fr) minmax(110px, 1.4fr) 64px 48px 28px; }
.opening > * { min-width: 0; }
.opening-head { font-size: .66rem; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); }

/* ── Tabs ── */
.tabs { display: flex; gap: .2rem; border-bottom: 1px solid var(--border); margin-bottom: 1rem; overflow-x: auto; }
.tab { border: 0; background: transparent; font: inherit; font-size: .9rem; color: var(--muted); padding: .6rem .9rem; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; display: inline-flex; gap: .4rem; align-items: center; }
.tab:hover { color: var(--ink); }
.tab.on { color: var(--forest); border-bottom-color: var(--forest); font-weight: 500; }
.tab .chip { font-size: .66rem; padding: 0 .4rem; }

/* ── Alerts & issues ── */
.alert { display: flex; gap: .7rem; padding: .8rem 1rem; border-radius: var(--radius-sm); border: 1px solid; font-size: .9rem; margin-bottom: .9rem; align-items: flex-start; }
.alert .grow { flex: 1; }
.alert.info { background: var(--info-bg); border-color: #c5daf0; color: #1f4f80; }
.alert.success { background: var(--success-bg); border-color: #bfe3cc; color: #1f5f3a; }
.alert.warning { background: var(--warning-bg); border-color: #efd99c; color: #6f4f0d; }
.alert.danger { background: var(--danger-bg); border-color: #f0c4c4; color: #8a2a2a; }
.alert.draft { background: #fff7ec; border-color: #f3c98b; color: #7a4a00; }
.issue { display: flex; gap: .55rem; padding: .55rem .2rem; border-bottom: 1px solid var(--border); font-size: .86rem; align-items: flex-start; }
.issue:last-child { border-bottom: 0; }
.issue .where { font-size: .74rem; color: var(--faint); }
.issue.clickable { cursor: pointer; border-radius: 6px; padding-left: .4rem; }
.issue.clickable:hover { background: var(--surface-2); }
.sev-error { color: var(--danger); }
.sev-warning { color: var(--warning); }
.sev-audit { color: var(--audit); }
.sev-lodgement { color: var(--info); }

/* ── Tip card ── */
.tip { border: 1px solid #cfe7da; background: linear-gradient(180deg, #f2faf6, #fff); border-radius: var(--radius); padding: .85rem .95rem; font-size: .87rem; }
.tip-title { display: flex; gap: .45rem; align-items: center; font-weight: 600; color: var(--forest); margin-bottom: .35rem; }
.tip p:last-child { margin-bottom: 0; }
.tip .tip-extra { margin-top: .5rem; padding-top: .5rem; border-top: 1px dashed #cfe7da; font-size: .82rem; color: var(--muted); }

/* ── Stats ── */
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .9rem 1rem; }
.stat-label { font-size: .76rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.stat-value { font-size: 1.55rem; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.2; margin-top: .15rem; }
.stat-value .unit { font-size: .8rem; font-weight: 400; color: var(--muted); margin-left: .2rem; }
.stat-delta { font-size: .78rem; margin-top: .1rem; }
.stat-delta.up { color: var(--danger); }
.stat-delta.down { color: var(--success); }
.mini-stats { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.mini-stat { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .5rem .6rem; }
.mini-stat .l { font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.mini-stat .v { font-weight: 600; font-variant-numeric: tabular-nums; }

/* ── EPC bands ── */
.band { display: inline-grid; place-items: center; min-width: 2.1em; height: 1.7em; padding: 0 .45em; border-radius: 6px; font-weight: 700; color: #fff; font-size: .9rem; }
.band-Aplus, .band-A\+ { background: var(--band-aplus); }
.band-A { background: var(--band-a); }
.band-B { background: var(--band-b); }
.band-C { background: var(--band-c); color: #1c2a0c; }
.band-D { background: var(--band-d); color: #3d3200; }
.band-E { background: var(--band-e); color: #3f2508; }
.band-F { background: var(--band-f); }
.band-G { background: var(--band-g); }
.rating-scale { display: flex; flex-direction: column; gap: 4px; }
.rating-row { display: flex; align-items: center; gap: .6rem; }
.rating-bar { height: 28px; border-radius: 0 5px 5px 0; display: flex; align-items: center; justify-content: space-between; padding: 0 .6rem; color: #fff; font-weight: 700; font-size: .86rem; clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 50%, calc(100% - 12px) 100%, 0 100%); }
.rating-bar .range { font-weight: 400; font-size: .74rem; opacity: .9; }
.rating-marker { display: flex; align-items: center; gap: .3rem; font-weight: 700; font-size: .95rem; color: var(--ink); }
.rating-marker .arrow { background: var(--ink); color: #fff; padding: .15rem .55rem .15rem .9rem; clip-path: polygon(12px 0, 100% 0, 100% 100%, 12px 100%, 0 50%); border-radius: 0 5px 5px 0; }

/* ── Hero rating ── */
.hero-rating { display: flex; gap: 1.25rem; align-items: center; }
.hero-rating .big { font-size: 3.2rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums; }
.hero-rating .big-band { font-size: 2.2rem; width: 72px; height: 72px; border-radius: 16px; display: grid; place-items: center; font-weight: 700; color: #fff; }

/* ── Bars / charts ── */
.hbar { display: grid; grid-template-columns: 130px 1fr 70px; gap: .6rem; align-items: center; font-size: .85rem; margin-bottom: .45rem; }
.hbar-track { height: 10px; background: var(--surface-2); border-radius: 99px; overflow: hidden; border: 1px solid var(--border); }
.hbar-fill { height: 100%; background: var(--jade); border-radius: 99px; }
.legend { display: flex; flex-wrap: wrap; gap: .4rem .9rem; font-size: .78rem; color: var(--muted); }

/* ── Pre-lodgement intelligence (after the SAP app's Validation Intelligence panel) ── */
.intel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.intel-head { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; padding: .75rem 1rem; background: #3B4953; color: #fff; }
.intel-badge { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: #5A7863; }
.intel-title { font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: .85rem; }
.intel-link { color: #fff; }
.intel-link:hover { background: rgba(255,255,255,.12); }
.intel-body { padding: 1.2rem; }
.intel-stats { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; margin: 1rem; padding: 1rem 1.2rem; border-radius: var(--radius); background: #EBF4DD; }
.intel-count { font-size: 2.6rem; font-weight: 700; line-height: 1; color: var(--ink); }
.intel-count-label { color: var(--muted); font-size: .85rem; }
.intel-levels { display: flex; gap: .35rem; flex-wrap: wrap; flex: 1; }
.intel-pill { padding: .35rem .9rem; border-radius: 99px; font-weight: 600; font-size: .85rem; color: #fff; background: #90AB8B; white-space: nowrap; }
.intel-pill.red { background: var(--danger); }
.intel-pill.purple { background: var(--audit); }
.intel-pill.amber { background: #B9871C; }
.intel-pill.green { background: var(--success); }
.intel-list { display: flex; flex-direction: column; gap: .5rem; padding: 0 1rem 1rem; }
.intel-card { display: flex; gap: .8rem; align-items: flex-start; padding: .8rem .9rem; border: 1px solid var(--border); border-left: 2px solid transparent; border-radius: var(--radius-sm); color: inherit; text-decoration: none; transition: background .12s; }
.intel-card:hover { background: #EBF4DD; text-decoration: none; }
.intel-card.picked { background: #EFF3F5; border-left-color: #3B4953; }
.intel-icon { width: 30px; height: 30px; flex: none; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.intel-icon.red { background: var(--danger-bg); color: var(--danger); }
.intel-icon.purple { background: var(--audit-bg); color: var(--audit); }
.intel-icon.amber { background: var(--warning-bg); color: var(--warning); }
.intel-text { flex: 1; min-width: 0; }
.intel-tag { font-size: .7rem; font-weight: 600; padding: .1rem .5rem; border-radius: 99px; background: #E3ECE6; color: #3B4953; }
.intel-msg { font-weight: 500; margin: .2rem 0 .1rem; }
.intel-empty { text-align: center; padding: 2rem 1rem; color: var(--success); }
.intel-empty h3 { margin: .5rem 0 .2rem; }
.intel-empty p { color: var(--muted); }
.intel-note { margin: 0 1rem .5rem; font-size: .8rem; color: var(--muted); }
.intel-foot { padding: .7rem 1rem; border-top: 1px solid var(--border); font-size: .75rem; color: var(--faint); background: var(--surface-2); }

/* ── Compliance overview tiles (after the SAP app's dashboard) ── */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .9rem 1rem; box-shadow: var(--shadow-sm); }
.tile-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.tile-value { font-size: 1.9rem; font-weight: 700; line-height: 1.15; }
.tile.green .tile-value { color: var(--forest); }
.tile.red .tile-value { color: var(--danger); }
.tile.amber .tile-value { color: #B9871C; }
.tile.purple .tile-value { color: var(--audit); }
.tile.blue .tile-value { color: var(--info); }
.section-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; margin: .4rem 0 .5rem; }

/* ── Floor plans ── */
.plan-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 1rem; align-items: start; }
.plan-tools { flex-wrap: wrap; gap: .5rem; }
.plan-hint { padding: .45rem 1.1rem; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--border); }
.plan-stage { overflow: auto; max-height: 72vh; background: #EEF2F0; border-radius: 0 0 var(--radius) var(--radius); }
.plan-svg { display: block; cursor: crosshair; user-select: none; -webkit-user-select: none; }
.plan-svg.mode-select { cursor: pointer; }
.plan-svg polygon.shape { fill: rgba(42, 107, 92,.18); stroke: var(--jade); stroke-width: 2; vector-effect: non-scaling-stroke; }
.plan-svg polygon.shape.unlinked { stroke-dasharray: 6 4; fill: rgba(42, 107, 92,.1); }
.plan-svg polygon.shape.selected { fill: rgba(40,90,72,.3); stroke: var(--primary); stroke-width: 3; }
.plan-svg .drawing { fill: rgba(212,168,67,.15); stroke: #B9871C; stroke-width: 2; vector-effect: non-scaling-stroke; }
.plan-svg .vertex { fill: #fff; stroke: #B9871C; stroke-width: 2; vector-effect: non-scaling-stroke; }
.plan-svg .scale-line { stroke: var(--danger); stroke-width: 2; stroke-dasharray: 8 4; vector-effect: non-scaling-stroke; }
.plan-svg .scale-end { fill: var(--danger); }
.plan-svg .plan-rubber { stroke: #B9871C; stroke-width: 1.5; stroke-dasharray: 4 4; vector-effect: non-scaling-stroke; pointer-events: none; }
.plan-svg text { text-anchor: middle; fill: var(--primary); font-weight: 600; paint-order: stroke; stroke: #fff; pointer-events: none; }
.plan-svg text.sub { fill: var(--muted); font-weight: 500; }
.plan-compass { display: inline-flex; flex-direction: column; align-items: center; font-size: .66rem; font-weight: 700; color: var(--danger); line-height: 1; }
.plan-compass span { display: inline-block; font-size: .9rem; }
.issue.plan-picked { background: #eef4e6; border-radius: 6px; }
@media (max-width: 1100px) { .plan-layout { grid-template-columns: minmax(0, 1fr); } }

/* ── Why this rating ── */
.why-row { display: grid; grid-template-columns: 130px minmax(0, 1fr) 92px 56px; gap: .6rem; align-items: center; font-size: .86rem; padding: .4rem 0; border-top: 1px solid var(--border); }
.why-row:first-of-type { border-top: 0; }
.why-name { font-weight: 500; }
.why-comp { height: 5px; margin-top: 3px; opacity: .7; }
.why-detail { margin: -.15rem 0 .35rem calc(130px + .6rem); font-size: .8rem; color: var(--muted); }
.why-facts { display: flex; flex-wrap: wrap; gap: .15rem 1rem; margin-top: .15rem; font-size: .76rem; }
.why-total { font-weight: 600; border-top: 2px solid var(--border-strong); }
.sev-ok { color: var(--success); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: .3rem; vertical-align: -1px; }

/* ── Progress ── */
.progress { height: 8px; background: rgba(255,255,255,.12); border-radius: 99px; overflow: hidden; }
.progress > div { height: 100%; background: var(--mint); border-radius: 99px; transition: width .3s; }
.progress.light { background: var(--surface-2); border: 1px solid var(--border); }
.progress.light > div { background: var(--jade); }

/* ── Tree (building navigator) ── */
.tree { font-size: .87rem; }
.tree-node { display: flex; align-items: center; gap: .4rem; padding: .3rem .45rem; border-radius: 6px; cursor: pointer; color: var(--text); min-width: 0; }
.tree-node:hover { background: var(--surface-2); }
.tree-node.selected { background: #eef4e6; color: var(--primary); font-weight: 500; }
.tree-node .lbl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-node .meta { font-size: .72rem; color: var(--faint); }
.tree-children { margin-left: 1.05rem; border-left: 1px dashed var(--border-strong); padding-left: .3rem; }

/* ── Drop zone ── */
.dropzone { border: 2px dashed var(--border-strong); border-radius: var(--radius); padding: 2.2rem 1rem; text-align: center; background: var(--surface); transition: border-color .15s, background .15s; position: relative; }
.dropzone:hover, .dropzone.over { border-color: var(--jade); background: #f2faf6; }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* ── Modal ── */
.modal-backdrop { position: fixed; inset: 0; background: rgba(9,20,19,.45); display: grid; place-items: center; z-index: 50; padding: 1rem; animation: fade .12s ease-out; }
.modal { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg); width: min(640px, 100%); max-height: 90vh; display: flex; flex-direction: column; animation: pop .15s ease-out; }
.modal.wide { width: min(980px, 100%); }
.modal-head { display: flex; align-items: center; gap: .6rem; padding: 1rem 1.2rem; border-bottom: 1px solid var(--border); }
.modal-head h2 { margin: 0; flex: 1; font-size: 1.1rem; }
.modal-body { padding: 1.2rem; overflow-y: auto; }
.modal-foot { padding: .85rem 1.2rem; border-top: 1px solid var(--border); display: flex; gap: .5rem; justify-content: flex-end; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: scale(.97) translateY(6px); } to { opacity: 1; transform: none; } }

/* ── Toasts ── */
.toasts { position: fixed; right: 1.2rem; bottom: 1.2rem; display: flex; flex-direction: column; gap: .5rem; z-index: 60; }
.toast { background: var(--ink); color: #fff; padding: .7rem 1rem; border-radius: 10px; box-shadow: var(--shadow-lg); font-size: .88rem; display: flex; gap: .6rem; align-items: center; min-width: 260px; max-width: 420px; animation: pop .15s ease-out; }
.toast.error { background: #8a2a2a; }
.toast.success { background: var(--primary); }

/* ── Empty state ── */
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
.empty .icon-ring { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto .8rem; background: var(--shell); color: var(--forest); }
.empty h3 { color: var(--ink); }

/* ── Home hero ── */
.hero { background: linear-gradient(120deg, var(--primary), var(--forest) 60%, var(--jade)); color: #fff; border-radius: 18px; padding: 2rem 2.2rem; margin-bottom: 1.5rem; position: relative; overflow: hidden; }
.hero h1 { color: #fff; font-size: 1.9rem; margin-bottom: .4rem; }
.hero p { color: #d6ece2; max-width: 640px; }
.hero::after { content: ""; position: absolute; right: -60px; top: -60px; width: 260px; height: 260px; border-radius: 50%; background: rgba(183, 216, 148,.12); }

/* ── Compass picker ── */
.compass { display: grid; grid-template-columns: repeat(3, 34px); grid-template-rows: repeat(3, 34px); gap: 3px; }
.compass button { border: 1px solid var(--border); background: var(--surface); border-radius: 6px; font: inherit; font-size: .7rem; cursor: pointer; color: var(--muted); padding: 0; }
.compass button.on { background: var(--forest); color: #fff; border-color: var(--forest); }
.compass .c { display: grid; place-items: center; font-size: .65rem; color: var(--faint); }

/* ── Spinner ── */
.spinner { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Report viewer ── */
.report-frame { width: 100%; height: calc(100vh - 230px); min-height: 520px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }

/* ── Utilities ── */
.mt-0 { margin-top: 0 !important; } .mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0 !important; } .mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; }
.gap-sm { gap: .4rem; }
.w-100 { width: 100%; }
.divider { height: 1px; background: var(--border); margin: 1rem 0; }
.kbd { font-family: var(--mono); font-size: .75rem; background: var(--surface-2); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 4px; padding: 0 .3rem; }

/* ── Signed-in assessor ── */
.sidebar-user { display: flex; align-items: center; gap: .6rem; margin-top: auto; padding: .75rem .9rem .75rem 1.1rem; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-user + .sidebar-foot { margin-top: 0; }
.sidebar-user .avatar { width: 32px; height: 32px; border-radius: 50%; flex: none; display: grid; place-items: center; background: rgba(183, 216, 148,.18); color: var(--mint); font-size: .78rem; font-weight: 600; }
.sidebar-user .who { flex: 1; min-width: 0; }
.sidebar-user .name { color: #fff; font-size: .85rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .sub { color: rgba(227, 231, 238,.6); font-size: .72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user .signout { color: #E3E7EE; }
.sidebar-user .signout:hover { background: rgba(255,255,255,.08); }
.nav-button { width: 100%; border: 0; background: none; font: inherit; text-align: left; }

/* ── Site survey ── one row per input: what was entered on the left, the answer, note and camera on the right. */
.survey-progress { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: 1rem; }
.survey-bar { flex: 1 1 160px; max-width: 320px; height: 8px; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
.survey-bar span { display: block; height: 100%; background: var(--forest); transition: width .2s ease; }
.survey-item { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: .5rem 1rem; padding: .8rem 1rem; border-top: 1px solid var(--border); border-left: 3px solid transparent; }
.survey-item:first-child { border-top: 0; }
.survey-item.ok { border-left-color: var(--success); }
.survey-item.bad { border-left-color: var(--danger); background: var(--danger-bg); }
.survey-item.warn { border-left-color: var(--warning); }
.survey-text { display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.survey-entered { font-size: .88rem; overflow-wrap: anywhere; }
.survey-actions { display: flex; flex-direction: column; gap: .45rem; min-width: 0; }
.survey-status { width: 100%; }
.survey-status button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: .3rem; }
.survey-status button.on.ok { color: #1f6b41; }
.survey-status button.on.bad { color: #a63232; }
.survey-status button.on.warn { color: #8a6312; }
.survey-photo { cursor: pointer; font: inherit; font-size: .75rem; }

/* ── Phones and tablets ──
   Below 760px the sidebar becomes a drawer behind the menu button, the top bar keeps
   icons only, and touch targets grow. iOS zooms into inputs under 16px, so they are 16px. */
.menu-btn, .nav-backdrop { display: none; }

@media (max-width: 1280px) {
    :root { --assistant-w: 280px; }
}
@media (max-width: 1100px) {
    .hide-md { display: none !important; }
    /* No room for the right-hand panel: the steps go back to the left menu. */
    .assistant { display: none; }
    .steps-in-sidebar { display: block; }
    .shell { grid-template-columns: var(--sidebar-w) minmax(0, 1fr); grid-template-areas: "side top" "side main"; }
}
@media (max-width: 900px) {
    :root { --sidebar-w: 220px; }
    .grid-2, .grid-3, .grid-4, .split { grid-template-columns: 1fr; }
    /* Pages that size their two columns inline (list beside editor, report list beside preview) stack too. */
    .split[style], .grid[style*="grid-template-columns"] { grid-template-columns: minmax(0, 1fr) !important; }
}
@media (max-width: 760px) {
    :root { --topbar-h: 56px; }
    .shell, .shell.no-project { grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "main"; height: 100vh; height: 100dvh; }
    .sidebar { position: fixed; top: 0; bottom: 0; left: 0; width: min(300px, 86vw); z-index: 45; transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow-lg); }
    .shell.nav-open .sidebar { transform: none; }
    .shell.nav-open .nav-backdrop { display: block; position: fixed; inset: 0; z-index: 44; background: rgba(9,20,19,.45); }
    .menu-btn { display: inline-flex; flex: none; }
    .nav-item { padding: .7rem .6rem; }

    .topbar { padding: 0 .5rem; gap: .4rem; }
    .topbar .btn-label, .hide-sm { display: none !important; }
    .topbar .btn.sm { min-height: 38px; padding: .3rem .55rem; }
    .topbar-title .t2 { display: none; }

    .main { padding: 1rem .85rem 5rem; }
    .hero { padding: 1.25rem 1.15rem; border-radius: 14px; }
    .hero h1 { font-size: 1.35rem; }
    .hero p { font-size: .9rem; }
    .page-actions { width: 100%; }
    .survey-item { grid-template-columns: minmax(0, 1fr); padding: .75rem .8rem; }
    .survey-status button { min-height: 42px; padding: .3rem .4rem; }
    .page-actions .input-wrap { width: 100% !important; }
    .page-actions select.input { flex: 1; }
    .grid-auto { grid-template-columns: minmax(0, 1fr); }
    .form-grid { grid-template-columns: minmax(0, 1fr); }
    /* A two-wide field in a one-column form would add a squeezed second column. */
    .form-grid .span-2 { grid-column: 1 / -1; }
    /* Lists that stay in view beside an editor on a wide screen would sit on top of it here. */
    .split > [style*="sticky"] { position: static !important; }
    .panes { grid-template-columns: minmax(0, 1fr); }

    .card-head { flex-wrap: wrap; }
    .why-row { grid-template-columns: 84px minmax(0, 1fr) 70px 48px; gap: .4rem; }
    .why-detail { margin-left: 0; }
    .btn { min-height: 40px; }
    .btn.sm { min-height: 36px; }
    .input, select.input, textarea.input { font-size: 16px; min-height: 42px; }

    .modal-backdrop { padding: .5rem; align-items: end; }
    .modal, .modal.wide { width: 100%; max-height: 92vh; border-radius: 16px 16px 12px 12px; }
    .toasts { left: .75rem; right: .75rem; bottom: .75rem; }
    .toast { min-width: 0; max-width: none; }
}

/* ── DEC additions ── */
/* The DEC A–G operational rating scale (methodology 3.7): A 0–25 … G over 150. */
.dec-scale { display: flex; flex-direction: column; gap: 4px; max-width: 460px; }
.dec-scale .bar { display: flex; align-items: center; gap: .6rem; }
.dec-scale .bar-fill { height: 26px; border-radius: 4px; color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: space-between; padding: 0 .6rem; font-size: .85rem; }
.dec-scale .bar.on .bar-fill { outline: 3px solid var(--ink); outline-offset: 1px; }
.dec-scale .bar-pointer { font-weight: 700; font-size: .95rem; color: var(--ink); white-space: nowrap; }
.dec-scale .range { font-weight: 500; opacity: .9; font-size: .75rem; }
.big-rating { font-size: 3rem; font-weight: 700; line-height: 1; color: var(--ink); }
.qa { border-left: 3px solid var(--border); padding: .4rem 0 .4rem .8rem; }
.qa.closed { opacity: .45; }
.qa .q { font-weight: 500; margin-bottom: .3rem; }
.level-Blocked { border-left: 4px solid var(--danger); }
.level-WillAudit { border-left: 4px solid var(--audit); }
.level-Check { border-left: 4px solid var(--warning); }
.level-Info { border-left: 4px solid var(--info); }
.issue-row { padding: .65rem .9rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: .5rem; }
.issue-row .t { font-weight: 600; }
.issue-row .src { font-size: .72rem; color: var(--faint); }
table.table td .input { min-width: 90px; }

/* DEC palette: sage and light green are light, so text on them is dark. */
.nav-item.done .nav-step, .rail-steps .nav-item.done .nav-step { color: var(--ink); }
.progress > div, .rail-steps .progress > div { background: var(--mint); }
.rail-steps .progress > div { background: var(--forest); }
.btn.accent { color: var(--ink); }
.brand-mark { color: var(--primary); }

/* Reading evidence notes: a quiet line under each reading */
.table tr.note-row td { padding-top: 0; border-top: 0; }
.table tr.note-row textarea { width: 100%; resize: vertical; font-size: .8rem; color: var(--muted); min-height: 2rem; }
.table tr:has(+ tr.note-row) td { border-bottom: 0; }
