.investigation-workspace{display:grid;gap:1rem;color:var(--ink,#17232d)}
.invest-panel{padding:clamp(1rem,3vw,1.5rem);border:1px solid rgba(18,45,57,.14);border-radius:1.25rem;background:rgba(255,255,255,.86);box-shadow:0 12px 32px rgba(17,38,51,.06)}
.invest-panel h3,.invest-panel h4{margin:.35rem 0 .75rem;line-height:1.2}
.invest-panel p{line-height:1.58}
.invest-kicker{margin:0;color:#166657;font-size:.72rem;font-weight:800;letter-spacing:.12em;text-transform:uppercase}
.invest-note{margin:.1rem 0;padding:.8rem 1rem;border-left:3px solid #d9a441;border-radius:.2rem .8rem .8rem .2rem;background:#fff8e8;font-size:.88rem;line-height:1.5}
.invest-button,.invest-choice,.invest-model,.invest-chip,.invest-flag,.invest-tab{min-height:2.75rem;border:1px solid #afbec1;border-radius:.75rem;background:#fff;color:#18323b;font:inherit;font-weight:700;cursor:pointer;transition:border-color .15s ease,background .15s ease,transform .15s ease}
.invest-button:hover,.invest-choice:hover,.invest-model:hover,.invest-chip:hover,.invest-flag:hover,.invest-tab:hover{border-color:#168473;transform:translateY(-1px)}
.invest-button:focus-visible,.invest-choice:focus-visible,.invest-model:focus-visible,.invest-chip:focus-visible,.invest-flag:focus-visible,.invest-tab:focus-visible,.invest-field input:focus-visible,.invest-field select:focus-visible{outline:3px solid #f0b846;outline-offset:2px}
.invest-choice,.invest-chip,.invest-flag,.invest-tab{padding:.62rem .8rem}
.invest-model{width:100%;padding:.85rem 1rem;text-align:left;line-height:1.4}
.invest-chip{padding:.8rem;text-align:left;line-height:1.35}
.invest-choice.is-selected,.invest-model.is-selected,.invest-chip.is-selected,.invest-flag.is-selected,.invest-tab.is-selected{border-color:#0d7567;background:#e4f4ef;color:#0a544a;box-shadow:inset 0 0 0 1px #0d7567}
.invest-chip-grid,.model-cards,.reference-buttons{display:grid;gap:.65rem}
.invest-field{display:grid;gap:.4rem;font-weight:750}
.invest-input-wrap{display:flex;align-items:center;gap:.45rem}
.invest-field input,.invest-field select,.relay-target select{width:100%;min-height:2.7rem;padding:.55rem .7rem;border:1px solid #aebdc0;border-radius:.65rem;background:#fff;color:#18323b;font:inherit}
.invest-input-wrap small{white-space:nowrap;color:#536970;font-weight:750}
.invest-table{width:100%;margin-top:1rem;border-collapse:collapse;font-size:.9rem}
.invest-table caption{padding:.4rem 0;text-align:left;font-weight:800}
.invest-table th,.invest-table td{padding:.55rem;border-bottom:1px solid #dbe3e4;text-align:left;vertical-align:middle}
.invest-table thead th{background:#eef5f3;color:#27494d}
.invest-table tfoot th{border-top:2px solid #9fb5b5}

.scatter-bars{display:grid;gap:.65rem;margin:1rem 0}
.scatter-bars>div{display:grid;grid-template-columns:minmax(7.5rem,1fr) minmax(7rem,2fr) 4rem;align-items:center;gap:.55rem}
.scatter-bars small{grid-column:1/-1;color:#61747a}
.scatter-track{height:.72rem;overflow:hidden;border-radius:999px;background:#e0e9e8}
.scatter-track i{display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,#138171,#f1b947)}
.evidence-cards{display:grid;gap:.7rem}
.evidence-cards article{padding:.85rem;border:1px solid #d8e1e2;border-radius:.85rem;background:#f8fbfa}
.evidence-cards article p{margin:0 0 .65rem}
.evidence-cards article div{display:grid;grid-template-columns:1fr 1fr;gap:.5rem}

.mixture-columns{display:grid;grid-template-columns:1fr 1fr;gap:.8rem}
.mixture-columns>div{display:grid;gap:.4rem;padding:1rem;border-radius:1rem;background:#edf7f4;text-align:center}
.mixture-columns strong{font-size:1.25rem}
.mixture-columns span,.mixture-columns small{color:#4f686d}
.invest-stepper{display:grid;grid-template-columns:minmax(2.8rem,1fr) minmax(3rem,auto) minmax(2.8rem,1fr);align-items:center;gap:.35rem}
.invest-stepper output{font-size:1.1rem;font-weight:850}
.mixture-total,.relay-total{margin:.8rem 0 0;padding:.65rem;border-radius:.7rem;background:#fff0e3;text-align:center}
.mixture-total.is-valid,.relay-total.is-valid{background:#e5f4ec;color:#145b47}
.mass-line{display:flex;align-items:center;gap:.65rem;margin:1rem 0;color:#4f656b;font-weight:800}
.mass-line i{height:.5rem;flex:1;border-radius:999px;background:linear-gradient(90deg,#168272,#edc35c)}
.equation-builder{display:grid;gap:.9rem}
.equation-builder>div{display:grid;grid-template-columns:minmax(12rem,1.2fr) minmax(11rem,1fr);align-items:end;gap:.75rem;padding:.75rem;border-radius:.8rem;background:#f5f8f7}
.equation-builder .equation-total{border-top:2px solid #8aa2a3;background:#edf7f4}

.relay-target{display:grid;gap:.65rem}
.subshell-grid{display:grid;grid-template-columns:repeat(5,minmax(5.4rem,1fr));gap:.55rem}
.subshell-grid>div{display:grid;gap:.35rem;padding:.7rem;border:1px solid #d6e0e0;border-radius:.75rem;background:#f8fbfa;text-align:center}
.subshell-grid small{color:#435c63}
.shell-fields{display:grid;grid-template-columns:repeat(3,1fr);gap:.7rem}
.shell-station,.lewis-station{display:grid;grid-template-columns:minmax(12rem,.8fr) minmax(16rem,1.2fr);align-items:center;gap:1rem}
.shell-diagram,.lewis-diagram{display:block;width:min(100%,16rem);height:auto;margin:auto;border:1px solid #d6e1e0;border-radius:1rem;background:radial-gradient(circle at center,#fff 0,#f6faf9 70%,#eef6f4 100%)}
.shell-ring{fill:none;stroke:#7fa6a2;stroke-width:1.5;stroke-dasharray:4 3}
.shell-nucleus{fill:#f0b843;stroke:#71581b;stroke-width:2}
.shell-symbol{fill:#263f44;font:800 16px system-ui,sans-serif}
.shell-electron{fill:#126f64;stroke:#fff;stroke-width:1.5}
.relay-boxes{display:grid;grid-template-columns:repeat(3,minmax(4rem,7rem));justify-content:center;gap:.75rem;margin:1rem 0}
.relay-box{aspect-ratio:1;min-height:4.5rem;border:2px solid #37646a;border-top:none;border-radius:0 0 .35rem .35rem;background:#f7fbfa;color:#173f45;font-size:1.45rem;font-weight:850;cursor:pointer}
.lewis-symbol{fill:#203d42;font:850 58px system-ui,sans-serif}
.lewis-dot{fill:#126f64}
.lewis-stepper{margin-top:.8rem}

.value-bank{display:flex;flex-wrap:wrap;gap:.45rem;margin:.8rem 0}
.value-bank span{padding:.35rem .6rem;border:1px dashed #81999c;border-radius:999px;background:#fff;font-weight:800}
.trend-svg,.spectrum-svg{display:block;width:100%;height:auto;margin:.8rem 0;border:1px solid #d3dede;border-radius:.8rem;background:#fcfefd}
.trend-svg text,.spectrum-svg text{fill:#3b555b;font:14px system-ui,sans-serif}
.grid-line{stroke:#dfe8e7;stroke-width:1}
.axis-line{stroke:#607b7e;stroke-width:2}
.trend-line{fill:none;stroke:#0c7e6e;stroke-width:4;stroke-linejoin:round}
.trend-point{fill:#f0b843;stroke:#6b4b00;stroke-width:2}
.segment-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.7rem}
.segment-grid>div{display:grid;gap:.45rem;padding:.75rem;border:1px solid #dae3e3;border-radius:.8rem}
.segment-grid>div>div{display:grid;grid-template-columns:1fr 1fr;gap:.4rem}
.invest-flag{padding:.45rem;font-size:.82rem}

.round-tabs{display:flex;flex-wrap:wrap;gap:.45rem;margin-bottom:.75rem}
.invest-tab{padding:.55rem .8rem}
.spectrum-baseline{stroke:#afbec0;stroke-width:2}
.spectrum-line{stroke-width:5}
.spectrum-line.unknown{stroke:#142f39}
.spectrum-line.ref-A{stroke:#2878c8}
.spectrum-line.ref-B{stroke:#d08a00}
.spectrum-line.ref-C{stroke:#8a55aa}
.reference-buttons{grid-template-columns:repeat(3,1fr)}

@media(max-width:760px){
  .scatter-bars>div{grid-template-columns:6.8rem 1fr 3.2rem}
  .mixture-columns,.shell-fields,.shell-station,.lewis-station,.segment-grid,.reference-buttons{grid-template-columns:1fr}
  .subshell-grid{grid-template-columns:repeat(2,1fr)}
  .subshell-grid>div:last-child{grid-column:1/-1}
  .equation-builder>div{grid-template-columns:1fr}
  .invest-table{font-size:.82rem}
  .invest-table th,.invest-table td{padding:.45rem .35rem}
}

@media(max-width:430px){
  .invest-panel{padding:.9rem}
  .evidence-cards article div{grid-template-columns:1fr}
  .scatter-bars>div{grid-template-columns:1fr 3.5rem}
  .scatter-track{grid-column:1/2}
  .scatter-bars small{grid-column:1/-1}
  .relay-boxes{gap:.45rem}
}

@media(prefers-reduced-motion:reduce){.invest-button,.invest-choice,.invest-model,.invest-chip,.invest-flag,.invest-tab{transition:none}}
/* Allow every nested workbench to shrink inside the phone reading surface. */
.investigation-workspace{min-width:0;grid-template-columns:minmax(0,1fr)}
.invest-panel,.invest-field,.invest-input-wrap,.shell-station>div,.lewis-station>div,.shell-fields>label,.subshell-grid>div,.relay-target{min-width:0}
.invest-field input,.invest-field select,.relay-target select{min-width:0}
.invest-table{table-layout:fixed}.invest-table td,.invest-table th{overflow-wrap:anywhere}
@media(max-width:430px){.subshell-grid>div{padding:.5rem}.subshell-grid .invest-stepper{grid-template-columns:minmax(30px,1fr) 22px minmax(30px,1fr);gap:3px}.subshell-grid .invest-button{padding:4px}.subshell-grid .invest-stepper output{font-size:15px}.relay-boxes{grid-template-columns:repeat(3,minmax(0,1fr))}.lewis-stepper{grid-template-columns:minmax(0,1fr) 25px minmax(0,1fr)}.lewis-stepper .invest-button{font-size:12px;padding:7px}.invest-table th,.invest-table td{padding:.45rem .25rem}.invest-input-wrap{flex-wrap:wrap}.invest-input-wrap small{font-size:11px}}
.invest-readout{padding:15px;border:1px solid #bdd0c5;border-radius:12px;background:#f3f7ec;margin:20px 0}.invest-readout summary{cursor:pointer;min-height:32px;font-size:13px;font-weight:700;line-height:1.7}
