:root {
  font-family: 'Avenir Next', Avenir, 'Segoe UI', Arial, sans-serif;
  color: #16344d;
  background: #eef5fb;
  --navy: #123a5a;
  --teal: #1779b8;
  --muted: #6e879b;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { display: block; min-height: 100vh; background: linear-gradient(#f7fbff, #eaf4fc); }
button, input { transition: background .2s, border-color .2s, box-shadow .2s, transform .2s; }
button { border-color: #d8e7f2; color: #24516c; font-weight: 650; }
button:hover { background: #eaf6ff; border-color: #9cccec; }
button:focus-visible, a:focus-visible, input:focus-visible, [data-asset]:focus-visible { outline: 3px solid #5ec7ff; outline-offset: 3px; }
button:disabled { opacity: .65; cursor: wait; }
a { color: #1676ae; }

/* Floating translucent navigation shares the same actions on every view. */
.topbar {
  position: fixed; z-index: 20; top: 19px; left: 50%; transform: translateX(-50%);
  width: min(1290px, calc(100% - 40px)); height: 68px; margin: 0; padding: 0 18px 0 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  border: 1px solid #ffffffb0; border-radius: 24px;
  background: #ffffffbf; box-shadow: 0 13px 40px #09293f27, inset 0 1px #ffffffd9;
  -webkit-backdrop-filter: blur(28px) saturate(1.6); backdrop-filter: blur(28px) saturate(1.6);
}
.brand, .brand span { color: #123c5a; font-size: 22px; letter-spacing: -.8px; }
.brand { gap: 9px; white-space: nowrap; }
.brand-mark { display: inline-flex; align-items: center; justify-content: center; width: 35px; height: 35px; border-radius: 11px; background: linear-gradient(135deg,#119fd0,#66d8e4); color: white; font-size: 24px; font-style: normal; box-shadow: 0 5px 12px #168fbb4d; }
.topbar .brand em { margin-left: 1px; border-color: #b8d9e8; color: #28769b; border-radius: 5px; }
.topbar nav { display: flex; align-items: center; gap: 4px; height: auto; }
.topbar nav button { height: 43px; padding: 0 15px; border: 0; border-radius: 13px; background: transparent; color: #41647b; white-space: nowrap; font-size: 13px; font-weight: 600; }
.topbar nav button:hover { background: #ffffffc7; color: #0d5e91; }
.topbar nav button.active { background: #ffffffec; border: 1px solid #ffffff; color: #0a75aa; box-shadow: 0 3px 12px #15476a1c; }
.topbar nav button.active:after { display: none; }
.workspace-label { border-color: #cde5f2; border-radius: 13px; color: #47738c; background: #ffffffa3; font-size: 11px; white-space: nowrap; }
.workspace-label:before { content: '●'; margin-right: 7px; color: #33bb9e; }

main { position: relative; width: 100%; max-width: none; margin: 0; padding: 0 0 27px; overflow: hidden; }
.intro { position: relative; z-index: 3; }
.eyebrow { color: #a6e9ff; font-size: 11px; font-weight: 750; letter-spacing: 2.1px; }
.intro h1 { font-weight: 660; letter-spacing: -1.8px; }
.workspace-hero { position: relative; z-index: 1; display: block; height: min(980px, max(900px, 100svh)); margin: 0; }
.workspace-hero.hidden { display: none; }
.photo-panel { position: absolute; inset: 0; min-height: 0; border-radius: 0; background: #102d41; }
.photo-panel img { position: absolute; width: 100%; height: 100%; object-fit: cover; object-position: center 51%; }
.photo-panel:after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg,#102b3a9e 0%,#15324370 37%,#1734451f 72%,#112b3b32 100%),linear-gradient(0deg,#132d3da6 0%,transparent 42%,#152c3a12 100%); }
.photo-label { top: auto; bottom: 20px; right: 3.7%; z-index: 3; padding: 6px 10px; border-radius: 9px; background: #0e314b82; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.photo-content { inset: auto auto 147px 5.3%; max-width: min(730px, 56%); justify-content: start; }
.photo-content .eyebrow { color: #b6edff; }
.photo-content h2 { max-width: none; margin: 16px 0 20px; color: white; font-size: clamp(45px, 4.5vw, 70px); font-weight: 520; letter-spacing: -2.9px; line-height: 1.02; text-shadow: 0 3px 20px #08233680; }
.photo-content h2 em { font-family: 'Iowan Old Style', Baskerville, 'Times New Roman', serif; font-size: 1.08em; font-weight: 500; letter-spacing: -3.5px; }
.photo-content p:not(.eyebrow) { max-width: 500px; color: #eff9ff; font-size: clamp(14px, 1.3vw, 18px); line-height: 1.6; text-shadow: 0 1px 10px #0823369c; }

body[data-view="overview"] .intro { position: absolute; top: 137px; left: 5.3%; margin: 0; color: white; }
body[data-view="overview"] .intro h1 { margin: 10px 0 3px; color: #fff; font-size: clamp(27px,2.5vw,36px); text-shadow: 0 2px 16px #061a2c91; }
body[data-view="overview"] .intro p:not(.eyebrow) { color: #e3f4fa; font-size: 14px; }
body[data-view="overview"] .context-note { display: none; }

.scenario { position: absolute; z-index: 4; width: min(620px, 49%); right: 5.3%; bottom: 70px; padding: 31px; border: 1px solid #ffffffc4; border-radius: 27px; background: #f7fcffdc; box-shadow: 0 25px 70px #041c3299, inset 0 1px #fff; -webkit-backdrop-filter: blur(28px) saturate(1.35); backdrop-filter: blur(28px) saturate(1.35); }
.section-kicker h2 { margin: 0; color: #153a55; font-family: 'Iowan Old Style', Baskerville, Georgia, serif; font-size: 27px; font-style: italic; font-weight: 500; letter-spacing: -.6px; }
.subtle-tag { padding: 6px 8px; border: 1px solid #b9ddce; border-radius: 999px; background: #e6f6eeba; color: #277e61; font-weight: 700; }
.subtle-tag i { display: inline-block; width: 6px; height: 6px; margin-right: 4px; border-radius: 50%; background: #28a97e; box-shadow: 0 0 0 4px #36ae8730; animation: live-pulse 1.8s infinite; }
.telemetry-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px; color: #7891a2; font-size: 10px; }
.telemetry-row button { padding: 4px 8px; border-radius: 999px; background: #ffffff9c; color: #446b80; font-size: 10px; }
.live-transformer-picker { display: block; margin-top: 12px; color: #4c7086; font-size: 10px; font-weight: 700; letter-spacing: .25px; }
.live-transformer-picker span { display: block; margin-bottom: 6px; }
.live-transformer-picker select { width: 100%; padding: 12px 39px 12px 13px; border: 1px solid #c7dfea; border-radius: 13px; outline: 0; background: #fbfeffe8; color: #173f54; font: 650 13px 'Avenir Next','Segoe UI',sans-serif; box-shadow: inset 0 1px #fff,0 5px 14px #244d6210; cursor: pointer; }
.live-transformer-picker select:focus-visible { border-color: #4faed5; outline: 3px solid #4ebce138; outline-offset: 2px; }
.scenario>p { margin: 9px 0 12px; color: #597c94; font-size: 13px; }
.mode-regulator { display: grid; grid-template-columns: 190px 1fr; align-items: center; gap: 16px; margin: 0 0 17px; padding: 12px 14px; border: 1px solid #d7e8ef; border-radius: 20px; background: #ffffff8c; box-shadow: inset 0 1px #fff; }
.mode-dial { position: relative; width: 180px; height: 158px; margin: auto; }
.dial-face { position: absolute; top: 29px; left: 35px; display: grid; place-items: center; width: 110px; height: 110px; border: 1px solid #cadde5; border-radius: 50%; background: conic-gradient(from -40deg,#67bca4 0 33%,#df6d62 33% 66%,#efb45e 66% 100%); box-shadow: inset 0 0 0 11px #f5fafbd9,0 8px 22px #31576820; }
.dial-face:after { content: ''; position: absolute; inset: 23px; border-radius: 50%; background: #f9fcfd; box-shadow: 0 3px 10px #1a46571f; }
.dial-face b { position: relative; z-index: 2; color: #21495b; font-size: 25px; font-weight: 600; }
.dial-pointer { position: absolute; z-index: 3; top: 8px; left: calc(50% - 1px); width: 3px; height: 43px; border-radius: 3px; background: #173f50; transform-origin: 50% 47px; transition: transform .4s cubic-bezier(.2,.8,.2,1); }
.mode-dial[data-mode="normal"] .dial-pointer { transform: rotate(0deg); }
.mode-dial[data-mode="above"] .dial-pointer { transform: rotate(-120deg); }
.mode-dial[data-mode="extreme"] .dial-pointer { transform: rotate(120deg); }
.mode-choice { position: absolute; z-index: 4; min-height: 28px; padding: 4px 8px; border: 1px solid transparent; border-radius: 999px; background: #f7fbfcd9; color: #617b88; font-size: 9px; font-weight: 700; line-height: 1.05; }
.mode-choice:hover,.mode-choice.active { border-color: #9ec5d2; background: #fff; color: #173f50; box-shadow: 0 4px 12px #274d5b1c; }
.mode-normal { top: 0; left: 50%; transform: translateX(-50%); }
.mode-above { bottom: 0; left: 0; }
.mode-extreme { right: 0; bottom: 0; }
.mode-details span { display: block; margin-bottom: 6px; color: #6d8a97; font-size: 9px; font-weight: 750; letter-spacing: 1.2px; }
.mode-details strong { display: block; color: #21495b; font-family: 'Iowan Old Style',Baskerville,Georgia,serif; font-size: 23px; font-style: italic; font-weight: 600; line-height: 1.05; }
.mode-details p { margin: 8px 0 0; color: #68828f; font-size: 11px; line-height: 1.45; }
.selected-live-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 8px; }
.selected-live-grid>div { min-width: 0; overflow: hidden; padding: 11px 10px; border: 1px solid #d3e5ed; border-radius: 13px; background: #ffffffa8; box-shadow: inset 0 1px #fff; }
.selected-live-grid span { display: block; min-height: 23px; color: #718c9b; font-size: 9px; line-height: 1.25; }
.selected-live-grid strong { display: block; color: #173f54; font-size: clamp(16px,2vw,19px); font-weight: 650; line-height: 1.15; overflow-wrap: anywhere; }
.controls { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 17px; margin: 0; }
.controls label { display: block; color: #45677d; font-size: 12px; font-weight: 650; }
.input-box { display: flex; align-items: baseline; gap: 4px; margin-top: 9px; padding: 13px 13px; border: 1px solid #d1e5f3; border-radius: 13px; background: #ffffffbb; box-shadow: inset 0 1px #fff; }
.input-box:focus-within { border-color: #59ade0; box-shadow: 0 0 0 3px #4dbaff38; }
.input-box input { min-width: 0; width: 100%; padding: 0; border: 0; outline: 0; background: transparent; color: #153e58; font-size: 31px; font-weight: 650; font-variant-numeric: tabular-nums; }
.input-box .unit { color: #829caf; font-size: 10px; white-space: nowrap; }
.scenario-actions { gap: 9px; margin-top: 19px; }
.scenario-actions button { min-height: 45px; border-radius: 12px; white-space: nowrap; }
.primary { flex: 1; border-color: #0d8ed1; background: linear-gradient(135deg,#0e9cda,#087abf); color: white; box-shadow: 0 8px 18px #0983c43d; }
.primary:hover { border-color: #0578b7; background: linear-gradient(135deg,#1192ca,#006caa); color: white; transform: translateY(-1px); }
.scenario-actions #live-toggle { font-size: 11px; background: #eef8f4d9; color: #26765e; }
.scenario-foot { margin-top: 13px; color: #7c9aad; font-size: 10px; }
#scenario-status { color: #158aae; }
#scenario-status.pending-note { color: #ac702a!important; }
.condition-alert { position: fixed; z-index: 40; inset: auto 24px 24px auto; display: flex; flex-direction: row; width: min(410px,calc(100% - 30px)); height: auto; padding: 18px 48px 18px 19px; border: 1px solid #f0c4a8; border-radius: 18px; background: #fff9f4e8; color: #4e3a2e; box-shadow: 0 18px 55px #38200f38; -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px); animation: alert-in .35s ease both; }
.condition-alert[hidden] { display: none; }
.condition-alert.critical { border-color: #e8a69e; background: #fff4f2ed; }
.condition-alert.emergency { border: 2px solid #d83e3e; background: #fff0eeed; box-shadow: 0 18px 65px #b4231847,0 0 0 7px #e54f4530; animation: alert-in .35s ease both, emergency-pulse 1.4s ease-in-out infinite alternate; }
.condition-alert #alert-level { display: block; margin-bottom: 5px; color: #ad5e31; font-size: 10px; font-weight: 750; letter-spacing: 1.4px; text-transform: uppercase; }
.condition-alert.critical #alert-level { color: #b43838; }
.condition-alert.emergency #alert-level { color: #c02626; }
.condition-alert strong { color: #573528; font-family: 'Iowan Old Style', Baskerville, Georgia, serif; font-size: 21px; font-style: italic; font-weight: 600; }
.condition-alert p { margin: 5px 0 0; color: #765b4b; font-size: 12px; line-height: 1.5; }
.condition-alert #alert-close { position: absolute; top: 12px; right: 12px; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; background: #ffffffa3; font-size: 20px; }
.condition-alert .alert-action { margin-top: 12px; padding: 9px 12px; border-color: #c73c36; border-radius: 9px; background: #c73c36; color: #fff; font-size: 11px; }
.condition-alert .alert-action[hidden] { display: none; }
@keyframes live-pulse { 50% { opacity: .45; transform: scale(.82); } }
@keyframes alert-in { from { opacity: 0; transform: translateY(18px); } }
@keyframes emergency-pulse { to { box-shadow: 0 18px 65px #b423185c,0 0 0 11px #e54f4514; } }

/* Results begin where the image ends, on a clean white and blue canvas. */
.notice, #error, #content, footer { position: relative; z-index: 2; width: min(1290px, calc(100% - 8%)); margin-left: auto; margin-right: auto; }
.notice { margin-top: 25px; margin-bottom: 30px; padding: 12px 16px; border: 1px solid #d4e9f7; border-left: 3px solid #45add8; border-radius: 13px; background: #e7f5fdd4; color: #648498; font-size: 12px; line-height: 1.5; }
.notice b { color: #2b749a; }
#error:empty { display: none; }
#error { padding: 12px 18px; border: 1px solid #ecc8b6; border-radius: 12px; background: #fff3ed; color: #a14e32; }
.results-heading { margin: 0 0 14px; }
.results-heading h2 { color: #527a94; font-size: 11px; font-weight: 750; letter-spacing: 1.5px; }
.results-heading span { color: #829baa; font-size: 11px; }
.focus-panel { margin-bottom: 23px; padding: 28px; border: 1px solid #ffffff73; border-radius: 27px; background: linear-gradient(135deg,#123e58,#0c5971 62%,#157587); color: #eefaff; box-shadow: 0 18px 50px #244f6a29; }
.focus-head { display: flex; align-items: end; justify-content: space-between; gap: 22px; }
.focus-kicker { color: #a8dcea; font-size: 9px; font-weight: 750; letter-spacing: 1.6px; }
.focus-head h2 { margin: 5px 0 2px; color: #fff; font-family: 'Iowan Old Style',Baskerville,Georgia,serif; font-size: 34px; font-style: italic; font-weight: 600; }
.focus-head p { margin: 0; color: #b9d9e3; font-size: 11px; }
.single-focus-badge { padding: 7px 10px; border: 1px solid #ffffff38; border-radius: 999px; background: #ffffff12; color: #c7e4ec; font-size: 9px; font-weight: 700; white-space: nowrap; }
.focus-summary { display: grid; grid-template-columns: 160px 1fr; gap: 20px; align-items: center; margin-top: 22px; }
.risk-orb { display: grid; place-items: center; align-content: center; width: 148px; height: 148px; border: 1px solid #ffffff70; border-radius: 50%; background: radial-gradient(circle at 35% 25%,#ffffff36,transparent 40%),#ffffff12; box-shadow: inset 0 0 0 9px #ffffff0a; text-align: center; }
.risk-orb span { color: #b9dae5; font-size: 10px; text-transform: uppercase; letter-spacing: 1px; }
.risk-orb strong { margin: 4px 0; color: #fff; font-size: 37px; font-weight: 620; }
.risk-orb em { color: #bce9dc; font-size: 10px; font-style: normal; font-weight: 700; }
.focus-panel.elevated .risk-orb em,.focus-panel.attention .risk-orb em { color: #ffd58e; }
.focus-panel.critical .risk-orb em,.focus-panel.emergency .risk-orb em { color: #ffaaa1; }
.focus-impact { display: grid; grid-template-columns: repeat(3,1fr); gap: 9px; }
.focus-impact span,.focus-impact b { padding: 14px; border: 1px solid #ffffff24; border-radius: 13px; background: #ffffff12; color: #d9edf3; font-size: 11px; font-weight: 600; }
.focus-impact b { grid-column: 1/-1; color: #fff; }
.focus-readings { display: grid; grid-template-columns: repeat(3,1fr); gap: 9px; margin-top: 18px; }
.focus-readings>div { padding: 12px 14px; border: 1px solid #ffffff20; border-radius: 13px; background: #ffffff0e; }
.focus-readings span { display: block; margin-bottom: 6px; color: #a9ceda; font-size: 9px; }
.focus-readings strong { color: #fff; font-size: 20px; font-weight: 600; }
.focus-readings small { margin-left: 4px; color: #b8d6df; font-size: 9px; }
.diagnostics { margin-top: 22px; padding: 21px; border-radius: 19px; background: #f7fbfdec; color: #244657; }
.diagnostics-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.diagnostics-head span { color: #7895a2; font-size: 9px; font-weight: 750; letter-spacing: 1.3px; }
.diagnostics-head h3 { margin: 4px 0 0; color: #173f54; font-family: 'Iowan Old Style',Baskerville,Georgia,serif; font-size: 25px; font-style: italic; }
.diagnostics-head>b { padding: 6px 9px; border-radius: 999px; background: #e9f0f3; color: #54717f; font-size: 10px; }
.issue-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.issue { display: grid; grid-template-columns: 30px 1fr; gap: 10px; padding: 13px; border: 1px solid #efd9b6; border-radius: 13px; background: #fffbf2; }
.issue.critical { border-color: #efc2bd; background: #fff4f2; }
.issue>i { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #e5a845; color: #fff; font-style: normal; font-weight: 800; }
.issue.critical>i { background: #cf4a45; }
.issue div>span { color: #a06d26; font-size: 8px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; }
.issue.critical div>span { color: #b43f3b; }
.issue h4 { margin: 2px 0 5px; color: #294b5c; font-size: 13px; }
.issue p { margin: 0 0 5px; color: #617c88; font-size: 10px; line-height: 1.35; }
.issue p strong { color: #274a5a; }
.issue small { color: #79909a; font-size: 9px; line-height: 1.35; }
.all-clear { display: flex; align-items: center; gap: 12px; padding: 14px; border: 1px solid #bfdfd4; border-radius: 13px; background: #edf8f4; }
.all-clear i { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #2c9a78; color: #fff; font-style: normal; }
.all-clear strong { color: #276b58; }
.all-clear p { margin: 3px 0 0; color: #6e8f83; font-size: 10px; }
.diagnostic-note { margin: 13px 0 0; color: #8096a0; font-size: 9px; line-height: 1.4; }
.residual-life { display: grid; grid-template-columns: 150px 1fr; align-items: center; gap: 24px; margin-top: 14px; padding: 22px; border: 1px solid #ffffff33; border-radius: 19px; background: linear-gradient(125deg,#0b3147,#124f65); box-shadow: inset 0 1px #ffffff1f; }
.life-gauge { display: grid; place-items: center; width: 136px; height: 136px; border-radius: 50%; background: conic-gradient(#64cbb1 calc(var(--life)*1%),#ffffff1c 0); box-shadow: 0 12px 28px #031c2940; }
.life-gauge:before { content: ''; grid-area: 1/1; width: 105px; height: 105px; border-radius: 50%; background: #103e52; box-shadow: inset 0 1px #ffffff21; }
.life-gauge>div { z-index: 1; grid-area: 1/1; text-align: center; }
.life-gauge strong { display: block; color: #fff; font-size: 30px; font-weight: 650; line-height: 1; }
.life-gauge span { display: block; margin-top: 6px; color: #afd5df; font-size: 9px; text-transform: uppercase; letter-spacing: .7px; }
.life-copy h3 { margin: 5px 0 6px; color: #fff; font-family: 'Iowan Old Style',Baskerville,Georgia,serif; font-size: 25px; font-style: italic; font-weight: 600; }
.life-copy>p { margin: 0; color: #c1dce4; font-size: 11px; line-height: 1.5; }
.life-factors { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; margin: 14px 0 11px; }
.life-factors span { padding: 9px; border: 1px solid #ffffff1f; border-radius: 11px; background: #ffffff0b; color: #9fc5d0; font-size: 9px; }
.life-factors b { display: block; margin-bottom: 3px; color: #eafaff; font-size: 16px; font-weight: 650; }
.life-copy small { display: block; color: #86afbb; font-size: 8px; line-height: 1.45; }
.stats { gap: 18px; margin-bottom: 23px; }
.stat { padding: 24px; border: 1px solid #ffffff; border-radius: 23px; background: #ffffffd9; box-shadow: 0 12px 32px #3a799b10, inset 0 1px #fff; -webkit-backdrop-filter: blur(22px); backdrop-filter: blur(22px); }
.stat:first-child { border-color: #125c91; background: linear-gradient(135deg,#155f93,#0a79a8); }
.stat strong { margin: 13px 0 8px; color: #164865; font-size: clamp(36px,3.7vw,48px); font-weight: 680; }
.stat:first-child strong { color: #f2fcff; }
.stat .muted { color: #7993a6; }
.stat:first-child .muted { color: #d4ebf8; }
.stat .muted:first-child { color: #40667f; font-weight: 650; }
.stat:first-child .muted:first-child { color: white; }
.layout { grid-template-columns: 1.35fr 1fr; gap: 20px; }
.panel { padding: 25px; margin-bottom: 21px; border: 1px solid #ffffff; border-radius: 23px; background: #ffffffdc; box-shadow: 0 12px 32px #3a799b0e, inset 0 1px #fff; -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
.panel h2 { color: #164665; font-size: 19px; font-weight: 680; letter-spacing: -.45px; }
.muted { color: #708da0; }
.map { border: 1px solid #d3e8f5; border-radius: 15px; background: #e9f5fc; }
.map circle:hover { filter: brightness(1.1); }
.legend { color: #718fa2; font-size: 11px; }
.asset { border-color: #e1edf4; }
.asset:hover { background: #eef8fd; }
.asset b { color: #295a75; font-weight: 650; }
.asset small { color: #849eae; }
.risk { color: #c2734a; }
.crew-grid h3 { color: #628198; }
.crew-grid b { color: #164b6b; }
.bar { background: #e3f0f7; }
.bar span { background: linear-gradient(90deg,#17a3d1,#0878b5); }
.field-banner { border-radius: 22px; background: #1a5579; }
.field-banner .eyebrow { color: #a9e6ff; }
.field-banner p { color: #d0e8f4; }
.crew { border: 1px solid #d8eaf5; border-left: 3px solid #319dcc; border-radius: 14px; background: #eef8fd; }
.crew p { color: #66869a; }
.tag.good { background: #e2f5ef; color: #188468; }
th { background: #eff7fc; color: #6c8ba1; }
td { border-color: #e5f0f6; color: #385d73; }
td b { color: #174866; }
pre { border-radius: 15px; background: #133d5a; color: #dcf7ff; }
footer { display: flex; justify-content: space-between; gap: 15px; margin-top: 7px; padding: 22px 0 0; border-top: 1px solid #d7e7f1; color: #829dac; font-size: 11px; }
footer strong { color: #527d96; }
dialog { border: 1px solid #d1e8f6; border-radius: 25px; padding: 29px; box-shadow: 0 35px 110px #0b385f78; background: #fafdffed; -webkit-backdrop-filter: blur(25px); backdrop-filter: blur(25px); }
dialog::backdrop { background: #0b365e9e; backdrop-filter: blur(8px); }
dialog h1 { color: #087eaf; }

/* Secondary views use the same image as a deliberately soft backdrop. */
body[data-view="plan"] main:before,
body[data-view="evidence"] main:before,
body[data-view="sim"] main:before { content: ''; position: absolute; z-index: 0; top: -25px; left: -25px; right: -25px; height: 660px; background: linear-gradient(90deg,#0a2f4fae,#0c4d73a1),url('/grid-substation-editorial.png') center 42% / cover; filter: blur(11px); }
body[data-view="plan"] main:after,
body[data-view="evidence"] main:after,
body[data-view="sim"] main:after { content: ''; position: absolute; z-index: 0; top: 430px; left: 0; right: 0; height: 250px; background: linear-gradient(transparent,#eef6fc); pointer-events: none; }
body[data-view="plan"] .intro,
body[data-view="evidence"] .intro,
body[data-view="sim"] .intro { min-height: 258px; margin: 0; padding: 145px 5.3% 30px; color: white; }
body[data-view="plan"] .intro h1,
body[data-view="evidence"] .intro h1,
body[data-view="sim"] .intro h1 { color: white; font-size: clamp(33px,3.2vw,45px); text-shadow: 0 2px 18px #09334f91; }
body[data-view="plan"] .intro p:not(.eyebrow),
body[data-view="evidence"] .intro p:not(.eyebrow),
body[data-view="sim"] .intro p:not(.eyebrow) { color: #e1f4fc; }
body[data-view="plan"] .context-note,
body[data-view="evidence"] .context-note,
body[data-view="sim"] .context-note { display: none; color: #d8ebf6; }
body[data-view="plan"] .workspace-hero { height: 700px; }
body[data-view="plan"] .photo-panel { display: none; }
body[data-view="plan"] .scenario { top: 0; bottom: auto; right: 5.3%; width: min(620px,49%); }
@media (max-width: 1250px) and (min-width: 701px) {
  body[data-view="overview"] .workspace-hero { height: 1250px; }
  body[data-view="overview"] .photo-content { inset: 285px 5.3% auto; max-width: 89%; }
  body[data-view="overview"] .scenario { left: 7.5%; right: auto; bottom: 75px; width: min(620px,85%); }
  body[data-view="plan"] .scenario { width: min(620px,62%); }
}
body[data-view="evidence"] .notice { margin-top: 0; }

@media (max-width: 1000px) {
  .topbar { width: calc(100% - 24px); padding: 0 12px; gap: 7px; }
  .topbar nav button { padding: 0 10px; font-size: 12px; }
  .workspace-label { display: none; }
  .photo-content { bottom: auto; }
  .photo-content h2 { font-size: clamp(42px,5vw,60px); }
  .scenario { width: min(620px,85%); }
  .scenario-actions { flex-wrap: wrap; }
  .scenario-actions button { flex: 1; }
}
@media (max-width: 700px) {
  .topbar { position: absolute; top: 10px; height: auto; min-height: 104px; flex-wrap: wrap; padding: 11px 12px 0; border-radius: 19px; }
  .brand span { font-size: 20px; }
  .brand-mark { width: 32px; height: 32px; }
  .topbar nav { order: 3; width: 100%; height: 46px; overflow: visible; justify-content: space-between; gap: 1px; }
  .topbar nav button { flex: 0 0 auto; height: 36px; padding: 0 4px; font-size: 9px; }
  .topbar nav button.active { border-radius: 10px; }
  .workspace-hero { height: 1450px; }
  .photo-panel img { object-position: 58% center; }
  .photo-panel:after { background: linear-gradient(180deg,#061b2caa,#092b4478 38%,#061b2ca3 100%),linear-gradient(90deg,#061b2c88,transparent); }
  body[data-view="overview"] .intro { top: 151px; left: 5%; right: 5%; }
  body[data-view="overview"] .intro h1 { font-size: 29px; }
  body[data-view="overview"] .intro p:not(.eyebrow) { font-size: 12px; }
  .photo-content { inset: 305px 5% auto; max-width: 90%; }
  .photo-content h2 { margin: 12px 0; font-size: clamp(42px,10vw,58px); }
  .photo-content p:not(.eyebrow) { font-size: 14px; }
  .scenario { left: 4%; right: 4%; bottom: 62px; width: 92%; padding: 22px; border-radius: 23px; }
  .mode-regulator { grid-template-columns: 165px 1fr; gap: 10px; padding: 10px; }
  .mode-dial { width: 160px; transform: scale(.92); }
  .controls { gap: 13px; }
  .input-box { padding: 10px; }
  .input-box input { font-size: 25px; }
  .scenario-actions { flex-wrap: nowrap; }
  .scenario-actions button { padding-left: 9px; padding-right: 9px; }
  .selected-live-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .selected-live-grid span { min-height: 0; margin-bottom: 5px; }
  .selected-live-grid strong { font-size: 19px; white-space: nowrap; }
  .notice, #error, #content, footer { width: calc(100% - 30px); }
  .notice { margin-top: 18px; }
  .stats { grid-template-columns: 1fr; gap: 10px; }
  .focus-panel { padding: 20px; }
  .focus-head { display: grid; }
  .single-focus-badge { width: fit-content; }
  .focus-summary { grid-template-columns: 125px 1fr; gap: 12px; }
  .risk-orb { width: 120px; height: 120px; }
  .risk-orb strong { font-size: 30px; }
  .focus-impact { grid-template-columns: 1fr; }
  .focus-impact b { grid-column: auto; }
  .focus-readings { grid-template-columns: repeat(2,1fr); }
  .focus-readings>div { min-width: 0; overflow: hidden; }
  .focus-readings strong { display: flex; align-items: baseline; flex-wrap: wrap; font-size: 18px; overflow-wrap: anywhere; }
  .issue-grid { grid-template-columns: 1fr; }
  .diagnostics-head { align-items: start; }
  .residual-life { grid-template-columns: 115px 1fr; gap: 16px; padding: 17px; }
  .life-gauge { width: 108px; height: 108px; }
  .life-gauge:before { width: 82px; height: 82px; }
  .life-gauge strong { font-size: 24px; }
  .stat { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 5px; padding: 18px 20px; }
  .stat strong { grid-column: 2; grid-row: 1/3; margin: 0; font-size: 36px; }
  .stat .muted { grid-column: 1; }
  .layout { grid-template-columns: 1fr; }
  .panel { padding: 19px; }
  body[data-view="plan"] .intro,
  body[data-view="evidence"] .intro,
  body[data-view="sim"] .intro { min-height: 295px; padding: 154px 5% 20px; }
  body[data-view="plan"] .intro h1,
  body[data-view="evidence"] .intro h1,
  body[data-view="sim"] .intro h1 { font-size: 32px; }
  body[data-view="plan"] .context-note,
  body[data-view="evidence"] .context-note { display: none; }
  body[data-view="plan"] .workspace-hero { height: 740px; }
  body[data-view="plan"] .scenario { top: 0; bottom: auto; left: 4%; right: 4%; width: 92%; }
  body[data-view="plan"] main:before,
  body[data-view="evidence"] main:before,
  body[data-view="sim"] main:before { height: 740px; }
  footer { display: block; line-height: 1.8; }
}
@media (max-width: 520px) {
  .scenario { left: 15px; right: auto; width: calc(100% - 30px); padding: 20px; }
  .mode-regulator { grid-template-columns: 150px minmax(0,1fr); gap: 6px; }
  .mode-dial { width: 150px; transform: scale(.88); }
  .mode-details { min-width: 0; }
  .mode-details strong { font-size: 21px; overflow-wrap: anywhere; }
  .mode-details p { overflow-wrap: anywhere; }
  .residual-life { grid-template-columns: 1fr; }
  .life-gauge { margin: auto; }
  .life-copy { text-align: center; }
  .life-factors { gap: 5px; }
  .life-factors span { min-width: 0; padding: 8px 5px; overflow-wrap: anywhere; }
}
@media (max-width: 430px) {
  .scenario { bottom: 40px; }
  .scenario-actions { flex-direction: column; }
  .controls { gap: 5px; }
  .mode-regulator { grid-template-columns: 1fr; }
  .mode-details { text-align: center; }
  .input-box { padding: 8px 6px; }
  .input-box input { font-size: 20px; }
  .input-box .unit { font-size: 9px; }
}
@media (prefers-reduced-motion: reduce) { *, *:before, *:after { transition: none!important; scroll-behavior: auto!important; } }
