:root {
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --line: #dedede;
  --accent: #0f6b62;
  --accent-soft: #e8f2ef;
  --paper: #fffefa;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; }
button, input { font: inherit; }
.explorer { padding: 28px; }
.explorer-header { max-width: 64ch; margin-bottom: 24px; }
.embedded .explorer { padding: 20px; }
.embedded .explorer-header { display: none; }
.kicker { margin: 0 0 8px; color: var(--accent); font-size: 0.74rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 10px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.8rem, 3.6vw, 2.7rem); font-weight: 500; letter-spacing: -0.035em; line-height: 1.04; }
h2 { margin-bottom: 12px; font-size: 1rem; }
p, label, button, dt, dd { font-size: 0.94rem; line-height: 1.5; }
.explorer-header > p:last-child { margin-bottom: 0; color: #3d3d40; }
.explorer-layout { display: grid; grid-template-columns: minmax(0, 7fr) minmax(220px, 3fr); gap: 20px; }
.diagram-panel { min-width: 0; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
#ray-diagram { display: block; width: 100%; height: auto; }
.diagram-note { margin: 10px 2px 0; color: var(--muted); font-size: 0.8rem; }
.diagram-panel .prompt { margin-top: 16px; }
.controls-panel { display: grid; align-content: start; gap: 12px; }
form, .results, .prompt { border: 1px solid var(--line); border-radius: 10px; }
form, .results { padding: 14px; }
fieldset { margin: 0; padding: 0; border: 0; }
legend { margin-bottom: 10px; font-size: 0.92rem; font-weight: 700; }
label { display: block; margin-top: 12px; font-weight: 600; }
label:first-of-type { margin-top: 0; }
label > span { display: block; }
output { display: block; margin-top: 2px; color: var(--accent); font-variant-numeric: tabular-nums; }
input[type="range"] { width: 100%; margin-top: 4px; accent-color: var(--accent); }
button { width: 100%; margin-top: 16px; padding: 9px 10px; border: 1px solid var(--accent); border-radius: 8px; color: #0b514a; background: white; font-weight: 700; cursor: pointer; }
button:hover { background: var(--accent-soft); }
.results { background: #f6f6f4; }
.results h2, .prompt h2 { margin-bottom: 8px; }
.controls-panel label, .controls-panel button, .controls-panel dt, .controls-panel dd, .controls-panel #interpretation { font-size: 0.86rem; }
.controls-panel .results h2 { font-size: 0.92rem; }
dl { margin: 0; }
dl > div { display: flex; justify-content: space-between; gap: 16px; padding: 6px 0; border-top: 1px solid var(--line); }
dt, dd { margin: 0; }
dd { font-variant-numeric: tabular-nums; font-weight: 700; text-align: right; }
#interpretation { margin: 10px 0 0; }
.prompt { padding: 18px; border-left: 4px solid var(--accent); background: var(--accent-soft); }
.prompt p { margin-bottom: 0; }
.file-fallback { padding: 24px; border: 1px solid var(--line); border-radius: 12px; background: #f6f6f4; }
.file-fallback p { margin: 8px 0 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 720px) {
  .explorer { padding: 20px; }
  .explorer-layout { grid-template-columns: 1fr; }
}
