:root { color-scheme: light; --ink: #20272b; --muted: #727c82; --line: #e1e7e9; --teal: #1d7480; --gold: #bd8b54; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #fff; font: 12px -apple-system, BlinkMacSystemFont, sans-serif; color: var(--ink); -webkit-user-select: none; user-select: none; }
button, input, select { font: inherit; }
button { cursor: pointer; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; padding: 7px 10px; background: #fff; white-space: nowrap; }
button[aria-pressed="true"], button[aria-expanded="true"] { color: var(--teal); background: #edf6f7; border-color: #adccd0; }
button:disabled { opacity: 0.45; cursor: default; }
button:focus-visible, input:focus-visible, select:focus-visible, canvas:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
input:invalid { outline: 1px solid #b53d3d; }
input[type="range"], input[type="checkbox"] { accent-color: var(--teal); }
input[type="range"] { width: 100%; min-width: 0; height: 24px; margin: 0; }
input[type="number"] { width: 60px; border: 0; background: #f1f5f5; border-radius: 4px; color: var(--teal); text-align: right; padding: 3px; }
output { font-variant-numeric: tabular-nums; color: var(--ink); }
[hidden] { display: none !important; }
#lab { display: flex; flex-direction: column; height: 100%; padding: 0 8px; }
.figures { display: grid; grid-template-columns: minmax(0, var(--volume-width, 2fr)) minmax(0, 3fr); flex: 1; min-height: 0; gap: 16px; }
.volume, .section-plot { display: flex; flex-direction: column; position: relative; min-width: 0; min-height: 0; }
.section-plot { border-left: 1px solid var(--line); padding-left: 12px; }
.figure-heading { display: flex; align-items: center; justify-content: space-between; min-height: 32px; gap: 8px; font-weight: 600; }
.figure-heading button { border: 0; font-size: 20px; padding: 0 7px; }
#sample-count { font-size: 11px; font-weight: 400; color: var(--muted); white-space: nowrap; }
#scene { flex: 1; position: relative; min-height: 0; touch-action: none; }
#scene canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
#scene-labels { position: absolute; inset: 0; pointer-events: none; z-index: 1; }
#volume-empty { position: absolute; inset: 0; display: grid; place-content: center; padding: 20px; background: #fffffff0; color: var(--muted); font-size: 14px; line-height: 1.6; text-align: center; pointer-events: none; }
.scene-label { position: absolute; white-space: nowrap; font-size: 11px; padding: 2px 3px; border-radius: 3px; background: #ffffffd9; transform: translate(-50%, -50%); }
.scene-label.axis { font-weight: 600; }
.scene-label.current { color: var(--gold); font-weight: 600; max-width: 190px; white-space: normal; text-align: center; }
.legend { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; min-height: 23px; color: var(--muted); font-size: 11px; }
.dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; }
.dot.selected { background: var(--gold); }.dot.sliced { background: var(--teal); }.dot.muted { background: #c1cbcf; }
#slice-canvas { flex: 1; width: 100%; min-height: 0; }
#sample-status { min-height: 23px; font-size: 11px; color: var(--muted); }
#linked-plot-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 4px 0 10px; font-size: 14px; }
#plot-modes { display: flex; gap: 4px; }
.plot-kind-label { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; min-width: 0; }
#plot-kind { max-width: 100%; min-width: 0; padding: 6px; border: 1px solid var(--line); border-radius: 6px; background: white; color: var(--ink); }
.linked-plot #sample-status { min-height: 42px; line-height: 16px; }
.linked-plot #slice-canvas { cursor: pointer; }
.controls { display: grid; grid-template-columns: auto minmax(130px, 1fr) minmax(120px, 0.65fr) auto; align-items: center; gap: 14px; border-top: 1px solid var(--line); padding: 8px 0; }
.axis-picker { display: flex; gap: 3px; }
.axis-picker button { min-width: 34px; font-weight: 600; }
.range-control { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.range-control > span { display: flex; justify-content: space-between; gap: 5px; align-items: center; }
/* Reserve both caption rows so changing values never resize the figures. */
.controls .range-control > span { height: 32px; flex-direction: column; align-items: flex-start; justify-content: flex-start; gap: 0; line-height: 16px; }
.controls .range-control > span > span, .controls .range-control output { white-space: nowrap; flex: none; }
@media (min-width: 1100px) { .controls .range-control > span { flex-direction: row; align-items: center; justify-content: space-between; gap: 5px; } }
#score-controls { display: grid; grid-template-columns: minmax(110px, .8fr) repeat(3, minmax(120px, 1fr)); align-items: center; gap: 16px; padding: 4px 0 8px; }
#preference-control { grid-column: span 2; min-width: 0; }
.preference-heading { display: flex; align-items: center; gap: 8px; min-height: 32px; font-size: 12px; }
.preference-heading label { margin-right: auto; }
.preference-heading output { white-space: nowrap; font-variant-numeric: tabular-nums; }
#reset-preference { padding: 2px; width: 28px; min-height: 28px; border: 0; background: transparent; font-size: 20px; }
#impedance-preference { width: 100%; accent-color: var(--accent); }
#preference-labels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); font-size: 10px; color: var(--muted); margin-top: 4px; }
#preference-labels > :nth-child(2) { text-align: center; }
#preference-labels > :last-child { text-align: right; }
.surface-toggle { display: flex; align-items: center; gap: 5px; }
#surface-mode-control { border-top: 1px solid var(--line); padding-top: 10px; }
#surface-modes { display: flex; flex-wrap: wrap; gap: 6px; }
.surface-hint { margin: 7px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
#surface-modes [data-surface="radiation"][aria-pressed="true"] { color: #21836b; border-color: #21836b; background: #edf7f2; }
#surface-modes [data-surface="impedance"][aria-pressed="true"] { color: #526da8; border-color: #526da8; background: #eff3fa; }
#surface-modes [data-surface="speed"][aria-pressed="true"] { color: #b67834; border-color: #b67834; background: #fcf4e9; }
#surface-description { min-height: 32px; margin: 8px 0 0; line-height: 16px; color: var(--muted); }
.surface-explorer .controls { grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr); }
.surface-explorer #score-controls { grid-template-columns: repeat(3, minmax(0, 1fr)); min-height: 60px; }
.surface-explorer #score-controls .range-control > span { height: 28px; }
.surface-explorer .physical-control { grid-column: 1 / -1; width: 100%; max-width: 480px; }
.surface-overlay #score-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.surface-overlay .physical-control { grid-column: auto; max-width: none; }
#radiation-control > span > span { color: #21836b; }
#impedance-control > span > span { color: #526da8; }
#speed-control > span > span { color: #b67834; }
#surface-status { min-height: 16px; margin: 0 0 6px; color: var(--muted); line-height: 16px; }
@media (max-height: 500px) { body:has(.surface-explorer) { overflow: auto; } .surface-explorer { min-height: 600px; } }
#scene-error { position: absolute; inset: 40px 10px 35px; display: grid; place-content: center; color: var(--muted); text-align: center; }
@media (pointer: coarse) { .axis-picker button, #score-expand, #surface-modes button { min-height: 38px; } input[type="range"] { height: 30px; } }
@media (max-width: 600px) { html, body { overflow: auto; } #lab { min-height: 700px; } .figures { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; gap: 6px; } .section-plot { border-left: 0; border-top: 1px solid var(--line); padding-left: 0; } .controls { grid-template-columns: auto 1fr; gap: 8px; } #score-controls { grid-template-columns: 1fr 1fr; gap: 12px; } }
@media (max-width: 600px) { .surface-explorer .controls { grid-template-columns: auto minmax(0, 1fr); } .surface-explorer .thickness { grid-column: 1 / -1; } .surface-explorer #score-controls { grid-template-columns: repeat(2, minmax(0, 1fr)); min-height: 124px; align-content: start; gap: 8px 12px; } .surface-explorer #surface-modes button { padding-inline: 8px; } }
