.tx-shell { width: min(1220px, calc(100% - 40px)); }
.tx-hero { grid-template-columns: 1.08fr .92fr; }
.tx-workspace { grid-template-columns: 282px minmax(0, 1fr); }
.tx-stage { padding-bottom: 24px; }

.circuit-status { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 0 0 14px; padding: 11px 13px; border: 1px solid var(--line); color: #c9d8d5; font-size: 12px; }
.circuit-status strong { color: var(--orange); font: 500 12px "DM Mono", monospace; }
.circuit-status.warn { border-color: rgba(255, 120, 109, .65); background: rgba(255, 120, 109, .07); }
.circuit-status.warn strong { color: var(--red); }

.circuit-board { overflow: hidden; border: 1px solid var(--line-soft); background: var(--panel-deep); }
.tx-scene { display: block; width: 100%; height: auto; min-height: 360px; }
.wire { fill: none; stroke: var(--cyan); stroke-width: 3; stroke-linecap: square; stroke-linejoin: round; }
.heat-line { fill: none; stroke: var(--red); stroke-linecap: round; filter: drop-shadow(0 0 6px rgba(255, 120, 109, .8)); }
.gen-face { fill: var(--panel-deep); stroke: var(--yellow); stroke-width: 2.5; }
.gen-sine { fill: none; stroke: var(--yellow); stroke-width: 2.2; }
.core-bar { stroke: #8a8a55; stroke-width: 3.5; }
.coil { fill: none; stroke: var(--orange); stroke-width: 2.4; }
.line-resistor { fill: #173238; stroke: var(--orange); stroke-width: 2.5; }
.house { fill: #173238; stroke: var(--orange); stroke-width: 2.5; }
.roof { fill: none; stroke: var(--orange); stroke-width: 2.5; stroke-linejoin: round; }
.lamp { fill: var(--panel-deep); stroke: var(--orange); stroke-width: 2; filter: drop-shadow(0 0 8px rgba(255, 173, 104, .7)); }
.lamp-x { stroke: var(--orange); stroke-width: 2; }
.lamp.off { filter: none; stroke: #4a6a70; }
.lamp-x.off { stroke: #4a6a70; }
.component-label { fill: #c9d8d5; font: 500 13px "DM Mono", monospace; paint-order: stroke; stroke: var(--panel-deep); stroke-width: 5px; }
.current-label { fill: var(--cyan); font: 500 12px "DM Mono", monospace; paint-order: stroke; stroke: var(--panel-deep); stroke-width: 5px; }
.current-arrow { stroke: var(--cyan); stroke-width: 2; }
.volt-label { fill: var(--yellow); }
.loss-label { fill: var(--red); font: 500 12px "DM Mono", monospace; paint-order: stroke; stroke: var(--panel-deep); stroke-width: 5px; }
.fail-label { fill: var(--red); font: 500 14px "DM Mono", monospace; paint-order: stroke; stroke: var(--panel-deep); stroke-width: 5px; }
.annotation.danger { fill: var(--red); }
.scene-note { fill: #587b79; font: 10px "DM Mono", monospace; }
.current-dot { fill: #d8fff6; stroke: var(--cyan); stroke-width: 2; filter: drop-shadow(0 0 5px rgba(101, 230, 209, .8)); }

.xf-cards { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; margin-top: 16px; }
.xf-card { min-width: 0; padding: 13px 15px 11px; border: 1px solid var(--line-soft); background: var(--panel-deep); }
.xf-card h3 { margin: 0 0 9px; color: var(--ink); font-size: 13px; font-weight: 600; }
.xf-card p { display: flex; justify-content: space-between; gap: 12px; margin: 6px 0; font-size: 12px; }
.xf-card p span { color: var(--muted); }
.xf-card p b { color: var(--cyan); font: 500 12px "DM Mono", monospace; text-align: right; overflow-wrap: anywhere; }

.tx-graph { min-width: 0; margin: 16px 0 0; border: 1px solid var(--line-soft); background: var(--panel-deep); }
.tx-graph figcaption { display: flex; justify-content: space-between; gap: 12px; padding: 11px 13px 8px; border-bottom: 1px solid rgba(41, 66, 71, .7); }
.tx-graph figcaption b { color: var(--ink); font-size: 13px; font-weight: 600; }
.tx-graph figcaption span { padding-top: 2px; color: var(--muted); font: 10px "DM Mono", monospace; }
.tx-graph svg { display: block; width: 100%; height: auto; }
.tx-curve { fill: none; stroke: var(--cyan); stroke-width: 2.5; }
.tx-point { fill: var(--orange); stroke: #fff1d8; stroke-width: 1.6; filter: drop-shadow(0 0 6px rgba(255, 173, 104, .65)); }
.tx-key { fill: var(--panel-deep); stroke: var(--yellow); stroke-width: 2; }
.fail-band { fill: rgba(255, 120, 109, .06); }
.fail-line { stroke: var(--red); stroke-width: 1.5; stroke-dasharray: 6 5; }

.tx-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tx-metrics .metric:nth-child(n+4) { margin-top: 13px; padding-top: 17px; border-top: 1px solid var(--line); }
.tx-metrics .metric:nth-child(4) { padding-left: 0; border-left: 0; }
.tx-metrics .metric-value { font-size: 19px; }

@media (max-width: 900px) { .tx-workspace { grid-template-columns: 260px minmax(0, 1fr); } }

@media (max-width: 820px) {
  .tx-shell { width: min(calc(100% - 24px), 650px); }
  .tx-hero { grid-template-columns: 1fr; }
  .tx-workspace { grid-template-columns: 1fr; }
  .xf-cards { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .tx-scene { min-height: 230px; }
}

@media (max-width: 520px) {
  .circuit-status { display: block; }
  .circuit-status span { display: block; margin-top: 5px; }
  .tx-scene .component-label { font-size: 17px; }
  .tx-scene .annotation { font-size: 16px; }
  .tx-scene .current-label, .tx-scene .loss-label { font-size: 16px; }
  .tx-scene .fail-label { font-size: 16px; }
  .tx-scene .scene-note { font-size: 13px; }
  .tx-graph svg .tick { font-size: 11px; }
  .tx-graph svg .axis-label { font-size: 12px; }
  .tx-graph svg .annotation { font-size: 12px; }
  .tx-metrics { grid-template-columns: 1fr; }
  .tx-metrics .metric, .tx-metrics .metric:nth-child(n) { margin-top: 0; padding: 13px 0; border-right: 0; border-bottom: 1px solid var(--line); border-left: 0; }
  .tx-metrics .metric:last-child { border-bottom: 0; }
  .xf-card p { flex-direction: column; gap: 2px; }
  .xf-card p b { text-align: left; }
}
