:root {
  --wb-ink: #16202a;
  --wb-muted: #687582;
  --wb-border: #d8e0e5;
  --wb-paper: #f8fafb;
  --wb-accent: #c64a3c;
  --wb-blue: #176c8a;
}

/* Desktop map workspace: the map is the primary canvas; context lives on the right. */
#app { grid-template-rows: auto 1fr; }
.main { grid-template-columns: minmax(0, 1fr) 472px; }
#mapPane { min-width: 0; }
#dataLensPane {
  min-width: 0; min-height: 0; overflow: auto; padding: 15px 14px 22px;
  background: var(--wb-paper); border-left: 1px solid var(--wb-border);
  color: var(--wb-ink); display: flex; flex-direction: column; gap: 11px;
}
.lens-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.lens-head h2 { margin: 4px 0 0; font: 750 17px/1.2 Georgia, "Songti SC", serif; letter-spacing: -.2px; }
.lens-head .eyebrow { color: var(--wb-blue); font: 800 9px/1.1 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .16em; }
#clearSelection { padding: 6px 8px; font-size: 10px; white-space: nowrap; }
.lens-context { display: flex; align-items: end; gap: 7px; padding: 0; border: 0; }
.lens-context label { display: grid; gap: 4px; color: var(--wb-muted); font-size: 10px; font-weight: 700; }
.lens-context input, .lens-context select { width: 132px; height: 29px; border: 1px solid #c9d2d9; border-radius: 6px; padding: 0 7px; color: var(--wb-ink); background: #fff; font-size: 11px; }
.lens-context select { width: 82px; }
.mode-switch { display: grid; grid-template-columns: 1fr 1fr; min-width: 158px; padding: 3px; border-radius: 8px; background: #e9eef1; }
.mode-switch button { border: 0; border-radius: 6px; padding: 7px; background: transparent; color: var(--wb-muted); font-size: 10px; font-weight: 700; }
.mode-switch button.active { background: #fff; color: var(--wb-ink); box-shadow: 0 1px 4px rgba(23, 35, 44, .12); }
.cursor-box { border: 1px solid var(--wb-border); border-radius: 8px; background: #fff; padding: 9px 10px 7px; }
.cursor-box.disabled { opacity: .48; }
.cursor-row { display: flex; justify-content: space-between; align-items: center; color: var(--wb-muted); font-size: 10px; }
.cursor-row output { color: var(--wb-ink); font: 700 10px ui-monospace, SFMono-Regular, Consolas, monospace; }
#timeCursor { width: 100%; margin: 9px 0 2px; accent-color: var(--wb-accent); }
.cursor-scale { display: flex; justify-content: space-between; color: #91a0aa; font: 9px ui-monospace, SFMono-Regular, Consolas, monospace; }
.lens-region { border: 1px solid var(--wb-border); border-radius: 8px; background: #fff; padding: 10px; }
.lens-region summary { cursor: pointer; color: var(--wb-ink); font-size: 11px; font-weight: 800; }
.empty-state, .muted { color: var(--wb-muted); font-size: 10px; line-height: 1.5; }
.raw-content { margin-top: 8px; font-size: 10px; line-height: 1.45; overflow-wrap: anywhere; }
.raw-content p { margin: 0; }
.raw-grid { display: grid; grid-template-columns: 1fr auto; gap: 5px 8px; }
.raw-grid dt { color: var(--wb-muted); }
.raw-grid dd { margin: 0; text-align: right; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; }
.metric-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin: 10px 0 0; }
.metric-grid dt { color: var(--wb-muted); font-size: 9px; }
.metric-grid dd { margin: 1px 0 0; color: var(--wb-ink); font: 750 12px ui-monospace, SFMono-Regular, Consolas, monospace; }
.lens-chart { display: block; width: 100%; height: 92px; margin-top: 9px; border-bottom: 1px solid #cfd9df; background: repeating-linear-gradient(to top, transparent 0 22px, #edf1f3 23px 24px); }
.series-line { fill: none; stroke: var(--wb-blue); stroke-width: 3; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.unit-curve-chart { height: auto; background: none; border-bottom: 0; }
.axis-label { fill: var(--wb-muted); font: 11px ui-monospace, SFMono-Regular, Consolas, monospace; }
.axis-line { stroke: #91a0aa; stroke-width: 1; }
.cursor-line { stroke: var(--wb-accent); stroke-width: 1; stroke-dasharray: 4 3; }
.unit-curve-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; }
.unit-curve-item { display: inline-flex; align-items: center; gap: 5px; color: var(--wb-muted); font-size: 10px; }
.unit-curve-item small { color: #91a0aa; font-size: 9px; }
.unit-curve-swatch { width: 16px; height: 4px; border-radius: 2px; flex: none; }
.unit-curve-swatch.is-aggregate { background: repeating-linear-gradient(90deg, #16202a 0 6px, transparent 6px 10px); }
.macro-balance { margin-top: 10px; border-top: 1px dashed var(--wb-border); padding-top: 8px; }
.macro-balance h3 { margin: 0; color: var(--wb-ink); font-size: 11px; }
.macro-formula { margin: 3px 0 0; color: var(--wb-muted); font-size: 8px; line-height: 1.4; }
.macro-chart { display: block; width: 100%; height: auto; margin-top: 5px; }
.macro-band { stroke: none; opacity: .84; }
.macro-space { fill: #dcebed; }
.macro-incoming { fill: #778f97; }
.macro-fixed { fill: #b88a52; }
.macro-solar { fill: #e6b64c; }
.macro-wind { fill: #68a98c; }
.macro-load-line, .macro-space-line { fill: none; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.macro-load-line { stroke: #17283c; stroke-width: 2; }
.macro-space-line { stroke: #a82f28; stroke-width: 2.5; }
.macro-cursor { stroke: #17283c; stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.macro-space-marker { fill: #a82f28; stroke: #fff; stroke-width: 2; vector-effect: non-scaling-stroke; }
.macro-axis-label { fill: var(--wb-muted); font: 11px ui-monospace, SFMono-Regular, Consolas, monospace; text-anchor: end; }
.macro-time-label { fill: var(--wb-muted); font: 11px ui-monospace, SFMono-Regular, Consolas, monospace; text-anchor: middle; }
.macro-unit { fill: var(--wb-muted); font: 11px ui-monospace, SFMono-Regular, Consolas, monospace; text-anchor: end; }
.grid-line { stroke: #e4eaee; stroke-width: 1; }
.macro-legend { display: flex; flex-wrap: wrap; gap: 4px 9px; margin-top: 4px; }
.macro-legend span { display: inline-flex; align-items: center; gap: 4px; color: var(--wb-muted); font-size: 10px; }
.macro-legend span::before { width: 10px; height: 4px; border-radius: 2px; background: #999; content: ""; }
.macro-legend [data-series="system_load"]::before { height: 2px; background: #17283c; }
.macro-legend [data-series="competitive_space"]::before { height: 2px; background: #a82f28; }
.macro-legend [data-series="wind"]::before { background: #68a98c; }
.macro-legend [data-series="solar"]::before { background: #e6b64c; }
.macro-legend [data-series="fixed"]::before { background: #b88a52; }
.macro-legend [data-series="incoming"]::before { background: #778f97; }
.price-distribution { margin-top: 10px; border-top: 1px dashed var(--wb-border); padding-top: 8px; }
.price-distribution h3 { margin: 0; font-size: 11px; color: var(--wb-ink); }
.maintenance-timeline { margin-top: 10px; border-top: 1px dashed var(--wb-border); padding-top: 8px; }
.maintenance-timeline h3 { margin: 0; font-size: 11px; color: var(--wb-ink); }
.maintenance-timeline-chart { display: block; width: 100%; height: auto; margin-top: 4px; }
.maintenance-tl-label { fill: var(--wb-ink); font: 12px ui-monospace, SFMono-Regular, Consolas, monospace; }
.maintenance-tl-baseline { stroke: #dde3e8; stroke-width: 1; }
.maintenance-tl-capsule { fill: #d56b37; stroke: #fff; stroke-width: 1; }
.maintenance-tl-capsule.is-unmapped { fill: #9aa5ad; }
.maintenance-tl-cursor { stroke: #7e5f19; stroke-width: 1; stroke-dasharray: 3 2; vector-effect: non-scaling-stroke; pointer-events: none; }
.maintenance-tl-x-label { fill: var(--wb-muted); font: 11px ui-monospace, SFMono-Regular, Consolas, monospace; }
.maintenance-timeline-chart:focus-visible { outline: 2px solid var(--wb-accent); outline-offset: 2px; }
.wb-tooltip { position: fixed; z-index: 1200; max-width: 340px; padding: 10px 13px 11px; border-radius: 8px; background: rgba(21, 30, 37, .97); color: #d9e3ea; box-shadow: 0 10px 28px rgba(0, 0, 0, .32), inset 0 0 0 1px rgba(255, 255, 255, .07); font: 12px/1.7 "Segoe UI", "Microsoft YaHei", system-ui, sans-serif; pointer-events: none; opacity: 0; visibility: hidden; transform: translateY(3px); transition: opacity .12s ease, transform .12s ease, visibility .12s; }
.wb-tooltip.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.wb-tooltip-title { margin-bottom: 4px; padding-bottom: 5px; border-bottom: 1px solid rgba(255, 255, 255, .12); color: #fff; font-size: 12.5px; font-weight: 600; }
.wb-tooltip-line { color: #bfcbd4; font-variant-numeric: tabular-nums; }
.distribution-chart { display: block; width: 100%; height: auto; margin-top: 5px; }
.distribution-y-label { fill: var(--wb-muted); font: 11px ui-monospace, SFMono-Regular, Consolas, monospace; text-anchor: end; }
.distribution-x-label { fill: var(--wb-muted); font: 11px ui-monospace, SFMono-Regular, Consolas, monospace; }
.distribution-unit { fill: var(--wb-muted); font: 11px ui-monospace, SFMono-Regular, Consolas, monospace; text-anchor: end; }
.distribution-band-outer { fill: rgba(101, 148, 185, .32); }
.distribution-band-inner { fill: rgba(58, 106, 143, .5); }
.distribution-p50 { fill: none; stroke: #1f3a4d; stroke-width: 2; vector-effect: non-scaling-stroke; }
.distribution-p50-dot { fill: #1f3a4d; }
.distribution-extreme-max { fill: #d64545; }
.distribution-extreme-min { fill: #2a9d8f; }
.distribution-extreme-badge { font: 11px ui-monospace, SFMono-Regular, Consolas, monospace; font-weight: 700; text-anchor: middle; }
.distribution-cursor { stroke: #7e5f19; stroke-width: 1; stroke-dasharray: 3 2; vector-effect: non-scaling-stroke; pointer-events: none; }
.distribution-chart:focus-visible { outline: 2px solid var(--wb-accent); outline-offset: 2px; }
.clearing-price { fill: none; stroke: #d64545; stroke-width: 1.5; vector-effect: non-scaling-stroke; pointer-events: none; }
.distribution-legend-row { display: flex; flex-wrap: wrap; gap: 4px 10px; margin: 4px 0 2px; font: 10px ui-monospace, SFMono-Regular, Consolas, monospace; color: var(--wb-muted); }
.distribution-legend-row span { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.distribution-legend-row .sw { display: inline-block; width: 14px; height: 9px; }
.distribution-legend-row .sw-outer { background: rgba(101, 148, 185, .32); border: 1px solid rgba(101, 148, 185, .8); }
.distribution-legend-row .sw-inner { background: rgba(58, 106, 143, .5); border: 1px solid rgba(58, 106, 143, .9); }
.distribution-legend-row .sw-p50 { height: 2px; background: #1f3a4d; }
.distribution-legend-row .sw-clearing { height: 2px; background: #d64545; }
.distribution-legend-row .sw-extreme { width: auto; height: auto; font-size: 9px; line-height: 1; color: #d64545; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.series-marker { fill: var(--wb-accent); stroke: #fff; stroke-width: 2; vector-effect: non-scaling-stroke; }
.value-badge { display: inline-block; margin-top: 8px; padding: 4px 6px; border-radius: 4px; background: #edf6f7; color: var(--wb-blue); font: 700 10px ui-monospace, SFMono-Regular, Consolas, monospace; }
.site-price-summary { margin-bottom: 8px; padding: 8px 9px; border-left: 3px solid #BF9A3D; background: #fffaf0; color: var(--wb-ink); font-size: 10px; line-height: 1.45; }
.site-price-summary p { margin: 3px 0 0; font-family: ui-monospace, monospace; }
.site-price-summary small { color: var(--wb-muted); }
.quality { display: inline-block; border-radius: 999px; padding: 2px 5px; background: #f0f3f5; color: var(--wb-muted); font-size: 9px; }
.quality.valid { background: #eaf7ef; color: #26714b; }
.quality.missing, .quality.not_sampled { background: #f2f4f5; color: #6e7a83; }
.source-line { border-top: 1px dashed var(--wb-border); padding-top: 6px; margin-top: 6px; color: var(--wb-muted); font-size: 9px; }
.source-line:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.raw-record { border-top: 1px dashed var(--wb-border); padding: 8px 0; }
.raw-record:first-child { border-top: 0; padding-top: 0; }
.raw-record p { margin: 4px 0 0; }
.raw-record-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.interval-timeline { margin-bottom: 10px; }
.timeline-label { color: var(--wb-muted); font-size: 9px; margin-bottom: 5px; }
.interval-track { position: relative; height: 22px; border-radius: 4px; border: 1px solid #d4e0e4; background: repeating-linear-gradient(90deg, #f5f8f9 0 24.9%, #e7eef0 25% 25.2%); }
.interval-bar { position: absolute; top: 4px; height: 12px; min-width: 4px; overflow: hidden; padding: 0 3px; border-radius: 3px; background: var(--wb-accent); color: #fff; font: 8px/12px ui-monospace, SFMono-Regular, Consolas, monospace; white-space: nowrap; }
.relation-choice { display: block; width: 100%; margin-top: 7px; padding: 8px; border: 1px solid #c7dce2; border-radius: 6px; background: #f4fbfc; color: var(--wb-blue); text-align: left; font-size: 10px; }
.relation-choice:hover { border-color: var(--wb-blue); background: #eaf6f7; }
.generation-unit { width: 100%; border-right: 0; border-bottom: 0; border-left: 0; background: transparent; text-align: left; cursor: pointer; color: inherit; }
.generation-unit:hover, .generation-unit.active { background: #edf6f7; color: var(--wb-blue); }
.reading-guide { margin-bottom: 9px; border: 1px solid #cbd9de; border-radius: 8px; padding: 9px 10px; background: linear-gradient(135deg, #f2f7f8, #fff); }
.reading-guide summary { cursor: pointer; color: #29444d; font-size: 10px; font-weight: 800; }
.reading-steps { display: grid; gap: 4px; margin: 8px 0 0; padding-left: 18px; color: #4f6069; font-size: 9px; line-height: 1.45; }
.reading-boundary { margin: 7px 0 0; border-top: 1px dashed #cbd9de; padding-top: 7px; color: #6b5b2f; font-size: 8px; line-height: 1.45; }
.no-data-band i { background: transparent; border-top: 3px dashed #77848b; }
.maintenance-section { margin-top: 11px; }
.maintenance-section h3 { margin: 0 0 3px; color: var(--wb-ink); font-size: 10px; }
.maintenance-note, .maintenance-target { color: var(--wb-muted); font-size: 9px; line-height: 1.45; }
.overview-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.overview-card { display: grid; gap: 3px; padding: 9px; border-radius: 7px; background: #f2f6f7; border-left: 3px solid #7a9299; }
.overview-card strong { color: var(--wb-ink); font: 800 15px/1 ui-monospace, SFMono-Regular, Consolas, monospace; }
.overview-card span { color: var(--wb-muted); font-size: 9px; }
.ranked-list h3 { margin: 13px 0 5px; color: var(--wb-muted); font-size: 10px; }
.ranked-row, .event-list-row { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 8px; border: 0; border-top: 1px dashed var(--wb-border); padding: 7px 2px; background: transparent; color: var(--wb-ink); text-align: left; font-size: 9px; cursor: pointer; }
.ranked-row:hover, .event-list-row:hover { color: var(--wb-blue); background: #f5fafb; }
.ranked-row:disabled { cursor: default; opacity: .72; }
.ranked-label { min-width: 0; display: grid; gap: 2px; }
.ranked-label strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ranked-label small { color: var(--wb-muted); font-size: 8px; font-weight: 400; }
.ranked-value { flex: none; color: var(--wb-blue); font: 800 10px ui-monospace, SFMono-Regular, Consolas, monospace; }
.topic-cards { margin-bottom: 8px; }
.topic-boundary { margin: 0 0 9px; padding: 7px 8px; border-radius: 6px; background: #eef4f5; color: #52636c; font-size: 8px; line-height: 1.45; }
.topic-hint { margin-bottom: 8px; }
.generation-unit-list { margin-top: 11px; }
.shape-notice, .topic-note { padding: 9px 10px; border-left: 3px solid #c59b35; background: #fbf7e9; color: #6f5a26; font-size: 10px; line-height: 1.5; }
.relation-strip { display: flex; gap: 5px; overflow-x: auto; margin-bottom: 8px; }
.relation-strip button { flex: 0 0 auto; max-width: 180px; overflow: hidden; text-overflow: ellipsis; border: 1px solid var(--wb-border); border-radius: 5px; padding: 5px 7px; background: #fff; color: var(--wb-muted); font-size: 9px; }
.relation-strip button.active { border-color: var(--wb-blue); color: var(--wb-blue); background: #eef8f9; }
.component-details { margin-top: 10px; border-top: 1px dashed var(--wb-border); padding-top: 8px; color: var(--wb-muted); font-size: 10px; }
.event-card p { margin: 6px 0 0; }
.event-time { color: var(--wb-blue); font: 700 9px ui-monospace, SFMono-Regular, Consolas, monospace; }
#dataLensPane { position: relative; }
.workspace-controls { position: absolute; z-index: 18; top: 12px; left: 12px; right: 12px; display: grid; gap: 5px; pointer-events: none; }
.workspace-row { min-height: 43px; display: flex; align-items: center; gap: 8px; padding: 6px; border: 1px solid rgba(197, 208, 215, .94); border-radius: 10px; background: rgba(255, 255, 255, .96); box-shadow: 0 5px 18px rgba(21, 31, 43, .10); backdrop-filter: blur(8px); pointer-events: auto; }
.workspace-primary .workspace-search { width: min(330px, 30vw); flex: 0 1 330px; }
.workspace-primary .workspace-clear { margin-left: auto; }
.workspace-secondary { min-height: 38px; padding: 4px 5px; }
.workspace-secondary .mode-switch button { padding: 5px 7px; }
.workspace-secondary .lens-tabs { flex: 1 1 auto; }
.workspace-secondary .lens-tabs button { padding: 6px 5px; }
.workspace-secondary .controls { position: static; display: flex; flex: 0 0 auto; gap: 4px; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.workspace-secondary .controls button { padding: 6px 7px; }
.workspace-secondary .opacity-control input { width: 58px; }
.search-results { position: absolute; top: 49px; left: 6px; z-index: 2; width: min(430px, 46vw); max-height: min(65vh, 590px); overflow: hidden; padding: 8px; border: 1px solid var(--wb-border); border-radius: 10px; background: rgba(255, 255, 255, .985); box-shadow: 0 16px 38px rgba(21, 31, 43, .20); pointer-events: auto; }
.search-results .section-head { padding: 2px 3px 7px; }
.search-results .station-list { max-height: min(57vh, 520px); gap: 3px; }
.search-group { margin: 8px 4px 3px; color: var(--wb-blue); font: 800 9px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .09em; }
.search-group:first-child { margin-top: 2px; }
.search-empty { padding: 18px 10px; color: var(--wb-muted); font-size: 11px; text-align: center; }
.search-result-kind { flex: none; min-width: 31px; border-radius: 5px; padding: 3px 4px; background: #edf3f5; color: #52636d; font-size: 9px; font-weight: 800; text-align: center; }
.contextual-detail { flex: 0 0 auto; max-height: 45vh; margin: 0; padding: 10px; border: 1px solid var(--wb-border); border-radius: 8px; background: #fff; }
.contextual-detail[hidden] { display: none; }
.contextual-detail + .cursor-box { margin-top: 0; }
.map-wrap > .zoom { bottom: 18px; }
.generation-directive { position: absolute; right: -6px; bottom: -6px; min-width: 12px; height: 12px; padding: 0 2px; border: 1px solid #fff; border-radius: 5px; background: #26333b; color: #fff; font: 800 8px/12px "Microsoft YaHei", sans-serif; text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,.24); }
.maintenance-cross { cursor: pointer; }
.maintenance-cross .maintenance-badge-bg { transition: fill .12s ease; }
.maintenance-cross:hover .maintenance-badge-bg, .maintenance-cross:focus-visible .maintenance-badge-bg { fill: #b5511e; }

/* Single desktop command rail. */
#app { grid-template-rows: 52px minmax(0, 1fr); }
.command-header {
  box-sizing: border-box; position: relative; z-index: 30; min-width: 0; min-height: 52px; height: 52px; max-height: 52px; padding: 6px 10px;
  display: flex; align-items: center; gap: 12px; border-bottom: 1px solid #cbd5da;
  background: #f7f9fa; box-shadow: 0 1px 0 rgba(20, 36, 45, .04);
}
.workspace-controls {
  position: relative; inset: auto; z-index: auto; min-width: 0; flex: 1 1 auto;
  display: flex; align-items: center; gap: 6px; pointer-events: auto;
}
.workspace-search { position: relative; flex: 1 1 230px; min-width: 170px; max-width: 310px; }
.workspace-search input { width: 100%; height: 34px; padding: 0 30px 0 11px; border-color: #cbd5da; border-radius: 7px; background: #fff; font-size: 11px; }
.workspace-search span { position: absolute; right: 10px; top: 8px; color: #74838c; }
.lens-context { flex: 0 0 auto; align-items: center; gap: 5px; }
.lens-context label { display: flex; align-items: center; gap: 5px; height: 34px; padding: 0 7px; border: 1px solid #d3dce1; border-radius: 7px; background: #fff; }
.lens-context label > span { white-space: nowrap; color: #697882; font-size: 9px; }
.lens-context input, .lens-context select { width: 106px; height: 26px; border: 0; padding: 0; background: transparent; font: 700 10px ui-monospace, Consolas, monospace; }
.lens-context select { width: 66px; }
.command-icon, .command-menu-trigger {
  box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; vertical-align: middle;
  height: 34px; border: 1px solid #cbd5da; border-radius: 7px; padding: 0 10px;
  background: #fff; color: #26343c; font-size: 10px; font-weight: 800; cursor: pointer;
}
.command-icon { width: 34px; padding: 0; }
.command-icon[aria-pressed="true"] { background: #172830; border-color: #172830; color: #fff; }
.command-icon:disabled { opacity: .38; cursor: wait; }
.selection-chip { min-width: 0; height: 34px; align-items: center; gap: 4px; padding: 3px 4px 3px 9px; border: 1px solid #b7ccd3; border-radius: 17px; background: #eef7f8; }
.selection-chip:not([hidden]) { display: flex; }
.selection-chip > span { max-width: 150px; overflow: hidden; color: #245465; font-size: 10px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.selection-chip button { border: 0; border-radius: 12px; padding: 4px 7px; background: transparent; color: #55717a; font-size: 9px; cursor: pointer; }
.selection-chip button.on, .selection-chip button:hover { background: #d8e9ec; color: #173f4c; }
#clearSelection { width: 24px; height: 24px; padding: 0; font-size: 15px; line-height: 1; }
.command-menu { position: relative; flex: 0 0 auto; }
.command-menu-trigger[aria-expanded="true"] { border-color: #6d8791; background: #eaf1f3; }
.command-popover {
  position: absolute; top: 40px; right: 0; z-index: 40; width: 210px; padding: 10px;
  display: grid; gap: 8px; border: 1px solid #c7d2d8; border-radius: 9px; background: #fff;
  box-shadow: 0 15px 34px rgba(22, 34, 42, .19); color: #26343c; font-size: 10px;
}
.command-popover[hidden] { display: none; }
.command-popover strong { padding-bottom: 5px; border-bottom: 1px solid #e3e9ec; font-size: 11px; }
.command-popover > label { display: flex; align-items: center; gap: 7px; cursor: pointer; }
.command-popover input[type="checkbox"] { accent-color: #176c8a; }
.command-popover .opacity-control { display: grid; grid-template-columns: auto 1fr auto; }
.command-popover .opacity-control input { min-width: 0; width: 100%; }
.search-results { top: 40px; left: 0; z-index: 45; width: min(430px, 42vw); }
.main { min-height: 0; }
.map-wrap { min-height: 0; }
#dataLensPane { position: relative; overflow-y: auto; overflow-x: hidden; }
.contextual-detail { flex: none; max-height: none; overflow: visible; }
.cursor-box[hidden] { display: none; }
.evidence-content { display: grid; gap: 5px; margin-top: 7px; }
.evidence-content h3 { margin: 5px 0 0; color: #63747d; font-size: 9px; }

/* One context sidebar: object identity, useful facts, then supporting evidence. */
.main { grid-template-columns: minmax(0, 1fr) 450px; }
#dataLensPane { display: block; background: #fff; padding: 18px 18px 24px; font-size: 12px; line-height: 1.55; }
.workspace-controls { justify-content: flex-end; gap: 10px; }
.workspace-search { flex: 1 1 300px; max-width: 420px; margin-right: auto; }
.lens-head { border: 0; padding: 0; margin: 0 0 16px; }
.lens-head h2 { font: 700 21px/1.4 "Microsoft YaHei", sans-serif; margin: 0; overflow-wrap: anywhere; }
#lensVisualization { padding: 0; border: 0; border-radius: 0; background: transparent; }
#lensVisualization h3 { font-size: 14px; line-height: 1.5; margin: 0 0 8px; color: #193142; }
#lensVisualization .macro-chart { height: auto; width: 100%; }
#lensVisualization .macro-legend, .distribution-legend-row { font-size: 10px; }
#lensVisualization .price-distribution { margin-top: 18px; padding-top: 16px; border-top: 1px solid #e2e8ec; }
.context-caption { color: #70808a; font-size: 11px; line-height: 1.6; margin: 5px 0 10px; }
.price-comparison { margin-top: 10px; }
.price-rank-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.price-rank-columns > div + div { border-left: 1px solid #e2e8ec; padding-left: 14px; }
.price-rank-columns .ranked-row { gap: 6px; padding: 8px 0; }
.price-rank-columns .ranked-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ranked-row { font-size: 12px; width: 100%; cursor: pointer; }
.ranked-row b { font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ranked-list { margin-top: 14px; }
.context-section { border-top: 1px solid #e2e8ec; margin-top: 18px; padding-top: 14px; }
.summary-row { display: flex; justify-content: space-between; border-bottom: 1px solid #edf1f3; padding: 10px 0; font-size: 12px; }
.summary-row strong { font-variant-numeric: tabular-nums; }
.context-disclosure { border-top: 1px solid #e5ebee; padding: 9px 0; }
.context-disclosure summary { color: #176c8a; font-size: 12px; line-height: 1.7; cursor: pointer; }
.context-disclosure[open] > summary { margin-bottom: 10px; }
.context-disclosure .raw-record-text { white-space: pre-wrap; font-size: 12px; line-height: 1.8; color: #435763; }
.context-disclosure .event-time { color: #6a7b86; font-size: 11px; }
#dataLensPane .selection-chip { height: auto; border: 0; padding: 0; border-radius: 0; background: transparent; justify-content: space-between; }
#selectionChipName { display: none; }
#clearSelection { width: auto; height: auto; padding: 0; font-size: 12px; line-height: 1.6; order: -1; color: #176c8a; }
#directBtn { font-size: 11px; border: 1px solid #cad8df; border-radius: 5px; padding: 5px 9px; }
.context-back { border: 0; background: transparent; padding: 0; text-align: left; color: #176c8a; font-size: 12px; cursor: pointer; }
.site-price-summary { padding: 0 0 8px; border: 0; background: transparent; }
.site-price-summary > strong { font-size: 13px; }
.site-price-summary > p { font-size: 26px; font-weight: 700; line-height: 1.3; margin: 6px 0 4px; color: #17384d; }
.site-price-summary small { font-size: 11px; color: #77858d; }
#entityDetails .contextual-detail { padding: 0; background: transparent; border: 0; }
#entityDetails .contextual-detail h2 { display: none; }
#entityDetails .generation-unit, #entityDetails .conn-title, #entityDetails .conn { display: none; }
#dataLensPane [hidden] { display: none !important; }
@media (max-width: 1100px) { .main { grid-template-columns: minmax(0, 1fr) 400px; } #dataLensPane { padding: 16px; } }
@media (max-width: 760px) { .main { grid-template-columns: 1fr; grid-template-rows: minmax(260px, 42vh) minmax(0,1fr); } .command-header { flex-wrap: wrap; } .workspace-search { min-width: 140px; } #dataLensPane { border-left: 0; border-top: 1px solid #d8e0e5; } }

.connection-diagram { margin: 12px 0 4px; text-align: center; }
.connection-diagram > strong { display: inline-block; border: 1px solid #5a9c91; border-radius: 4px; padding: 5px 10px; color: #175b50; background: #eff8f5; font-size: 12px; }
.connection-branches { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 12px; position: relative; }
.connection-branches::before { content: ""; position: absolute; height: 12px; width: 1px; background: #83b4a7; top: -12px; left: 50%; }
.connection-branches button { border: 1px solid #d0e3dc; background: #fff; border-radius: 4px; padding: 5px 8px; color: #3c6b5e; font-size: 11px; cursor: pointer; }
.relation-strip select { max-width: 100%; padding: 5px; border: 1px solid #d5dfe4; background: #fff; border-radius: 4px; }

/* Keep object identity and location together above its operating data. */
#entityDetails { margin: 0 0 18px; border: 0; padding: 0; }
#entityDetails > summary { color: #687582; font-size: 11px; font-weight: 500; }
#entityDetails[open] > summary { margin-bottom: 8px; }
#detail .type { font-size: 12px; color: #435763; margin-bottom: 8px; }
#detail .kv { grid-template-columns: 80px minmax(0,1fr); gap: 5px 10px; font-size: 12px; line-height: 1.55; }
#detail .v { font-weight: 500; overflow-wrap: anywhere; }
#detail .badge { font-size: 10px; }
#detail .detail-actions { margin: 8px 0 0; }
#detail .detail-actions button { padding: 4px 8px; border-radius: 4px; }
#dataLensPane .selection-chip { margin-bottom: 10px; }
#parentSelection { margin: 0 0 8px; }
#dataLensPane .cursor-box { margin-bottom: 16px; }
#lensVisualization > .macro-balance, #lensVisualization > .context-section:first-child { border-top: 0; margin-top: 0; padding-top: 0; }
#lensVisualization .macro-formula { font-size: 10px; line-height: 1.5; margin-bottom: 6px; }
#lensVisualization .maintenance-timeline { border-top: 0; margin-top: 0; padding-top: 0; }
#lensVisualization .metric-grid { grid-template-columns: 80px minmax(0,1fr); margin: 6px 0 12px; gap: 4px 12px; }
#lensVisualization .metric-grid dt { font-size: 11px; }
#lensVisualization .metric-grid dd { text-align: right; font-size: 12px; font-variant-numeric: tabular-nums; }
#lensVisualization .empty-state { font-size: 11px; line-height: 1.6; margin: 6px 0 0; }
#lensVisualization .ranked-row { padding: 8px 0; min-height: 34px; background: transparent; border-bottom: 0; border-top: 1px solid #edf1f3; }
#lensVisualization .ranked-row:hover { background: #f3f8fa; }
#dataLensPane button:focus-visible, #dataLensPane summary:focus-visible { outline: 2px solid #176c8a; outline-offset: 2px; }
.connection-list .ranked-label { display: grid; grid-template-columns: minmax(85px,1fr) minmax(0,1.5fr); gap: 10px; align-items: center; flex: 1; }
.connection-list .ranked-label small { font-size: 11px; line-height: 1.5; margin: 0; color: #70808a; }
.connection-list .ranked-value { font-size: 11px; font-weight: 500; }
.jiangsu-layer-note { display: none !important; }

#lensVisualization .context-section.is-empty { margin-top: 12px; padding-top: 12px; }
#lensVisualization .context-section.is-empty h3 { font-size: 12px; font-weight: 500; color: #687582; margin-bottom: 0; }
