:root {
  --bg: #0e1626;
  --panel: #152036;
  --panel2: #1b2944;
  --line: #2a3b5e;
  --text: #e6eefb;
  --muted: #9fb0cf;
  --accent: #7cc4ff;
  --accent2: #b9e2ff;
  --ok: #7ee0a1;
  --bad: #ff8f8f;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
header { padding: 12px 20px; border-bottom: 1px solid var(--line); display: flex;
  align-items: baseline; gap: 16px; flex-wrap: wrap; }
h1 { font-size: 20px; margin: 0; font-weight: 600; }
h2 { font-size: 13px; margin: 0 0 8px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.sub { color: var(--muted); }
main { display: grid; grid-template-columns: minmax(300px, 400px) 1fr; gap: 16px; padding: 16px; }
@media (max-width: 860px) { main { grid-template-columns: 1fr; } #view { order: -1; } }
#panel { display: flex; flex-direction: column; gap: 12px; max-height: calc(100vh - 90px); overflow-y: auto; padding-right: 4px; }
@media (max-width: 860px) { #panel { max-height: none; } }
.box { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.row { display: flex; align-items: center; gap: 8px; margin: 6px 0; flex-wrap: wrap; }
label.row { justify-content: space-between; }
select, input[type=number], input[type=text] { background: var(--panel2); color: var(--text);
  border: 1px solid var(--line); border-radius: 6px; padding: 5px 7px; font: inherit; }
select { min-width: 0; max-width: 100%; }
#method { flex: 1; }
.seedrow input { width: 120px; }
.chk { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); }
button, .btn { background: var(--panel2); color: var(--text); border: 1px solid var(--line);
  border-radius: 6px; padding: 6px 10px; font: inherit; cursor: pointer; text-decoration: none; display: inline-block; }
button:hover:not(:disabled), .btn:hover { border-color: var(--accent); }
button:disabled { opacity: .45; cursor: default; }
.primary { background: #1d5a92; border-color: #2b77bd; }
.primary:hover:not(:disabled) { background: #236aa9; }
.knob { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; margin: 9px 0; }
.knob .lbl { color: var(--text); }
.knob .val { color: var(--accent2); font-variant-numeric: tabular-nums; text-align: right; min-width: 64px; }
.knob input[type=range] { grid-column: 1 / -1; width: 100%; accent-color: var(--accent); }
.knob select { grid-column: 2; }
.knob .help { grid-column: 1 / -1; color: var(--muted); font-size: 12px; }
.knob.changed .lbl::after { content: " •"; color: var(--accent); }
.recipe input { width: 100%; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; }
.msg { color: var(--muted); font-size: 12px; min-height: 1em; }
.msg.err { color: var(--bad); }
#view { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.tabs { display: flex; gap: 6px; }
.tab.active { border-color: var(--accent); background: #20365a; }
.stage { position: relative; background: #101828; border: 1px solid var(--line); border-radius: 10px;
  aspect-ratio: 1 / 1; max-height: calc(100vh - 260px); width: 100%; margin: 0 auto; overflow: hidden; }
@media (max-width: 860px) { .stage { max-height: none; } }
.pane { position: absolute; inset: 0; display: none; }
.pane.active { display: block; }
.pane img { width: 100%; height: 100%; object-fit: contain; image-rendering: auto; }
#threeBox { position: absolute; inset: 0; }
#threeBox canvas { display: block; width: 100% !important; height: 100% !important; }
.hint { position: absolute; bottom: 6px; left: 10px; color: var(--muted); font-size: 12px; pointer-events: none; }
.busy { position: absolute; top: 8px; right: 10px; background: #0009; padding: 3px 8px; border-radius: 6px; color: var(--accent2); }
.info { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; min-height: 1.4em; }
.actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.progress { position: relative; flex: 1; min-width: 200px; height: 26px; background: var(--panel2);
  border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.progress .bar { position: absolute; inset: 0 auto 0 0; width: 0; background: linear-gradient(90deg, #2b77bd, #7cc4ff); transition: width .3s; }
.progress .ptext { position: relative; padding: 0 10px; line-height: 24px; font-size: 12px; }
.result { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.downloads { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.validation { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.validation .ok { color: var(--ok); }
.validation .bad { color: var(--bad); }
.validation code { color: var(--accent2); word-break: break-all; }
.nature { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 13px; }
.nature .sum { color: var(--accent2); margin-bottom: 4px; }
.nature .facts { color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.nature summary { cursor: pointer; color: var(--muted); font-size: 12px; }
.nature table { border-collapse: collapse; width: 100%; margin-top: 6px; font-size: 12px; font-variant-numeric: tabular-nums; }
.nature th, .nature td { text-align: left; padding: 2px 6px; border-bottom: 1px solid var(--line); }
.nature th { color: var(--muted); font-weight: 600; }
.nature tr.idle td { color: #5d6c88; }
.nature .note { color: var(--muted); font-size: 11px; margin: 6px 0 0; }
@media (max-width: 600px) { .nature table { display: block; overflow-x: auto; } }
.tools { display: flex; flex-wrap: wrap; gap: 6px; margin: 2px 0 8px; }
.tools .preset { background: #2a2350; border-color: #5a4bb0; }
.tools .today { background: #183c3a; border-color: #2f8f86; }
.today-report { flex-basis: 100%; background: var(--panel2); border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 10px; font-size: 12px; }
.today-report .headline { color: var(--accent2); font-size: 13px; margin-bottom: 4px; }
.today-report .where { margin-bottom: 2px; }
.today-report .muted { color: var(--muted); }
.today-report ul { margin: 4px 0; padding-left: 18px; }
.today-report .credit { color: var(--muted); font-size: 11px; margin-top: 4px; }
.today-report a { color: var(--accent); }
.place-row { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.place-row span { flex-basis: 100%; color: var(--muted); font-size: 12px; }
.place-row select { flex: 1; min-width: 0; }
.three-msg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center;
  padding: 24px; color: var(--muted); pointer-events: none; }
.three-msg[hidden] { display: none; }
#threeBox canvas.softview { cursor: grab; }
#threeBox canvas.softview:active { cursor: grabbing; }
.soft-note { top: 6px; bottom: auto; right: 10px; left: auto; }
.support { background: #3a2140; border: 1px solid #a2577a; color: #ffd9ea; border-radius: 999px;
  padding: 6px 14px; text-decoration: none; font-weight: 600; white-space: nowrap; }
.support:hover { background: #4d2a55; border-color: #e07aa8; }
@media (max-width: 600px) { .support { margin-left: 0; } }
.helplink { margin-left: auto; color: var(--accent2); text-decoration: none; border: 1px solid var(--line);
  border-radius: 999px; padding: 6px 12px; white-space: nowrap; }
.helplink:hover { border-color: var(--accent); }
@media (max-width: 600px) { .helplink { margin-left: 0; } }
.methodrow #method { flex: 1; min-width: 0; }
.methodrow .about { font-size: 13px; color: var(--accent); white-space: nowrap; }
.site-about { max-width: 1000px; margin: 8px auto 40px; padding: 0 20px; color: var(--muted); font-size: 13px; }
.site-about h2 { font-size: 15px; color: var(--accent2); margin: 18px 0 6px; text-transform: none; letter-spacing: 0; }
.site-about a { color: var(--accent); }
.printlink { color: var(--accent2); text-decoration: none; border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 12px; white-space: nowrap; }
.printlink:hover { border-color: var(--accent); }
