:root {
  color-scheme: dark;
  --night: #050d19;
  --panel: #0b1a2c;
  --panel-deep: #081522;
  --line: #234158;
  --fine-line: #162d42;
  --ink: #f0f8ff;
  --muted: #a5bed3;
  --blue: #71aaff;
  --ice: #6ee4fc;
  --aqua: #48d7cb;
  --amber: #ffc488;
  --rose: #ff887c;
  --display: "Bahnschrift", "Segoe UI", system-ui, sans-serif;
  --sans: "Segoe UI", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-width: 300px;
  min-height: 100svh;
  background: radial-gradient(ellipse at 49% -15%, #173451 0%, #07101e 44%, var(--night) 76%);
  color: var(--ink);
  font: 1rem/1.45 var(--sans);
}
a { color: inherit; text-decoration: none; }
button, select { color: inherit; font: inherit; }
button { cursor: pointer; }
a:focus-visible, button:focus-visible, select:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--ice);
  outline-offset: 3px;
}
p, h1, h2, h3, ul { margin: 0; }
svg { display: block; }
.sr-only { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
.skip { position: absolute; z-index: 12; left: .75rem; top: .55rem; transform: translateY(-150%); color: #04101b; background: var(--ice); padding: .5rem 1rem; }
.skip:focus { transform: none; }
.console { width: min(100%, 1920px); margin: auto; padding: 0 clamp(14px, 1.75vw, 34px); }
.mast {
  position: relative;
  min-height: 75px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}
.mast::after {
  content: "";
  position: absolute;
  height: 2px;
  left: 30%;
  right: 30%;
  bottom: -1px;
  background: linear-gradient(90deg, transparent, #56bbeb81 30%, #b0efff 50%, #56bbeb81 70%, transparent);
  box-shadow: 0 0 22px #4baef866;
  pointer-events: none;
}
.wordmark { display: flex; align-items: center; gap: 9px; justify-self: start; min-width: 0; }
.wordmark img { flex: none; object-fit: contain; }
.wordmark strong { color: #ecf9ff; font-size: .92rem; letter-spacing: .085em; }
.wordmark small { display: block; color: var(--muted); font: 600 .68rem/1.1 var(--display); letter-spacing: .15em; margin-top: 3px; }
.mast-title { text-align: center; padding: 7px 4px 9px; }
.mast-title h1 { font-size: clamp(1.52rem, 2.7vw, 3.15rem); font-weight: 690; line-height: 1.12; letter-spacing: .095em; }
.mast-title p { color: #a4ceed; font: 640 .72rem/1.3 var(--display); letter-spacing: .25em; margin-top: 5px; }
.mast-tools, .scope-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.plain-control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 33px;
  border-radius: 4px;
  border: 1px solid var(--line);
  color: #bed7eb;
  background: #0c1c2d;
  padding: 3px 10px;
  font-size: .84rem;
  white-space: nowrap;
}
.plain-control:hover { color: var(--ice); border-color: #5696b4; background: #143047; }
.module-nav {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 7px;
  max-width: 1030px;
  margin: 8px auto 5px;
}
.module-nav button {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 3px 8px;
  white-space: nowrap;
  color: #bfd1e2;
  background: #0a192a;
  border: 1px solid #21394f;
  border-radius: 4px 4px 2px 2px;
  font-size: .89rem;
  font-weight: 635;
}
.module-nav i { font-style: normal; flex: none; }
.module-nav button:hover, .module-nav button[aria-current] { color: #effcff; border-color: #57a8d0; background: linear-gradient(180deg,#143955,#10253b); }
.module-nav button[aria-current] { box-shadow: inset 0 -2px var(--ice), inset 0 0 20px #489be242, 0 2px 14px #267ece25; }
.module-nav button[aria-current] svg { color: var(--ice); }
.scope-bar { min-height: 43px; display: flex; align-items: center; justify-content: space-between; gap: 9px; margin: 0 0 7px; }
.scope-main { display: flex; align-items: center; min-width: 0; gap: 9px; }
.scope-kind {
  padding: 2px 7px;
  color: #9aeafa;
  background: #10324a;
  border: 1px solid #2d5870;
  border-radius: 3px;
  white-space: nowrap;
  font-size: .75rem;
  font-weight: 670;
}
.scope-kind.simulated { color: #ffce9d; border-color: #693f2e; background: #342228; }
.scope-kind.backtest { color: #d4d8ff; border-color: #495899; background: #23284d; }
.scope-label { color: #bed5e7; font-size: .84rem; }
.period-control { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: .82rem; white-space: nowrap; }
.period-control select {
  border: 1px solid var(--line);
  border-radius: 4px;
  min-height: 33px;
  max-width: 145px;
  padding: 3px 7px;
  background: #0a1b2e;
  color: #e0eff9;
  font-size: .85rem;
}
.main-board {
  display: grid;
  grid-template-columns: minmax(215px, 1.02fr) minmax(0, 3.05fr) minmax(215px, 1.05fr);
  gap: 9px;
  align-items: stretch;
}
.stack { display: flex; flex-direction: column; gap: 8px; min-width: 0; min-height: 0; }
.stack > .panel { flex: 1 1 auto; }
.panel, .stage, .rail-item {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: linear-gradient(152deg, #0e2237, var(--panel-deep) 72%);
  box-shadow: inset 0 1px 0 #73bce314;
}
.panel { padding: 10px 12px; overflow: hidden; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 7px; margin-bottom: 8px; }
.panel-head h2, .rail-item h2 {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .93rem;
  font-weight: 675;
  line-height: 1.3;
  letter-spacing: .025em;
}
.panel-head h2 svg, .rail-item h2 svg { flex: none; color: var(--ice); }
.panel-tag { font-size: .72rem; color: var(--muted); white-space: nowrap; line-height: 1.35; }
.metric-val, .chip, .milestone-time { font-family: var(--display); font-variant-numeric: tabular-nums; }
.metric-val { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.metric-val strong { font-size: clamp(1.64rem, 2.45vw, 2.9rem); line-height: 1; font-weight: 660; letter-spacing: -.025em; }
.metric-val small { color: #bad5eb; font: .74rem/1.25 var(--sans); white-space: nowrap; }
.metric-foot { display: flex; justify-content: space-between; align-items: center; gap: 5px 7px; flex-wrap: wrap; margin-top: 7px; color: var(--muted); font-size: .76rem; }
.chip { padding: 2px 5px; border: 1px solid #2d655f; background: #153a3a; color: #92f4df; border-radius: 3px; font-size: .77rem; font-weight: 650; line-height: 1.13; white-space: nowrap; }
.chip.down, .chip.warning { color: #ffd0a5; background: #382628; border-color: #76503b; }
.chip.alarm { color: #ffb1a5; background: #462b31; border-color: #834c51; }
.chip.neutral { color: #b9ddf5; background: #142b43; border-color: #34566e; }
.composite { display: grid; grid-template-columns: minmax(62px, .75fr) minmax(0, 1fr); gap: 7px; align-items: center; }
.ring { display: grid; position: relative; align-items: center; width: min(100%, 113px); aspect-ratio: 1; margin-inline: auto; }
.ring svg { width: 100%; height: auto; transform: rotate(-90deg); }
.ring .center { position: absolute; inset: 0; display: grid; align-content: center; justify-items: center; pointer-events: none; font: 680 clamp(.98rem, 1.46vw, 1.42rem)/1 var(--display); }
.ring small { font: .71rem/1.1 var(--sans); color: var(--muted); margin-top: 4px; }
.legend { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.legend-row { display: grid; grid-template-columns: 7px minmax(0,1fr) auto; align-items: center; gap: 5px; color: #c4d9e9; font-size: .78rem; }
.legend-row i { width: 6px; height: 6px; border-radius: 1px; }
.legend-row strong { color: #e4f3ff; font: 650 .81rem/1.15 var(--display); white-space: nowrap; }
.detail-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--fine-line); color: #c6dbea; font-size: .82rem; }
.detail-row:last-child { border-bottom: 0; }
.detail-name { color: var(--muted); min-width: 0; }
.detail-value { text-align: right; font-family: var(--display); font-weight: 645; }
.panel-note { color: var(--muted); font-size: .76rem; line-height: 1.45; margin-top: 7px; }
.detail-title { color: #e5f4ff; font-size: .93rem; margin-top: 4px; font-weight: 675; }
.detail-title + .panel-note { margin-top: 4px; }
.dense-table {
  width: 100%;
  border-collapse: collapse;
  border-spacing: 0;
  font-size: .79rem;
  line-height: 1.25;
}
.dense-table :is(th, td) {
  padding: 3px 3px;
  white-space: nowrap;
  text-align: right;
  border-bottom: 1px solid #647e9a27;
}
.dense-table :is(th, td):first-child { text-align: left; padding-left: 0; }
.dense-table :is(th, td):last-child { padding-right: 0; }
.dense-table thead th { font-weight: 550; color: #9fbbd0; }
.dense-table tbody th { color: #dae9f6; font-weight: 560; }
.dense-table tbody td { font-family: var(--display); font-variant-numeric: tabular-nums; font-weight: 610; color: #eff8ff; }
.dense-table tbody tr:last-child :is(th, td) { border-bottom: 0; }
.dense-table tbody tr.selected-row { background: #17415c8c; }
.dense-table tbody tr:has(button:hover) { background: #1b435b99; }
.table-point {
  display: block;
  width: 100%;
  padding: 1px 3px 1px 1px;
  background: transparent;
  border: 0;
  color: inherit;
  text-align: left;
  cursor: pointer;
}
.table-point[aria-pressed="true"] { color: #a9eeff; }
.table-point:hover { color: #a9eeff; }
.table-point:focus-visible { outline-offset: 1px; }
.mini-status { display: inline-flex; align-items: center; gap: 4px; color: #a2e5d6; font-family: var(--sans); font-size: .72rem; font-weight: 610; }
.mini-status::before { content: ""; height: 5px; width: 5px; border-radius: 50%; background: #61ddc7; flex: none; }
.mini-status.warning { color: #ffcb9a; }
.mini-status.warning::before { background: #ffbd81; }
.mini-status.alarm { color: #ffa995; }
.mini-status.alarm::before { background: #ff8f7f; }
.load-reading { display: inline-flex; align-items: center; justify-content: flex-end; gap: 4px; }
.load-reading i { width: 19px; height: 4px; border-radius: 1px; background: linear-gradient(90deg, #65ccec var(--load), #264052 var(--load)); }
.load-reading.warm i { background: linear-gradient(90deg, #ffc080 var(--load), #443a42 var(--load)); }
.panel .rail-columns { margin-block: 4px 1px; gap: 4px; }
.stage {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: clamp(400px, calc(100svh - 290px), 690px);
  border-color: #39647d;
  overflow: hidden;
  background: #050e1b;
}
.stage::before, .stage::after { content: ""; position: absolute; z-index: 5; pointer-events: none; height: 15px; width: 15px; border-color: #8cdfffbb; border-style: solid; }
.stage::before { top: 0; left: 0; border-width: 1px 0 0 1px; }
.stage::after { bottom: 0; right: 0; border-width: 0 1px 1px 0; }
.stage-head { z-index: 3; display: flex; justify-content: space-between; align-items: flex-start; gap: 9px; padding: 10px 13px; background: #08182a; border-bottom: 1px solid #28475f; }
.stage-head h2 { font-size: 1.03rem; line-height: 1.2; letter-spacing: .02em; font-weight: 690; }
.stage-head p { color: #a5c6df; font-size: .76rem; margin-top: 3px; }
.stage-head .stage-tag { color: #a5dff3; border: 1px solid #365c74; background: #112944; border-radius: 4px; padding: 3px 6px; white-space: nowrap; font-size: .73rem; }
.stage-image, .stage-overlay { position: absolute; inset: 0; width: 100%; height: 100%; }
.stage-overlay { pointer-events: none; }
.stage-image { object-fit: cover; object-position: var(--image-position, center); }
.field { flex: 1; min-height: 285px; position: relative; isolation: isolate; overflow: hidden; }
.field::after { content: ""; position: absolute; z-index: 1; inset: 0; pointer-events: none; background: linear-gradient(0deg, #040d1ce8 0%, #04102010 27%, #06182a00 67%, #06172a50 100%); }
.field-meter { z-index: 2; position: absolute; inset: auto 12px 11px; display: flex; justify-content: space-between; align-items: flex-end; gap: 8px; color: #e1f1fc; text-shadow: 0 2px 8px #04101c, 0 1px 4px #04101c; font-size: .76rem; line-height: 1.3; pointer-events: none; }
.field-meter span:last-child { color: #beD6ec; text-align: right; }
.field-key {
  position: absolute;
  z-index: 2;
  top: 9px;
  right: 10px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 4px 7px;
  color: #deebfa;
  background: #071725d9;
  border: 1px solid #44718a8e;
  border-radius: 3px;
  font-size: .74rem;
  pointer-events: none;
}
.field-key span { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.field-key i { width: 7px; height: 4px; background: var(--key-color); border-radius: 1px; }
.field-plaque {
  position: absolute;
  z-index: 2;
  left: 10px;
  bottom: 30px;
  width: min(24%, 190px);
  padding: 5px 7px;
  color: #e2effc;
  background: #081929e6;
  border: 1px solid #4c7f9eaa;
  border-radius: 4px;
}
.field-plaque h3 { font-size: .76rem; font-weight: 670; padding-bottom: 2px; border-bottom: 1px solid #45749569; }
.field-plaque .detail-row { font-size: .75rem; padding-block: 2px; }
.field-plaque .detail-value { color: #d9efff; }
.scene-mark {
  position: absolute;
  z-index: 2;
  left: var(--x);
  top: var(--y);
  transform: translate(-50%, -61%);
  display: grid;
  gap: 2px;
  min-width: 58px;
  padding: 5px 7px;
  color: #e9f9ff;
  background: #061a2dec;
  border: 1px solid #5487a6;
  font-size: .77rem;
  line-height: 1.12;
  border-radius: 3px;
  box-shadow: 0 4px 18px #001121bb;
  text-align: left;
  white-space: nowrap;
}
.scene-mark strong { color: var(--ice); font: 660 .88rem/1.18 var(--display); }
.scene-mark::after { content: ""; position: absolute; left: 50%; bottom: -6px; height: 6px; width: 6px; transform: translateX(-50%); border-radius: 50%; background: var(--ice); box-shadow: 0 0 11px #60e8ff; }
.scene-mark.warm strong, .scene-mark.alert strong { color: var(--amber); }
.scene-mark.warm::after, .scene-mark.alert::after { background: var(--amber); box-shadow: 0 0 13px #ffb965; }
.scene-mark:focus-visible, .scene-mark:hover, .scene-mark[aria-pressed="true"] { background: #103b52f5; border-color: var(--ice); z-index: 3; }
.scene-mark.warm[aria-pressed="true"], .scene-mark.alert[aria-pressed="true"] { border-color: var(--amber); background: #51312bee; }
.stage-plot { z-index: 3; padding: 7px 12px 5px; background: #081827; border-top: 1px solid var(--line); }
.stage-plot .chart { max-height: 130px; }
.stage-plot .panel-head { margin-bottom: 3px; }
.stage-plot .panel-head h2 { font-size: .87rem; }
.stage-plot .chart-meta { margin: 1px 0; }
.stage-plot .panel-tag { white-space: normal; }
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: #31516a; stroke-width: .8; stroke-dasharray: 2.8 4.3; }
.chart .axis { fill: #b2cee6; font: 550 9px var(--display); }
.chart .column { fill: #74d9fe1a; }
.chart .point { fill: var(--ice); stroke: #062d45; stroke-width: 1.3; }
.chart .line { stroke: var(--ice); stroke-width: 1.8; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.chart .line.compare { stroke: #9dacf0; stroke-width: 1.45; stroke-dasharray: 4 4; }
.chart .threshold { stroke: #f3a86f; stroke-width: .8; stroke-dasharray: 4 4; opacity: .8; }
.chart .chart-hit { cursor: pointer; outline: none; }
.chart .chart-hit rect { fill: transparent; }
.chart .chart-hit:is(:hover,:focus-visible) rect { fill: #77dcff25; stroke: #7bdbff8c; stroke-width: .5; }
.chart-meta { display: flex; gap: 7px 12px; justify-content: space-between; flex-wrap: wrap; margin-top: 4px; color: var(--muted); font-size: .75rem; }
.chart-meta b { color: #e0f3ff; font-family: var(--display); }
.chart-meta .compare-key b { color: #cfcbff; }
.rail { display: grid; grid-template-columns: 1.2fr 1fr 1.05fr; gap: 8px; margin-top: 8px; }
.rail-item { padding: 8px 11px; }
.rail-item h2 { font-size: .88rem; margin-bottom: 6px; }
.rail-item p { font-size: .8rem; line-height: 1.41; color: #bed4e5; }
.rail-item .rail-emphasis { color: #e6f4ff; font-weight: 650; }
.rail-columns { display: flex; gap: 8px; align-items: stretch; }
.mini-reading { flex: 1; min-width: 0; display: grid; align-content: center; gap: 1px; border: 1px solid #233f54; border-radius: 3px; padding: 4px 6px; background: #0b2033; font-size: .74rem; color: #aac3d9; }
.mini-reading strong { font: 665 .95rem/1.2 var(--display); color: #ecf8ff; }
.archive-anchor { color: #8fdeef; text-decoration: underline; text-underline-offset: 3px; font-size: .78rem; }
.archive-anchor:hover { color: #e1f8ff; }
.milestones { display: grid; gap: 3px; grid-template-columns: repeat(var(--steps), minmax(0,1fr)); position: relative; }
.milestones::before { content: ""; position: absolute; left: 7%; right: 7%; top: 6px; background: #3a6f8f; height: 1px; }
.milestone { position: relative; z-index: 1; display: grid; justify-items: center; gap: 1px; min-width: 0; padding: 1px 0 3px; color: #bdd3e6; background: transparent; border: 1px solid transparent; border-radius: 3px; text-align: center; font-size: .7rem; white-space: nowrap; }
.milestone::before { content: ""; height: 7px; width: 7px; margin: 1px 0 3px; border: 1px solid #6c93b6; background: #0b2439; border-radius: 50%; }
.milestone[aria-pressed="true"]::before { background: var(--ice); border-color: #b8efff; box-shadow: 0 0 9px #66deff9c; }
.milestone:hover { border-color: #365b72; background: #113452; }
.milestone-time { font-size: .81rem; color: #ecf8ff; font-weight: 640; line-height: 1.1; }
.console-footer { display: flex; justify-content: space-between; gap: 9px; padding: 8px 1px 10px; color: #a4bdd3; font-size: .73rem; }
.loading { margin: 6px 0; padding: 2rem; background: var(--panel); border: 1px solid var(--line); color: var(--muted); }
@media (max-height: 840px) and (min-width: 1001px) {
  .mast { min-height: 59px; }
  .mast-title { padding-block: 4px; }
  .mast-title h1 { font-size: clamp(1.52rem, 2.45vw, 2.5rem); }
  .mast-title p { margin-top: 3px; }
  .module-nav { margin-top: 5px; margin-bottom: 2px; }
  .module-nav button { min-height: 33px; }
  .scope-bar { min-height: 35px; margin-bottom: 5px; }
  .scope-actions :is(select, .plain-control) { min-height: 30px; }
  .stack { gap: 6px; }
  .panel { padding: 7px 10px; }
  .panel-head { margin-bottom: 5px; }
  .metric-val strong { font-size: clamp(1.52rem, 2.28vw, 2.26rem); }
  .metric-foot { margin-top: 4px; }
  .detail-row { padding-block: 3px; }
  .panel-note { margin-top: 4px; }
  .ring { width: min(100%, 87px); }
  .legend { gap: 3px; }
  .dense-table :is(th, td) { padding-block: 2px; }
  .stack .chart { max-height: 88px; }
  .stage-head { padding: 8px 11px; }
  .stage { min-height: clamp(365px, calc(100svh - 258px), 610px); }
  .field { min-height: 250px; }
  .stage-plot .chart { max-height: 99px; }
  .rail-item { padding: 5px 9px; }
  .rail-item h2 { margin-bottom: 4px; }
}
@media (max-width: 1150px) {
  .main-board { grid-template-columns: minmax(196px, 1fr) minmax(0, 2.7fr) minmax(196px, 1fr); }
  .panel { padding-inline: 9px; }
  .wordmark { gap: 5px; }
}
@media (max-height: 900px) and (min-width: 1001px) {
  .mast { min-height: 51px; }
  .mast-title { padding-block: 2px; }
  .mast-title h1 { font-size: clamp(1.45rem, 2.1vw, 1.93rem); }
  .mast-title p { font-size: .65rem; margin-top: 2px; }
  .module-nav { margin-block: 4px 1px; }
  .module-nav button { min-height: 30px; }
  .scope-bar { min-height: 30px; margin-bottom: 4px; }
  .scope-actions :is(select, .plain-control) { min-height: 27px; }
  .panel { padding-block: 5px; }
  .stack { gap: 5px; }
  .stack .chart { max-height: 72px; }
  .chart-meta { font-size: .69rem; line-height: 1.22; gap: 3px 6px; }
  .panel-head { margin-bottom: 3px; }
  .panel-head h2, .rail-item h2 { font-size: .85rem; line-height: 1.22; }
  .metric-val strong { font-size: clamp(1.45rem, 2.08vw, 2.04rem); }
  .metric-foot { margin-top: 2px; line-height: 1.18; }
  .metric-foot .chip { padding-block: 1px; }
  .dense-table { font-size: .76rem; }
  .dense-table :is(th, td) { padding-block: .55px; }
  .legend { gap: 2px; }
  .legend-row { font-size: .74rem; line-height: 1.15; }
  .ring { width: min(100%, 75px); }
  .detail-row { padding-block: 1px; font-size: .78rem; line-height: 1.18; }
  .detail-title { margin-top: 2px; font-size: .84rem; line-height: 1.23; }
  .panel-note { font-size: .73rem; line-height: 1.26; }
  .panel > .archive-anchor { display: block; line-height: 1.25; margin-top: 2px; }
  .panel .rail-columns { margin-block: 3px 1px; }
  .mini-reading { font-size: .69rem; padding: 3px 4px; line-height: 1.14; }
  .mini-reading strong { font-size: .84rem; line-height: 1.11; white-space: nowrap; }
  .panel .rail-columns:not(:has(.mini-reading:nth-child(3))) .mini-reading {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 3px;
  }
  .rail { margin-top: 7px; }
  .rail-item p { font-size: .75rem; line-height: 1.25; }
  .rail-item > .archive-anchor { display: block; line-height: 1.24; margin-top: 3px; }
  .stage-head { padding-block: 7px; }
}
@media (max-width: 1000px) {
  .main-board { grid-template-columns: 1fr 1fr; }
  .stage { grid-row: 1; grid-column: 1 / -1; min-height: min(64svh, 530px); }
  .stage .field { min-height: 285px; }
  .rail { grid-template-columns: 1fr 1fr; }
  .rail .rail-item:last-child { grid-column: 1 / -1; }
  .field-plaque { display: none; }
}
@media (max-width: 640px) {
  .console { padding-inline: 10px; }
  .mast { grid-template-columns: minmax(0,1fr) auto; min-height: 0; padding-top: 7px; gap: 5px; }
  .wordmark img { width: 27px; height: 27px; }
  .wordmark strong { font-size: .84rem; }
  .wordmark small { font-size: .6rem; }
  .mast-title { grid-row: 2; grid-column: 1 / -1; padding: 3px 2px 9px; }
  .mast-title h1 { font-size: clamp(1.38rem, 6.3vw, 2.1rem); letter-spacing: .05em; }
  .mast-title p { font-size: .65rem; }
  .mast-tools { grid-row: 1; grid-column: 2; gap: 5px; }
  .module-nav { grid-template-columns: repeat(3, minmax(0,1fr)); gap: 4px; margin-top: 7px; }
  .module-nav button { min-height: 36px; font-size: .82rem; gap: 5px; padding: 2px 4px; }
  .module-nav button svg { width: 14px; height: 14px; }
  .scope-kind { font-size: .7rem; }
  .scope-main, .scope-actions { gap: 4px; }
  .scope-label { font-size: .74rem; }
  .scope-bar { flex-wrap: wrap; padding: 4px 0; min-height: 37px; }
  .period-control { font-size: 0; }
  .period-control select { min-height: 30px; font-size: .77rem; width: 99px; padding: 2px; }
  .plain-control { min-height: 30px; font-size: .76rem; padding-inline: 7px; }
  .main-board, .rail { gap: 5px; }
  .main-board, .rail { grid-template-columns: minmax(0, 1fr); }
  .stage { min-height: 0; }
  .stage .field { min-height: 265px; }
  .stage-head { padding: 7px 9px; }
  .stage-head h2 { font-size: .91rem; }
  .stage-head p, .stage-head .stage-tag { font-size: .68rem; }
  .field-meter { font-size: .67rem; inset: auto 6px 7px; }
  .field-key { top: 5px; right: 5px; gap: 6px; padding: 3px 5px; font-size: .65rem; }
  .scene-mark { font-size: .68rem; min-width: 45px; padding: 4px 5px; }
  .scene-mark strong { font-size: .75rem; }
  .stack { gap: 5px; }
  .panel, .rail-item { padding: 7px 6px; }
  .panel-head { gap: 3px; margin-bottom: 6px; }
  .panel-head h2 { font-size: .82rem; gap: 4px; }
  .panel-head h2 svg, .rail-item h2 svg { width: 13px; height: 13px; }
  .panel-tag { display: none; }
  .metric-val { gap: 4px; }
  .metric-val strong { font-size: clamp(1.24rem, 5.4vw, 1.8rem); }
  .metric-val small { font-size: .67rem; }
  .metric-foot .chip, .metric-foot { font-size: .69rem; }
  .composite { grid-template-columns: minmax(70px, .65fr) minmax(0, 1fr); gap: 6px; }
  .ring { width: 83px; }
  .ring small { font-size: .65rem; }
  .dense-table { font-size: .79rem; }
  .table-point { min-height: 31px; }
  .panel-note, .rail-item p { font-size: .73rem; }
  .console-footer { font-size: .68rem; }
}
@media (max-width: 355px) {
  .wordmark small { display: none; }
  .scope-main { flex: 1 1 auto; }
  .scope-bar { gap: 4px; }
  .detail-row { gap: 3px; font-size: .73rem; }
  .milestone { font-size: .64rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
}

.mast-title {
  position: relative;
  isolation: isolate;
}
.mast-title::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0 -46px -2px;
  background: linear-gradient(180deg, #13294349, #0e355298);
  clip-path: polygon(7% 0, 93% 0, 100% 100%, 0 100%);
  border-bottom: 1px solid #79ccec;
}
.mast-title h1 {
  color: #f2fbff;
  text-shadow: 0 2px 13px #54c9fa6b;
}
.mast::after {
  box-shadow: 0 0 16px #4bc0f6ad;
}
.module-nav button[aria-current] {
  border-top-color: #88dbf1;
  box-shadow: inset 0 -2px var(--ice), inset 0 0 23px #489be25c, 0 1px 15px #267ece35;
}
.panel, .rail-item {
  position: relative;
  background: linear-gradient(145deg, #10283d 0%, #081727 75%);
}
.panel::before, .rail-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 7px;
  width: 23px;
  height: 1px;
  background: #64cff088;
  pointer-events: none;
}
.panel:has(.chip.warning)::before {
  background: #ffac70ab;
}
.stage {
  border-color: #436f8d;
  box-shadow: 0 0 23px #13466e55, inset 0 0 0 1px #60a7d01c;
}
.stage::before, .stage::after {
  width: 27px;
  height: 23px;
  border-color: #92e5ffdd;
  filter: drop-shadow(0 0 4px #7adfff80);
}
.stage-head {
  background: linear-gradient(100deg, #102942, #0a1a2c 53%, #10263a);
}
.stage-head h2 {
  color: #effaff;
}
.stage-head .stage-tag {
  border-color: #5889a6;
  box-shadow: inset 0 0 12px #4c8fb82d;
}
.stage-image {
  filter: contrast(1.08) saturate(1.1);
}
.field-substation .stage-image, .field-forecast .stage-image {
  filter: brightness(1.08) contrast(1.08) saturate(1.12);
}
.field::after {
  background: linear-gradient(0deg, #030a16f4, #07162d1a 27%, transparent 72%, #06132242),
    radial-gradient(ellipse at 50% 45%, transparent 34%, #030b181c 64%, #030b1870 109%);
}
.field-graphics {
  position: absolute;
  z-index: 2;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.field-key, .field-plaque, .field-meter, .scene-mark, .field-focus {
  z-index: 3;
}
.field-plaque {
  width: min(25%, 182px);
  border-color: #548cafbc;
  box-shadow: inset 0 1px #70dbf12b, 0 4px 14px #0007;
}
.field-key {
  background: #071522e0;
}
.field-key i {
  box-shadow: 0 0 7px color-mix(in srgb, var(--key-color) 52%, transparent);
}
.field[data-graphics="active"] .scene-mark::after {
  opacity: 0;
}
.scene-mark {
  background: linear-gradient(155deg, #123047f5, #051527f7);
  border-color: #6baccbd4;
  padding: 5px 8px 6px;
  transition: box-shadow .15s ease, border-color .15s ease;
}
.scene-mark strong {
  font-size: .97rem;
  letter-spacing: .02em;
}
.scene-mark.warm, .scene-mark.alert {
  border-color: #d69a6cc2;
}
.scene-mark[aria-pressed="true"] {
  border-color: #98eaff;
  box-shadow: 0 0 0 1px #6de6fe6e, 0 0 18px #26d0fb69, inset 0 0 12px #319acd35;
  z-index: 4;
}
.scene-mark.warm[aria-pressed="true"], .scene-mark.alert[aria-pressed="true"] {
  color: #fff3e0;
  border-color: #ffd198;
  box-shadow: 0 0 0 1px #ffbe7661, 0 0 20px #fca95675, inset 0 0 12px #f6925d35;
}
.field-focus {
  --focus-color: #7eeafd;
  position: absolute;
  right: 11px;
  bottom: 28px;
  width: clamp(150px, 28%, 226px);
  padding: 6px 10px 7px 11px;
  border: 1px solid #5c92af;
  border-left: 2px solid var(--focus-color);
  border-radius: 4px;
  background: linear-gradient(120deg, #10263af5, #040e1ef2);
  box-shadow: 0 6px 23px #02070ebf, inset 0 1px #9de9fc29;
  pointer-events: none;
}
.field-focus[data-tone="amber"] { --focus-color: #ffcc8d; border-color: #c89467; border-left-color: var(--focus-color); }
.field-focus[data-tone="alarm"] { --focus-color: #ffa88b; border-color: #c9776c; border-left-color: var(--focus-color); }
.focus-name, .focus-detail {
  display: block;
  color: #becfe1;
  font-size: .75rem;
  line-height: 1.2;
}
.focus-name { color: #e2f4ff; font-weight: 640; }
.field-focus p {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 6px;
  margin-block: 4px;
  color: var(--focus-color);
  line-height: 1;
}
.field-focus strong {
  font: 670 clamp(1.4rem, 2.25vw, 2.6rem)/1 var(--display);
  font-variant-numeric: tabular-nums;
  letter-spacing: -.025em;
  text-shadow: 0 0 12px color-mix(in srgb, var(--focus-color) 34%, transparent);
}
.field-focus small { color: #dbeaf8; font-size: .7rem; }
.field-focus progress {
  display: block;
  appearance: none;
  width: 100%;
  height: 3px;
  margin-top: 6px;
  accent-color: var(--focus-color);
  border: 0;
  background: #253b52;
  border-radius: 1px;
}
.field-focus progress::-webkit-progress-bar { background: #253b52; border-radius: 1px; }
.field-focus progress::-webkit-progress-value { background: var(--focus-color); border-radius: 1px; }
.field-focus progress::-moz-progress-bar { background: var(--focus-color); border-radius: 1px; }
.stage-plot {
  background: linear-gradient(160deg, #0d2942, #061322 72%);
}
.stage-plot .chart {
  max-height: 137px;
}
.stage-plot .chart .line { stroke-width: 2.45; }
.stage-plot .chart .line.compare { stroke-width: 1.9; }
.stage-plot .chart .column { fill: #51d7fe34; }
@media (max-width: 1040px) {
  .mast-title::before { inset-inline: -16px; }
}
@media (max-width: 640px) {
  .mast-title::before { inset-inline: 0; }
  .scene-mark { padding: 4px 5px; }
  .scene-mark strong { font-size: .79rem; }
  .field-focus {
    width: clamp(120px, 43%, 168px);
    right: 6px;
    bottom: 21px;
    padding: 4px 6px;
  }
  .focus-name, .focus-detail { font-size: .66rem; }
  .field-focus strong { font-size: 1.23rem; }
  .field-focus small { font-size: .62rem; }
  .field-focus p { margin-block: 2px; }
}
@media (max-height: 840px) and (min-width: 1001px) {
  .stage-plot .chart { max-height: 112px; }
}
@media (prefers-reduced-motion: reduce) {
  .scene-mark { transition: none; }
}

