:root {
  color-scheme: dark;
  --bg: #07131d;
  --panel: #0b1b27;
  --panel-2: #0e2230;
  --panel-3: #112b37;
  --line: rgba(160, 204, 202, .12);
  --line-strong: rgba(160, 204, 202, .2);
  --text: #e5f1ef;
  --muted: #8ca6a8;
  --dim: #5e777c;
  --accent: #76e2bd;
  --accent-soft: rgba(118, 226, 189, .12);
  --accent-glow: rgba(118, 226, 189, .24);
  --warn: #e5c58b;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; min-height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); }
body { min-height: 100vh; overflow: hidden; }
body.embed-mode { height: 100vh; height: 100dvh; overflow: hidden; }
button, input { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.app-shell {
  width: 100%; height: 100vh; height: 100dvh; display: grid; grid-template-rows: 76px minmax(0, 1fr);
  background: radial-gradient(ellipse at 18% 0%, rgba(33, 90, 91, .13), transparent 34%), linear-gradient(135deg, #07131d 0%, #081722 52%, #07141e 100%);
  overflow: hidden;
}
.topbar { display: flex; align-items: center; justify-content: space-between; min-width: 0; padding: 0 28px; border-bottom: 1px solid var(--line); background: rgba(7, 19, 29, .88); position: relative; z-index: 2; }
.brand-lockup { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand-mark { width: 34px; height: 34px; border: 1px solid rgba(118, 226, 189, .3); border-radius: 11px; display: grid; grid-template-columns: repeat(3, 4px); grid-template-rows: repeat(3, 4px); gap: 3px; place-content: center; transform: rotate(30deg); background: rgba(118, 226, 189, .06); box-shadow: inset 0 0 18px rgba(118, 226, 189, .06); }
.brand-mark span { width: 4px; height: 4px; border-radius: 50%; background: var(--accent); opacity: .75; }
.brand-mark span:nth-child(2), .brand-mark span:nth-child(6) { opacity: .35; }
.brand-mark span:nth-child(4) { opacity: .5; }
.brand-mark span:nth-child(5) { width: 5px; height: 5px; opacity: 1; box-shadow: 0 0 8px var(--accent); }
.brand-copy { min-width: 0; }
.eyebrow, .section-kicker, .section-heading, .stage-meta, .stage-chip, .topbar-label, .seed-label, .readout-label, .meter-labels, .field-size, .legend, .inspector-footer, .time-readout span, .quality-button, .control-note { letter-spacing: .12em; text-transform: uppercase; }
.eyebrow { color: var(--accent); font-size: 9px; font-weight: 700; margin-bottom: 4px; }
h1 { font-size: 17px; line-height: 1.1; margin: 0; font-weight: 620; letter-spacing: -.025em; }
.topbar-right { display: flex; align-items: center; gap: 11px; color: var(--muted); font-size: 9px; white-space: nowrap; }
.live-dot, .chip-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent-glow); }
.topbar-label { font-weight: 650; font-size: 9px; }
.topbar-divider { height: 16px; width: 1px; background: var(--line-strong); margin: 0 4px; }
.seed-label { color: var(--dim); font-size: 8px; }
.seed-label strong { color: #b6d3ce; font-size: 10px; font-weight: 600; letter-spacing: .06em; margin-left: 5px; }
.seed-label em { font-size: 8px; color: var(--dim); font-style: normal; letter-spacing: .04em; text-transform: lowercase; margin-left: 3px; }
.workspace { min-height: 0; min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) 372px; grid-template-rows: minmax(0, 1fr) 66px; gap: 0; padding: 18px 18px 18px 22px; }
.stage { grid-column: 1; grid-row: 1; min-width: 0; min-height: 0; position: relative; overflow: hidden; border: 1px solid rgba(141, 188, 183, .16); border-radius: 16px 16px 0 0; background: #081823; isolation: isolate; animation: stageReveal 1.1s cubic-bezier(.2,.8,.2,1) both; }
@keyframes stageReveal { from { opacity: .35; filter: saturate(.72); } to { opacity: 1; filter: saturate(1); } }
#field { width: 100%; height: 100%; display: block; image-rendering: auto; }
.stage-vignette { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 50% 45%, transparent 40%, rgba(4, 13, 20, .26) 100%); z-index: 1; }
.stage-topline, .stage-bottomline { position: absolute; z-index: 2; left: 22px; right: 22px; display: flex; align-items: center; justify-content: space-between; pointer-events: none; }
.stage-topline { top: 20px; }
.stage-bottomline { bottom: 18px; }
.stage-chip { display: inline-flex; align-items: center; gap: 8px; border: 1px solid rgba(118, 226, 189, .2); border-radius: 999px; padding: 7px 11px; background: rgba(7, 19, 29, .65); color: #c8e6de; font-size: 8px; font-weight: 700; backdrop-filter: blur(10px); }
.stage-meta { color: rgba(190, 218, 213, .48); font-size: 8px; font-weight: 600; }
.stage-meta span { padding: 0 5px; color: var(--accent); }
.legend { display: flex; align-items: center; gap: 7px; font-size: 8px; color: rgba(193, 218, 211, .55); font-weight: 650; }
.legend-ramp { width: 62px; height: 5px; border-radius: 10px; background: linear-gradient(90deg, #0a1b28, #155c5b, #53b99a, #d3ffe1); box-shadow: 0 0 12px rgba(118, 226, 189, .12); }
.legend-note { margin-left: 7px; color: rgba(193, 218, 211, .34); font-size: 7px; }
.field-size { color: #d5e9e3; font-size: 10px; font-weight: 650; letter-spacing: .06em; }
.field-size span { color: rgba(193, 218, 211, .38); font-size: 7px; margin-left: 5px; }
.transport { grid-column: 1; grid-row: 2; min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 16px; border: 1px solid var(--line); border-top: 0; border-radius: 0 0 16px 16px; background: rgba(11, 27, 39, .94); }
.transport-left, .transport-right { display: flex; align-items: center; gap: 8px; min-width: 0; }
.primary-button, .icon-button, .quality-button, .screenshot-button { border: 1px solid var(--line-strong); border-radius: 9px; height: 36px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: rgba(17, 43, 55, .68); cursor: pointer; transition: border-color .18s ease, background .18s ease, transform .18s ease; }
.primary-button:hover, .icon-button:hover, .quality-button:hover, .screenshot-button:hover { border-color: rgba(118, 226, 189, .45); background: rgba(26, 65, 70, .75); }
.primary-button:active, .icon-button:active, .quality-button:active, .screenshot-button:active { transform: translateY(1px); }
.primary-button { min-width: 92px; padding: 0 12px; color: #09201e; border-color: transparent; background: var(--accent); font-size: 11px; font-weight: 750; }
.primary-button:hover { background: #9af0d0; border-color: transparent; }
.play-icon { font-size: 13px; line-height: 1; }
.icon-button { width: 36px; padding: 0; color: #b9d3ce; font-size: 15px; }
.transport-separator { height: 22px; width: 1px; background: var(--line-strong); margin: 0 5px; }
.time-readout { display: flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.time-readout span { color: var(--dim); font-size: 7px; font-weight: 700; }
.time-readout strong { color: #d8eae4; font-size: 13px; font-weight: 620; font-variant-numeric: tabular-nums; }
.time-readout em { color: var(--dim); font-size: 8px; font-style: normal; }
.quality-button { height: 32px; padding: 0 10px; color: var(--muted); font-size: 8px; font-weight: 700; letter-spacing: .09em; }
.quality-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 7px var(--accent-glow); }
.quality-button[aria-pressed="false"] .quality-dot { background: #6c8387; box-shadow: none; }
.screenshot-button { height: 32px; padding: 0 11px; color: #c7d9d4; font-size: 10px; font-weight: 600; }
.screenshot-button span { color: var(--accent); font-size: 14px; }
.inspector { grid-column: 2; grid-row: 1 / span 2; min-width: 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; margin-left: 14px; border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(180deg, rgba(13, 31, 43, .97), rgba(9, 24, 35, .97)); scrollbar-width: thin; scrollbar-color: rgba(118, 226, 189, .22) transparent; }
.inspector::-webkit-scrollbar { width: 6px; }
.inspector::-webkit-scrollbar-thumb { background: rgba(118, 226, 189, .2); border-radius: 10px; }
.inspector-section { padding: 17px 18px; border-bottom: 1px solid var(--line); }
.intro-section { padding-top: 19px; }
.section-kicker { color: var(--accent); font-size: 8px; font-weight: 750; margin-bottom: 9px; }
.intro-title-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
h2 { font-size: 15px; line-height: 1.2; margin: 0; font-weight: 650; letter-spacing: -.025em; }
.state-badge { flex: 0 0 auto; padding: 5px 8px; border-radius: 5px; font-size: 7px; font-weight: 800; letter-spacing: .12em; color: #b7c8c6; background: rgba(117, 151, 151, .13); border: 1px solid rgba(117, 151, 151, .2); }
.state-badge.pattern { color: var(--accent); background: var(--accent-soft); border-color: rgba(118, 226, 189, .24); }
.state-badge.near { color: var(--warn); background: rgba(229, 197, 139, .09); border-color: rgba(229, 197, 139, .22); }
.caption { margin: 9px 0 0; color: #91a9aa; font-size: 10px; line-height: 1.55; max-width: 48ch; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: #9cb5b2; font-size: 8px; font-weight: 750; }
.unit-tag { color: #587579; font-size: 7px; font-weight: 650; }
.readouts-section { padding-top: 15px; padding-bottom: 15px; }
.readout-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 11px; }
.readout-card { min-width: 0; min-height: 70px; padding: 10px 10px 8px; border: 1px solid rgba(151, 192, 187, .11); border-radius: 9px; background: rgba(15, 39, 51, .58); }
.readout-label { color: #68858a; font-size: 7px; font-weight: 750; letter-spacing: .09em; white-space: nowrap; }
.readout-value { margin-top: 7px; color: #e0f1ea; font-size: 22px; line-height: 1; font-weight: 620; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.readout-unit { margin-top: 5px; color: #617b7f; font-size: 8px; }
.margin-card .readout-value { color: var(--accent); }
.threshold-meter { margin-top: 14px; }
.meter-labels { display: flex; justify-content: space-between; color: #617a7d; font-size: 6px; font-weight: 750; }
.meter-track { position: relative; height: 5px; margin-top: 7px; border-radius: 8px; background: linear-gradient(90deg, rgba(111, 143, 144, .3), rgba(118, 226, 189, .2)); overflow: visible; }
.meter-fill { height: 100%; width: 25%; border-radius: inherit; background: linear-gradient(90deg, #367e78, var(--accent)); box-shadow: 0 0 9px rgba(118, 226, 189, .2); transition: width .22s ease; }
.meter-marker { position: absolute; top: -3px; left: 41.67%; width: 2px; height: 11px; border-radius: 2px; background: #d2e6dc; box-shadow: 0 0 5px rgba(210, 230, 220, .4); }
.threshold-foot { display: flex; justify-content: space-between; margin-top: 7px; color: #688186; font-size: 8px; }
.threshold-foot strong { color: #bcd5cd; font-weight: 650; font-variant-numeric: tabular-nums; }
.controls-section { padding-top: 16px; padding-bottom: 14px; }
.control-row { margin-top: 14px; }
.control-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.control-head label { color: #d4e4df; font-size: 10px; font-weight: 600; }
.symbol { color: #6f9190; font-size: 9px; font-weight: 500; margin-left: 4px; }
.control-head output { color: var(--accent); font-size: 11px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.control-head output small { color: #5e7c7c; font-size: 7px; font-weight: 600; margin-left: 2px; }
input[type="range"] { display: block; width: 100%; height: 17px; margin: 7px 0 0; background: transparent; cursor: pointer; appearance: none; -webkit-appearance: none; }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 10px; background: linear-gradient(90deg, rgba(118, 226, 189, .6), rgba(118, 226, 189, .14)); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 10px; background: linear-gradient(90deg, rgba(118, 226, 189, .6), rgba(118, 226, 189, .14)); }
input[type="range"]::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 12px; height: 12px; border: 2px solid #d9fff0; border-radius: 50%; margin-top: -4.5px; background: #4eaf91; box-shadow: 0 0 0 4px rgba(118, 226, 189, .1), 0 0 10px rgba(118, 226, 189, .35); }
input[type="range"]::-moz-range-thumb { width: 9px; height: 9px; border: 2px solid #d9fff0; border-radius: 50%; background: #4eaf91; box-shadow: 0 0 0 4px rgba(118, 226, 189, .1), 0 0 10px rgba(118, 226, 189, .35); }
.range-hints { display: flex; justify-content: space-between; color: #577176; font-size: 7px; margin-top: 2px; }
.last-control { margin-top: 13px; }
.control-note { margin: 12px 0 0; color: #5d787b; font-size: 7px; letter-spacing: .055em; line-height: 1.5; text-transform: none; }
.presets-section { padding-top: 15px; padding-bottom: 15px; }
.preset-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 11px; }
.preset-button { display: flex; align-items: center; gap: 8px; min-width: 0; padding: 9px 8px; border: 1px solid rgba(151, 192, 187, .12); border-radius: 9px; background: rgba(15, 39, 51, .45); text-align: left; cursor: pointer; transition: border-color .18s ease, background .18s ease; }
.preset-button:hover, .preset-button.active { border-color: rgba(118, 226, 189, .34); background: rgba(27, 68, 67, .26); }
.preset-swatch { flex: 0 0 auto; width: 29px; height: 29px; border-radius: 7px; border: 1px solid rgba(118, 226, 189, .1); background-color: #0a1d2a; }
.uniform-swatch { background-image: radial-gradient(circle at 35% 40%, rgba(118, 226, 189, .08), transparent 38%), linear-gradient(135deg, #0a1c28, #102a35); }
.pattern-swatch { background-image: radial-gradient(circle at 28% 30%, #9ceac7 0 12%, #267e70 20%, transparent 28%), radial-gradient(circle at 70% 68%, #9ceac7 0 12%, #267e70 20%, transparent 28%), linear-gradient(135deg, #0a1c28, #12333a); }
.preset-button strong { display: block; color: #d4e5df; font-size: 8px; font-weight: 700; white-space: nowrap; }
.preset-button small { display: block; color: #678185; font-size: 7px; margin-top: 4px; white-space: nowrap; }
.preset-arrow { margin-left: auto; color: #62827e; font-size: 11px; }
.check-section { padding-top: 14px; padding-bottom: 14px; }
.check-status { display: inline-flex; align-items: center; gap: 5px; color: #72c7a8; font-size: 7px; font-weight: 750; }
.check-status span { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 7px var(--accent-glow); }
.check-line { display: grid; grid-template-columns: 1fr 1px 1fr; align-items: center; gap: 14px; margin-top: 12px; }
.check-line > div:not(.check-divider) { display: flex; flex-direction: column; gap: 5px; }
.check-label { color: #71898b; font-size: 8px; }
.check-line strong { color: #d9eae4; font-size: 15px; font-weight: 650; font-variant-numeric: tabular-nums; }
.check-line strong small { color: #5c7779; font-size: 7px; font-weight: 500; }
.check-divider { width: 1px; height: 28px; background: var(--line-strong); }
.check-difference { margin-top: 10px; color: #728b8d; font-size: 8px; }
.check-difference strong { color: var(--accent); font-size: 9px; font-weight: 700; font-variant-numeric: tabular-nums; }
.check-difference span { color: #536e72; }
.science-panel { margin: 0; border-bottom: 1px solid var(--line); }
.science-panel summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 9px; padding: 15px 18px; color: #d0e1db; font-size: 10px; font-weight: 650; }
.science-panel summary::-webkit-details-marker { display: none; }
.science-icon { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; color: var(--accent); background: var(--accent-soft); font-size: 13px; }
.details-chevron { margin-left: auto; color: #76918e; font-size: 14px; transition: transform .18s ease; }
.science-panel[open] .details-chevron { transform: rotate(180deg); }
.science-content { padding: 0 18px 16px; color: #91a9a8; font-size: 9px; line-height: 1.6; }
.science-content h3 { margin: 12px 0 5px; color: #c9ddd5; font-size: 9px; font-weight: 700; letter-spacing: .02em; }
.science-content p { margin: 5px 0 8px; }
.equation-block { margin: 9px 0; padding: 10px 11px; border-left: 2px solid rgba(118, 226, 189, .55); border-radius: 0 7px 7px 0; background: rgba(18, 49, 58, .55); color: #d1ece0; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 9px; line-height: 1.9; overflow-wrap: anywhere; }
.science-citation { color: #7e9b98; font-style: italic; }
.disclaimer { color: #78928d; padding-top: 8px; border-top: 1px solid var(--line); font-size: 8px; }
.inspector-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding: 13px 18px 15px; color: #49666b; font-size: 6px; font-weight: 700; letter-spacing: .08em; }
@media (max-width: 1050px) and (min-width: 701px) {
  .workspace { grid-template-columns: minmax(0, 1fr) 340px; padding-left: 14px; padding-right: 14px; }
  .inspector { margin-left: 10px; }
  .topbar { padding: 0 18px; }
  .stage-topline, .stage-bottomline { left: 16px; right: 16px; }
}
@media (max-width: 700px) {
  html, body { overflow: hidden; }
  body.embed-mode { height: 100vh; height: 100dvh; overflow: hidden; }
  .app-shell { grid-template-rows: 62px minmax(0, 1fr); }
  .topbar { padding: 0 14px; }
  .brand-lockup { gap: 10px; }
  .brand-mark { width: 29px; height: 29px; border-radius: 9px; }
  .eyebrow { font-size: 7px; margin-bottom: 3px; }
  h1 { font-size: 14px; }
  .topbar-right { gap: 7px; }
  .topbar-label, .topbar-divider, .seed-label { display: none; }
  .workspace { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(245px, 40dvh) 54px minmax(0, 1fr); padding: 9px 9px 9px; gap: 0; }
  .stage { grid-column: 1; grid-row: 1; border-radius: 12px 12px 0 0; }
  .stage-topline { top: 12px; left: 12px; right: 12px; }
  .stage-bottomline { bottom: 11px; left: 12px; right: 12px; }
  .stage-chip { padding: 6px 8px; font-size: 7px; }
  .stage-meta { font-size: 6px; }
  .legend { gap: 5px; font-size: 6px; }
  .legend-ramp { width: 42px; height: 4px; }
  .legend-note { display: none; }
  .field-size { font-size: 8px; }
  .field-size span { font-size: 6px; }
  .transport { grid-column: 1; grid-row: 2; border-radius: 0 0 12px 12px; padding: 0 9px; gap: 6px; }
  .transport-left, .transport-right { gap: 5px; }
  .primary-button { min-width: 75px; height: 32px; padding: 0 8px; font-size: 10px; }
  .icon-button { width: 31px; height: 32px; font-size: 13px; }
  .transport-separator { margin: 0 2px; height: 18px; }
  .time-readout { gap: 4px; }
  .time-readout span { display: none; }
  .time-readout strong { font-size: 11px; }
  .time-readout em { font-size: 7px; }
  .quality-button { width: 43px; height: 30px; padding: 0 5px; font-size: 0; gap: 5px; }
  .quality-button::after { content: "HQ"; color: #91aaa5; font-size: 8px; font-weight: 750; letter-spacing: .03em; }
  .quality-button[aria-pressed="false"]::after { content: "LQ"; }
  .screenshot-button { height: 30px; padding: 0 8px; font-size: 9px; }
  .screenshot-button span { font-size: 12px; }
  .inspector { grid-column: 1; grid-row: 3; margin: 9px 0 0; border-radius: 12px; }
  .inspector-section { padding-left: 14px; padding-right: 14px; }
  .intro-section { padding-top: 15px; }
  h2 { font-size: 14px; }
  .caption { font-size: 9px; }
  .readout-card { min-height: 66px; }
  .readout-value { font-size: 20px; }
  .control-head label { font-size: 10px; }
  .preset-button { gap: 6px; padding: 8px 6px; }
  .preset-swatch { width: 25px; height: 25px; }
  .preset-button strong { font-size: 7px; }
  .preset-button small { font-size: 6px; }
  .inspector-footer { padding-left: 14px; padding-right: 14px; }
}
@media (max-width: 380px) {
  .topbar { padding: 0 10px; }
  .stage-meta { display: none; }
  .transport { padding: 0 6px; }
  .transport-left, .transport-right { gap: 4px; }
  .primary-button { min-width: 69px; }
  .icon-button { width: 29px; }
  .screenshot-button { padding: 0 6px; }
  .readout-card { padding-left: 8px; padding-right: 8px; }
  .readout-label { font-size: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .stage { animation: none; }
}
