/* Shared widget styles for the three playground designs. Each design sets the variables and the layout. */
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: var(--font-size, 14px)/1.5 var(--font-ui); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.stage { position: relative; overflow: hidden; }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.stage canvas.scene { touch-action: none; }
.btn, .chip, .preset, .body-chip { background: var(--btn-bg); border: 1px solid var(--edge); border-radius: var(--radius-btn, 999px); padding: 6px 12px; min-height: 36px; cursor: pointer; color: var(--ink); white-space: nowrap; }
.btn:hover, .chip:hover, .preset:hover, .body-chip:hover { border-color: var(--edge-strong); }
.btn:disabled { opacity: 0.4; cursor: default; }
.btn.warn { color: var(--warn); }
.btn.play { width: 44px; height: 44px; padding: 0; display: inline-grid; place-items: center; border-color: var(--accent-edge); color: var(--accent); }
[aria-pressed="true"].chip, [aria-pressed="true"].preset, [aria-pressed="true"].body-chip { border-color: var(--accent-edge); color: var(--accent); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--muted); margin-right: 7px; vertical-align: 0; flex: none; }
.dot.big { width: 12px; height: 12px; margin-top: 26px; }
.dot.k-planet { background: #8fb3b8; } .dot.k-moon { background: #c9c4b8; } .dot.k-star { background: #ffcf8a; box-shadow: 0 0 6px #ffcf8a88; } .dot.k-test { background: transparent; border: 1px solid var(--muted); }
.body-chip, .chip { display: flex; align-items: center; gap: 2px; text-align: left; }
.body-chip .ms { color: var(--muted); margin-left: 8px; font-size: 0.85em; font-variant-numeric: tabular-nums; }
.time { display: flex; align-items: center; min-width: 0; }
.rate { display: flex; align-items: center; gap: 10px; min-width: 0; }
.rate input { width: 140px; }
.rate-out { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 8.5em; font-size: 0.92em; white-space: nowrap; }
input[type="range"] { -webkit-appearance: none; appearance: none; background: transparent; height: 28px; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 2px; background: var(--track); border-radius: 2px; }
input[type="range"]::-moz-range-track { height: 2px; background: var(--track); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; margin-top: -7px; border-radius: 50%; background: var(--bg); border: 1.5px solid var(--accent); }
input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--bg); border: 1.5px solid var(--accent); }
.field { display: grid; gap: 2px; margin: 0 0 10px; min-width: 0; }
.field label, .lbl { font-size: 0.82em; color: var(--muted); letter-spacing: 0.02em; }
.field .in { display: flex; gap: 6px; align-items: center; }
.field input, .small, select { background: var(--input-bg); border: 1px solid var(--edge); border-radius: 8px; padding: 5px 8px; min-height: 34px; min-width: 0; width: 100%; font-variant-numeric: tabular-nums; }
.field select { width: auto; }
.field .unit { color: var(--muted); font-size: 0.85em; white-space: nowrap; }
.field input[aria-invalid="true"], .small[aria-invalid="true"] { border-color: var(--warn); }
.err { color: var(--warn); font-size: 0.82em; } .err:empty { display: none; }
.hint { color: var(--muted); font-size: 0.8em; display: block; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.insp-head { display: flex; gap: 10px; align-items: flex-start; } .insp-head .field { flex: 1; }
.close { background: none; border: 1px solid transparent; color: var(--muted); font-size: 20px; line-height: 1; width: 34px; height: 34px; border-radius: 50%; cursor: pointer; margin-top: 20px; flex: none; }
.close:hover { border-color: var(--edge); color: var(--ink); }
.derived { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; margin: 4px 0 10px; font-size: 0.9em; font-variant-numeric: tabular-nums; }
.derived dt { color: var(--muted); } .derived dt:empty + dd { color: var(--muted); font-size: 0.85em; } .derived dd { margin: 0; text-align: right; }
.row { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.toggles { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 10px 0; }
.toggle { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; min-height: 32px; }
.toggle input { accent-color: var(--accent); width: 16px; height: 16px; }
.gk { display: grid; grid-template-columns: auto 1fr 70px; gap: 4px 10px; align-items: center; }
.gk .hint, .gk .err { grid-column: 1 / -1; }
.frame { display: flex; align-items: center; gap: 10px; margin: 6px 0; } .frame select { width: auto; }
.empty { color: var(--muted); margin: 0; }
.formula .katex-display, .formula-live .katex-display { margin: 4px 0; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.formula .katex { color: var(--ink); font-size: 1.05em; } .formula-live .katex { color: var(--accent); font-size: 0.95em; }
.formula { display: grid; } .formula > .formula-layer { grid-area: 1 / 1; }
.status { color: var(--ink); font-size: 0.88em; min-height: 1.4em; margin: 0; transition: opacity 1.2s; }
.status.faded { opacity: 0; }
.clock, .energy { color: var(--muted); font-size: 0.85em; font-variant-numeric: tabular-nums; }
svg.spark { width: 160px; height: 34px; overflow: visible; } svg.spark path { fill: none; stroke: var(--line); stroke-width: 1.2; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* ── Guided widgets (used only by the light designs; class names are new, so the night designs are unaffected) ── */
.kind { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; gap: 0 8px; align-items: center; text-align: left; width: 100%;
  background: none; border: 1px solid transparent; border-radius: var(--radius-btn, 8px); padding: 8px 10px; cursor: pointer; color: var(--ink); min-height: 44px; }
.kind:hover, .kind:focus-visible { border-color: var(--edge-strong); }
.kind[aria-pressed="true"] { border-color: var(--accent-edge); }
.kind .dot { grid-row: 1 / 3; margin: 0; }
.kind .k-label { font-weight: 600; } .kind .k-blurb { color: var(--muted); font-size: 0.85em; }
.banner { display: grid; grid-template-columns: 1fr auto; gap: 2px 14px; align-items: center; }
.banner .b-title { font-weight: 600; color: var(--accent-text, var(--accent)); } .banner .b-text { grid-column: 1; font-size: 0.9em; } .banner .btn { grid-column: 2; grid-row: 1 / 3; }
.state { font-size: 0.9em; } .state .muted, .muted { color: var(--muted); }
.tip { display: flex; gap: 8px; align-items: center; font-size: 0.9em; } .tip .close { margin: 0; width: 28px; height: 28px; font-size: 17px; }
.masses { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 10px 0 4px; } .masses .lbl { margin-right: 4px; }
.chip.mass { padding: 4px 10px; min-height: 32px; }
.actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 2px; }
.btn.primary { background: var(--accent-fill, var(--btn-bg)); border-color: var(--accent-edge); color: var(--accent-text, var(--accent)); }
.hint.inline { margin: 4px 0 6px; }
.ttl { display: grid; flex: 1; min-width: 0; } .ttl strong { font-size: 1.05em; overflow-wrap: anywhere; } .kindline { color: var(--muted); font-size: 0.85em; }
.insp-head .ttl + .close { margin-top: 0; }
.exact { margin-top: 10px; border-top: 1px solid var(--edge); padding-top: 8px; } .exact summary { cursor: pointer; color: var(--muted); min-height: 32px; display: flex; align-items: center; }
.help { font-size: 0.85em; color: var(--muted); min-height: 1.3em; }
.keys { list-style: none; padding: 0; margin: 0; display: grid; gap: 3px; font-size: 0.85em; color: var(--muted); }
kbd { font: 0.85em ui-monospace, Menlo, monospace; border: 1px solid var(--edge-strong); border-radius: 4px; padding: 1px 5px; color: var(--ink); background: var(--input-bg); }
.g-label { font-size: 0.85em; color: var(--muted); } .g-out { font-variant-numeric: tabular-nums; min-width: 3.5em; font-weight: 600; }
.addmenu > summary { list-style: none; cursor: pointer; } .addmenu > summary::-webkit-details-marker { display: none; }
.banner .b-warn { grid-column: 1 / -1; font-size: 0.88em; color: var(--warn); } .banner .b-warn:empty { display: none; }
.banner[hidden], .state[hidden], .tip[hidden] { display: none !important; }
@media (max-width: 760px) { .banner .b-text { font-size: 12.5px; } }
