/* 2.6.0 Site experience, demand map, needs attention, Sunny moments. Quiet neutral surfaces, Solar Gain navy + gold used
   on purpose, translucency only on controls floating over the 3D scene. Status colours always come with a label. */
:root {
  --s3-ok: #1baf7a; --s3-low: #eda100; --s3-down: #e34948; --s3-none: #8a94a8;
  --s3-ok-ink: #0f7a55; --s3-low-ink: #8a5c00; --s3-down-ink: #b3262a;
  --s3-float: var(--surface-overlay, #fff); --s3-float-line: rgb(16 22 43 / .1); --s3-stage: #f3f1ec;
  --s3-ease: cubic-bezier(.2, .8, .2, 1);
}
:root[data-theme=dark] { --s3-float: #182136; --s3-float-line: rgb(255 255 255 / .1); --s3-stage: #0f1626; --s3-ok-ink: #3fd19d; --s3-low-ink: #f5c04a; --s3-down-ink: #ff7b7d; }
/* the app is light-only (styles.css: dark is off unless <html data-theme="dark">), so no prefers-color-scheme switch here */

.s3-page { display: flex; flex-direction: column; min-width: 0; width: 100%; min-height: calc(100vh - var(--topbar-h, 56px)); background: var(--canvas); }
.s3-page > * { min-width: 0; }
.main.flush > .s3-page, .main.flush > .dm-page { flex: 1; min-height: 0; overflow: auto; }
.s3-page > .s3-head, .s3-page > .s3-body, .s3-page > .s3-timeline { flex: none; }
.nv-board > .att-page { flex: 1; min-height: 0; overflow: auto; }
.s3-msg { display: grid; place-items: center; padding: 48px 20px; }
.s3-head { background: var(--surface-overlay, #fff); display: grid; grid-template-columns: auto minmax(0, 1fr) auto; min-width: 0; gap: 6px 18px; align-items: center; padding: 14px 20px 12px; border-bottom: 1px solid var(--line); background: var(--panel); }
.s3-back { display: inline-flex; gap: 6px; align-items: center; color: var(--link); font-size: 13px; font-weight: 600; text-decoration: none; padding: 6px 8px; margin-left: -8px; border-radius: 6px; }
.s3-back:hover { background: var(--hover); }
.s3-title { min-width: 0; }
.s3-title h1 { margin: 0; font-size: 22px; line-height: 1.15; letter-spacing: -.02em; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s3-sub { margin: 3px 0 0; font-size: 13px; color: var(--muted); }
.s3-sub a { color: var(--link); }
.s3-facts { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.s3-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 4px 9px; border-radius: 999px; background: var(--soft); border: 1px solid var(--line); color: var(--ink-2); text-decoration: none; font-variant-numeric: tabular-nums; }
.s3-chip.sample { background: #fff5dd; border-color: #f2d48a; color: #6b4a00; }
.s3-chip.s3-tkchip { color: var(--link); }
.s3-chip.s3-tkchip:hover { border-color: var(--link); }

.s3-body { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); min-height: 0; min-width: 0; }
.s3-page.has-drawer .s3-body { grid-template-columns: minmax(0, 1fr) 380px; }
.s3-stage { position: relative; min-height: 520px; height: calc(100vh - var(--topbar-h, 56px) - 250px); background: var(--s3-stage); overflow: hidden; }
.s3-stage:fullscreen { height: 100vh; }
.s3-canvas-host { position: absolute; inset: 0; }
.s3-canvas { position: absolute; inset: 0; display: block; width: 100% !important; height: 100% !important; cursor: grab; touch-action: none; }
.s3-canvas:active { cursor: grabbing; }
.s3-canvas:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }

/* floating controls over the scene (the only translucent surfaces) */
.s3-toolbar, .s3-cam, .s3-compass, .s3-legend, .s3-note, .s3-sun, .s3-energy, .s3-split-labels span { background: var(--s3-float); border: 1px solid var(--s3-float-line); box-shadow: 0 6px 24px rgb(16 22 43 / .08); }
@media (prefers-reduced-transparency: reduce) { .s3-toolbar, .s3-cam, .s3-compass, .s3-legend, .s3-note, .s3-sun, .s3-energy, .s3-split-labels span { backdrop-filter: none; background: var(--panel); } }
.s3-toolbar { position: absolute; top: 14px; left: 14px; z-index: 3; display: flex; gap: 8px; padding: 5px; border-radius: 12px; }
.s3-seg { display: inline-flex; gap: 2px; padding: 2px; border-radius: 9px; background: rgb(16 22 43 / .05); }
:root[data-theme=dark] .s3-seg { background: rgb(255 255 255 / .06); }
.s3-seg button { display: inline-flex; align-items: center; gap: 6px; font: inherit; font-size: 13px; font-weight: 600; color: var(--ink-2); background: transparent; border: 0; border-radius: 7px; padding: 6px 11px; cursor: pointer; min-height: 32px; transition: background .18s var(--s3-ease), color .18s; }
.s3-seg button:hover:not(:disabled) { background: rgb(16 22 43 / .06); }
.s3-seg button.on { background: var(--panel); color: var(--link); box-shadow: 0 1px 3px rgb(16 22 43 / .14); }
.s3-seg button:disabled { opacity: .45; cursor: not-allowed; }
.s3-seg.small button { font-size: 12px; padding: 4px 9px; min-height: 28px; }
.s3-note { position: absolute; top: 14px; left: 50%; transform: translateX(-50%); z-index: 2; display: flex; gap: 6px; align-items: center; max-width: min(560px, 60%); font-size: 12px; font-weight: 600; color: var(--ink-2); padding: 6px 11px; border-radius: 999px; }
.s3-note-t { white-space: nowrap; font-weight: 650; }
.s3-note-more { font-weight: 400; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s3-compass { position: absolute; top: 14px; right: 14px; z-index: 3; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; }
.s3-compass svg { width: 40px; height: 40px; transition: transform .05s linear; }
.s3-compass circle { fill: none; stroke: var(--line-2); }
.s3-compass path { fill: var(--muted); }
.s3-compass path.n { fill: var(--s3-down); }
.s3-compass text { font-size: 6px; font-weight: 700; text-anchor: middle; fill: var(--ink); }
.s3-cam { position: absolute; right: 14px; bottom: 14px; z-index: 3; display: grid; gap: 2px; padding: 4px; border-radius: 12px; }
.s3-cam button { width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: var(--ink-2); cursor: pointer; }
.s3-cam button:hover:not(:disabled) { background: rgb(16 22 43 / .07); color: var(--link); }
.s3-cam button[aria-pressed=false] { color: var(--muted); }
.s3-cam button:disabled { opacity: .35; }
.s3-legend { position: absolute; left: 14px; bottom: 14px; z-index: 3; display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; max-width: min(620px, calc(100% - 90px)); padding: 8px 12px; border-radius: 12px; font-size: 12px; color: var(--ink-2); }
.s3-legend .s3-lgi { display: inline-flex; gap: 6px; align-items: center; font-weight: 600; }
.s3-legend .s3-lgi i { width: 11px; height: 11px; border-radius: 3px; background: var(--s3-none); }
.s3-legend small { color: var(--muted); font-weight: 400; }
.s3-legend .s3-lgnote { color: var(--muted); }
.st-ok i { background: var(--s3-ok) !important; } .st-low i { background: var(--s3-low) !important; } .st-down i { background: var(--s3-down) !important; }
.s3-lgi.st-unmapped i { background: repeating-linear-gradient(45deg, #8a94a8 0 2px, #c7cdd8 2px 4px) !important; }

/* labels projected from the scene */
.s3-labels { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.s3-lbl { position: absolute; left: 0; top: 0; font-size: 11.5px; font-weight: 650; color: var(--ink); background: var(--s3-float); border: 1px solid var(--s3-float-line); padding: 3px 8px; border-radius: 999px; white-space: nowrap; transition: opacity .15s; box-shadow: 0 2px 8px rgb(16 22 43 / .1); }
.s3-lbl::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; background: var(--s3-none); vertical-align: 1px; }
.s3-lbl.st-ok::before { background: var(--s3-ok); } .s3-lbl.st-low::before { background: var(--s3-low); } .s3-lbl.st-down::before { background: var(--s3-down); }
.s3-lbl.on { border-color: var(--accent); box-shadow: 0 0 0 2px rgb(252 181 55 / .45); }
.s3-lbl.array::before { background: #31435f; }
.s3-lbl.flow { display: grid; text-align: center; padding: 5px 10px; border-radius: 10px; }
.s3-lbl.flow::before { display: none; }
.s3-lbl.flow small { font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }

/* sun + energy panels */
.s3-sun, .s3-energy { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 3; width: min(720px, calc(100% - 120px)); padding: 12px 14px 10px; border-radius: 14px; display: grid; gap: 10px; }
.mode-sun .s3-cam { bottom: 14px; }
.sun-row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; font-size: 12px; color: var(--ink-2); }
.sun-row input[type=date] { width: auto; min-height: 30px; font-size: 12px; padding: 3px 6px; }
.sun-date { display: inline-flex; gap: 6px; align-items: center; font-weight: 600; }
.sun-cmp { display: inline-flex; gap: 6px; align-items: center; font-weight: 600; }
.sun-cmp input { width: auto; min-height: 0; }
.grow { flex: 1; }
.sun-track { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; }
.sun-play { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-2); background: var(--panel); color: var(--link); display: grid; place-items: center; cursor: pointer; }
.sun-scale { position: relative; height: 40px; }
.sun-scale .night { position: absolute; top: 14px; height: 8px; background: rgb(23 38 86 / .14); border-radius: 4px; }
.sun-scale .heat { position: absolute; top: 14px; height: 8px; background: repeating-linear-gradient(-45deg, rgb(227 73 72 / .28) 0 3px, rgb(227 73 72 / .1) 3px 6px); border-radius: 4px; }
.sun-scale input[type=range] { position: absolute; inset: 8px 0 auto; width: 100%; min-height: 20px; margin: 0; padding: 0; border: 0; background: linear-gradient(90deg, rgb(252 181 55 / .2), rgb(252 181 55 / .55) 50%, rgb(252 181 55 / .2)); height: 8px; top: 14px; border-radius: 4px; -webkit-appearance: none; appearance: none; }
.sun-scale input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%; background: #FCB537; border: 3px solid #fff; box-shadow: 0 2px 8px rgb(16 22 43 / .3); cursor: grab; }
.sun-scale input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #FCB537; border: 3px solid #fff; box-shadow: 0 2px 8px rgb(16 22 43 / .3); }
.sun-scale input[type=range]:focus-visible { outline: 3px solid var(--link); outline-offset: 4px; }
.sun-scale .tick { position: absolute; top: 26px; transform: translateX(-50%); font-size: 10.5px; font-weight: 650; color: var(--ink-2); white-space: nowrap; text-align: center; line-height: 1.1; font-variant-numeric: tabular-nums; }
.sun-scale .tick small { display: block; font-weight: 400; color: var(--muted); }
.sun-now { display: grid; text-align: right; min-width: 150px; }
.sun-now b { font-size: 20px; letter-spacing: -.02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.sun-now small { font-size: 11px; color: var(--muted); }
.sun-basis { margin: 0; font-size: 11px; line-height: 1.45; color: var(--muted); }
.sun-basis b { color: var(--ink-2); font-weight: 650; }
.heat-key { display: inline-block; width: 14px; height: 7px; border-radius: 2px; background: repeating-linear-gradient(-45deg, rgb(227 73 72 / .35) 0 3px, rgb(227 73 72 / .12) 3px 6px); vertical-align: 0; }
.s3-split-labels { position: absolute; top: 64px; left: 0; right: 0; display: grid; grid-template-columns: 1fr 1fr; pointer-events: none; z-index: 2; }
.s3-split-labels span { justify-self: center; font-size: 12px; font-weight: 700; color: var(--ink); padding: 4px 10px; border-radius: 999px; }
.s3-split-labels::after { content: ''; position: absolute; left: 50%; top: -64px; bottom: -100vh; width: 2px; background: rgb(255 255 255 / .8); box-shadow: 0 0 0 1px rgb(16 22 43 / .12); }
.fresh { font-size: 12px; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.fresh b, .fresh-tag { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--soft); border: 1px solid var(--line); }
.fr-live b, .fresh-tag.fr-live { background: #e5f7ef; border-color: #9fdcc2; color: var(--s3-ok-ink); }
.fr-delayed b, .fresh-tag.fr-delayed { background: #fff6e0; border-color: #f0d38a; color: var(--s3-low-ink); }
.fr-historical b, .fresh-tag.fr-historical { background: #eef1f7; border-color: #cdd5e4; color: #3b4a67; }
.fr-unavailable b, .fresh-tag.fr-unavailable { background: #f4f4f6; border-color: #d8dbe2; color: #5a616f; }
.s3-schem { display: block; width: 100%; height: 96px; }
.s3-schem .sl { stroke: var(--line-3, #bdc9df); stroke-width: 2; stroke-dasharray: 4 4; }
.s3-schem .sl.measured { stroke: #E39A17; stroke-width: 3; stroke-dasharray: none; }
.s3-schem marker path { fill: var(--line-3, #bdc9df); }
.s3-schem rect { fill: var(--panel); stroke: var(--line-2); }
.s3-schem .sn[role=button] { cursor: pointer; }
.s3-schem .sn[role=button]:hover rect, .s3-schem .sn:focus-visible rect { stroke: var(--link); stroke-width: 2; }
.s3-schem .sn:focus-visible { outline: none; }
.s3-schem text { font-size: 9.5px; font-weight: 650; text-anchor: middle; fill: var(--ink); }
.s3-schem text.v { font-size: 9px; font-weight: 500; fill: var(--muted); }
.s3-schem .sn-array rect { stroke: #31435f; }

/* 2D plan */
.s3-plan { position: absolute; inset: 0; display: grid; grid-template-rows: auto 1fr auto; padding: 66px 70px 80px 20px; }
.s3-plan-note { margin: 0 0 8px; font-size: 12px; color: var(--muted); }
.s3-plan-energy { display: grid; gap: 6px; max-width: 620px; padding-top: 8px; }
.s3-plan svg { width: 100%; height: 100%; }
.pl-bldg { fill: #e9e1d4; stroke: #b9ab95; stroke-width: .12; }
:root[data-theme=dark] .pl-bldg { fill: #2a3142; stroke: #4b5568; }
.pl-ridge { stroke: #b9ab95; stroke-width: .12; stroke-dasharray: .5 .4; }
.pl-obs { fill: #bac1ca; }
.pl-pan { fill: #1c2740; stroke: #c9d0da; stroke-width: .04; cursor: pointer; }
.pl-pan.st-ok { fill: #1f6f60; } .pl-pan.st-low { fill: #a7790f; } .pl-pan.st-down { fill: #a72d2d; }
.pl-pan.on { stroke: #FCB537; stroke-width: .16; }
.pl-eq { cursor: pointer; }
.pl-eq circle { fill: var(--s3-none); stroke: #fff; stroke-width: .18; }
.pl-eq.st-ok circle { fill: var(--s3-ok); } .pl-eq.st-low circle { fill: var(--s3-low); } .pl-eq.st-down circle { fill: var(--s3-down); }
.pl-eq.on circle { stroke: #FCB537; stroke-width: .35; }
.pl-eq:focus-visible { outline: none; } .pl-eq:focus-visible circle { stroke: var(--link); stroke-width: .4; }
.pl-eq text { font-size: .9px; font-weight: 700; text-anchor: middle; fill: var(--ink); paint-order: stroke; stroke: var(--canvas); stroke-width: .25; }
.pl-north path { fill: var(--s3-down); } .pl-north text { font-size: 1px; font-weight: 700; text-anchor: middle; fill: var(--ink); }

/* drawer */
.s3-drawer { position: relative; border-left: 1px solid var(--line); background: var(--surface-overlay, #fff); overflow: auto; max-height: calc(100vh - var(--topbar-h, 56px) - 250px); min-height: 520px; animation: s3-in .28s var(--s3-ease); }
@keyframes s3-in { from { transform: translateX(16px); opacity: 0; } to { transform: none; opacity: 1; } }
.s3-x { position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; display: grid; place-items: center; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; }
.s3-x:hover { background: var(--hover); color: var(--ink); }
.s3-detail { padding: 18px 20px 24px; display: grid; gap: 12px; }
.s3-kicker { margin: 0; font-size: 12px; font-weight: 650; color: var(--muted); display: flex; gap: 5px; align-items: center; }
.s3-detail h2 { margin: 0; font-size: 19px; line-height: 1.25; letter-spacing: -.015em; color: var(--ink); padding-right: 30px; }
.s3-detail h3 { margin: 0 0 6px; font-size: 12.5px; font-weight: 700; color: var(--ink-2); }
.s3-detail section { padding-top: 10px; border-top: 1px solid var(--line); }
.s3-detail p { margin: 0; }
.s3-statline { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; color: var(--muted); }
.s3-status { display: inline-flex; gap: 6px; align-items: center; font-size: 12.5px; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--soft); border: 1px solid var(--line); color: var(--ink-2); }
.s3-status i { width: 9px; height: 9px; border-radius: 50%; background: var(--s3-none); }
.s3-status.st-ok { color: var(--s3-ok-ink); } .s3-status.st-low { color: var(--s3-low-ink); } .s3-status.st-down { color: var(--s3-down-ink); }
.s3-spark { margin: 0; }
.s3-spark svg { width: 100%; height: 58px; }
.s3-spark rect { fill: #31435f; } :root[data-theme=dark] .s3-spark rect { fill: #8fa7d9; }
.s3-spark rect.gap { fill: var(--line-2); }
.s3-spark rect.zero { fill: var(--s3-down) !important; }
.s3-spark figcaption { font-size: 11px; color: var(--muted); margin-top: 3px; }
.s3-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13px; }
.s3-list li { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.s3-list .link { text-align: left; padding: 0; }
.s3-photos { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.s3-photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.s3-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }

/* timeline */
.s3-timeline { border-top: 1px solid var(--line); background: var(--surface-overlay, #fff); padding: 12px 20px 16px; }
.s3-timeline header { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-bottom: 10px; }
.s3-timeline h2 { margin: 0; font-size: 15px; color: var(--ink); }
.s3-repeat { display: inline-flex; gap: 5px; align-items: center; font-size: 12px; font-weight: 650; color: var(--s3-low-ink); background: #fff6e0; border: 1px solid #f0d38a; padding: 3px 9px; border-radius: 999px; }
.s3-events { list-style: none; margin: 0; padding: 0 0 4px; display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x proximity; }
.s3-events .ev { flex: 0 0 236px; scroll-snap-align: start; }
.s3-events button { width: 100%; height: 100%; text-align: left; display: grid; grid-template-columns: auto 1fr; gap: 3px 8px; padding: 9px 11px; border-radius: 10px; border: 1px solid var(--line); background: var(--soft); font: inherit; color: var(--ink); cursor: pointer; transition: border-color .15s, transform .15s var(--s3-ease); }
.s3-events button:hover { border-color: var(--line-3, #bdc9df); }
.s3-events .ev.on button { border-color: var(--accent); background: #fffaf0; box-shadow: 0 0 0 2px rgb(252 181 55 / .3); }
:root[data-theme=dark] .s3-events .ev.on button { background: #2a2617; }
.ev-ic { grid-row: span 2; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 7px; background: var(--panel); border: 1px solid var(--line); color: var(--link); }
.ev-alert .ev-ic { color: var(--s3-down-ink); } .ev-replacement .ev-ic, .ev-rma .ev-ic { color: var(--s3-low-ink); } .ev-closed .ev-ic { color: var(--s3-ok-ink); }
.ev-d { font-size: 11px; font-weight: 650; color: var(--muted); font-variant-numeric: tabular-nums; }
.ev-t { font-size: 12.5px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ev-eq, .ev-ph { grid-column: 2; font-size: 11px; color: var(--link); font-weight: 650; display: inline-flex; gap: 4px; align-items: center; }

/* Sunny moments */
.sun-moment { display: grid; justify-items: center; gap: 10px; text-align: center; padding: 28px 16px; color: var(--ink-2); }
.sun-moment.compact { padding: 12px; gap: 6px; }
.sun-title { margin: 0; font-size: 15px; font-weight: 650; color: var(--ink); }
.sun-body { font-size: 13px; color: var(--muted); max-width: 420px; }
.sun-art { position: relative; width: var(--s); height: var(--s); display: block; }
.sun-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.sun-glow { position: absolute; inset: 14%; border-radius: 50%; background: radial-gradient(circle, rgb(252 181 55 / .55), rgb(252 181 55 / 0) 70%); animation: sun-breathe 5.5s ease-in-out infinite; }
.sun-rays { animation: sun-turn 80s linear infinite; }
.sun-face { animation: sun-bob 6s ease-in-out infinite; }
.sm-loading .sun-rays { animation-duration: 18s; }
.sm-success .sun-art { animation: sun-pop .7s var(--s3-ease) 1; }
.sm-success .sun-glow { animation: sun-flare 1.4s ease-out 1 forwards; }
@keyframes sun-turn { to { transform: rotate(360deg); } }
@keyframes sun-breathe { 0%, 100% { opacity: .55; transform: scale(.96); } 50% { opacity: .9; transform: scale(1.06); } }
@keyframes sun-bob { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-2px) rotate(-2deg); } }
@keyframes sun-pop { 0% { transform: scale(.6); opacity: 0; } 60% { transform: scale(1.08); opacity: 1; } 100% { transform: scale(1); } }
@keyframes sun-flare { 0% { opacity: 1; transform: scale(1.4); } 100% { opacity: .55; transform: scale(1); } }

/* needs attention */
.att-page { padding: 18px 20px 40px; max-width: 1200px; }
.att-head { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: flex-end; margin-bottom: 14px; }
.att-head h1 { margin: 0; font-size: 22px; letter-spacing: -.02em; }
.att-head p { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.att-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.att-filters button { font: inherit; font-size: 12.5px; font-weight: 650; border: 1px solid var(--line-2); background: var(--panel); color: var(--ink-2); border-radius: 999px; padding: 5px 11px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.att-filters button.on { border-color: var(--link); color: var(--link); box-shadow: inset 0 0 0 1px var(--link); }
.att-filters b { font-variant-numeric: tabular-nums; }
.att-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.att-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 18px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.att-card h2 { margin: 0; font-size: 15.5px; letter-spacing: -.01em; }
.att-card h2 a { color: var(--ink); text-decoration: none; } .att-card h2 a:hover { color: var(--link); }
.att-addr { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.att-reasons { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.att-reasons li { display: flex; gap: 8px; align-items: baseline; font-size: 13px; }
.att-tag { flex: none; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--soft); color: var(--ink-2); }
.att-tag.k-fault { background: #fdecec; border-color: #f2b4b4; color: var(--s3-down-ink); }
.att-tag.k-anomaly { background: #fff6e0; border-color: #f0d38a; color: var(--s3-low-ink); }
.att-tag.k-overdue { background: #fdf0e6; border-color: #f0c39f; color: #9a4b12; }
.att-tag.k-repeat { background: #eef1f7; border-color: #cdd5e4; color: #3b4a67; }
.att-impact { align-self: start; text-align: right; font-size: 12px; color: var(--muted); max-width: 260px; }
.att-impact b { display: block; font-size: 18px; letter-spacing: -.02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.att-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; }
.att-actions a { color: var(--link); font-weight: 600; }

/* demand map */
.dm-page { display: flex; flex-direction: column; min-width: 0; width: 100%; min-height: calc(100vh - var(--topbar-h, 56px)); background: var(--canvas); }
.dm-page > * { min-width: 0; }
.dm-bar { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--line); background: var(--panel); }
.dm-bar h1 { margin: 0 8px 0 0; font-size: 19px; letter-spacing: -.02em; }
.dm-bar label { display: inline-flex; gap: 6px; align-items: center; font-size: 12px; font-weight: 650; color: var(--ink-2); }
.dm-bar select { width: auto; max-width: 190px; min-height: 30px; font-size: 12.5px; padding: 3px 6px; }
.dm-body { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 360px; min-height: 0; min-width: 0; }
.dm-stage { position: relative; min-height: 520px; background: var(--s3-stage); overflow: hidden; }
.dm-stage .s3-canvas-host { position: absolute; inset: 0; }
.dm-scale { position: absolute; left: 14px; bottom: 14px; z-index: 3; padding: 8px 12px; border-radius: 12px; font-size: 12px; color: var(--ink-2); background: var(--s3-float); border: 1px solid var(--s3-float-line); display: grid; gap: 4px; }
.dm-scale .bar { display: flex; gap: 8px; align-items: flex-end; }
.dm-scale .bar i { display: block; width: 10px; background: linear-gradient(#243D90, #6f86c9); border-radius: 2px 2px 0 0; }
.dm-scale small { color: var(--muted); }
.dm-flat { position: absolute; inset: 0; }
.dm-flat svg { width: 100%; height: 100%; }
.dm-flat .town { fill: var(--muted); font-size: 11px; font-weight: 650; }
.dm-flat .town-dot { fill: var(--line-3, #bdc9df); }
.dm-flat .cl { fill: rgb(36 61 144 / .78); stroke: #fff; stroke-width: 1.5; cursor: pointer; }
.dm-flat .cl.on { fill: #FCB537; stroke: #243D90; stroke-width: 2.5; }
.dm-flat .cl:focus-visible { outline: none; stroke: #FCB537; stroke-width: 4; }
.dm-flat .cl-n { fill: #fff; font-size: 11px; font-weight: 750; text-anchor: middle; pointer-events: none; }
.dm-flat .cl.on + .cl-n { fill: #172656; }
.dm-flat .job-hi { fill: none; stroke: #e34948; stroke-width: 3; }
.dm-side { border-left: 1px solid var(--line); background: var(--surface-overlay, #fff); overflow: auto; max-height: calc(100vh - var(--topbar-h, 56px) - 58px); }
.dm-side header { padding: 14px 16px 10px; border-bottom: 1px solid var(--line); display: grid; gap: 4px; }
.dm-side h2 { margin: 0; font-size: 15px; }
.dm-side .muted { font-size: 12px; }
.dm-jobs { list-style: none; margin: 0; padding: 6px 8px 16px; display: grid; gap: 2px; }
.dm-jobs li button { width: 100%; text-align: left; font: inherit; border: 0; background: transparent; border-radius: 8px; padding: 8px 10px; cursor: pointer; display: grid; gap: 2px; color: var(--ink); }
.dm-jobs li button:hover, .dm-jobs li.on button { background: var(--hover); }
.dm-jobs li.on button { box-shadow: inset 3px 0 0 #FCB537; }
.dm-jobs .r1 { font-size: 13px; font-weight: 600; }
.dm-jobs .r2 { font-size: 11.5px; color: var(--muted); display: flex; gap: 6px; flex-wrap: wrap; }
.dm-jobs .r3 { display: flex; gap: 10px; font-size: 12px; }
.dm-jobs .r3 a { color: var(--link); font-weight: 600; }
.dm-prec { font-size: 11px; color: var(--muted); padding: 0 16px 10px; }

@media (max-width: 1100px) { .s3-page.has-drawer .s3-body { grid-template-columns: minmax(0, 1fr) 330px; } .dm-body { grid-template-columns: minmax(0, 1fr) 300px; } }
@media (max-width: 820px) {
  .s3-head { grid-template-columns: 1fr; padding: 10px 14px; }
  .s3-facts { justify-content: flex-start; }
  .s3-page.has-drawer .s3-body { grid-template-columns: minmax(0, 1fr); }
  .s3-stage { height: 58vh; min-height: 380px; }
  .s3-drawer { position: fixed; left: 0; right: 0; bottom: 0; max-height: 62vh; min-height: 0; border-left: 0; border-top: 1px solid var(--line); border-radius: 16px 16px 0 0; z-index: var(--z-sheet, 30); box-shadow: 0 -10px 40px rgb(16 22 43 / .18); animation-name: s3-up; }
  @keyframes s3-up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
  .s3-toolbar { flex-direction: column; align-items: flex-start; }
  .s3-seg button span { display: none; }
  .s3-note { top: auto; bottom: 64px; left: 14px; transform: none; max-width: calc(100% - 80px); }
  .s3-note-more { display: none; }
  .s3-sun, .s3-energy { left: 8px; right: 8px; width: auto; transform: none; bottom: 8px; padding: 10px; }
  .mode-sun .s3-cam, .mode-energy .s3-cam { bottom: auto; top: 76px; }
  .mode-sun .s3-legend, .mode-energy .s3-legend { display: none; }
  .sun-track { grid-template-columns: auto 1fr; } .sun-now { grid-column: 1 / -1; text-align: left; }
  .s3-legend { max-width: calc(100% - 70px); }
  .s3-plan { padding: 100px 60px 70px 12px; }
  .att-card { grid-template-columns: 1fr; } .att-impact { text-align: left; }
  .dm-body { grid-template-columns: 1fr; } .dm-stage { height: 56vh; min-height: 340px; } .dm-side { border-left: 0; border-top: 1px solid var(--line); max-height: none; }
}
@media (prefers-reduced-motion: reduce) {
  .sun-rays, .sun-face, .sun-glow, .sm-success .sun-art, .sm-success .sun-glow, .s3-drawer, .s3-compass svg { animation: none !important; transition: none !important; }
}
.cb-dacts { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 6px 16px 10px; border-bottom: 1px solid var(--line); }
.cb-dacts .cb-link { display: inline-flex; gap: 5px; align-items: center; font-weight: 650; }
/* Sunny success toast: a brief, warm confirmation (only after a real success) */
.toast.toast-sun { display: flex; align-items: center; gap: 10px; padding-left: 10px; }
.toast.toast-sun::before { content: ''; flex: none; width: 26px; height: 26px; background: url(/sunny-face.png) center / contain no-repeat; filter: drop-shadow(0 0 6px rgb(252 181 55 / .7)); animation: sun-pop .6s var(--s3-ease) 1; }
@media (prefers-reduced-motion: reduce) { .toast.toast-sun::before { animation: none; } }

/* 2.6.0: floating controls over the 3D stage are solid (the layout audit's no-see-through rule); the demand map's
   keyboard list of areas appears where it can be seen while one of its buttons has focus */
.dm-keys { position: absolute; left: 14px; top: 60px; z-index: 4; display: flex; flex-wrap: wrap; gap: 6px; max-width: calc(100% - 28px); width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.dm-keys:focus-within { width: auto; height: auto; overflow: visible; clip-path: none; }
.dm-keys button { font: inherit; font-size: 12px; font-weight: 650; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--s3-float-line); background: var(--s3-float); color: var(--ink); cursor: pointer; }
.dm-keys button[aria-pressed="true"] { border-color: var(--accent); }
.dm-keys button:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
