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

.mode-control { display: grid; grid-template-columns: 1fr 1fr; margin: 0 0 28px; border: 1px solid var(--line); }
.mode-option { min-width: 0; border: 0; }
.mode-option + .mode-option { border-left: 1px solid var(--line); }
.mode-option.active { color: #08211f; background: var(--cyan); }

.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); }
.circuit-scene { display: block; width: 100%; height: auto; min-height: 400px; }
.wire { fill: none; stroke: var(--cyan); stroke-width: 3; stroke-linecap: square; stroke-linejoin: round; }
.battery-long, .battery-short { stroke: var(--yellow); stroke-width: 4; }
.resistor { fill: #173238; stroke: var(--orange); stroke-width: 2.5; }
.resistor-inner { fill: #173238; stroke: var(--yellow); stroke-width: 2.2; }
.source-box { fill: none; stroke: #4a6a70; stroke-width: 1.5; stroke-dasharray: 7 6; }
.source-box-label { fill: #8fb0ad; font: 11px "DM Mono", monospace; }
.component-label, .current-label, .battery-label { fill: #c9d8d5; font: 500 13px "DM Mono", monospace; paint-order: stroke; stroke: var(--panel-deep); stroke-width: 5px; }
.battery-label { fill: var(--yellow); font-size: 17px; }
.current-label { fill: var(--cyan); font-size: 12px; }
.current-arrow { stroke: var(--cyan); stroke-width: 2; }
.junction { fill: var(--cyan); }
.switch-post { fill: var(--panel-deep); stroke: var(--cyan); stroke-width: 2; }
.switch-blade { stroke: var(--cyan); stroke-width: 3.2; stroke-linecap: round; }
.slider-bar, .slider-stem { stroke: var(--orange); stroke-width: 2.4; }
.meter-face { fill: var(--panel-deep); stroke-width: 2.5; }
.meter-face.ammeter { stroke: var(--cyan); }
.meter-face.voltmeter { stroke: var(--orange); }
.meter-letter { fill: var(--cyan); font: 500 15px "DM Mono", monospace; }
.meter-letter.volt { fill: var(--orange); }
.short-label { fill: var(--red); font: 500 13px "DM Mono", monospace; paint-order: stroke; stroke: var(--panel-deep); stroke-width: 5px; }
.current-dot { fill: #d8fff6; stroke: var(--cyan); stroke-width: 2; filter: drop-shadow(0 0 5px rgba(101, 230, 209, .8)); }

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

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

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

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

@media (max-width: 520px) {
  .circuit-status { display: block; }
  .circuit-status span { display: block; margin-top: 5px; }
  .circuit-scene { min-height: 280px; }
  .circuit-scene .component-label, .circuit-scene .current-label { font-size: 15px; }
  .circuit-scene .annotation { font-size: 15px; }
  .circuit-scene .source-box-label { font-size: 14px; }
  .circuit-scene .meter-letter { font-size: 17px; }
  .circuit-scene .short-label { font-size: 15px; }
  .cc-graph svg .tick { font-size: 11px; }
  .cc-graph svg .axis-label { font-size: 12px; }
  .cc-graph svg .annotation { font-size: 12px; }
  .cc-metrics { grid-template-columns: 1fr; }
  .cc-metrics .metric, .cc-metrics .metric:nth-child(n) { margin-top: 0; padding: 13px 0; border-right: 0; border-bottom: 1px solid var(--line); border-left: 0; }
  .cc-metrics .metric:last-child { border-bottom: 0; }
}
