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

.mode-control { display: grid; grid-template-columns: 1fr 1fr; margin: 0 0 24px; border: 1px solid var(--line); }
.mode-control.mode-three { grid-template-columns: 1fr 1fr 1fr; }
.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); }
.control.hidden { display: none; }

.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; }

.gas-panels { display: grid; grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr); gap: 14px; }
.gas-panel { min-width: 0; margin: 0; border: 1px solid var(--line-soft); background: var(--panel-deep); }
.gas-panel figcaption { display: flex; justify-content: space-between; gap: 12px; padding: 11px 13px 8px; border-bottom: 1px solid rgba(41, 66, 71, .7); }
.gas-panel figcaption b { color: var(--ink); font-size: 13px; font-weight: 600; }
.gas-panel figcaption span { padding-top: 2px; color: var(--muted); font: 10px "DM Mono", monospace; }
.gas-panel svg { display: block; width: 100%; height: auto; }

.cyl-wall { fill: #2c4a51; }
.heater { stroke: rgba(255, 255, 255, .18); stroke-width: 1; }
.cyl-label { fill: #8fb0ad; font: 12px "DM Mono", monospace; }
.piston { fill: var(--orange); stroke: #b06f35; stroke-width: 1.5; filter: drop-shadow(0 0 6px rgba(255, 173, 104, .35)); }
.piston-rod { stroke: #b8895c; stroke-width: 7; }
.weight { fill: #3a4d55; stroke: var(--yellow); stroke-width: 1.6; }
.weight-label { fill: var(--yellow); font: 10px "DM Mono", monospace; }
.pin { fill: var(--yellow); }
.pin-label { fill: var(--yellow); font: 11px "DM Mono", monospace; text-anchor: end; }
.vol-label { fill: #c9d8d5; font: 500 12px "DM Mono", monospace; writing-mode: sideways-lr; }
.molecule { fill: #d8fff6; opacity: .85; }

.process-line { fill: none; stroke: var(--cyan); stroke-width: 2.6; }
.isotherm-ref { fill: none; stroke: rgba(101, 230, 209, .28); stroke-width: 1.5; stroke-dasharray: 5 6; }
.annotation.dim { fill: #6e8f8d; }
.pv-key { fill: var(--panel-deep); stroke: var(--yellow); stroke-width: 2; }
.pv-point { fill: var(--orange); stroke: #fff1d8; stroke-width: 1.6; filter: drop-shadow(0 0 6px rgba(255, 173, 104, .65)); }

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

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

@media (max-width: 820px) {
  .gas-shell { width: min(calc(100% - 24px), 650px); }
  .gas-hero { grid-template-columns: 1fr; }
  .gas-workspace { grid-template-columns: 1fr; }
  .gas-panels { grid-template-columns: 1fr; }
  .gas-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gas-metrics .metric:nth-child(n) { margin-top: 0; padding: 13px 12px 13px 0; border: 0; border-bottom: 1px solid var(--line); }
}

@media (max-width: 520px) {
  .circuit-status { display: block; }
  .circuit-status span { display: block; margin-top: 5px; }
  .gas-panel svg .tick { font-size: 14px; }
  .gas-panel svg .axis-label { font-size: 15px; }
  .gas-panel svg .annotation { font-size: 14px; }
  .gas-panel svg .cyl-label, .gas-panel svg .pin-label { font-size: 13px; }
  .gas-panel svg .vol-label { font-size: 14px; }
  .gas-metrics { grid-template-columns: 1fr; }
  .gas-metrics .metric:last-child { border-bottom: 0; }
}
