/* Shared beam controls stay below every visualisation, with room for the sample. */
.photon-controls { border-top:1px solid var(--line); padding:8px 12px 9px; background:var(--soft); flex:none; min-width:0; }
.gun-title { display:flex; align-items:center; gap:9px; line-height:1; margin-bottom:7px; }
.gun-title strong { display:flex; align-items:center; gap:7px; font-size:13px; }
.gun-title svg { width:34px; height:20px; color:var(--green); }
#beam-band { color:var(--muted); font-size:10px; margin-left:auto; }
.beam-toggle { border:1px solid var(--line); background:var(--panel); color:var(--ink); border-radius:20px; min-width:45px; padding:5px 9px; font-size:11px; }
.beam-on .beam-toggle { background:var(--green); color:white; border-color:var(--green); }
.em-scale { position:relative; padding-top:17px; height:37px; margin:0 4px 3px; }
.em-bands { position:absolute; inset:0 0 auto; height:23px; display:grid; grid-template-columns:1fr 3fr 1.58fr .31fr 3.11fr 3fr 3fr; border-radius:5px; background:linear-gradient(90deg,#6872ad 0%,#778ac8 7%,#9b76b9 27%,#aa79c5 37.2%,#a071bb 37.3%,#567bd2 37.7%,#58a073 38.2%,#dad283 38.6%,#cf765f 39.4%,#b7776b 40%,#bc8c76 60%,#90a59a 80%,#779d94 100%); }
.em-bands span { color:#102321; text-align:center; font-size:8px; align-self:start; padding:2px 0; white-space:nowrap; }
.em-scale input { width:100%; position:relative; margin:0; height:18px; accent-color:var(--green); cursor:pointer; }
.wavelength-controls { display:grid; grid-template-columns:12px minmax(68px,1fr) 46px auto minmax(84px,1.1fr); gap:5px; align-items:center; margin:2px 0 6px; }
.wavelength-controls input,.wavelength-controls select { width:100%; min-width:0; font-size:11px; padding:5px 4px; border:1px solid var(--line); border-radius:6px; background:var(--panel); color:var(--ink); }
.wavelength-controls button { font-size:10px; padding:5px 8px; }
.wavelength-controls label { font-size:15px; color:var(--muted); }
.beam-power { display:grid; grid-template-columns:48px minmax(60px,1fr) minmax(85px,auto); gap:7px; align-items:center; }
.beam-power label { font-size:11px; }
.beam-power input { min-width:0; width:100%; margin:2px 0; accent-color:var(--green); }
.photon-controls #intensity { grid-row:auto; grid-column:auto; }
.beam-power output { font-size:10px; font-variant-numeric:tabular-nums; text-align:right; }
.thermal-strip { display:flex; align-items:center; flex-wrap:wrap; gap:4px 8px; margin:5px 0; }
.thermal-strip span { font-size:10px; font-variant-numeric:tabular-nums; }
#sample-thermal-mini { font-weight:650; }
#bulk-phase { color:var(--muted); margin-right:auto; }
#bulk-phase { border-radius:10px; padding:3px 6px; background:var(--panel); transition:background-color .25s,color .25s; }
#bulk-phase[data-state="solid"] { color:#287458; }
#bulk-phase[data-state="liquid"] { color:#2861a8; }
#bulk-phase[data-state="gas"] { color:#ad3c47; }
html[data-app-theme="dark"] #bulk-phase[data-state="solid"] { color:#9ed8bd; }
html[data-app-theme="dark"] #bulk-phase[data-state="liquid"] { color:#a2c6f5; }
html[data-app-theme="dark"] #bulk-phase[data-state="gas"] { color:#f2a5ae; }
.thermal-strip button { font-size:10px; padding:4px 7px; }
.photon-controls #heating-status { grid-row:auto; margin:3px 0; white-space:normal; font-size:9px; }
.excitation-status,.phase-transition-note { font-size:10px; color:var(--muted); line-height:1.4; margin:3px 0; }
.phase-transition-note { color:var(--green); font-weight:650; }
.photon-controls .heating-guidance,.photon-controls .model-range-note { font-size:9px; }
.beam-notes { position:relative; margin-top:5px; font-size:10px; color:var(--muted); }
.beam-notes summary { cursor:pointer; width:max-content; }
.beam-notes > summary { padding:2px 0; font-size:9px; min-height:0; }
.beam-notes p { line-height:1.6; margin:8px 0; }
.element-context { font-size:10px; color:var(--muted); line-height:1.5; margin:4px 0; }
.experiment-panel { display:flex; flex-direction:column; }
.visual-view[hidden] { display:none !important; }
.reference-view { min-height:0; overflow:auto; }
.atom-reference-layout { display:grid; grid-template-columns:minmax(100px,.8fr) minmax(180px,1.2fr); gap:6px; align-items:start; }
.atom-reference-layout .atom-visual { height:200px; min-height:100px; width:100%; }
.atom-reference-layout .atom-visual svg { height:100%; width:100%; }
.atom-reference-layout .photon-reference { min-width:0; }
.scene-gun-label { color:#d4e8dc; font-size:9px; }
@media(min-width:1060px) and (min-height:650px) {
  .right-column { grid-template-rows:minmax(0,2.6fr) minmax(155px,1fr); }
  .experiment-panel { height:100%; }
  .view-tabs { flex:0 0 34px; }
  #view-crucible:not([hidden]) { flex:1 1 auto; height:auto; min-height:0; display:grid; grid-template-columns:138px minmax(0,1fr); grid-template-rows:30px minmax(95px,1fr) 40px 25px 18px; }
  .scene-heading { grid-row:1; }
  .scene-heading h2 { font-size:22px; }
  .chamber-stage { grid-row:2; height:auto; min-height:95px; }
  .playback,.readings { grid-row:3; }
  .playback { padding:3px 6px; }
  .readings { padding:3px 8px; grid-template-columns:1fr 1fr; }
  .readings > div:nth-child(2) { grid-column:2; }
  .readings strong { font-size:22px; }
  .reading-label { font-size:9px; }
  .advanced-controls,.chart-details { grid-row:4; }
  .advanced-controls>summary,.chart-details>summary { padding:4px 12px; height:25px; }
  .model-caption { grid-row:5; }
  .reference-view:not([hidden]) { flex:1 1 auto; height:auto; min-height:0; }
  .reference-view .atom-visual { height:180px; }
  .reference-view .energy-level-graph { height:auto; min-height:180px; }
  .photon-controls { padding:6px 11px 7px; }
  .experiment-panel[data-active-view="crucible"] #sample-thermal-mini { display:none; }
  .beam-notes[open] { position:fixed; top:78px; right:20px; z-index:900; width:min(440px,calc(100vw - 40px)); max-height:calc(100dvh - 110px); overflow:auto; background:var(--panel); padding:15px 20px; border:1px solid var(--line); border-radius:12px; box-shadow:0 14px 50px #07151a40; }
}
@media(max-width:720px) {
  .photon-controls { padding:10px 12px; }
  .gun-title strong { font-size:14px; }
  .photon-controls input[type=range] { min-height:24px; }
  .em-scale { height:43px; }
  .wavelength-controls { grid-template-columns:10px minmax(64px,1fr) 42px auto minmax(80px,1fr); gap:4px; }
  .thermal-strip { gap:6px; }
  .thermal-strip button { min-height:32px; }
  .atom-reference-layout { grid-template-columns:minmax(0,1fr); }
  .atom-reference-layout .atom-visual { height:180px; }
  .photon-controls .heating-status { font-size:10px; }
}
@media(prefers-reduced-motion:reduce) { .photon-controls * { transition:none !important; } }
@media(min-width:1060px) and (min-height:650px) {
  .right-column { display:flex; flex-direction:column; height:100%; overflow-y:auto; overflow-x:hidden; }
  .experiment-panel { height:calc(100dvh - 310px); min-height:530px; flex:0 0 auto; overflow:hidden; }
  #view-crucible:not([hidden]) { min-height:208px; flex:1 0 208px; }
  .reference-view:not([hidden]) { flex:1 1 280px; height:280px; max-height:none; padding:7px 12px; }
  .reference-heading { margin-bottom:3px; }
  .reference-heading h2 { font-size:23px; margin:0; }
  .reference-choice { margin:3px 0; }
  .configuration-large { font-size:16px; margin:3px 0 4px; }
  .details-panel { display:block; flex:none; height:auto; min-height:210px; overflow:visible; }
  .element-context { width:auto; }
  .photon-controls .beam-power { height:24px; }
  .photon-controls .thermal-strip { flex-wrap:nowrap; }
}
.ground-state-details { margin-top:8px; border-top:1px solid var(--line); }
.ground-state-details > summary { font-size:11px; padding:8px 0; cursor:pointer; }
.atomic-reset { font-size:10px; padding:4px 6px; white-space:nowrap; }
.atomic-caveat { color:var(--amber-dark,#9c6629); font-size:9px; line-height:1.4; margin:3px 0; }
.atomic-caveat[hidden] { display:none; }
html[data-app-theme="dark"] .atomic-caveat { color:#e6c28b; }
.model-tools { display:flex; gap:8px; align-items:center; }
.model-tools #open-molecule { font-size:10px; white-space:nowrap; }
.molecule-popout { width:min(460px,calc(100vw - 28px)); max-height:calc(100dvh - 60px); overflow:auto; color:var(--ink); background:var(--panel); border:1px solid var(--line); border-radius:14px; }
#molecule-content svg { display:block; width:100%; height:auto; }
.photon-host .photon-reference { container-type:inline-size; }
@container(max-width:350px) { .photon-reference-facts { grid-template-columns:repeat(2,minmax(0,1fr)); } }

#beam-kind { padding:2px 20px 2px 3px; color:var(--ink); background:transparent; border:1px solid transparent; border-radius:5px; font:inherit; font-weight:600; max-width:155px; }
#beam-kind:focus-visible { outline:2px solid var(--green-dark); }
#photon-settings[hidden],#electron-settings[hidden],#photon-details[hidden] { display:none; }
.electron-scale { border-radius:5px; padding:3px 4px 0; background:linear-gradient(90deg,#274a5b,#659caa); }
.electron-scale > div { display:flex; justify-content:space-between; color:#edf3ed; font-size:8px; }
.electron-scale input { width:100%; margin:1px 0 0; height:13px; }
.electron-exact { display:flex; gap:7px; align-items:center; margin:6px 0; }
.electron-exact label { display:flex; align-items:center; gap:4px; font-size:10px; white-space:nowrap; min-width:0; }
.electron-exact input { width:85px; min-width:0; padding:5px; border:1px solid var(--line); border-radius:5px; background:var(--paper); color:var(--ink); font:inherit; }
.electron-exact button { margin-left:auto; }
.electron-current-row { display:grid; grid-template-columns:auto minmax(30px,1fr) auto; gap:8px; align-items:center; font-size:10px; }
.electron-current-row input { width:100%; min-width:0; }
.electron-current-row output { min-width:65px; text-align:right; font-variant-numeric:tabular-nums; }
.electron-summary { color:var(--muted); font-size:10px; line-height:1.4; margin:4px 0; overflow-wrap:anywhere; }
.electron-edit-note { color:var(--amber-dark,#9c6629); font-size:10px; line-height:1.4; margin:3px 0 6px; }
.electron-edit-note[hidden] { display:none; }
.electron-exact input[data-edited="true"] { border-color:var(--amber-dark,#9c6629); box-shadow:0 0 0 1px var(--amber-dark,#9c6629); }
html[data-app-theme="dark"] .electron-edit-note { color:#e6c28b; }
#try-impact { font-size:10px; padding:2px 0; }
@media(max-width:420px) { .electron-exact { gap:4px; flex-wrap:wrap; } .electron-exact input { width:67px; } #beam-kind { max-width:132px; } }

.photon-controls.electron-source .beam-toggle { margin-left:auto; }

@media(max-width:420px) { .gun-title #beam-band { display:none; } .gun-title .beam-toggle { margin-left:auto; } .gun-title strong { min-width:0; } }
