:root {
  color-scheme: dark;
  --bg: #0b1116;
  --panel: #111b22;
  --panel-2: #14212a;
  --line: #263640;
  --line-soft: rgba(154, 181, 192, .12);
  --text: #edf4f5;
  --muted: #9aadb5;
  --faint: #70838c;
  --accent: #79e4d2;
  --accent-soft: rgba(121, 228, 210, .12);
  --brass: #c9954f;
  --radius: 16px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); }
body { min-width: 320px; }
button, input, select { font: inherit; }
button { color: inherit; }
.app { min-height: 100vh; display: flex; flex-direction: column; background: radial-gradient(ellipse at 28% -12%, rgba(44, 78, 84, .17), transparent 45%), var(--bg); }
.topbar { min-height: 72px; padding: 13px clamp(16px, 3vw, 40px); display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line-soft); background: rgba(11, 17, 22, .92); }
.brand-lockup { display: flex; align-items: center; gap: 14px; min-width: 0; }
.brand-mark { width: 36px; height: 36px; border: 1px solid rgba(121,228,210,.4); border-radius: 11px; display: flex; align-items: center; justify-content: center; gap: 3px; background: var(--accent-soft); flex: 0 0 auto; }
.brand-mark span { width: 3px; border-radius: 4px; background: var(--accent); display: block; }
.brand-mark span:nth-child(1) { height: 9px; opacity: .65; }
.brand-mark span:nth-child(2) { height: 18px; }
.brand-mark span:nth-child(3) { height: 12px; opacity: .8; }
.eyebrow, .section-kicker { color: var(--muted); font-size: 9px; font-weight: 800; letter-spacing: .16em; line-height: 1.3; }
.eyebrow .dot { display: inline-block; width: 4px; height: 4px; margin: 0 7px 2px; border-radius: 50%; background: var(--accent); }
h1 { font-size: clamp(17px, 1.65vw, 22px); margin: 3px 0 0; letter-spacing: -.035em; line-height: 1.15; font-weight: 690; }
.topbar-right { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.seed-chip, .quality-button { height: 32px; border: 1px solid var(--line); border-radius: 9px; display: inline-flex; align-items: center; gap: 8px; padding: 0 10px; color: var(--muted); background: #101a21; font-size: 9px; font-weight: 750; letter-spacing: .08em; }
.seed-chip b { color: var(--text); font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.seed-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px rgba(121,228,210,.7); }
.quality-button { color: var(--accent); cursor: pointer; border-color: rgba(121,228,210,.28); }
.quality-button:hover, .text-button:hover { background: var(--accent-soft); }
.workbench { width: min(100%, 1600px); margin: 0 auto; padding: 18px clamp(12px, 2.1vw, 30px) 14px; display: grid; grid-template-columns: minmax(0, 1.58fr) minmax(360px, .88fr); gap: 16px; flex: 1; min-height: 0; }
.visual-column { display: grid; grid-template-rows: minmax(350px, 1fr) 196px; gap: 14px; min-width: 0; min-height: 0; }
.hero-card, .response-card, .panel { border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(155deg, rgba(22, 35, 43, .97), rgba(14, 23, 29, .98)); box-shadow: 0 12px 34px rgba(0,0,0,.13); }
.hero-card { display: flex; flex-direction: column; overflow: hidden; min-height: 0; }
.stage-heading { padding: 15px 18px 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stage-title { margin-top: 4px; font-size: 15px; font-weight: 680; letter-spacing: -.02em; }
.live-indicator { display: flex; align-items: center; gap: 7px; color: var(--accent); font-size: 8px; font-weight: 800; letter-spacing: .12em; white-space: nowrap; }
.live-indicator span { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px var(--accent); animation: pulse 1.8s infinite; }
@keyframes pulse { 50% { opacity: .35; box-shadow: 0 0 2px var(--accent); } }
.stage { flex: 1; min-height: 220px; position: relative; overflow: hidden; background: #0b151b; }
#heroCanvas { display: block; width: 100%; height: 100%; }
.caption-row { min-height: 55px; display: flex; align-items: center; gap: 11px; padding: 10px 17px; border-top: 1px solid var(--line-soft); background: rgba(11, 18, 23, .55); }
.caption-icon { width: 25px; height: 25px; border-radius: 8px; flex: 0 0 auto; display: grid; place-items: center; color: var(--accent); background: var(--accent-soft); font-size: 15px; }
.caption-row p { color: #c0cfd3; font-size: 11px; line-height: 1.5; margin: 0; }
.response-card { padding: 13px 16px 9px; display: flex; flex-direction: column; min-height: 0; }
.card-heading, .panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.compact-heading { align-items: flex-start; }
.compact-heading .stage-title { font-size: 14px; }
.type-tag { color: var(--faint); font-size: 8px; font-weight: 800; letter-spacing: .11em; margin-left: 7px; white-space: nowrap; }
.graph-legend { display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 9px; white-space: nowrap; margin-top: 7px; }
.legend-line { width: 18px; height: 2px; background: var(--accent); box-shadow: 0 0 7px rgba(121,228,210,.45); }
#responseCanvas { display: block; width: 100%; flex: 1; min-height: 85px; margin-top: 4px; }
.graph-foot { display: flex; justify-content: space-between; color: var(--faint); font-size: 7px; font-weight: 800; letter-spacing: .12em; padding: 2px 3px 0; }
.control-column { min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 12px; overflow: auto; scrollbar-width: thin; scrollbar-color: #34454e transparent; padding-right: 2px; }
.panel { padding: 15px 16px; }
.controls-panel { padding-bottom: 13px; }
.panel-heading h2 { font-size: 15px; letter-spacing: -.025em; margin: 4px 0 0; font-weight: 680; }
.text-button { border: 1px solid var(--line); border-radius: 8px; background: #101a21; padding: 7px 9px; color: var(--muted); font-size: 8px; letter-spacing: .1em; font-weight: 800; cursor: pointer; }
.preset-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 13px 0 14px; }
.preset-button { min-height: 36px; border: 1px solid var(--line); border-radius: 8px; padding: 6px 7px; color: #aabac0; background: #0e171d; font-size: 9px; line-height: 1.15; font-weight: 700; cursor: pointer; text-align: left; transition: border-color .15s, background .15s, color .15s; }
.preset-button:hover { border-color: rgba(121,228,210,.45); color: var(--text); }
.preset-button.active { color: var(--accent); border-color: rgba(121,228,210,.5); background: var(--accent-soft); }
.control-group { min-width: 0; margin-bottom: 12px; }
.control-label { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 7px; }
.control-label label { color: #dce6e8; font-size: 10px; font-weight: 650; }
.control-label output { color: var(--accent); font-size: 10px; font-weight: 750; font-variant-numeric: tabular-nums; white-space: nowrap; }
input[type="range"] { display: block; width: 100%; height: 13px; margin: 0; accent-color: var(--accent); cursor: pointer; background: transparent; }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; background: #34454e; border-radius: 10px; }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 12px; height: 12px; margin-top: -4.5px; border-radius: 50%; background: var(--accent); border: 2px solid #0d171c; box-shadow: 0 0 0 1px var(--accent); }
input[type="range"]::-moz-range-track { height: 3px; background: #34454e; border-radius: 10px; }
input[type="range"]::-moz-range-thumb { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); border: 2px solid #0d171c; }
.range-ends { display: flex; justify-content: space-between; gap: 5px; color: var(--faint); font-size: 8px; margin-top: 3px; }
.range-ends em { color: #627780; font-style: normal; font-size: 7px; font-weight: 800; letter-spacing: .08em; white-space: nowrap; }
.control-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 14px; }
.full-width { grid-column: 1 / -1; }
select { width: 100%; height: 29px; padding: 0 9px; border: 1px solid #33444d; border-radius: 7px; color: var(--text); background: #0c151b; font-size: 10px; }
select:focus, input:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#dentControl.disabled { opacity: .38; }
#dentControl.disabled input { pointer-events: none; }
.transport-row { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 7px; margin-top: 2px; }
.transport-button { height: 34px; border: 1px solid var(--line); border-radius: 8px; background: #0d171d; color: #b8c6ca; font-size: 8px; font-weight: 850; letter-spacing: .1em; cursor: pointer; }
.transport-button:hover { border-color: rgba(121,228,210,.45); color: var(--text); }
.transport-button.primary { border-color: rgba(121,228,210,.5); color: var(--accent); background: var(--accent-soft); display: flex; align-items: center; justify-content: center; gap: 8px; }
.play-glyph { font-size: 11px; }
.readout-panel { padding-bottom: 13px; }
.slim-heading h2 { font-size: 14px; }
.check-status { border: 1px solid rgba(121,228,210,.28); border-radius: 20px; padding: 4px 8px; color: var(--accent); font-size: 7px; font-weight: 850; letter-spacing: .12em; }
.readout-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 13px; }
.readout { border: 1px solid var(--line-soft); border-radius: 10px; padding: 10px 10px 9px; background: rgba(8, 15, 19, .36); min-width: 0; }
.readout span { display: block; color: var(--muted); font-size: 9px; line-height: 1.25; }
.readout strong { display: block; color: var(--text); font-size: 20px; font-weight: 680; letter-spacing: -.04em; margin-top: 5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.readout small { display: block; color: var(--faint); font-size: 8px; margin-top: 3px; line-height: 1.3; }
.checks-panel { padding-bottom: 11px; }
.check-list { display: grid; gap: 7px; margin-top: 12px; }
.check-item { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 8px; border-bottom: 1px solid rgba(154,181,192,.08); padding-bottom: 6px; }
.check-item:last-child { border-bottom: 0; padding-bottom: 0; }
.check-name { display: block; color: #c8d5d8; font-size: 9px; font-weight: 650; }
.check-kind { display: block; color: var(--faint); font-size: 7px; margin-top: 2px; letter-spacing: .08em; }
.check-value { color: var(--accent); font-size: 9px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.experiment-copy { color: var(--muted); font-size: 10px; line-height: 1.5; margin: 10px 0; }
.experiment-button { width: 100%; height: 34px; border: 1px solid rgba(121,228,210,.42); border-radius: 8px; background: var(--accent-soft); color: var(--accent); font-size: 8px; font-weight: 850; letter-spacing: .1em; cursor: pointer; display: flex; justify-content: space-between; align-items: center; padding: 0 11px; }
.experiment-button:hover { background: rgba(121,228,210,.2); }
.experiment-result { margin-top: 9px; padding: 9px 10px; border-radius: 8px; background: rgba(8,15,19,.45); color: #b7c7cb; font-size: 9px; line-height: 1.5; }
.science-panel { padding: 0; overflow: hidden; }
.science-panel summary { list-style: none; padding: 13px 16px; display: flex; align-items: center; justify-content: space-between; cursor: pointer; }
.science-panel summary::-webkit-details-marker { display: none; }
.science-panel summary b { display: block; font-size: 14px; margin-top: 4px; }
.chevron { color: var(--accent); font-size: 18px; transition: transform .2s; }
.science-panel[open] .chevron { transform: rotate(180deg); }
.science-content { border-top: 1px solid var(--line-soft); padding: 13px 16px 16px; }
.science-content h3 { margin: 11px 0 5px; color: #dce8e9; font-size: 11px; }
.science-content h3:first-child { margin-top: 0; }
.science-content p { color: var(--muted); font-size: 10px; line-height: 1.62; margin: 0 0 8px; }
.science-content i { color: #dce8e9; }
.not-affiliated { color: #8ea1a8 !important; font-style: italic; }
.footer { padding: 0 clamp(16px, 3vw, 40px) 10px; display: flex; justify-content: space-between; gap: 10px; color: #536770; font-size: 7px; font-weight: 800; letter-spacing: .13em; }
body.embed-mode { height: 100vh; height: 100dvh; overflow: hidden; }
body.embed-mode .app { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
body.embed-mode .topbar, body.embed-mode .footer { display: none; }
body.embed-mode .workbench { height: 100%; min-height: 0; padding-top: 10px; padding-bottom: 10px; }
body.embed-mode .control-column { overscroll-behavior: contain; }
@media (max-width: 980px) {
  .workbench { grid-template-columns: minmax(0, 1.35fr) minmax(320px, .9fr); gap: 12px; padding-left: 12px; padding-right: 12px; }
  .visual-column { grid-template-rows: minmax(330px, 1fr) 180px; }
  .panel { padding-left: 13px; padding-right: 13px; }
  .control-grid { column-gap: 10px; }
}
@media (max-width: 760px) {
  .topbar { min-height: 64px; padding: 10px 13px; }
  .brand-mark { width: 31px; height: 31px; }
  .eyebrow { font-size: 7px; }
  h1 { font-size: 16px; }
  .seed-chip { display: none; }
  .workbench { display: flex; flex-direction: column; padding: 10px 10px 16px; gap: 10px; }
  .visual-column { display: contents; }
  .hero-card { order: 0; min-height: 345px; }
  .stage { min-height: 230px; }
  .response-card { order: 1; height: 190px; }
  .control-column { order: 2; overflow: visible; display: flex; }
  .controls-panel { order: 0; }
  .readout-panel { order: 1; }
  .checks-panel { order: 2; }
  .experiment-panel { order: 3; }
  .science-panel { order: 4; }
  .footer { padding: 0 12px 10px; font-size: 6px; }
  body.embed-mode .workbench { display: block; overflow-y: auto; overscroll-behavior: contain; }
  body.embed-mode .hero-card { height: 330px; min-height: 330px; margin-bottom: 10px; }
  body.embed-mode .response-card { height: 180px; margin-bottom: 10px; }
  body.embed-mode .control-column { overflow: visible; }
}
@media (max-width: 390px) {
  .topbar-right { gap: 5px; }
  .quality-button { padding: 0 7px; font-size: 8px; }
  .stage-heading { padding-left: 13px; padding-right: 13px; }
  .stage-title { font-size: 14px; }
  .live-indicator { font-size: 7px; }
  .panel { padding-left: 12px; padding-right: 12px; }
  .preset-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .readout strong { font-size: 18px; }
  .range-ends { font-size: 7px; }
  .range-ends em { font-size: 6px; }
}
@media (min-width: 761px) {
  html, body { height: 100%; overflow: hidden; }
  .app { height: 100vh; min-height: 0; overflow: hidden; }
  .workbench { flex: 1 1 auto; min-height: 0; }
  .visual-column, .control-column { height: 100%; min-height: 0; }
}
@media (max-width: 760px) {
  html, body { height: auto; overflow-x: hidden; overflow-y: auto; }
  .app { height: auto; min-height: 100vh; overflow: visible; }
}
