/* =========================================================
   FEASIBILITY APP
   Same paper and charcoal as Systems.
   ========================================================= */

:root {
    --ink: #2a2824;
    --paper: #efece5;
    --red: #b4534d;
    --green: #3f7a55;
    --blue: #3d5f8c;
    --gold: #b8893a;
    --line: rgba(42, 40, 36, 0.2);
    --sheet: #f6f4ee;
    /* palette, the same block as systems.css (it was missing here, so --pop-ink and the rest had no value on the app pages).
       -ink: text on Ivory. -lt: text and lines on Charcoal. plain: fills, borders, icons. -bg: soft card backgrounds */
    --sage: #879487;   --sage-ink: #4F5E4F;   --sage-lt: #A9B5A8;   --sage-bg: #E3E7E0;
    --clay: #B97863;   --clay-ink: #8A4A36;   --clay-lt: #D49A85;   --clay-bg: #F2E3DC;
    --slate: #788B9A;  --slate-ink: #445767;  --slate-lt: #9DAEBB;  --slate-bg: #E0E6EA;
    --pop: #C8553D;    --pop-ink: #B04A33;
    --none: rgba(42, 40, 36, 0.45);
}

body.app {
    background: var(--paper);
    color: var(--ink);
    font-family: 'Work Sans', sans-serif;
}
body.full-open { overflow: hidden; }

.header.solid,
.header.scrolled { background: var(--paper); }
.logo a, nav a { color: var(--ink); }

.app-main { padding: 5.5rem 3vw 4rem; }

.screen[hidden] { display: none; }

.screen h2 {
    font-family: 'Cinzel', serif;
    font-size: clamp(1.5rem, 2.6vw, 2.4rem);
    letter-spacing: 0.08rem;
    line-height: 1.2;
    margin: 1rem 0 1.5rem;
}

.eyebrow {
    display: block;
    font-size: 0.68rem;
    letter-spacing: 0.2rem;
    text-transform: uppercase;
    opacity: 0.6;
    margin-bottom: 0.7rem;
}

.small { font-size: 0.85rem; line-height: 1.5; opacity: 0.8; }

#screen-a { max-width: none; margin: 0; }


/* ---------- buttons (style.css styles every button; reset ours) ---------- */

.app-main button, .full button {
    font: inherit;
    font-size: 0.8rem;
    letter-spacing: 0.04rem;
    color: var(--ink);
    background: none;
    border: 1px solid var(--ink);
    padding: 0.5rem 0.9rem;
    cursor: pointer;
}

.app-main button.solid, .full button.solid { background: var(--ink); color: var(--paper); }
.app-main button.big { padding: 1rem 3rem; font-size: 0.9rem; letter-spacing: 0.15rem; text-transform: uppercase; }
.app-main button.mini, .full button.mini { padding: 0.25rem 0.55rem; font-size: 0.7rem; }
/* disabled: see the hover rule at the end of this file */

.app-main .back {
    display: inline-block;
    border: none;
    padding: 0;
    background: none;
    color: var(--ink);
    font-size: 0.85rem;
    text-decoration: underline;
    text-underline-offset: 0.25rem;
    cursor: pointer;
}

.switch { display: inline-flex; }
.app-main .switch button, .full .switch button { border-right-width: 0; }
.app-main .switch button:last-child, .full .switch button:last-child { border-right-width: 1px; }
.app-main .switch button.on, .full .switch button.on { background: var(--ink); color: var(--paper); }

.actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-top: 1rem; }

.error { margin-top: 0.7rem; font-size: 0.85rem; line-height: 1.5; color: var(--red); }
.error[hidden] { display: none; }

.export-note { margin-top: 0.6rem; font-size: 0.82rem; line-height: 1.6; }


/* ---------- start: cards ---------- */

.types { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }

.app-main .type {
    min-height: 7rem;
    padding: 1.3rem;
    border: none;
    border-top: 3px solid var(--line);
    background: rgba(42, 40, 36, 0.04);
    text-align: left;
}
.app-main .type strong { font-family: 'Cinzel', serif; font-size: 1.15rem; letter-spacing: 0.06rem; }
.app-main .type:hover { background: rgba(42, 40, 36, 0.09); }
.app-main .type.on { border-top-color: var(--ink); background: var(--ink); color: var(--paper); }
.type-letter { display: block; margin-bottom: 0.6rem; font-family: 'Cinzel', serif; font-size: 1.6rem; line-height: 1; opacity: 0.6; }

.in-progress { margin-top: 1rem; font-size: 0.95rem; }
.in-progress[hidden] { display: none; }


/* ---------- start: questions ---------- */

.questions { display: block; margin-top: 1.2rem; padding: 1.6rem 0 2rem; border-top: 1px solid var(--ink); }
.questions[hidden] { display: none; }

.q-lead { margin-bottom: 1.6rem; font-size: 0.95rem; }

.q-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.8rem 2.5rem; }
.q-group.wide { grid-column: span 2; }
.q-group h3 { font-family: 'Cinzel', serif; font-size: 1.3rem; letter-spacing: 0.08rem; padding-bottom: 0.4rem; margin-bottom: 0.9rem; border-bottom: 1px solid var(--ink); }

.q { display: block; margin-bottom: 1rem; font-size: 0.88rem; }
.q-head { display: flex; justify-content: space-between; gap: 0.6rem; align-items: baseline; margin-bottom: 0.25rem; }

.qtag {
    flex-shrink: 0;
    padding: 0.03rem 0.4rem;
    font-size: 0.66rem;
    border: 1px dashed currentColor;
    white-space: nowrap;
}
.qtag.given { border-style: solid; background: var(--ink); color: var(--paper); border-color: var(--ink); }

.q-line { margin: 0.2rem 0 0.7rem; font-size: 0.82rem; line-height: 1.45; opacity: 0.85; }

.compass { display: grid; grid-template-columns: repeat(3, 7rem); gap: 0.4rem; margin-bottom: 0.8rem; }
.compass label { display: flex; flex-direction: column; gap: 0.1rem; font-size: 0.7rem; }
.compass label span { font-weight: 500; }
.compass input { font-size: 0.85rem; }
.compass input::placeholder { color: var(--ink); opacity: 0.45; font-size: 0.72rem; }
.compass .mid-site {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--ink);
    background: rgba(42, 40, 36, 0.05);
    font-family: 'Cinzel', serif;
    font-size: 0.85rem;
}
.entrance-pick { display: flex; align-items: baseline; gap: 0.7rem; font-size: 0.82rem; }
.entrance-pick select { max-width: 8rem; }
.q-default { margin-top: 0.4rem; font-size: 0.74rem; opacity: 0.72; }


/* ---------- forms ---------- */

.field { display: flex; flex-direction: column; gap: 0.25rem; margin-bottom: 0.8rem; font-size: 0.85rem; }
.field.row { flex-direction: row; align-items: center; gap: 0.5rem; }

input[type=number], input[type=text], input[type=date], .app-main select, .full select {
    font: inherit;
    font-size: 0.95rem;
    color: var(--ink);
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--ink);
    border-radius: 0;
    padding: 0.25rem 0;
    width: 100%;
    min-width: 0;
}
input:focus, select:focus { outline: none; border-bottom-width: 2px; }
input[type=radio], input[type=checkbox] { accent-color: var(--ink); width: 1rem; height: 1rem; }
input[type=file] { width: 100%; font-size: 0.8rem; }
input[type=range] { width: 100%; accent-color: var(--ink); }

.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.7rem; }

.readout { margin-bottom: 0.8rem; font-size: 0.85rem; }
.readout div { display: flex; justify-content: space-between; gap: 0.5rem; padding: 0.25rem 0; border-bottom: 1px solid var(--line); }
.readout span { opacity: 0.7; }


/* ---------- split screen ---------- */

.split { display: block; }
/* plan (about 60%) and results (about 40%). The plan stays in view only inside this row: it stops before the full width details below */
.split-top { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 2rem 2.4rem; align-items: start; }



.split-view { display: flex; flex-direction: column; min-width: 0; min-height: 0; position: sticky; top: 5rem; z-index: 1; align-self: start; height: calc(100vh - 6.5rem); max-height: 56rem; background: var(--paper); }
.view-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin-bottom: 0.5rem; }
.view-bar #go-full { margin-left: auto; }

.view-box { position: relative; flex: 1; min-height: 0; border: 1px solid var(--line); background: var(--sheet); overflow: hidden; }
.view-box svg#plan-page { display: block; width: 100%; height: 100%; }
.view-box svg#plan-page[hidden] { display: none; }
#host-page { width: 100%; height: 100%; }
#host-page[hidden] { display: none; }
#host-page canvas, #host-full canvas { display: block; }

.split-results { min-width: 0; }
.split-results h2 { margin-top: 0; margin-bottom: 0.8rem; }

.view-foot { margin: 0.6rem 0 0; text-align: center; }
.view-foot:has(> [hidden]) { display: none; }
.app-main .view-note {
    background: var(--ink);
    color: var(--paper);
    border-color: var(--ink);
    white-space: nowrap;
}

.plan-areas {
    position: absolute;
    left: 0.6rem;
    top: 0.6rem;
    padding: 0.35rem 0.55rem;
    background: rgba(246, 244, 238, 0.9);
    font-size: 0.74rem;
    line-height: 1.5;
    pointer-events: none;
}
.plan-areas b { font-weight: 500; }
.zoom-read { font-size: 0.74rem; font-variant-numeric: tabular-nums; }
.view-box .zoom-read { position: absolute; right: 0.6rem; top: 0.6rem; pointer-events: none; }
#host-page:not([hidden]) ~ .zoom-read { display: none; }
.full-actions { align-items: center; }

.rose { position: absolute; right: 0.6rem; bottom: 0.6rem; width: 130px; pointer-events: none; }
.rose[hidden] { display: none; }
.rose svg { display: block; width: 100%; height: auto; }
.rose .ring { fill: rgba(246, 244, 238, 0.9); stroke: var(--line); }
.rose .pet { fill: var(--slate); }
.rose text { font-family: 'Work Sans', sans-serif; font-size: 11px; fill: var(--ink); text-anchor: middle; }

/* plan drawing */
.plan .grid { stroke: var(--ink); opacity: 0.07; vector-effect: non-scaling-stroke; }
.plan .site { fill: rgba(42, 40, 36, 0.035); stroke: var(--ink); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.plan .road { fill: rgba(42, 40, 36, 0.1); fill-rule: evenodd; }
.plan .road-main { fill: rgba(42, 40, 36, 0.18); fill-rule: evenodd; }
.plan .setback { fill: none; stroke: var(--clay); stroke-width: 1; stroke-dasharray: 6 4; vector-effect: non-scaling-stroke; }
.plan .building { fill: rgba(120, 139, 154, 0.25); fill-rule: evenodd; stroke: var(--slate-ink); stroke-width: 1.3; vector-effect: non-scaling-stroke; }
.plan .building.sel { stroke-width: 2.2; }
.plan .ghost { fill: none; stroke: var(--clay); stroke-width: 1; stroke-dasharray: 2 3; vector-effect: non-scaling-stroke; }
.plan .edge-hit { stroke: transparent; fill: none; }
.plan .road-outer { stroke: transparent; fill: none; cursor: ns-resize; }
.plan .road-line { stroke: var(--ink); stroke-width: 1; stroke-dasharray: 2 3; vector-effect: non-scaling-stroke; }
.plan .bld-hit { fill: transparent; cursor: move; }
.plan .corner { fill: var(--paper); stroke: var(--ink); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.plan .corner.sel { fill: var(--pop); }
.plan .corner.b { stroke: var(--blue); }
.plan .hit { fill: transparent; cursor: grab; }
.plan .mid { fill: var(--ink); opacity: 0.45; }
.plan .mid.b { fill: var(--blue); }
.plan .mid-hit { fill: transparent; cursor: copy; }
.plan .bend { fill: var(--gold); stroke: var(--paper); stroke-width: 1; vector-effect: non-scaling-stroke; }
.plan .bend-hit { fill: transparent; cursor: move; }
.plan .rot-line { stroke: var(--blue); stroke-width: 1; vector-effect: non-scaling-stroke; }
.plan .rot { fill: var(--blue); stroke: var(--paper); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.plan .rot-hit { fill: transparent; cursor: grab; }
.plan text { fill: var(--ink); font-family: 'Work Sans', sans-serif; text-anchor: middle; pointer-events: none; paint-order: stroke; stroke: var(--sheet); stroke-width: 3px; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.plan text.on-road { fill: var(--ink); stroke: #e4e1da; }
.plan text.b { fill: var(--blue); }
.plan text.num { pointer-events: auto; cursor: text; text-decoration: underline; }
.plan text.add-road { fill: var(--blue); }
.plan text.lay { font-weight: 500; }

/* climate layers on the plan */
.plan .shadow { fill: rgba(42, 40, 36, 0.2); fill-rule: nonzero; }
.plan .sun-arc { fill: none; stroke: var(--pop); stroke-width: 1.2; stroke-dasharray: 2 5; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.plan .sun-arc.on { stroke-width: 2.2; }
.plan .sun-ring { fill: none; stroke: var(--ink); stroke-width: 1; stroke-dasharray: 1 5; stroke-linecap: round; opacity: 0.55; vector-effect: non-scaling-stroke; }
.plan .sun-hour { fill: var(--paper); stroke: var(--pop); stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.plan .sun-dot { fill: var(--pop); stroke: var(--ink); stroke-width: 1; vector-effect: non-scaling-stroke; }
.plan .sun-ray { stroke: var(--pop); stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.plan .wind-arrow { stroke: var(--blue); stroke-width: 2.5; fill: none; vector-effect: non-scaling-stroke; }
.plan .wind-head { fill: var(--blue); }
.plan .face { stroke-width: 5; vector-effect: non-scaling-stroke; }


/* ---------- analysis ---------- */

.figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(125px, 1fr)); gap: 0.9rem 1.2rem; }
.figures div { border-top: 1px solid var(--ink); padding-top: 0.4rem; }
.figures dt { font-size: 0.72rem; line-height: 1.3; opacity: 0.72; }
.figures dd { margin-top: 0.2rem; font-size: 1.15rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.figures dd small { display: block; font-size: 0.68rem; font-weight: 400; color: var(--red); }
.figures .bad dd { color: var(--red); }

.block { margin-top: 2rem; }

.warn ul { list-style: none; }
.warn li { padding: 0.4rem 0 0.4rem 0.6rem; border-left: 3px solid var(--pop); font-size: 0.86rem; line-height: 1.45; }
.warn li + li { margin-top: 0.3rem; }
.warn li.ok { border-left-color: var(--green); }

.rule { padding: 0.5rem 0; border-top: 1px solid var(--line); font-size: 0.85rem; line-height: 1.4; }
.rule-head { display: flex; justify-content: space-between; gap: 0.5rem; align-items: baseline; }
.rule-head b { font-weight: 500; }
.rule-val { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; margin-top: 0.15rem; }
.rule-val input { width: 7rem; flex: 0 0 7rem; }
.rule small { display: block; margin-top: 0.25rem; font-size: 0.72rem; opacity: 0.75; }
.rule .changed { display: block; margin-top: 0.3rem; font-size: 0.75rem; color: var(--red); }

.tag {
    display: inline-block;
    padding: 0.05rem 0.4rem;
    border-top: 2px solid var(--blue);
    background: var(--slate-bg);
    font-size: 0.64rem;
    white-space: nowrap;
}
.tag.old { border-top-color: var(--clay); background: var(--clay-bg); }
.tag.none { border-top-color: var(--line); background: rgba(42, 40, 36, 0.05); }

.suggestions, .answers, .meaning { list-style: none; }
.suggestions li { padding: 0.5rem 0; border-top: 1px solid var(--line); font-size: 0.86rem; line-height: 1.45; }
.suggestions .actions { margin-top: 0.4rem; }
.meaning li { padding: 0.45rem 0; border-top: 1px solid var(--line); font-size: 0.92rem; line-height: 1.45; }

.answers li { display: flex; justify-content: space-between; gap: 0.6rem; align-items: baseline; padding: 0.3rem 0; border-top: 1px solid var(--line); font-size: 0.82rem; }
.answers span:first-child { opacity: 0.7; }
.answers .val { margin-left: auto; text-align: right; }

.note-box { display: flex; flex-direction: column; gap: 0.3rem; margin-top: 1rem; font-size: 0.85rem; }

.app-main textarea {
    margin: 0;
    width: 100%;
    min-height: 4.5rem;
    color: var(--ink);
    background: transparent;
    border: 1px solid var(--ink);
    padding: 0.6rem;
    font-size: 0.85rem;
}

.orient { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; margin: 0.8rem 0; font-size: 0.8rem; }
.orient .label { margin-left: 0.3rem; opacity: 0.7; }
.app-main button.sel { background: var(--ink); color: var(--paper); }

.floors { width: 100%; border-collapse: collapse; font-size: 0.8rem; margin: 0.6rem 0; }
.floors th, .floors td { padding: 0.25rem 0.4rem 0.25rem 0; text-align: left; border-bottom: 1px solid var(--line); }
.floors th { font-weight: 500; font-size: 0.68rem; opacity: 0.7; }
.floor-scroll { overflow: visible; }
.st-Pass { color: var(--green); }
.st-Over { color: var(--red); }

.steps { padding-left: 1.2rem; font-size: 0.9rem; line-height: 1.6; }
.steps li { margin-bottom: 0.4rem; }
.steps a, .split-results a { color: inherit; overflow-wrap: anywhere; }

.report-in { display: flex; flex-direction: column; gap: 0.3rem; margin-top: 1rem; font-size: 0.85rem; }
.report-in textarea { font-family: Consolas, Menlo, monospace; }

.report {
    margin-top: 1rem;
    padding: 0.9rem;
    border-top: 3px solid var(--sage);
    background: var(--sage-bg);
    font-family: Consolas, Menlo, monospace;
    font-size: 0.85rem;
    line-height: 1.6;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
.report[hidden] { display: none; }


/* ---------- climate cards ---------- */

.cards { display: flex; flex-direction: column; gap: 0.7rem; }

.card { border: 1px solid var(--line); border-top: 3px solid var(--line); }
.card.on { border-color: var(--ink); border-top-color: var(--sage); }

.app-main .card-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: baseline;
    width: 100%;
    border: none;
    padding: 0.7rem 0.9rem;
    text-align: left;
}
.card-head b { font-family: 'Cinzel', serif; font-size: 0.98rem; }
.card-head span { font-size: 0.8rem; opacity: 0.8; text-align: right; }
.card-body { padding: 0 0.9rem 0.9rem; font-size: 0.86rem; line-height: 1.5; }
.card-body[hidden] { display: none; }
.card-body p { margin-top: 0.5rem; }

.mini-figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(105px, 1fr)); gap: 0.6rem 1rem; margin: 0.7rem 0; }
.mini-figs div { border-top: 1px solid var(--line); padding-top: 0.3rem; }
.mini-figs dt { font-size: 0.7rem; opacity: 0.7; line-height: 1.3; }
.mini-figs dd { font-size: 1rem; font-weight: 500; font-variant-numeric: tabular-nums; }

.chart { display: block; width: 100%; max-width: 440px; height: auto; margin-top: 0.7rem; }
.chart text { font-family: 'Work Sans', sans-serif; font-size: 10px; fill: currentColor; }
.chart .axis { stroke: var(--line); }
.chart .bar { fill: var(--slate); }
.chart .bar.sun { fill: var(--clay); }
.chart .bar.hot { fill: var(--pop); opacity: 0.7; }
.chart .avg { fill: var(--ink); stroke: var(--sheet); stroke-width: 1.5; }
.chart-key { margin-top: 0.3rem; font-size: 0.74rem; opacity: 0.75; }

.chips { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.app-main .chips button.on, .full .chips button.on { background: var(--ink); color: var(--paper); }

.scale { display: flex; align-items: center; gap: 0.4rem; margin-top: 0.6rem; font-size: 0.72rem; }
.scale i { flex: 1; height: 0.6rem; }

.tag-line { margin-top: 0.5rem; }

.face-list { list-style: none; margin-top: 0.5rem; }
.face-list li { display: flex; justify-content: space-between; padding: 0.2rem 0; border-top: 1px solid var(--line); }


/* ---------- full screen editor ---------- */

.full {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    background: var(--paper);
    color: var(--ink);
    font-family: 'Work Sans', sans-serif;
}
.full[hidden] { display: none; }

.full-side { display: flex; flex-direction: column; gap: 0.7rem; min-height: 0; overflow-y: auto; padding: 1rem; border-right: 1px solid var(--ink); font-size: 0.86rem; }
.full-side h3 { font-family: 'Cinzel', serif; font-size: 1.1rem; }
.full-side .readout { margin: 0; }
.full-side .warn ul { list-style: none; }

.full-plan { position: relative; min-width: 0; min-height: 0; background: var(--sheet); }
.full-plan svg#plan-full { display: block; width: 100%; height: 100%; touch-action: none; user-select: none; }

.full-top { position: absolute; left: 0.8rem; bottom: 3.6rem; display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.full .full-top button { background: var(--paper); }
.full .full-top button.on { background: var(--ink); color: var(--paper); }
.full .plan-areas { top: 0.8rem; left: 0.8rem; }

.full-hint, .full-msg {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.4rem 0.9rem;
    font-size: 0.85rem;
    pointer-events: none;
    white-space: nowrap;
}
.full-hint { top: 0.8rem; background: var(--ink); color: var(--paper); }
/* the hint and the message sit between the area box and the 3D view, never under it */
@media (min-width: 1001px) {
    .full-hint, .full-msg { left: 12rem; right: calc(min(340px, 26vw) + 1.6rem); transform: none; white-space: normal; width: fit-content; max-width: none; }
}
.full-msg { top: 3.2rem; background: var(--pop-ink); color: var(--paper); }
.full-hint[hidden], .full-msg[hidden] { display: none; }

.full-actions { position: absolute; left: 0.8rem; bottom: 0.8rem; display: flex; gap: 0.4rem; }
.full .full-actions button { background: var(--paper); }
.full .full-actions button.solid { background: var(--ink); }

.pop {
    position: absolute;
    z-index: 5;
    width: 190px;
    padding: 0.7rem;
    background: var(--paper);
    border: 1px solid var(--ink);
    box-shadow: 0 8px 22px rgba(42, 40, 36, 0.25);
    font-size: 0.82rem;
}
.pop[hidden] { display: none; }
.pop .field { margin-bottom: 0.5rem; }
.pop .actions { margin-top: 0.3rem; }

.full-3d {
    position: absolute;
    top: 0.8rem;
    right: 0.8rem;
    width: min(340px, 26vw);
    height: min(240px, 30vh);
    border: 1px solid var(--ink);
    background: var(--sheet);
    box-shadow: 0 8px 28px rgba(42, 40, 36, 0.25);
    overflow: hidden;
}
.full .rose { right: 0.8rem; bottom: 0.8rem; }


/* ---------- phone or narrow screen: view on top, results below ---------- */

@media (max-width: 1000px) {
    .split-top { display: block; }
    .split-view { position: static; height: auto; max-height: none; }
    .view-box { height: 60vh; flex: none; }
    .split-results { margin-top: 1.4rem; }
}

@media (max-width: 900px) {
    .types { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .q-group.wide { grid-column: auto; }
    .full { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) 30vh; }
    .full-side { order: 2; border-right: none; border-top: 1px solid var(--ink); }
    .full-3d { width: 40vw; height: 20vh; }
    .full-hint { max-width: 90vw; white-space: normal; text-align: center; top: 0.4rem; left: 0.5rem; right: 44vw; transform: none; }
    .plan-areas { display: none; }
}

@media (max-width: 600px) {
    .header,
    .header.shrink-header { padding-left: 16px; padding-right: 16px; }
    .app-main { padding: 5rem 16px 4rem; }
    .q-groups { grid-template-columns: minmax(0, 1fr); }
    .compass { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .rose { width: 90px; }
}


/* ---------- What fits here?: the start page ---------- */

.page-title { font-family: 'Cinzel', serif; font-size: clamp(1.8rem, 3.4vw, 2.8rem); letter-spacing: 0.1rem; line-height: 1.2; margin: 1rem 0 1rem; }
.page-lead { max-width: 760px; font-family: 'Fraunces', serif; font-style: italic; font-size: clamp(1.05rem, 1.6vw, 1.3rem); line-height: 1.55; }

.inputs-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.6rem; margin-top: 2rem; }
.in-item { display: flex; flex-direction: column; gap: 0.3rem; padding: 0.8rem 0.9rem; border: 1px solid var(--line); }
.in-item span { display: flex; align-items: center; gap: 0.4rem; font-size: 0.64rem; letter-spacing: 0.12rem; text-transform: uppercase; opacity: 0.7; }
.in-item b { font-weight: 500; font-size: 0.88rem; line-height: 1.4; }
.in-item small { font-size: 0.7rem; opacity: 0.6; }
.strip-note { margin-top: 0.6rem; font-size: 0.82rem; opacity: 0.8; }
.strip-note a { color: inherit; }

/* the three squares, same as Systems */
.sq { display: inline-block; flex-shrink: 0; width: 0.75rem; height: 0.75rem; border: 1px solid currentColor; }
.sq.a { border-style: dashed; }
.sq.g { background: currentColor; }
.sq.d { background: repeating-linear-gradient(135deg, currentColor 0 1px, transparent 1px 4px); }
.figures small.d { color: inherit; opacity: 0.7; }

.part-title { margin-top: 4rem; padding-top: 2.5rem; border-top: 1px solid var(--ink); scroll-margin-top: 5rem; }
.part-title span { display: block; margin-bottom: 0.5rem; font-family: 'Work Sans', sans-serif; font-size: 0.7rem; letter-spacing: 0.25rem; text-transform: uppercase; opacity: 0.6; }

.type-note { margin-top: 0.8rem; font-size: 0.82rem; opacity: 0.75; }

.sub-types { margin-top: 1.6rem; }
.sub-types[hidden] { display: none; }
.sub-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.app-main .sub-chip { display: flex; flex-direction: column; gap: 0.15rem; padding: 0.7rem 1rem; border: 1px solid var(--ink); text-align: left; }
.sub-chip b { font-weight: 500; font-size: 0.9rem; }
.sub-chip small { font-size: 0.72rem; opacity: 0.7; }
.app-main .sub-chip.on { background: var(--ink); color: var(--paper); }

.gh-cards { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.8rem; margin-top: 1.4rem; }
.gh-card { display: grid; grid-template-columns: 2.2rem minmax(0, 1fr); gap: 0.8rem; padding: 1.1rem 1.2rem; border: 1px solid var(--ink); }
.gh-n { display: grid; place-items: center; width: 2rem; height: 2rem; border: 1px solid var(--ink); border-radius: 50%; font-size: 0.85rem; }
.gh-card b { font-family: 'Cinzel', serif; font-size: 1.05rem; letter-spacing: 0.04rem; }
.gh-ask { margin-top: 0.3rem; font-family: 'Fraunces', serif; font-style: italic; font-size: 1rem; }
.gh-card dl { margin-top: 0.6rem; }
.gh-card dl div { padding: 0.3rem 0; border-top: 1px solid var(--line); font-size: 0.82rem; line-height: 1.45; }
.gh-card dt { font-size: 0.62rem; letter-spacing: 0.12rem; text-transform: uppercase; opacity: 0.6; }
.gh-card a { color: inherit; }
.gh-line { margin-top: 1rem; font-size: 0.9rem; }

/* footer, same as the Systems page */
.app .footer-contact { background: var(--ink); color: var(--paper); }
.app .footer-contact[hidden] { display: none; }
.app .footer-nav a,
.app .email-link { color: var(--paper); }
.app .footer-contact textarea { border-color: var(--paper); color: var(--paper); }
.app .footer-contact button {
    background: var(--paper) !important;
    color: var(--ink) !important;
    padding: 0.8rem 1.5rem !important;
    font-weight: 500 !important;
}

@media (max-width: 900px) {
    .inputs-strip { grid-template-columns: minmax(0, 1fr); }
    .gh-cards { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
    .types { grid-template-columns: minmax(0, 1fr); }
    .app .footer-contact { padding-left: 16px; padding-right: 16px; }
}


/* ---------- the two tabs, and sources under each question ---------- */
.part-tabs { display: flex; margin: 2.4rem 0 1.6rem; }
.app-main .part-tabs button { padding: 0.75rem 1.2rem; font-size: 0.82rem; }
.app-main .part-tabs button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.part[hidden] { display: none; }
.checker[hidden] { display: none; }
.virtual-note { margin-top: 1.6rem; padding: 1rem 1.2rem; border: 1px dashed var(--ink); font-size: 0.95rem; }
.virtual-note[hidden] { display: none; }
.in-item a { margin-top: auto; padding-top: 0.3rem; font-size: 0.72rem; color: inherit; }
.q-src { display: block; margin-top: 0.3rem; font-size: 0.72rem; line-height: 1.4; opacity: 0.7; }
.q-note { margin: 0.2rem 0 1rem; padding: 0.5rem 0.7rem; border: 1px dashed var(--ink); font-size: 0.85rem; }
#a-beds[readonly] { border-bottom-style: dashed; }

@media (max-width: 600px) {
    .part-tabs { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
    .app-main .part-tabs button { padding: 0.7rem 0.5rem; font-size: 0.74rem; line-height: 1.35; text-align: center; white-space: normal; }
}


/* ---------- search, the site box, live results, near the site ---------- */
.board-search { margin-bottom: 0.4rem; }
.browse-lead { margin-top: 2rem; }

.site-wrap { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 2rem; align-items: start; }
.sb-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.sb-head b { font-family: 'Cinzel', serif; font-size: 1.2rem; }
.app-main .units-chip { padding: 0.35rem 0.7rem; border: 1px solid var(--ink); font-size: 0.72rem; }
.units-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; margin-top: 0.6rem; font-size: 0.75rem; }
.units-pick[hidden] { display: none; }
.units-pick span { margin-left: 0.4rem; opacity: 0.7; }
.app-main .units-pick .mini.on { background: var(--ink); color: var(--paper); }

.sb-grid { display: grid; grid-template-columns: 4.8rem minmax(0, 1fr) 4.8rem; gap: 0.5rem; align-items: center; margin-top: 0.9rem; }
.sb-road { display: flex; flex-direction: column; gap: 0.1rem; font-size: 0.68rem; }
.sb-road span { font-weight: 500; }
.sb-road input, .sb-dim input { font-size: 0.9rem; text-align: center; }
.sb-plot { display: flex; flex-direction: column; gap: 0.3rem; }
.sb-mid { display: grid; grid-template-columns: 4.2rem minmax(0, 1fr) 4.2rem; gap: 0.4rem; align-items: center; }
.sb-rect { position: relative; min-height: 7rem; border: 2px solid var(--ink); background: rgba(42, 40, 36, 0.04); }
.sb-north { position: absolute; top: 0.4rem; right: 0.4rem; width: 1.1rem; height: auto; }
.sb-north path { fill: var(--ink); }
.sb-north text { font-family: 'Work Sans', sans-serif; font-size: 9px; text-anchor: middle; fill: var(--ink); }
.sb-dim { display: flex; flex-direction: column; gap: 0.1rem; font-size: 0.68rem; text-align: center; }
.sb-dim.top, .sb-dim.bottom { width: 7rem; margin: 0 auto; }
.sb-line { margin-top: 0.8rem; font-size: 0.8rem; opacity: 0.85; }
.site-box .entrance-pick { margin-top: 0.5rem; }
.sb-area { margin-top: 1.2rem; padding-top: 0.8rem; border-top: 1px solid var(--line); }
.sb-area label { display: flex; flex-direction: column; gap: 0.2rem; max-width: 14rem; font-size: 0.85rem; }
.sb-area .qtag { display: inline-block; margin-top: 0.4rem; }
.qtag.derived { border-style: solid; background: repeating-linear-gradient(135deg, rgba(42, 40, 36, 0.18) 0 1px, transparent 1px 4px); }
.sb-warn { margin-top: 0.5rem; padding: 0.4rem 0.6rem; border: 1px dashed var(--ink); font-size: 0.82rem; }
.sb-warn[hidden] { display: none; }

.live { padding: 1rem 1.1rem; border: 1px solid var(--ink); }
.live h3 { font-family: 'Cinzel', serif; font-size: 1.05rem; margin-bottom: 0.6rem; }
.live-figs div { display: flex; justify-content: space-between; gap: 0.8rem; padding: 0.35rem 0; border-top: 1px solid var(--line); font-size: 0.85rem; }
.live-figs dt { opacity: 0.75; }
.live-figs dd { text-align: right; font-weight: 500; }
.live-figs small { display: block; font-weight: 400; font-size: 0.68rem; opacity: 0.7; }
.live-checks { list-style: none; margin-top: 0.8rem; }
.live-checks li { padding: 0.4rem 0 0.4rem 0.6rem; font-size: 0.82rem; line-height: 1.45; border-left: 2px solid var(--ink); }
.live-checks li + li { margin-top: 0.3rem; }
.live-checks li.fail { border-left-style: dashed; }
.live-checks b { font-weight: 500; }
.warn li.ok { border-left-color: var(--ink); border-left-style: solid; }

.near { margin-top: 1.6rem; }
.near h3 { font-family: 'Cinzel', serif; font-size: 1.05rem; margin-bottom: 0.4rem; }
.near-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.2rem 1rem; align-items: center; padding: 0.5rem 0; border-top: 1px solid var(--line); font-size: 0.86rem; }
.near-item small { grid-column: 1 / -1; font-size: 0.72rem; opacity: 0.7; }
.near-item.off span { opacity: 0.6; }
.app-main .near .switch .mini.on { background: var(--ink); color: var(--paper); }

/* the editor: angles and locks */
.plan .lock { cursor: pointer; }
.plan .lock-hit { fill: transparent; }
.plan .lock-body { fill: var(--paper); stroke: var(--ink); stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.plan .lock-arc { fill: none; stroke: var(--ink); stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.plan .lock.on .lock-body { fill: var(--ink); }
.full-area { margin-top: 0.4rem; }

@media (max-width: 900px) {
    .site-wrap { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
    .sb-grid { grid-template-columns: 3.6rem minmax(0, 1fr) 3.6rem; gap: 0.35rem; }
    .sb-mid { grid-template-columns: 3.4rem minmax(0, 1fr) 3.4rem; }
    .sb-dim.top, .sb-dim.bottom { width: 6rem; }
}

/* notes: just information, a smaller list under the warnings */
.warn .notes-head { display: block; margin-top: 1.2rem; }
.warn ul.notes { margin-top: 0.4rem; }
.warn ul.notes li { border-left: 1px solid var(--line, rgba(42, 40, 36, 0.25)); font-size: 0.76rem; opacity: 0.8; padding: 0.25rem 0 0.25rem 0.6rem; }
.full-side .warn ul.notes { margin-top: 0.8rem; }
.warn li .mini[data-refit] { margin-top: 0.4rem; display: inline-block; }
.full-msg { white-space: normal; max-width: min(90%, 560px); text-align: center; }


/* =========================================================
   ROUND 3: the calm lower half. Black and white only.
   ========================================================= */

/* Part 1: questions over the full width, two columns on wide screens */
.q-group { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 2.5rem; align-items: start; }
.q-group h3, .q-group .q-city { grid-column: 1 / -1; }
.q-city .city-needs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 2.5rem; }
.city-needs-head { grid-column: 1 / -1; display: block; margin: 0.4rem 0 0.6rem; font-weight: 500; font-size: 0.82rem; letter-spacing: 0.04rem; }
.q-two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0.6rem; }
.q-derived { display: block; margin-top: 0.3rem; font-size: 0.72rem; line-height: 1.4; opacity: 0.75; }
.city-q { margin-bottom: 1rem; font-size: 0.88rem; }

/* a long line: cut with an ellipsis, tap to read it all */
.src-line, .app-main button.src-line {
    display: block;
    width: 100%;
    margin-top: 0.3rem;
    padding: 0;
    border: none;
    background: none;
    font-size: 0.72rem;
    line-height: 1.4;
    letter-spacing: 0;
    text-align: left;
    opacity: 0.7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}
.src-line.open { white-space: normal; }

.a-tag { font-size: 0.64rem; font-weight: 400; letter-spacing: 0.04rem; opacity: 0.65; }
.sb-area .q-head { max-width: 14rem; }
.sb-rect { min-height: 0; height: 9rem; width: auto; max-width: 100%; margin: 0 auto; }

/* the plan's results panel: the inputs bar stays at the top */
.inputs-bar {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.2rem 1.2rem;
    align-items: start;
    margin: 0 -0.2rem 1.2rem;
    padding: 0.7rem 0.2rem 0.5rem;
    background: var(--paper);
    border-bottom: 1px solid var(--ink);
}
.inputs-bar .field { margin-bottom: 0.5rem; font-size: 0.8rem; }
.inputs-bar .field[hidden] { display: none; }
.inputs-bar .q-head { margin: 0; }
.bar-city { grid-column: 1 / -1; }
.area-wrap { margin-bottom: 1.2rem; max-width: 46rem; }
.bar-area { grid-column: 1 / -1; }
.area-box { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 0; font-size: 0.85rem; }
.area-box input { width: 100%; }
.area-lines { display: flex; flex-direction: column; gap: 0.1rem; font-size: 0.78rem; line-height: 1.45; }
.area-check { align-self: flex-start; }
.area-note { font-size: 0.68rem; opacity: 0.65; }
.bar-area .area-box { font-size: 0.8rem; }
.bar-city:empty { display: none; }
.bar-city .city-needs { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 0 1.2rem; }
.bar-city .city-needs-head { font-size: 0.74rem; margin: 0.2rem 0 0.3rem; }
.bar-city .city-q { margin-bottom: 0.5rem; font-size: 0.8rem; }

/* Floors: Auto or typed */
.floors-ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.5rem; font-size: 0.8rem; }
.inputs-bar .floors-ctl { grid-column: span 2; }
.fl-label { width: 100%; }
.fl-ctl { display: inline-flex; align-items: center; gap: 0.25rem; }
.fl-ctl input { width: 3.4rem; text-align: center; }
.fl-why { width: 100%; font-size: 0.72rem; line-height: 1.4; opacity: 0.75; }
.full-side .floors-ctl { padding-bottom: 0.6rem; border-bottom: 1px solid var(--line); }

/* key figures: 8 tiles, two rows */
.figures { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.figures dd small { display: block; color: inherit; opacity: 0.65; font-size: 0.64rem; font-weight: 400; }
.figures dd .of { font-size: 0.72rem; font-weight: 400; opacity: 0.7; }
.figures .bad dd { color: var(--ink); text-decoration: underline; text-decoration-color: var(--red); text-underline-offset: 0.25rem; }
.warn li.ok { border-left: 1px solid var(--line); opacity: 0.7; }

/* sources: one style everywhere, thin border, grey text */
.tag { border: 1px solid var(--line); border-top: 1px solid var(--line); background: none; color: rgba(42, 40, 36, 0.7); }
.tag.old, .tag.none { border-top-color: var(--line); background: none; }
.app-main button.src {
    display: inline-block;
    max-width: 100%;
    padding: 0.05rem 0.4rem;
    border: 1px solid var(--line);
    background: none;
    color: rgba(42, 40, 36, 0.72);
    font-size: 0.64rem;
    letter-spacing: 0;
    line-height: 1.5;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}
.src .src-full { display: none; }
.app-main button.src.open { white-space: normal; }
.src.open .src-full { display: block; margin-top: 0.3rem; padding-top: 0.3rem; border-top: 1px solid var(--line); }

/* rules used: label left, value on the same line, source far right */
.rules .rule { display: grid; grid-template-columns: minmax(7rem, 1fr) auto minmax(0, 10rem); gap: 0.2rem 0.8rem; align-items: center; }
.rule-label { font-weight: 500; }
.rules .rule-val { margin: 0; flex-wrap: nowrap; justify-content: flex-end; }
.rules .rule-val input { width: 4.6rem; flex: 0 0 4.6rem; text-align: right; font-size: 0.88rem; }
.rule-unit { font-size: 0.72rem; opacity: 0.7; white-space: nowrap; }
.rule-text { font-size: 0.82rem; text-align: right; }
.rule-src { display: flex; justify-content: flex-end; align-items: center; gap: 0.3rem; min-width: 0; }
.rules .rule-note { grid-column: 1 / -1; margin: 0; }
.sb-boxes { display: inline-grid; grid-template-columns: repeat(4, 3.2rem); gap: 0.3rem; }
.sb-boxes label { display: flex; flex-direction: column; font-size: 0.6rem; opacity: 0.9; }
.rules .sb-boxes input { width: 100%; flex: none; }

.rules-other-head { margin-top: 1.4rem; }
.orule { border-top: 1px solid var(--line); font-size: 0.85rem; }
.orule summary { display: flex; gap: 0.8rem; align-items: baseline; padding: 0.45rem 0; cursor: pointer; list-style: none; }
.orule summary::-webkit-details-marker { display: none; }
.orule summary b { flex: 0 0 auto; font-weight: 500; }
.orule summary span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: 0.8; }
.orule[open] summary span { white-space: normal; }
.orule-body { padding: 0 0 0.6rem; font-size: 0.8rem; line-height: 1.5; }
.orule-src { margin-top: 0.3rem; font-size: 0.72rem; opacity: 0.7; overflow-wrap: anywhere; }

/* closed sections: Not given or assumed, Notes */
details.fold { border-top: 1px solid var(--ink); }
details.fold > summary { padding: 0.7rem 0; font-size: 0.68rem; letter-spacing: 0.2rem; text-transform: uppercase; cursor: pointer; }
details.fold[hidden] { display: none; }
.nga-cat { margin-bottom: 0.8rem; }
.nga-cat b { display: block; margin-bottom: 0.2rem; font-weight: 500; font-size: 0.8rem; }
.nga-cat ul { list-style: none; }
.nga-cat li { padding: 0.3rem 0 0.3rem 0.6rem; border-left: 1px dashed var(--ink); font-size: 0.8rem; line-height: 1.45; }
.nga-cat li + li { margin-top: 0.2rem; }
.nga-how { display: block; font-size: 0.72rem; opacity: 0.7; }
.nga-how a { color: inherit; }
#notes-box ul.notes { list-style: none; }
#notes-box ul.notes li { padding: 0.25rem 0 0.25rem 0.6rem; border-left: 1px solid var(--line); font-size: 0.78rem; line-height: 1.45; opacity: 0.85; }

/* the file input as a button that shows the file name */
.file-btn { position: relative; display: flex; align-items: center; gap: 0.7rem; cursor: pointer; font-size: 0.8rem; }
.file-btn input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-pick { flex: 0 0 auto; padding: 0.5rem 0.9rem; border: 1px solid var(--ink); }
.file-btn:focus-within .file-pick { outline: 2px solid var(--ink); outline-offset: 2px; }
.file-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: 0.75; }
.export-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.export-row button { width: 100%; }
.weather-file { margin-bottom: 1rem; }

@media (max-width: 1300px) {
    .figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .rules .rule { grid-template-columns: minmax(0, 1fr) auto; }
    .rule-src { grid-column: 1 / -1; justify-content: flex-start; }
}
@media (max-width: 1000px) {
    .figures { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .inputs-bar { position: static; }
}
@media (max-width: 700px) {
    .q-group, .q-city .city-needs { grid-template-columns: minmax(0, 1fr); }
    .figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .export-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .inputs-bar .floors-ctl { grid-column: 1 / -1; }
    .rules .rule { grid-template-columns: minmax(0, 1fr); }
    .rules .rule-val { justify-content: flex-start; }
}

/* ---------- Site on a map ---------- */
.map-wrap { margin-bottom: 1.2rem; max-width: 46rem; }
.map-box { display: flex; flex-direction: column; gap: 0.4rem; font-size: 0.85rem; margin-bottom: 0; }
.map-box .q-head { align-items: center; }
.map-box .mp-body { display: flex; flex-direction: column; gap: 0.5rem; }
.map-box .mp-body[hidden] { display: none; }
.mp-coord { display: flex; flex-direction: column; gap: 0.25rem; }
.mp-row { display: flex; gap: 0.4rem; }
.mp-row input { flex: 1; min-width: 0; }
.mp-map { position: relative; z-index: 0; isolation: isolate; width: 100%; height: 320px; border: 1px solid var(--line); background: #e9e6df; }
.mp-msg { margin: 0; min-height: 1.1em; font-size: 0.8rem; color: var(--ink); }
.mp-tools { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.mp-tools [hidden] { display: none; }
.mp-edges-lead { margin: 0 0 0.3rem; font-size: 0.8rem; }
.mp-edge { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.7rem; padding: 0.3rem 0; border-top: 1px solid var(--line); }
.mp-edge > span { flex: 1 1 14rem; }
.mp-edge input[type="number"] { width: 6rem; }
.mp-edge label { display: flex; align-items: center; gap: 0.3rem; }
.mp-priv { color: var(--ink); opacity: 0.7; }
.mp-len.leaflet-tooltip { background: rgba(255,255,255,0.88); border: 1px solid var(--line); color: var(--ink); font-size: 11px; padding: 1px 4px; box-shadow: none; text-align: center; }
.mp-len.leaflet-tooltip::before { display: none; }
.sb-geo { display: block; width: 100%; max-height: 220px; margin: 0.4rem 0; }
.sb-geo polygon { fill: rgba(120, 139, 154, 0.18); stroke: var(--ink); stroke-width: 1.4; vector-effect: non-scaling-stroke; }

.full-map-panel {
    position: absolute; z-index: 6; left: 0.8rem; bottom: 3.6rem;
    width: min(560px, calc(100% - 1.6rem)); max-height: calc(100% - 7rem); overflow: auto;
    padding: 0.7rem; background: var(--paper); border: 1px solid var(--ink);
}
.full-map-panel[hidden] { display: none; }
.full-map-panel .mp-map { height: 300px; }

@media (max-width: 600px) {
    .mp-map { height: 280px; }
    .full-map-panel { left: 0.4rem; width: calc(100% - 0.8rem); bottom: 3.2rem; }
}


/* panning or clicking on the map, the plan or the editor must never select page text (inputs still take typing) */
.mp-map, .mp-map *, .view-box, .view-box *, .full-plan, .full-plan *, .full-3d, .full-3d *, .rose, .plan-areas, .zoom-read,
.sb-rect, .sb-geo, .pv-wrap, .pv-wrap svg, .pv-wrap svg * { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.mp-map, .view-box svg, .full-plan svg, .pv-wrap svg { touch-action: none; }
input, textarea, select, [contenteditable], .mp-edge input, .full-pop input { -webkit-user-select: text; user-select: text; }

.mp-area { margin: 0; min-height: 1.1em; font-size: 0.85rem; font-weight: 500; }
.mp-corner { width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid var(--slate-ink); box-sizing: border-box; cursor: grab; box-shadow: 0 0 0 2px rgba(255,255,255,0.7); }

/* roads on the edges */
.edges-wrap { margin: 0 0 1.2rem; max-width: 46rem; }
.mp-form { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.8rem; font-size: 0.85rem; }
.mp-form .mp-form-name { flex: 1 1 100%; font-weight: 500; }
.mp-form .mp-form-dir { flex: 1 1 100%; opacity: 0.7; font-size: 0.72rem; margin-top: -0.2rem; }
.mp-form label { display: flex; align-items: center; gap: 0.3rem; }
.mp-form input[type="number"] { width: 5.5rem; }
.mp-edge { padding: 0.45rem 0; border-top: 1px solid var(--line); }
.mp-edge .mp-form { flex-wrap: wrap; }
.mp-pop .leaflet-popup-content { margin: 0.6rem 0.8rem; }
.mp-pop .mp-form { flex-direction: column; align-items: flex-start; }
.sb-typed { display: grid; grid-template-columns: minmax(0, 8rem) minmax(0, 8rem) minmax(0, 1fr); gap: 0.8rem; align-items: end; margin-top: 0.8rem; }
.sb-typed .sb-dim { text-align: left; }
.sb-typed .sb-rect { grid-column: 1 / -1; }
.mp-hit { cursor: pointer; }

/* Preview */
body.pv-lock { overflow: hidden; }
.pv-panel { position: fixed; inset: 0; z-index: 2000; background: var(--bg, #f1eee8); display: flex; flex-direction: column; padding: 0.8rem 1rem 1rem; gap: 0.5rem; overflow: auto; }
.pv-head { display: flex; justify-content: space-between; align-items: center; }
.pv-info, .pv-help { margin: 0; font-size: 0.85rem; }
.pv-help { opacity: 0.75; font-size: 0.78rem; }
.pv-wrap { flex: 1 1 auto; min-height: 16rem; border: 1px solid var(--line); background: #fff; display: flex; }
.pv-wrap svg { width: 100%; height: 100%; display: block; }
.pv-plot { fill: rgba(120, 139, 154, 0.14); stroke: #2a2824; stroke-width: 2; vector-effect: non-scaling-stroke; }
.pv-road { fill: rgba(42, 40, 36, 0.1); stroke: rgba(42, 40, 36, 0.35); stroke-width: 1; vector-effect: non-scaling-stroke; cursor: pointer; }
.pv-road.main { fill: var(--clay-bg); stroke: var(--clay); }
.pv-hit { stroke: transparent; stroke-width: 18; vector-effect: non-scaling-stroke; cursor: pointer; }
.pv-main { fill: var(--pop); stroke: var(--clay-ink); stroke-width: 1; vector-effect: non-scaling-stroke; pointer-events: none; }
.pv-lab { fill: #2a2824; font-family: 'Work Sans', sans-serif; pointer-events: none; }
.pv-lab.road { fill: var(--slate-ink); }
.pv-north line, .pv-scale line { stroke: #2a2824; stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.pv-north polygon { fill: #2a2824; }
.pv-north text, .pv-scale text { fill: #2a2824; font-family: 'Work Sans', sans-serif; }
.pv-pop { position: fixed; left: 50%; bottom: 1.2rem; transform: translateX(-50%); z-index: 2100; background: #fff; border: 1px solid var(--ink); padding: 0.8rem 2rem 0.8rem 0.9rem; box-shadow: 0 4px 18px rgba(0,0,0,0.2); max-width: calc(100vw - 2rem); }
.pv-pop .mp-form { flex-direction: column; align-items: flex-start; }
.pv-pop-x { position: absolute; top: 0.2rem; right: 0.35rem; border: 0; background: none; font-size: 1rem; cursor: pointer; }

/* the project sentence and the four-part bar, read from Understand it */
.strip-sentence { max-width: 900px; margin: 0.8rem 0 0.4rem; font-size: clamp(1.2rem, 2.4vw, 1.7rem); line-height: 1.3; min-height: 0; }
.strip-sentence:empty, .strip-bar:empty { display: none; }
.strip-bar { display: flex; gap: 2px; max-width: 900px; margin-bottom: 0.8rem; }
.strip-bar .sb { display: flex; align-items: center; gap: 0.3rem; min-width: 3rem; padding: 0.3rem 0.5rem; border-top: 3px solid currentColor; font-size: 0.72rem; white-space: nowrap; overflow: hidden; }
.strip-bar .sb.a { border-top-style: dashed; }
.strip-bar .sb.n { border-top-style: dotted; }
.strip-bar .sb.d { border-top-style: double; }
.strip-bar .sb .sq { margin: 0 0.2rem 0 0; width: 0.6rem; height: 0.6rem; }
@media (max-width: 600px) { .strip-bar { flex-wrap: wrap; } .strip-bar .sb { flex: 1 1 40% !important; } }
.sq.n { border-style: dotted; }


/* Levels, each use, First report */
.lv-all { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-bottom: 0.6rem; font-size: 0.9rem; }
.lv-all input, .lv-table input { width: 5rem; padding: 0.3rem; font: inherit; }
.lv-scroll { overflow-x: auto; }
.lv-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.lv-table th, .lv-table td { padding: 0.25rem 0.5rem; text-align: left; border-bottom: 1px solid rgba(0,0,0,0.12); }
.lv-table th { font-weight: 400; font-size: 0.7rem; letter-spacing: 0.1rem; text-transform: uppercase; }
#mixed-box { margin-top: 0.8rem; }
.rp-head { font-size: 1rem; margin-bottom: 0.5rem; }
.rp-rules { list-style: none; margin-bottom: 1rem; }
.rp-rules li { padding: 0.35rem 0; font-size: 0.88rem; line-height: 1.45; border-bottom: 1px solid rgba(0,0,0,0.1); }
.rp-rules small { margin-left: 0.4rem; opacity: 0.7; }
.rp-dot { display: inline-block; width: 0.7rem; height: 0.7rem; margin-right: 0.5rem; border: 1px solid currentColor; vertical-align: -0.05rem; }
.rp-dot.green { background: #4f7a4f; border-color: #4f7a4f; }
.rp-dot.amber { background: #c09a3a; border-color: #c09a3a; }
.rp-dot.red { background: #a8473f; border-color: #a8473f; }
.rp-fix { display: block; margin-left: 1.2rem; font-size: 0.82rem; }
.rp-group h4 { font-weight: 400; font-size: 0.7rem; letter-spacing: 0.15rem; text-transform: uppercase; margin: 0.8rem 0 0.2rem; opacity: 0.7; }
.rp-btn { display: grid; grid-template-columns: 1fr auto; gap: 0.1rem 0.6rem; width: 100%; padding: 0.4rem 0; text-align: left; font: inherit; color: inherit; background: none; border: none; border-bottom: 1px solid rgba(0,0,0,0.1); cursor: pointer; }
.rp-btn small { grid-column: 1 / -1; opacity: 0.75; font-size: 0.8rem; }
.rp-work { padding: 0.4rem 0 0.6rem; font-size: 0.8rem; line-height: 1.5; opacity: 0.85; }
.rp-work[hidden] { display: none; }
.rp-score { margin: 1rem 0 0.4rem; font-size: 1rem; }
.rp-score b { font-size: 2rem; font-weight: 400; }
.rp-score.grey { opacity: 0.5; }
.rp-bars div { position: relative; margin: 0.3rem 0; font-size: 0.78rem; }
.rp-bars i { display: block; height: 0.4rem; margin-top: 0.1rem; background: currentColor; opacity: 0.55; max-width: 100%; }
.rp-bars small { opacity: 0.7; margin-left: 0.4rem; }
.tiers .plain { list-style: none; }


/* ---------- What fits here: full width layout (UI round 5) ---------- */
.q-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 1.6rem 2.4rem; align-items: start; }
.q-map, .q-side { min-width: 0; }
.map-wrap, .area-wrap, .edges-wrap { max-width: none; }
.mp-map { height: clamp(380px, 62vh, 640px); }
.q-side .site-wrap { grid-template-columns: minmax(0, 1fr); gap: 1.2rem; margin-top: 1.2rem; }
.q-open { margin: 1rem 0 0; }
.q-open button.big { width: 100%; }
.q-side .edges-wrap { margin-bottom: 0; }
.near, .q-groups { margin-top: 1.6rem; }
/* "Near the site" sits under the map so the left column has no hole beside the long side panel */
.q-grid { grid-template-areas: "map side" "near side"; grid-template-rows: auto 1fr; }
.q-map { grid-area: map; }
.q-side { grid-area: side; }
.q-grid > .near { grid-area: near; margin-top: 0; }
@media (max-width: 1000px) {
    .q-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "map" "side" "near"; grid-template-rows: auto; }
    .mp-map { height: 340px; }
}

/* the longer sections run the full width under the plan and the results */
.split-wide { display: grid; grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr)); gap: 1.5rem; margin-top: 2.4rem; }
.split-wide[hidden] { display: none; }
.split-wide > .block, .split-wide > .fold { margin: 0; padding: 1.3rem 1.5rem; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.35); min-width: 0; }
.split-wide > .block:first-child, .split-wide > #nga, .split-wide > #notes-box { grid-column: 1 / -1; }
.split-wide .rules { columns: 2 28rem; column-gap: 2.4rem; }
.split-wide .rules > * { break-inside: avoid; }
@media (max-width: 1000px) { .split-wide { grid-template-columns: minmax(0, 1fr); } }

/* ---------- map: drawing, labels, Satellite, road questions (UI round 5) ---------- */
.mp-hint-line { margin: 0; padding: 0.4rem 0.7rem; border-left: 3px solid var(--ink); background: rgba(42, 40, 36, 0.06); font-size: 0.82rem; }
.mp-hint-line[hidden] { display: none; }
.mp-map.mp-drawing, .mp-map.mp-drawing .leaflet-grab, .mp-map.mp-drawing .leaflet-interactive, .mp-map.mp-drawing .leaflet-dragging .leaflet-grab { cursor: crosshair !important; }
.mp-map.mp-drawing.mp-closing, .mp-map.mp-drawing.mp-closing .leaflet-grab, .mp-map.mp-drawing.mp-closing .leaflet-interactive { cursor: pointer !important; }
.mp-base.leaflet-bar { display: flex; background: #fff; border: 1px solid var(--ink); box-shadow: none; }
.mp-base button { padding: 0.3rem 0.7rem; border: none; border-right: 1px solid var(--ink); background: #fff; color: var(--ink); font-size: 0.74rem; cursor: pointer; }
.mp-base button:last-child { border-right: none; }
.mp-base button.on { background: var(--ink); color: var(--paper); }
.mp-len-edit.leaflet-tooltip { cursor: pointer; pointer-events: auto; }
.mp-len-edit.leaflet-tooltip:hover { background: var(--ink); color: var(--paper); }
.mp-ang.leaflet-tooltip { border-radius: 999px; padding: 1px 6px; }
.mp-hint.leaflet-tooltip { background: var(--ink); color: var(--paper); border: none; font-size: 11px; }
.mp-hint.leaflet-tooltip::before { display: none; }
.mp-num { display: flex; flex-direction: column; gap: 0.4rem; font-size: 0.82rem; }
.mp-num-row { display: flex; align-items: center; gap: 0.3rem; }
.mp-num input { width: 6rem; }
.mp-num-msg { margin: 0; max-width: 16rem; color: #8a2f2a; font-size: 0.75rem; line-height: 1.4; }
.mp-num-msg:empty { display: none; }
.ed-q { margin-top: 0.9rem; }
.ed-ask { margin: 0 0 0.4rem; font-size: 0.95rem; font-weight: 500; }
.ed-pills { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.app-main .ed-pill { padding: 0.4rem 0.9rem; border: 1px solid var(--ink); border-radius: 999px; font-size: 0.8rem; background: transparent; }
.app-main .ed-pill:hover { background: rgba(42, 40, 36, 0.1); }
.app-main .ed-pill.on { background: var(--ink); color: var(--paper); }
.ed-widths { margin-top: 0.8rem; display: grid; gap: 0.5rem; }
.ed-w label { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; font-size: 0.85rem; }
.ed-w input { width: 5.5rem; }
.ed-sugg { margin: 0.25rem 0 0; font-size: 0.78rem; line-height: 1.45; }
.area-lines { display: flex; flex-direction: column; gap: 0.25rem; }
.area-lines .qtag.derived { font-style: normal; margin-right: 0.3rem; }
.area-src { display: block; margin-left: 0; opacity: 0.65; font-size: 0.7rem; }


/* =========================================================
   MEANING COLOURS (UI round 7). The shape says it first (solid, dashed,
   hatched, dotted); the colour is added on top, never instead of it.
   Given = slate, Assumed = clay, Derived = sage, Not given = charcoal 45%.
   ========================================================= */
.sq.g { color: var(--slate-ink); }
.sq.a { color: var(--clay-ink); }
.sq.d { color: var(--sage-ink); }
.sq.n { color: var(--none); }
.dark .sq.g { color: var(--slate-lt); }
.dark .sq.a { color: var(--clay-lt); }
.dark .sq.d { color: var(--sage-lt); }
.dark .sq.n { color: rgba(239, 236, 229, 0.5); }

/* the sheet bar: row 1 the bar, sized by count (a 0 is not drawn); row 2 the four labels. Nothing is cut. */
.sbar { max-width: 900px; margin: 0.6rem 0 1rem; }
.sbar:empty { display: none; }
.sbar-track { display: flex; gap: 2px; height: 10px; }
.sbar-track i { display: block; min-width: 6px; }
.sbar-track .g { background: var(--slate); }
.sbar-track .a { background: repeating-linear-gradient(90deg, var(--clay) 0 7px, transparent 7px 10px); box-shadow: inset 0 0 0 1px var(--clay); }
.sbar-track .n { background: radial-gradient(circle, var(--none) 1.2px, transparent 1.6px) 0 0 / 5px 5px; box-shadow: inset 0 0 0 1px var(--none); }
.sbar-track .d { background: repeating-linear-gradient(135deg, var(--sage) 0 2px, transparent 2px 5px); box-shadow: inset 0 0 0 1px var(--sage); }
.sbar-key { display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; margin-top: 0.5rem; font-size: 0.78rem; }
.sbar-key span { display: inline-flex; align-items: center; white-space: nowrap; }
.sbar-key .sq { width: 0.7rem; height: 0.7rem; margin-right: 0.4rem; }
.sbar-key b { font-weight: 500; margin-right: 0.25rem; }
.qtag { border-color: var(--clay); color: var(--clay-ink); background: var(--clay-bg); }
.qtag.given { background: var(--slate-ink); border-color: var(--slate-ink); color: var(--paper); }
.qtag.derived { border-color: var(--sage); color: var(--sage-ink); background: var(--sage-bg); }
.a-tag, .figures dd small.a-tag { color: var(--clay-ink); }
.figures dd small { color: inherit; opacity: 0.75; }
.figures .bad dd { color: var(--pop-ink); text-decoration-color: var(--pop); }


/* =========================================================
   UI ROUND 7: three steps. 1 Draw the plot, 2 Check the plan (overlay), 3 Take it to Rhino.
   No empty space: every row is filled edge to edge.
   ========================================================= */

.app-main .back { display: inline-block; margin-bottom: 0.4rem; }
.strip-sentence { font-family: 'Fraunces', serif; font-style: italic; font-size: clamp(1.3rem, 2.6vw, 1.9rem); line-height: 1.3; }
.sbar { max-width: 900px; margin: 0.4rem 0 1.2rem; }
.sbar:empty { display: none; }
.sbar-track { display: flex; gap: 2px; height: 10px; }
.sbar-track i { display: block; min-width: 6px; }
.sbar-track .g { background: var(--slate); }
.sbar-track .a { background: repeating-linear-gradient(90deg, var(--clay) 0 7px, transparent 7px 10px); box-shadow: inset 0 0 0 1px var(--clay); }
.sbar-track .n { background: radial-gradient(circle, var(--none) 1.2px, transparent 1.6px) 0 0 / 5px 5px; box-shadow: inset 0 0 0 1px var(--none); }
.sbar-track .d { background: repeating-linear-gradient(135deg, var(--sage) 0 2px, transparent 2px 5px); box-shadow: inset 0 0 0 1px var(--sage); }
.sbar-key { display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; margin-top: 0.5rem; font-size: 0.78rem; }
.sbar-key span { display: inline-flex; align-items: center; white-space: nowrap; }
.sbar-key .sq { width: 0.7rem; height: 0.7rem; margin-right: 0.4rem; }
.sbar-key b { font-weight: 500; margin-right: 0.25rem; }

/* the step strip: current filled ink, done sage with a tick, next outlined */
.step-strip { list-style: none; display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 0.4rem 0 2rem; padding: 0; }
.step-strip[hidden] { display: none; }
.app-main .step-pill { display: inline-flex; align-items: center; gap: 0.6rem; min-height: 44px; padding: 0.4rem 1.1rem 0.4rem 0.45rem; border: 1px solid var(--ink); border-radius: 999px; background: transparent; color: var(--ink); font-size: 0.85rem; letter-spacing: 0.04rem; text-transform: none; }
.app-main .step-pill .step-n { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; border: 1px solid currentColor; font-size: 0.8rem; }
.app-main .step-pill.now { background: var(--ink); color: var(--paper); }
.app-main .step-pill.done { border-color: var(--sage); background: var(--sage-bg); color: var(--sage-ink); }
.app-main .step-pill.done .step-n { background: var(--sage-ink); border-color: var(--sage-ink); color: var(--paper); }
.app-main .step-pill:disabled { opacity: 0.55; }

/* buttons: one main action (ink, terracotta on hover), one quiet line button */
.app-main .btn-main, .full .btn-main, a.btn-main {
    display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 1.6rem;
    background: var(--ink); color: var(--paper); border: 1px solid var(--ink); text-decoration: none;
    font-size: 0.8rem; letter-spacing: 0.14rem; text-transform: uppercase; cursor: pointer; transition: background 0.2s ease, border-color 0.2s ease;
}
.app-main .btn-main:hover:not(:disabled), .full .btn-main:hover:not(:disabled), a.btn-main:hover { background: var(--pop-ink); border-color: var(--pop-ink); }
.app-main .btn-main:disabled { opacity: 0.4; cursor: default; }
.app-main .btn-line, .full .btn-line { min-height: 44px; padding: 0 1.2rem; border: 1px solid var(--ink); background: transparent; color: var(--ink); font-size: 0.8rem; letter-spacing: 0.1rem; text-transform: uppercase; }

.need-answers { display: flex; flex-direction: column; align-items: flex-start; gap: 1rem; max-width: 640px; padding: 1.6rem; border-radius: 10px; background: var(--clay-bg); border-top: 3px solid var(--clay); }
.need-answers[hidden] { display: none; }
.need-answers p { font-size: 1.05rem; }
.app-body[hidden] { display: none; }

.step { margin-top: 1rem; }
.step + .step { margin-top: 4.5rem; padding-top: 2.6rem; border-top: 1px solid var(--line); }
.step-h { display: flex; align-items: center; gap: 0.8rem; margin: 0 0 1.2rem; font-family: 'Cinzel', serif; font-size: clamp(1.4rem, 2.4vw, 2rem); letter-spacing: 0.08rem; font-weight: 600; scroll-margin-top: 5rem; }
.step-h .step-n { display: grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--ink); color: var(--paper); font-family: 'Work Sans', sans-serif; font-size: 0.95rem; }
.step { scroll-margin-top: 5rem; }
.step-lead { max-width: 760px; margin-bottom: 1.4rem; font-family: 'Fraunces', serif; font-style: italic; font-size: clamp(1.05rem, 1.6vw, 1.25rem); line-height: 1.5; }

/* cards: radius 10, soft fills, a coloured top border */
.card { padding: 1rem 1.1rem; border-radius: 10px; background: #f6f4ee; border-top: 3px solid var(--line); }
.place-card { background: var(--clay-bg); border-top-color: var(--clay); }
.plot-card { background: var(--slate-bg); border-top-color: var(--slate); }
.climate-card { background: var(--sage-bg); border-top-color: var(--sage); }
.how-card { background: #f6f4ee; border-top-color: var(--ink); }
.card[hidden] { display: none; }
.card > b { display: block; margin-bottom: 0.45rem; font-family: 'Cinzel', serif; font-size: 1.1rem; letter-spacing: 0.04rem; font-weight: 600; }
.how-card ul { margin: 0; padding-left: 1.1rem; font-size: 0.88rem; line-height: 1.6; }
.pc-rules { font-size: 0.9rem; margin-bottom: 0.3rem; }
.pc-change { display: inline-block; margin-top: 0.4rem; font-size: 0.82rem; color: var(--clay-ink); }

/* step 1: map left 62%, the panel right 38%, the same height. The map grows with the panel. */
.s1-row { display: grid; grid-template-columns: minmax(0, 62fr) minmax(0, 38fr); gap: 32px; align-items: stretch; }
.s1-map { display: flex; min-width: 0; }
.s1-map .map-box { flex: 1; display: flex; flex-direction: column; margin: 0; }
.s1-map .mp-body { flex: 1; display: flex; flex-direction: column; }
.s1-map .mp-map { flex: 1 1 auto; height: auto; min-height: clamp(480px, 36.5vw, 560px); border-radius: 10px; overflow: hidden; }
.s1-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.s1-side .btn-main { width: 100%; }
.see-why { margin: -0.4rem 0 0; font-size: 0.8rem; opacity: 0.75; }
.see-why:empty { display: none; }

/* the plot card: figures, then each side */
.pc-figs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.6rem; margin: 0 0 0.8rem; }
.pc-figs dt { font-size: 0.7rem; letter-spacing: 0.06rem; text-transform: uppercase; color: var(--slate-ink); }
.pc-figs dd { font-size: 1.05rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.pc-sides { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; margin: 0; padding: 0; }
.pc-side { padding: 0.55rem 0.7rem; border-radius: 8px; background: rgba(255, 255, 255, 0.55); }
.pc-side.on { background: #fff; box-shadow: inset 3px 0 0 var(--slate-ink); }
.pc-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.9rem; font-size: 0.88rem; }
.pc-head b { font-weight: 500; }
.pc-head span { font-variant-numeric: tabular-nums; color: var(--slate-ink); }
.pc-head label { display: inline-flex; align-items: center; gap: 0.35rem; min-height: 32px; cursor: pointer; }
.pc-road { margin-left: auto; }
.pc-widths { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.45rem; }
.app-main .pc-w { min-height: 36px; padding: 0 0.75rem; border: 1px solid var(--slate); border-radius: 999px; background: transparent; color: var(--slate-ink); font-size: 0.8rem; letter-spacing: 0; text-transform: none; }
.app-main .pc-w:hover { background: var(--slate-bg); }
.app-main .pc-w.on { background: var(--slate-ink); border-color: var(--slate-ink); color: var(--paper); }
.pc-exact { display: flex; align-items: center; gap: 0.6rem; margin-top: 0.45rem; }
.pc-exact[hidden] { display: none; }
.pc-exact input[type="range"] { flex: 1; accent-color: var(--slate-ink); }
.pc-exact output { min-width: 4rem; font-variant-numeric: tabular-nums; font-size: 0.85rem; }
.pc-side .ed-sugg { margin: 0.4rem 0 0; font-size: 0.78rem; }

/* the climate card: 4 small figures in a 2 x 2 grid */
.snap { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.7rem 1rem; margin: 0 0 0.5rem; }
.snap dt { font-size: 0.72rem; color: var(--sage-ink); }
.snap dd { font-size: 1.1rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.snap small { font-size: 0.7rem; opacity: 0.7; }

/* Near the site: full width, three cards a row */
.near { margin-top: 2rem; }
.near:empty { display: none; }
.near h3 { margin-bottom: 0.8rem; font-family: 'Cinzel', serif; font-size: 1.15rem; letter-spacing: 0.04rem; }
.near-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.near-item.card { display: flex; flex-direction: column; gap: 0.4rem; margin: 0; font-size: 0.88rem; }
.near-item.card small { font-size: 0.76rem; line-height: 1.45; opacity: 0.8; }

/* step 3: three cards, locked (outlined, muted) until the plan was opened once */
.s3-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.s3-card { display: flex; flex-direction: column; gap: 0.7rem; background: #f6f4ee; border-top-color: var(--slate); }
.s3-card h3 { font-family: 'Cinzel', serif; font-size: 1.1rem; letter-spacing: 0.04rem; }
.s3-card p { font-size: 0.88rem; line-height: 1.5; }
.s3-card .btn-main, .s3-card .btn-line { align-self: flex-start; }
.s3-lock { margin-bottom: 1rem; font-size: 0.88rem; color: var(--clay-ink); }
.s3-lock[hidden] { display: none; }
.step3.locked .s3-cards, .step3.locked .s3-paste { opacity: 0.45; pointer-events: none; filter: grayscale(0.6); }
.step3.locked .s3-card { background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
.gh-list { list-style: none; display: flex; flex-direction: column; gap: 0.3rem; margin: 0; padding: 0; }
.app-main .gh-head { display: grid; grid-template-columns: 1.8rem minmax(0, 1fr); gap: 0.1rem 0.6rem; width: 100%; min-height: 44px; padding: 0.4rem 0; border: none; border-top: 1px solid var(--line); background: none; color: inherit; text-align: left; text-transform: none; letter-spacing: 0; font-size: 0.86rem; }
.gh-head .gh-n { grid-row: span 2; display: grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; border: 1px solid var(--ink); font-size: 0.72rem; }
.gh-head b { font-weight: 500; }
.gh-head small { font-size: 0.76rem; opacity: 0.75; }
.gh-detail { margin: 0 0 0.4rem 2.4rem; font-size: 0.8rem; }
.gh-detail[hidden] { display: none; }
.gh-detail div { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr); gap: 0.5rem; padding: 0.15rem 0; }
.gh-detail dt { opacity: 0.65; }
.gh-line { font-size: 0.8rem; opacity: 0.75; }
.s3-results { margin-top: 1rem; }
.s3-results[hidden] { display: none; }
.s3-paste { margin-top: 1.4rem; }
.s3-paste summary { cursor: pointer; font-size: 0.88rem; min-height: 32px; }

/* =========================================================
   STEP 2: THE OVERLAY (same pattern as the Research overlay)
   ========================================================= */
body.ov-open { overflow: hidden; }
.full.ov { display: block; grid-template-columns: none; overflow-y: auto; overscroll-behavior: contain; background: var(--paper); }
.full.ov[hidden] { display: none; }
.full.ov:not([hidden]) { animation: ov-in 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
@keyframes ov-in { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.ov-close { position: fixed; top: 1.2rem; right: 1.6rem; z-index: 10; width: 3rem; height: 3rem; padding: 0; border-radius: 50%; border: none; background: rgba(42, 40, 36, 0.7); cursor: pointer; transition: background 0.3s ease, transform 0.3s ease; }
.full .ov-close { background: rgba(42, 40, 36, 0.7); }
.full .ov-close:hover, .full .ov-close:focus-visible { background: var(--ink); transform: rotate(90deg); }
.ov-close span { position: absolute; top: 50%; left: 50%; width: 1.1rem; height: 1px; background: var(--paper); }
.ov-close span:first-child { transform: translate(-50%, -50%) rotate(45deg); }
.ov-close span:last-child { transform: translate(-50%, -50%) rotate(-45deg); }
.ov-page { padding: 1.6rem 3vw 4rem; }
.ov-top { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1.4rem; padding: 0 4rem 1.2rem 0; margin-bottom: 1.2rem; border-bottom: 1px solid var(--line); }
.ov-title { font-family: 'Cinzel', serif; font-size: clamp(1.3rem, 2.2vw, 1.8rem); letter-spacing: 0.08rem; font-weight: 600; }
.ov-sentence { flex: 1 1 18rem; min-width: 0; font-family: 'Fraunces', serif; font-style: italic; font-size: 1.05rem; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 0.9rem; }
.units-wrap { position: relative; }
.full .units-chip { min-height: 40px; padding: 0 0.9rem; border: 1px solid var(--ink); border-radius: 999px; background: transparent; font-size: 0.8rem; }
.full .units-pick { position: absolute; top: calc(100% + 0.4rem); left: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; width: 18rem; padding: 0.7rem; background: var(--paper); border: 1px solid var(--ink); box-shadow: 0 8px 22px rgba(42, 40, 36, 0.2); font-size: 0.78rem; }
.full .units-pick[hidden] { display: none; }
.full .units-pick span { flex: 1 1 100%; opacity: 0.7; }
.full .floors-ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 0.6rem; font-size: 0.82rem; max-width: 30rem; }
.full .floors-ctl .fl-why { flex: 1 1 100%; font-size: 0.72rem; opacity: 0.75; }

.ov-row { display: grid; grid-template-columns: minmax(0, 60fr) minmax(0, 40fr); gap: 2rem 2.4rem; align-items: start; }
.ov-left { min-width: 0; }
.ov-left .view-bar { margin-bottom: 0.6rem; }
.full.ov .full-plan { position: relative; height: clamp(460px, 72vh, 820px); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--sheet); }
.full.ov .full-top { display: none; }
.full.ov .full-actions { flex-wrap: wrap; right: 0.8rem; }
.full.ov .full-actions .zoom-read { align-self: center; padding: 0 0.3rem; background: rgba(246, 244, 238, 0.85); }
.full.ov .full-area { max-width: 22rem; margin-top: 0.8rem; }
.ov-right { min-width: 0; }
.ov-right .block:first-of-type { margin-top: 1.4rem; }
.full .warn li { border-left: 3px solid var(--pop); }
.full .warn li.ok { border-left-color: var(--sage); }
.ov-wide { margin-top: 2.4rem; padding-top: 1.6rem; border-top: 1px solid var(--line); }
.ov-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem 2.4rem; }
.full .rules-city:empty { display: none; }
.full .rules-city { margin: 0.6rem 0 1rem; padding: 0.8rem 1rem; border-radius: 10px; background: var(--clay-bg); border-top: 3px solid var(--clay); }
.full .city-needs-head { display: block; margin-bottom: 0.5rem; font-weight: 500; }
.full .eyebrow { display: block; font-size: 0.68rem; letter-spacing: 0.25rem; text-transform: uppercase; opacity: 0.6; margin-bottom: 0.5rem; }
.full .fold summary { cursor: pointer; min-height: 36px; font-size: 0.9rem; }
.full .block { margin-top: 2rem; }

@media (max-width: 1100px) {
    .s3-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .near-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1000px) {
    .s1-row, .ov-row, .ov-two { grid-template-columns: minmax(0, 1fr); }
    .s1-map .mp-map { min-height: 60vh; }
    .full.ov .full-plan { height: 70vh; }
}
@media (max-width: 600px) {
    .app-main { padding-left: 16px; padding-right: 16px; }
    .s3-cards, .near-grid { grid-template-columns: minmax(0, 1fr); }
    .ov-page { padding: 1rem 16px 3rem; }
    .ov-top { padding-right: 3.4rem; }
    .ov-close { top: 0.8rem; right: 0.8rem; }
    .ov-sentence { white-space: normal; }
    .pc-road { margin-left: 0; }
    .full.ov .full-3d { width: 44vw; height: 30vw; }
}
@media (prefers-reduced-motion: reduce) {
    .full.ov:not([hidden]) { animation: none; }
    .ov-close { transition: none; }
}

.screen .step-h { margin: 0 0 1.2rem; font-size: clamp(1.4rem, 2.4vw, 2rem); }
.full .ov-title { margin: 0; }


/* =========================================================
   UI ROUND 8: find, pin, draw on the map
   ========================================================= */
.mp-guide { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; margin: 0 0 0.6rem; padding: 0; font-size: 0.86rem; }
.mp-guide li { display: inline-flex; align-items: center; gap: 0.45rem; color: rgba(42, 40, 36, 0.55); }
.mp-guide i { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 1px solid currentColor; font-style: normal; font-size: 0.74rem; }
.mp-guide li.now { color: var(--ink); font-weight: 500; }
.mp-guide li.now i { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.mp-guide li.done { color: var(--sage-ink); }
.mp-guide li.done i { background: var(--sage-ink); border-color: var(--sage-ink); color: var(--paper); }

/* the buttons on the map, top right, one group */
.mp-acts { display: flex; background: var(--paper); border: 1px solid var(--ink) !important; border-radius: 999px !important; overflow: hidden; box-shadow: 0 4px 14px rgba(42, 40, 36, 0.2); }
.mp-acts button { min-height: 40px; padding: 0 0.9rem; border: none; border-right: 1px solid var(--line); border-radius: 0; background: transparent; color: var(--ink); font-size: 0.78rem; letter-spacing: 0.03rem; text-transform: none; }
.mp-acts button:last-child { border-right: none; }
.mp-acts button:hover:not(:disabled) { background: var(--slate-bg); }
.mp-acts button.on { background: var(--ink); color: var(--paper); }
.mp-acts button:disabled { opacity: 0.4; cursor: default; }
.mp-acts [data-base] { opacity: 0.55; }
.mp-acts [data-base].on { opacity: 1; font-weight: 500; text-decoration: underline; text-underline-offset: 0.2rem; }

/* the search on the map, top left (place.js) */
.mp-search { width: min(300px, 60vw); }
.mp-search .ps-input { width: 100%; min-height: 40px; padding: 0.5rem 0.9rem; font: inherit; font-size: 0.88rem; color: var(--ink); background: var(--paper); border: 1px solid var(--ink); border-radius: 999px; box-shadow: 0 4px 14px rgba(42, 40, 36, 0.2); }
.mp-search .ps-input:focus { outline: 2px solid var(--slate-ink); outline-offset: 1px; }
.mp-search .ps-list { list-style: none; margin: 0.3rem 0 0; padding: 0; max-height: 260px; overflow: auto; background: var(--paper); border: 1px solid var(--ink); border-radius: 12px; }
.mp-search .ps-list[hidden], .mp-search .ps-note[hidden] { display: none; }
.mp-search .ps-list li { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem; padding: 0.5rem 0.8rem; cursor: pointer; font-size: 0.84rem; }
.mp-search .ps-list li + li { border-top: 1px solid var(--line); }
.mp-search .ps-list li.on, .mp-search .ps-list li:hover { background: var(--slate-bg); }
.mp-search .ps-main { display: flex; flex-direction: column; min-width: 0; }
.mp-search .ps-main b { font-weight: 500; }
.mp-search .ps-main small { font-size: 0.74rem; color: var(--slate-ink); }
.mp-search .ps-tag { flex: none; padding: 0.05rem 0.45rem; border: 1px solid var(--sage); border-radius: 999px; font-style: normal; font-size: 0.62rem; text-transform: uppercase; color: var(--sage-ink); }
.mp-search .ps-note { margin: 0.3rem 0 0; padding: 0.3rem 0.7rem; background: var(--paper); border-radius: 8px; font-size: 0.78rem; color: var(--clay-ink); }

/* the pin and pin mode */
.mp-pin { width: 22px; height: 30px; background: var(--pop); clip-path: path("M11 30 C11 30 0 17 0 11 A11 11 0 1 1 22 11 C22 17 11 30 11 30 Z"); cursor: grab; }
.mp-pin::after { content: ""; position: absolute; left: 7px; top: 7px; width: 8px; height: 8px; border-radius: 50%; background: var(--paper); }
.mp-pinning, .mp-pinning .leaflet-interactive { cursor: crosshair !important; }

/* the one line under the map about the roads found */
.mp-roads { margin: 0.5rem 0 0; min-height: 1.2em; font-size: 0.86rem; color: var(--slate-ink); }
.mp-roads:empty { display: none; }
.mp-wform { display: flex; flex-direction: column; align-items: flex-start; gap: 0.5rem; }
.mp-area[hidden] { display: none; }

.app-main .mp-acts button, .full .mp-acts button { min-height: 40px; padding: 0 0.9rem; border: none; border-right: 1px solid var(--line); border-radius: 0; background: transparent; color: var(--ink); font-size: 0.78rem; letter-spacing: 0.03rem; text-transform: none; }
.app-main .mp-acts button.on, .full .mp-acts button.on { background: var(--ink); color: var(--paper); }
.full .pc-w { min-height: 36px; padding: 0 0.75rem; border: 1px solid var(--slate); border-radius: 999px; background: transparent; color: var(--slate-ink); font-size: 0.8rem; }
.full .pc-w.on { background: var(--slate-ink); color: var(--paper); }


/* =========================================================
   WEBSITE ROUND 15: example, drawing by touch, phone map, step band, plugin request, credits, report pages
   ========================================================= */
.example-tag { margin: 0.4rem 0 0.8rem; padding: 0.7rem 0.9rem; background: var(--clay-bg); border-left: 3px solid var(--clay); font-size: 0.9rem; line-height: 1.45; }
.example-tag[hidden] { display: none; }
.example-tag b { display: inline-block; margin-right: 0.5rem; padding: 0.1rem 0.5rem; background: var(--clay); color: var(--paper); font-size: 0.72rem; letter-spacing: 0.12rem; text-transform: uppercase; }
.example-tag a { display: inline-flex; align-items: center; min-height: 44px; margin-left: 0.4rem; color: inherit; }
.need-answers .need-example { margin-left: 0.6rem; }
.need-answers .need-example[hidden] { display: none; }
.need-answers a { min-height: 44px; display: inline-flex; align-items: center; }
.draw-touch { display: none; }
@media (pointer: coarse) { .draw-touch { display: block; } .draw-mouse { display: none; } }
.mp-acts .sh { display: none; }
.mp-acts { white-space: nowrap; display: flex; }
.mp-acts button, .mp-drawbar button { min-height: 44px; }
.mp-drawbar { display: flex; gap: 0; background: var(--paper); }
.mp-drawbar button { padding: 0 0.9rem; border: none; background: var(--paper); color: var(--ink); font: inherit; font-size: 0.86rem; cursor: pointer; }
.mp-drawbar button + button { border-left: 1px solid var(--line); }
.mp-drawbar button[hidden] { display: none; }
/* Website round 16: the plugin request opens as one full width panel under the three cards; Send stays dashed until all four fields are right */
.plugin-open { align-self: flex-start; display: inline-flex; align-items: center; min-height: 44px; margin-top: 0.4rem; padding: 0 1rem; border: 1px solid var(--ink); border-radius: 0; background: transparent; color: var(--ink); font: inherit; font-size: 0.86rem; cursor: pointer; }
.plugin-open.on { background: var(--ink); color: var(--paper); }
.plugin-ask { margin-top: 16px; padding: 1.1rem 1.2rem; background: #f6f4ee; border-top-color: var(--clay); }
.plugin-ask[hidden] { display: none; }
.plugin-form { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.8rem 1.2rem; }
@media (min-width: 800px) { .plugin-form { grid-template-columns: repeat(2, minmax(0, 1fr)); } .plugin-form .pf-end { grid-column: 1 / -1; } }
.plugin-form .pf-field { display: grid; gap: 0.25rem; align-content: start; align-self: start; font-size: 0.82rem; }
.plugin-form input { min-height: 44px; padding: 0 0.6rem; border: 1px solid var(--line); border-radius: 0; background: #fff; font: inherit; font-size: 0.9rem; color: var(--ink); }
.plugin-form input[aria-invalid="true"] { border-color: var(--pop); }
.plugin-form input:disabled { background: transparent; color: rgba(42, 40, 36, 0.6); }
.pf-err { color: var(--pop-ink); font-size: 0.78rem; line-height: 1.35; }
.pf-err[hidden] { display: none; }
.pf-trap { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.pf-end { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1.2rem; }
.plugin-form button[type="submit"] { min-height: 44px; padding: 0 1.2rem; border: 1px solid var(--ink); border-radius: 0; background: transparent; color: var(--ink); font: inherit; font-size: 0.8rem; letter-spacing: 0.1rem; text-transform: uppercase; cursor: pointer; }
.pf-note { margin: 0; font-size: 0.86rem; line-height: 1.45; }
.pf-note:empty { display: none; }
.pf-note.pf-ok { padding-left: 0.6rem; border-left: 3px solid var(--sage); }
.pf-note.pf-bad { padding-left: 0.6rem; border-left: 3px solid var(--pop); }
.rh-revit { margin-top: 1rem; }
.rr-credits { margin: 0.6rem 0 0; padding-top: 0.5rem; border-top: 1px solid var(--line); font-size: 0.78rem; line-height: 1.4; opacity: 0.85; }
.rr-reports { margin-top: 1rem; }
.rr-reports[hidden] { display: none; }
.rr-pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.6rem; margin-top: 0.5rem; }
.rr-pages img { width: 100%; display: block; border: 1px solid var(--line); }
@media (max-width: 600px) {
    .mp-acts .lg { display: none; }
    .mp-acts .sh { display: inline; }
    .mp-acts button { padding: 0 0.55rem; font-size: 0.8rem; }
    .mp-map { height: min(60vh, 460px); }
    .map-box > .mp-body > .mp-search, .mp-body > .mp-search { position: static; width: 100%; margin: 0 0 0.5rem; }
    /* the step band: only the three app steps, the current one with its name */
    .sb-step.later { display: none; }
    .sb-steps { min-width: 0; padding: 0 16px; }
    .sb-steps::before { left: 16px; right: 16px; }
    .sb-step { padding-right: 1.2rem; }
    .sb-step:not(.now) .sb-in > span { display: none; }
    .sb-in { min-height: 44px; }
}

/* =========================================================
   ONE HOVER EVERYWHERE (UI round 9): it lifts with a shadow, it never fades
   or flips its colours. Picked = ink fill with Ivory text (Ivory fill with ink
   text on Charcoal). Disabled = dashed border, 45% text, no hover.
   ========================================================= */
body.app button:not(:disabled), body.app .btn, body.app a.btn-main, body.app .cv-go, body.app .half, body.app .stmt-chip, body.app .door, body.app .pc-w, body.app .cv-chip, body.app .bs-chip, body.app .bs-use {
    transition: transform 150ms ease, box-shadow 150ms ease;
}
body.app button:not(:disabled):hover, body.app .btn:hover, body.app a.btn-main:hover, body.app .cv-go:hover, body.app .half:hover, body.app .stmt-chip:hover, body.app .door:hover, body.app .bs-chip:hover, body.app .bs-use:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(42, 40, 36, 0.18);
    opacity: 1;
}
.step-band button:not(:disabled):hover, .step-band a:hover { box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45); }
body.app button:disabled { border-style: dashed !important; color: rgba(42, 40, 36, 0.45) !important; opacity: 1 !important; box-shadow: none !important; transform: none !important; cursor: default; }
body.app :focus-visible { outline: 2px solid var(--slate); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
    body.app button:not(:disabled):hover, body.app .btn:hover, body.app a.btn-main:hover, body.app .cv-go:hover, body.app .half:hover, body.app .stmt-chip:hover, body.app .door:hover, body.app .bs-chip:hover, body.app .bs-use:hover { transform: none; }
}


/* =========================================================
   UI ROUND 9: three pages (plan, check, rhino) share one body; each shows only its part
   ========================================================= */
body[data-step="plan"] .only-check, body[data-step="plan"] .only-rhino,
body[data-step="check"] .only-plan, body[data-step="check"] .only-rhino,
body[data-step="rhino"] .only-plan, body[data-step="rhino"] .only-check { display: none !important; }
body.app .app-main { padding-top: 2rem; }

/* the step band: sticky right under the fixed header, Charcoal, 56 px */
.step-band { position: sticky; top: calc(var(--header-hs, 56px) - 1px); margin-top: 0; z-index: 950; height: 56px; background: var(--ink); color: var(--paper); overflow-x: auto; overflow-y: hidden; }
.sb-steps { position: relative; display: flex; align-items: center; gap: 0; height: 56px; margin: 0; padding: 0 3vw; list-style: none; min-width: max-content; }
.sb-steps::before { content: ""; position: absolute; left: 3vw; right: 3vw; top: 50%; height: 1px; background: rgba(239, 236, 229, 0.25); }
.sb-step { position: relative; display: flex; align-items: center; padding-right: 2.4rem; }
.sb-in { position: relative; display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.2rem 0.6rem 0.2rem 0; background: var(--ink); color: var(--paper); text-decoration: none; font-size: 0.86rem; white-space: nowrap; border-radius: 999px; }
a.sb-in:hover { background: rgba(239, 236, 229, 0.08); }
.sb-c { width: 24px; height: 24px; flex: none; }
.sb-c circle { fill: var(--ink); stroke-width: 2; }
.sb-c text { font-family: "Work Sans", sans-serif; font-size: 11px; fill: currentColor; }
.sb-step.sage .sb-c circle { stroke: var(--sage-lt); }
.sb-step.slate .sb-c circle { stroke: var(--slate-lt); }
.sb-step.clay .sb-c circle { stroke: var(--clay-lt); }
.sb-step.now .sb-in { font-weight: 600; }
.sb-step.now.sage .sb-c circle { fill: var(--sage-lt); }
.sb-step.now.slate .sb-c circle { fill: var(--slate-lt); }
.sb-step.now.clay .sb-c circle { fill: var(--clay-lt); }
.sb-step.now .sb-c text { fill: var(--ink); }
.sb-step.done .sb-c circle { fill: rgba(239, 236, 229, 0.12); }
.sb-in.off { color: rgba(239, 236, 229, 0.45); }
.sb-step.later { font-size: 0.78rem; }
.sb-step.later .sb-c circle { fill: none; stroke: rgba(239, 236, 229, 0.35); }
.sb-dot { position: absolute; left: 0; top: 24px; width: 8px; height: 8px; border-radius: 50%; background: var(--pop); transition: transform 600ms cubic-bezier(0.3, 0.7, 0.2, 1); pointer-events: none; }
@media (prefers-reduced-motion: reduce) { .sb-dot { transition: none !important; } }

/* the pin: a real drop pin, clay with a white ring, its tip on the point */
.mp-pin { position: relative; width: 30px; height: 30px; background: none !important; border: none !important; clip-path: none !important; cursor: grab; }
.mp-pin::before { content: ""; position: absolute; left: 3px; top: 0; width: 24px; height: 24px; box-sizing: border-box; background: var(--clay); border: 2px solid #fff; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); box-shadow: 0 3px 8px rgba(0, 0, 0, 0.35); }
.mp-pin::after { content: ""; position: absolute; left: 12px; top: 9px; width: 6px; height: 6px; border-radius: 50%; background: #fff; }
.mp-roadlab.leaflet-tooltip { background: var(--ink); color: var(--paper); border: none; font-size: 11px; padding: 1px 6px; }

/* no road read: the guide in a clay box; the Road boxes pulse twice */
.pc-guide { margin: 0 0 0.8rem; padding: 0.7rem 0.9rem; border-radius: 8px; background: var(--clay-bg); border-left: 3px solid var(--clay); font-size: 0.85rem; line-height: 1.45; }
.pc-guide ol { margin: 0.35rem 0 0; padding-left: 1.2rem; }
.pulse .pc-road { animation: pc-pulse 1s ease 2; border-radius: 6px; }
@keyframes pc-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(185, 120, 99, 0); } 50% { box-shadow: 0 0 0 6px rgba(185, 120, 99, 0.45); } }
@media (prefers-reduced-motion: reduce) { .pulse .pc-road { animation: none; } }

/* picked width chip: ink with Ivory text, never pale */
.app-main .pc-w.on, .full .pc-w.on { background: var(--ink) !important; border-color: var(--ink) !important; color: var(--paper) !important; }
.app-main .pc-w { color: var(--ink); }

/* Your plan: read only, under the map */
.your-plan { margin-top: 2.4rem; padding-top: 1.6rem; border-top: 1px solid var(--line); }
.your-plan[hidden] { display: none; }
.yp-h { font-family: "Cinzel", serif; font-size: 1.3rem; letter-spacing: 0.05rem; margin-bottom: 1rem; }
.yp-row { display: grid; grid-template-columns: minmax(0, 62fr) minmax(0, 38fr); gap: 32px; align-items: stretch; }
.yp-svg { padding: 24px; border-radius: 10px; background: #f6f4ee; border: 1px solid var(--line); min-height: 320px; display: flex; }
.yp-svg svg { width: 100%; height: auto; max-height: 520px; }
.yp-road { fill: rgba(42, 40, 36, 0.35); }
.yp-plot { fill: #fff; stroke: var(--ink); stroke-width: 2; vector-effect: non-scaling-stroke; }
.yp-build { fill: url(#yp-hatch); stroke: var(--clay); stroke-width: 1.4; stroke-dasharray: 6 4; vector-effect: non-scaling-stroke; }
.yp-hl { stroke: var(--slate); stroke-width: 1; vector-effect: non-scaling-stroke; }
.yp-lab { fill: var(--paper); font-family: "Work Sans", sans-serif; paint-order: stroke; stroke: var(--ink); stroke-width: 3px; vector-effect: non-scaling-stroke; }
.yp-north polygon, .yp-north text, .yp-scale text { fill: var(--ink); font-family: "Work Sans", sans-serif; }
.yp-scale line { stroke: var(--ink); stroke-width: 2; vector-effect: non-scaling-stroke; }
.yp-figs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-content: start; margin: 0; }
.yp-figs div { padding: 0.8rem 0.9rem; border-radius: 10px; background: var(--slate-bg); border-top: 3px solid var(--slate); }
.yp-figs dt { font-size: 0.72rem; letter-spacing: 0.06rem; text-transform: uppercase; color: var(--slate-ink); }
.yp-figs dd { margin-top: 0.2rem; font-size: 1.1rem; font-weight: 500; overflow-wrap: anywhere; }
.your-plan .btn-main { margin-top: 1.4rem; }

/* check.html: the old overlay, as a normal page */
.full.check-page { position: static; inset: auto; z-index: auto; display: block; background: none; }
.check-page .ov-top { display: flex; flex-wrap: wrap; align-items: center; gap: 0.8rem 1.4rem; padding: 0 0 1.2rem; margin-bottom: 1.2rem; border-bottom: 1px solid var(--line); }
.check-page .ov-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem 1rem; width: 100%; }
.check-page .ov-tools .btn-main { margin-left: auto; }
.check-page .ov-row { display: grid; grid-template-columns: minmax(0, 60fr) minmax(0, 40fr); gap: 2rem 2.4rem; align-items: start; }
.check-page .view-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin-bottom: 0.6rem; }
.check-page .switch [aria-selected="true"] { background: var(--ink); color: var(--paper); }
.plan-figs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0 0 0.6rem; }
.plan-figs div { padding: 0.45rem 0.7rem; border-radius: 8px; background: #f6f4ee; }
.plan-figs dt { font-size: 0.7rem; opacity: 0.7; }
.plan-figs dd { font-size: 0.95rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.check-page .full-plan { position: relative; height: clamp(440px, 64vh, 760px); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--sheet); }
.check-page .full-plan svg#plan-full { display: block; width: 100%; height: 100%; }
.check-page .full-3d { display: none; }
.check-page .full-plan.is-3d svg#plan-full, .check-page .full-plan.is-3d .rose { display: none; }
.check-page .full-plan.is-3d .full-3d { display: block; position: absolute; inset: 0; top: 0; right: 0; width: auto; height: auto; border: none; box-shadow: none; }
.check-page .full-hint, .check-page .full-hint[hidden] { display: block !important; position: static; transform: none; margin: 0.5rem 0 0; padding: 0; background: none; color: var(--ink); opacity: 0.75; font-size: 0.82rem; white-space: normal; width: auto; max-width: none; }
.check-page .full-actions { position: static; display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-top: 0.6rem; }
.check-page .full-msg { left: 0.8rem; right: auto; top: 0.8rem; transform: none; max-width: calc(100% - 1.6rem); white-space: normal; }
.check-page .rose { right: 0.6rem; bottom: 0.6rem; width: 96px; }
.check-page .full-area { max-width: 22rem; margin-top: 0.8rem; }
.check-next { display: flex; justify-content: flex-end; margin-top: 2.4rem; padding-top: 1.6rem; border-top: 1px solid var(--line); }

@media (max-width: 1000px) {
    .check-page .ov-row, .yp-row { grid-template-columns: minmax(0, 1fr); }
    .check-page .full-plan { height: 66vh; }
}
@media (max-width: 600px) {
    .plan-figs, .yp-figs { grid-template-columns: minmax(0, 1fr); }
    .check-page .ov-tools .btn-main { margin-left: 0; }
}


/* =========================================================
   UI ROUND 10
   ========================================================= */

/* check.html row 1: plan left, tiles / warnings / suggestions right, the same height (the plan grows to match) */
.check-page .ov-row { align-items: stretch; }
.check-page .ov-left { display: flex; flex-direction: column; min-width: 0; }
.check-page .full-plan { flex: 1 1 auto; height: auto; min-height: clamp(440px, 60vh, 720px); }
.check-page .ov-right .block:first-of-type { margin-top: 1.2rem; }

/* row 2: scores, six cards, 3 a row */
.chk-scores { margin-top: 2rem; }
.rp-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.4rem 1.6rem; }
.rp-top .rp-head { margin: 0; }
.rp-top .rp-score { margin: 0; }
.rp-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 1rem; }
.rp-group.card { margin: 0; padding: 0.9rem 1rem; background: #f6f4ee; border-top: 3px solid var(--slate); }
.rp-group.card h4 { margin-bottom: 0.4rem; font-family: "Cinzel", serif; font-size: 1rem; }
.rp-group .rp-mark { border-left: 3px solid var(--line); padding-left: 0.6rem; margin-top: 0.4rem; }
.rp-group .rp-mark.good { border-left-color: var(--sage); }
.rp-group .rp-mark.fair { border-left-color: var(--clay); }
.rp-group .rp-mark.bad { border-left-color: var(--pop); }

/* rows 3 and 4: two columns */
.chk-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 2.4rem; align-items: start; }
.note-card { padding: 1rem 1.1rem; }
.note-card textarea { width: 100%; }

/* Floor heights: one line, opens to the table */
.lv-fold > summary { cursor: pointer; list-style: none; font-size: 0.92rem; line-height: 1.5; padding: 0.4rem 0; }
.lv-fold > summary::-webkit-details-marker { display: none; }
.lv-change { margin-left: 0.4rem; text-decoration: underline; text-underline-offset: 0.2rem; color: var(--slate-ink); }
.lv-fold[open] .lv-change { display: none; }

/* 3D: + - Fit in the corner; the wheel zooms the view, never the page */
#host-full { position: relative; }
.z3d { position: absolute; right: 0.6rem; top: 0.6rem; z-index: 2; display: flex; gap: 0.3rem; }
body.app .z3d button { min-width: 34px; min-height: 34px; padding: 0 0.6rem; border: 1px solid var(--ink); border-radius: 999px; background: var(--paper); color: var(--ink); font-size: 0.85rem; }

/* the strip: each step on its own Charcoal pill, so the line stops at the pill */
.sb-in { padding: 0.25rem 10px; }
.sb-step { padding-right: 2rem; }
.sb-c circle { stroke: var(--paper); stroke-width: 1.5; fill: var(--ink); }
.sb-c text { fill: var(--paper); font-weight: 600; }
.sb-step.now .sb-c circle { fill: var(--paper) !important; stroke: var(--paper); }
.sb-step.now .sb-c text { fill: var(--ink) !important; }
.sb-step.done .sb-c circle { fill: var(--sage) !important; stroke: var(--sage-lt); }
.sb-step.done .sb-c text { fill: var(--ink) !important; }
.sb-step.later .sb-c circle { fill: var(--ink); stroke: rgba(239, 236, 229, 0.35); }
a.sb-in { transition: transform 150ms ease, box-shadow 150ms ease, background-color 150ms ease; }
a.sb-in:hover { background: rgba(239, 236, 229, 0.08); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45); }
.sb-dot { transition: transform 400ms cubic-bezier(0.3, 0.7, 0.2, 1); }
@media (prefers-reduced-motion: reduce) { a.sb-in:hover { transform: none; } }


/* rhino.html */
.rh-h { margin: 2.6rem 0 1rem; font-family: "Cinzel", serif; font-size: 1.3rem; letter-spacing: 0.05rem; }
.rh-need { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.rh-card { display: flex; flex-direction: column; gap: 0.5rem; padding: 1rem 1.1rem; background: #f6f4ee; border-top-color: var(--slate); }
.rh-card b { font-family: "Cinzel", serif; font-size: 1.05rem; }
.rh-card p { font-size: 0.88rem; line-height: 1.5; }
.rh-steps { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 0; padding: 0; }
.rh-step { display: grid; grid-template-columns: 2.4rem minmax(0, 1fr); gap: 0.9rem; padding: 1.1rem 1.2rem; background: #f6f4ee; border-top-color: var(--sage); }
.rh-step b { font-size: 1rem; font-weight: 500; }
.rh-step p { margin-top: 0.3rem; font-size: 0.88rem; line-height: 1.5; }
.rh-step .btn-main, .rh-step .btn-line { margin-top: 0.7rem; }
.rh-n { display: grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--ink); color: var(--paper); font-weight: 600; }
.rh-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 16px; align-items: stretch; }
.rh-live { border-top-color: var(--clay); }
.rh-live .btn-line { align-self: flex-start; }
.rh-files .export-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
body.app .rh-files .export-row button, body.app .export-row button { min-width: 7rem; white-space: nowrap; padding: 0.6rem 1rem; }
.rh-files .eyebrow { margin-top: 0.8rem; }
.rh-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.4rem 1.6rem; }
.rh-results:not([hidden]) { display: block; padding: 1rem 1.1rem; border-radius: 10px; background: var(--sage-bg); border-top: 3px solid var(--sage); }
.rh-noresults[hidden] { display: none; }
/* round 11 plugin: results.json from Rhino, one card per panel; phone first: one column, then as many 300 px columns as fit (no empty cells: the cards stretch) */
.rr-bar { display: flex; flex-direction: column; align-items: flex-start; gap: 0.5rem; margin-top: 0.8rem; }
.rr-pick { cursor: pointer; }
.rr-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin-top: 16px; }
.rr-grid[hidden] { display: none; }
@media (min-width: 700px) { .rr-grid { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); } .rr-bar { flex-direction: row; align-items: center; } }
.rr-card { padding: 1rem 1.1rem; background: #f6f4ee; border-top-color: var(--slate); }
.rr-card h3 { margin: 0 0 0.6rem; font-family: "Cinzel", serif; font-size: 1.05rem; }
.rr-card h3 small { font-family: inherit; font-size: 0.8rem; opacity: 0.6; }
.rr-card li { display: flex; flex-direction: column; gap: 0.15rem; padding: 0.45rem 0; border-top: 1px solid rgba(42, 40, 36, 0.12); font-size: 0.85rem; }
.rr-card li:first-child { border-top: 0; }
.rr-t { display: flex; align-items: center; gap: 0.45rem; }
.rr-k { font-size: 0.78rem; line-height: 1.45; opacity: 0.85; overflow-wrap: anywhere; }

@media (max-width: 1100px) {
    .rp-grid, .rh-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 800px) {
    .chk-two, .rh-two, .rh-steps, .rh-need { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
    .rp-grid, .rh-grid { grid-template-columns: minmax(0, 1fr); }
}


/* =========================================================
   UI ROUND 11
   ========================================================= */

/* ---------- Part 8: the app pages have their own colours (change them here) ---------- */
body.app-theme {
    --app-bg: #E4E9E6;         /* cool sage grey page */
    --app-card: #EFECE5;       /* Ivory cards on it */
    --app-strip: #445767;      /* the step strip, slate ink */
    --app-strip-hi: #52677A;   /* a hovered or current step */
    --app-shadow: 0 1px 2px rgba(42, 40, 36, 0.06), 0 6px 20px rgba(42, 40, 36, 0.06);
    background: var(--app-bg);
}
body.app-theme .header.solid, body.app-theme .header.scrolled { background: var(--app-bg); border-bottom: none; box-shadow: none; }
body.app-theme .chk-card, body.app-theme .rh-card, body.app-theme .rh-step, body.app-theme .yp-svg, body.app-theme .rp-group.card,
body.app-theme .mp-edges {
    background: var(--app-card); border-radius: 12px; box-shadow: var(--app-shadow);
}
body.app-theme .yp-svg { border: none; }
body.app-theme .mp-edges { padding: 16px; }

/* entered with the wave from the Systems page: the page starts covered (wave.js pulls the cover away) */
html.wave-in::after { content: ""; position: fixed; inset: 0; z-index: 6000; background: #E4E9E6; }

/* ---------- Part 4: the strip ---------- */
/* no gap under the header: room for the full header above the page, the strip sticks 1 px into the shrunk header.
   Both measured once by app.js (bandTop), never changed while scrolling, so the strip never moves */
body.app { padding-top: calc(var(--header-h0, 72px) - 1px); }
body.app .step-band { position: sticky; top: calc(var(--header-hs, 56px) - 1px); margin-top: 0; background: var(--app-strip, var(--ink)); }
/* every pill is solid, so the line behind shows only between pills */
body.app .sb-in, body.app .sb-in.off { background: var(--app-strip, var(--ink)); }
body.app a.sb-in:hover, body.app .sb-step.now .sb-in { background: var(--app-strip-hi, #3A3833); }
body.app .sb-c circle, body.app .sb-step.later .sb-c circle { fill: var(--app-strip, var(--ink)); }
body.app .sb-step.now:not(.done) .sb-c circle { fill: var(--paper); }
body.app .sb-step.done .sb-c circle { fill: var(--sage-lt) !important; stroke: var(--sage-lt); }
body.app .sb-step.done .sb-c text { fill: var(--ink) !important; }
body.app .sb-dot { background: var(--pop); }

/* ---------- Part 5: buttons never go white on white ---------- */
body.app .btn-main:hover:not(:disabled), body.app a.btn-main:hover, body.app a.btn-main:focus-visible { background: var(--pop-ink); border-color: var(--pop-ink); color: var(--paper); }
body.app .btn-main:disabled, body.app button.solid:disabled { background: transparent !important; border: 1px dashed rgba(42, 40, 36, 0.45) !important; color: rgba(42, 40, 36, 0.45) !important; }
body.app .mp-acts button.on, body.app .mp-acts button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
body.app .mp-acts button:hover:not(:disabled):not(.on):not([aria-pressed="true"]) { background: var(--slate-bg); color: var(--ink); }

/* ---------- Part 2: the map labels ---------- */
.mp-len.leaflet-tooltip { font-size: 10.5px; padding: 0 4px; background: rgba(255, 255, 255, 0.92); border-color: rgba(42, 40, 36, 0.25); }
/* the road width sits inside the band: plain Ivory text, no box */
.mp-roadlab.leaflet-tooltip { background: none; border: none; box-shadow: none; padding: 0; color: var(--paper); font-size: 11px; font-weight: 600; text-shadow: 0 0 3px rgba(42, 40, 36, 0.95), 0 0 1px rgba(42, 40, 36, 1); }
.mp-roadlab.leaflet-tooltip::before { display: none; }
/* the side card: tap a side on the map, or its name here, to open it */
body.app .pc-name { padding: 0; border: none; background: none; font: inherit; font-weight: 500; color: var(--ink); cursor: pointer; text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 0.2rem; }
.pc-side.open { background: #fff; box-shadow: inset 3px 0 0 var(--clay); }
.pc-len { display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem 1rem; margin-top: 0.55rem; font-size: 0.85rem; }
.pc-len label { display: inline-flex; align-items: center; gap: 0.4rem; }
.pc-len input[type="number"] { width: 6rem; min-height: 36px; }
.pc-msg { width: 100%; margin: 0; color: var(--pop-ink); font-size: 0.8rem; }
.pc-msg:empty { display: none; }

/* ---------- Part 6: check.html lower half ---------- */
.chk-lower { display: flex; flex-direction: column; gap: 32px; margin-top: 2.4rem; padding-top: 0; border-top: none; }
.chk-lower[hidden] { display: none; }
.chk-lower .block, .chk-lower .chk-scores { margin: 0; }
.chk-card { min-width: 0; padding: 24px; border-radius: 12px; background: var(--app-card, var(--paper)); box-shadow: var(--app-shadow, none); }
details.fold.chk-card { border-top: none; }
details.fold.chk-card > summary { padding: 0; }
details.fold.chk-card[open] > summary { margin-bottom: 0.8rem; }
.chk-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 40px; align-items: start; }
.chk-stack { display: flex; flex-direction: column; gap: 32px; min-width: 0; }
.chk-rules .rules { columns: auto; }
/* Rules used: one table */
.rt { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.rt > thead > tr > th, .rt > tbody > tr > th, .rt > tbody > tr > td { padding: 0.65rem 0.8rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.rt > thead > tr > th { padding-top: 0; font-size: 0.68rem; font-weight: 500; letter-spacing: 0.1rem; text-transform: uppercase; color: var(--slate-ink); }
.rt > tbody > tr > th { font-weight: 500; white-space: nowrap; }
.rt > tbody > tr.given > th { box-shadow: inset 3px 0 0 var(--slate); }
.rt .rt-val input[type="number"] { width: 6.5rem; min-height: 36px; }
.rt .rt-unit { white-space: nowrap; color: rgba(42, 40, 36, 0.75); }
.rt .rt-state { white-space: nowrap; }
.rt .rt-says { min-width: 280px; line-height: 1.5; }
.rt .rt-says .src { margin-right: 0.3rem; }
.rt .sb-boxes { display: grid; grid-template-columns: repeat(4, 4.4rem); gap: 0.4rem; }
.rt .sb-boxes label { display: flex; flex-direction: column; gap: 0.15rem; font-size: 0.75rem; }
.rt .sb-boxes input { width: 100%; min-height: 34px; }
.rt > tbody > tr.rt-tiers > td { padding-top: 0; }
.sb-tiers { border-collapse: collapse; min-width: 22rem; margin: 0 0 0.3rem; font-size: 0.82rem; font-variant-numeric: tabular-nums; }
.sb-tiers caption { padding-bottom: 0.35rem; text-align: left; font-size: 0.68rem; letter-spacing: 0.1rem; text-transform: uppercase; color: var(--slate-ink); }
.sb-tiers th, .sb-tiers td { padding: 0.3rem 0.9rem 0.3rem 0.6rem; text-align: left; border-bottom: 1px solid var(--line); }
.sb-tiers thead th { font-weight: 500; }
.sb-tiers tr.now td { background: var(--sage-bg); font-weight: 500; }
@media (max-width: 1000px) {
    /* the table becomes one block per rule, never one word per line */
    .rt > thead { display: none; }
    .rt, .rt > tbody, .rt > tbody > tr, .rt > tbody > tr > th, .rt > tbody > tr > td { display: block; }
    .rt > tbody > tr { padding: 0.7rem 0; border-bottom: 1px solid var(--line); }
    .rt > tbody > tr > th, .rt > tbody > tr > td { padding: 0.15rem 0; border: none; }
    .rt .rt-val, .rt .rt-unit, .rt .rt-state { display: inline-block; vertical-align: middle; margin-right: 0.6rem; }
    .rt .rt-says { min-width: 0; margin-top: 0.3rem; }
    .sb-tiers { min-width: 0; width: 100%; }
}
@media (max-width: 820px) {
    .chk-pair { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Part 9: moving between the steps ----------
   UI round 13: the steps change inside the page (app.js goStep, Web Animations): no View Transition any more */
@media (prefers-reduced-motion: reduce) {
    html.wave-in::after { display: none; }
}


/* =========================================================
   UI ROUND 12
   ========================================================= */

/* nothing shows half built: the content (and the footer under it) waits for body.ready (app.js appReady).
   The header and the strip always show. */
body.app:not(.ready) .app-main, body.app:not(.ready) .footer-contact { visibility: hidden; }
/* space kept for the parts that come late, so nothing pushes the rest */
body.app .figures { min-height: 9.5rem; }
body.app .plan-figs { min-height: 3.4rem; }
body.app .yp-svg { min-height: 360px; }

/* the 3D view uses its whole box: the box is the plan box (same width) and the 3D host fills it
   (round 10 made #host-full position: relative, so it only got the canvas height).
   UI round 13: the box fits on screen under the header and the strip; the Climate tab uses the same box. */
.check-page .full-plan.is-3d, .check-page .full-plan.is-climate { flex: none; height: clamp(380px, calc(100vh - var(--header-h0, 72px) - 56px - 140px), 720px); min-height: 0; }
.check-page .full-plan.is-3d #host-full { position: absolute; inset: 0; width: 100%; height: 100%; }
#host-full canvas { display: block; }

/* round 14: the wheel scrolls the page; this shows once over a map, plan or 3D box */
.zoom-hint { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 900; pointer-events: none;
    background: rgba(42, 40, 36, 0.82); color: var(--paper); font-size: 0.85rem; padding: 0.45rem 0.8rem; border-radius: 4px; opacity: 1; transition: opacity 0.4s; }
.zoom-hint.out { opacity: 0; }

/* round 14: Live link as one full width row (text left, button right): no empty space under it; Files | Import below */
.rh-live-row { flex-direction: row; align-items: center; justify-content: space-between; gap: 1.2rem; margin-top: 16px; }
.rh-live-row > div { display: flex; flex-direction: column; gap: 0.35rem; }
.rh-live-row .btn-line { align-self: center; flex: none; }
@media (max-width: 600px) { .rh-live-row { flex-direction: column; align-items: stretch; } .rh-live-row .btn-line { align-self: flex-start; } }
.mp-search .ps-input { min-height: 44px; }
/* Website round 15: the step band fits a phone; tap targets 44 px for buttons, summaries and the back link */
@media (max-width: 600px) {
    .sb-steps { width: 100%; justify-content: space-between; }
    .sb-step { padding-right: 0; }
}
.app-main button, .app-main summary, .app-main .back, .app-main .units-chip, .sb-in { min-height: 44px; }
.app-main .back { display: inline-flex; align-items: center; }
.app-main summary { display: flex; align-items: center; }
.leaflet-container button, .leaflet-bar a { min-height: 0; }
.mp-acts button, .mp-drawbar button { min-height: 44px; }
body.app .app-main details > summary { min-height: 44px; }
/* Website round 15: 44 px tap targets on the map and the plot card */
.mp-map .leaflet-control-zoom.leaflet-bar a { width: 44px; height: 44px; line-height: 44px; }
.leaflet-bar.mp-acts button, .leaflet-bar.mp-drawbar button { height: 44px; min-height: 44px; }
.app-main .pc-change, .app-main .pc-w { min-height: 44px; }
.app-main .pc-change { display: inline-flex; align-items: center; }

/* =========================================================
   Website round 16: What you need keeps each card its own height; the steps are one column,
   steps 2 to 4 with their picture on the right (under the text on a phone);
   Start from a ready canvas: Yours full width, the other four two by two; the large view.
   ========================================================= */
.rh-need { align-items: start; }
.rh-steps { grid-template-columns: minmax(0, 1fr); }
.rh-step.has-pic { grid-template-columns: 2.4rem minmax(0, 1fr); }
.rh-step .rh-pic { grid-column: 1 / -1; }
@media (min-width: 900px) {
    .rh-step.has-pic { grid-template-columns: 2.4rem minmax(0, 1fr) minmax(0, 1.3fr); align-items: center; }
    .rh-step .rh-pic { grid-column: auto; }
}
.app-main .rh-pic, .app-main .cv-pic { display: block; margin: 0; min-height: 0; width: 100%; padding: 0; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; background: #d4d0c7; cursor: zoom-in; }   /* the Grasshopper canvas grey: a letterbox reads as canvas */
.rh-pic img, .cv-pic img { display: block; width: 100%; height: auto; }
.rh-lead { margin: -0.4rem 0 1rem; font-size: 0.9rem; line-height: 1.5; }
.cv-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
@media (min-width: 800px) { .cv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .cv-grid > :first-child { grid-column: 1 / -1; } }
.cv-card { display: flex; flex-direction: column; gap: 0.8rem; margin: 0; padding: 1rem 1.1rem; background: #f6f4ee; border-top-color: var(--sage); }
.cv-card .cv-pic { aspect-ratio: 16 / 7; }
.cv-card .cv-pic img { width: 100%; height: 100%; object-fit: contain; }
@media (min-width: 1100px) {
    .cv-grid > .cv-card:first-child { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 1.2rem; align-items: center; }
}
.cv-yours { border-top-color: var(--ink); }
.cv-txt h3 { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 0.35rem; font-family: "Cinzel", serif; font-size: 1.05rem; }
.cv-tag { padding: 0.15rem 0.5rem; background: var(--ink); color: var(--paper); font-family: inherit; font-size: 0.72rem; letter-spacing: 0.08rem; text-transform: uppercase; }
.cv-txt p { margin: 0; font-size: 0.88rem; line-height: 1.5; }
.cv-txt .cv-tools-list { margin-top: 0.45rem; font-size: 0.8rem; opacity: 0.85; }
.cv-txt .cv-file { margin-top: 0.35rem; font-size: 0.76rem; opacity: 0.7; }
.cv-view { position: fixed; inset: 0; z-index: 3000; display: flex; flex-direction: column; background: #141311; color: var(--paper); }
.cv-view[hidden] { display: none; }
.cv-stage { position: relative; flex: 1; overflow: hidden; touch-action: none; cursor: grab; }
.cv-stage:active { cursor: grabbing; }
.cv-stage img { position: absolute; left: 0; top: 0; max-width: none; transform-origin: 0 0; user-select: none; -webkit-user-drag: none; }
.cv-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.6rem 1rem; padding: 0.6rem 16px calc(0.6rem + env(safe-area-inset-bottom)); }
.cv-bar p { margin: 0; font-size: 0.82rem; opacity: 0.8; }
.cv-tools { display: flex; gap: 0.4rem; }
.cv-view .cv-tools button { min-width: 44px; min-height: 44px; padding: 0 0.9rem; border: 1px solid var(--paper); border-radius: 0; background: transparent; color: var(--paper); font: inherit; font-size: 0.9rem; cursor: pointer; }
html.cv-on, html.cv-on body { overflow: hidden; }

/* Location card (Revit Round 2): ten fields, edge to edge, one column on a phone */
.rh-loc { border-top-color: var(--sage); }
.loc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 0.2rem 0.9rem; }
.loc-grid .field { margin-bottom: 0.4rem; }
.loc-grid input { width: 100%; min-height: 44px; }
.rr-stale { font-style: normal; font-size: 0.72rem; padding: 0 0.4rem; border: 1px dashed var(--pop-ink); color: var(--pop-ink); margin-left: 0.3rem; }
