:root {
  color-scheme: dark;
  --bg: #0b1115;
  --panel: #111b20;
  --panel-2: #142128;
  --line: #26363e;
  --muted: #8fa1a8;
  --text: #e9f0ed;
  --soft: #bdcbc6;
  --accent: #c7f36b;
  --accent-dim: rgba(199, 243, 107, .15);
  --accent-line: rgba(199, 243, 107, .38);
  --radius: 16px;
  --grid: 8px;
}
* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; min-height: 100%; background: var(--bg); color: var(--text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
body { overflow: hidden; }
button, input { font: inherit; }
button { color: inherit; }
.app-shell { height: 100vh; height: 100dvh; min-height: 0; display: flex; flex-direction: column; overflow: hidden; background: radial-gradient(ellipse at 18% 8%, rgba(50, 76, 73, .15), transparent 40%), var(--bg); }
.topbar { flex: 0 0 68px; display: flex; align-items: center; justify-content: space-between; padding: 0 24px; border-bottom: 1px solid rgba(128, 157, 162, .13); background: rgba(11, 17, 21, .94); z-index: 2; }
.brand-lockup { display: flex; align-items: center; gap: 13px; }
.brand-mark { width: 30px; height: 30px; border: 1px solid var(--accent-line); border-radius: 9px; display: flex; align-items: center; justify-content: center; gap: 2px; transform: rotate(-8deg); background: var(--accent-dim); }
.brand-mark span { display: block; width: 3px; border-radius: 5px; background: var(--accent); transform: skewY(-25deg); }
.brand-mark span:nth-child(1) { height: 10px; opacity: .55; }
.brand-mark span:nth-child(2) { height: 17px; }
.brand-mark span:nth-child(3) { height: 12px; opacity: .75; }
.eyebrow { color: #8fa5a7; font-size: 9px; letter-spacing: .18em; font-weight: 750; line-height: 1.3; }
h1 { margin: 3px 0 0; font-size: 17px; line-height: 1; letter-spacing: -.035em; font-weight: 720; }
h1 span { color: #91a6a4; font-weight: 480; }
.topbar-right { display: flex; align-items: center; gap: 20px; }
.model-tag { display: flex; align-items: center; gap: 7px; color: #9eada9; font-size: 9px; letter-spacing: .13em; font-weight: 700; }
.model-tag i { width: 6px; height: 6px; display: inline-block; background: var(--accent); border-radius: 50%; box-shadow: 0 0 12px rgba(199, 243, 107, .65); }
.icon-button { border: 1px solid var(--line); border-radius: 9px; padding: 8px 11px; background: #121d22; display: flex; align-items: center; gap: 7px; color: #d7e2dd; font-size: 11px; cursor: pointer; transition: border-color .2s, background .2s, transform .2s; }
.icon-button:hover { border-color: var(--accent-line); background: #19272b; transform: translateY(-1px); }
.icon-button svg { width: 15px; height: 15px; fill: none; stroke: var(--accent); stroke-width: 1.5; }
.workspace { min-height: 0; flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 376px; gap: 16px; padding: 16px; overflow: hidden; }
.stage-column { min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 12px; }
.stage-card { min-height: 0; flex: 1; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: linear-gradient(145deg, rgba(22, 36, 40, .96), rgba(12, 21, 25, .98)); box-shadow: 0 18px 55px rgba(0,0,0,.18); }
.stage-head { flex: 0 0 58px; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; border-bottom: 1px solid rgba(134, 162, 163, .12); }
.stage-title { margin-top: 4px; font-size: 13px; font-weight: 640; letter-spacing: -.01em; }
.state-pill { display: inline-flex; align-items: center; gap: 7px; padding: 6px 9px; border-radius: 999px; border: 1px solid var(--accent-line); background: var(--accent-dim); color: var(--accent); font-size: 9px; font-weight: 800; letter-spacing: .12em; }
.state-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 9px rgba(199,243,107,.6); }
.canvas-wrap { position: relative; min-height: 0; flex: 1; background: radial-gradient(ellipse at 50% 48%, #17272b 0%, #101b20 58%, #0d171b 100%); overflow: hidden; }
#simCanvas { width: 100%; height: 100%; display: block; }
.canvas-corner { position: absolute; top: 14px; color: #81959a; font-size: 8px; letter-spacing: .16em; font-weight: 750; pointer-events: none; }
.corner-left { left: 17px; display: flex; align-items: center; gap: 7px; }
.corner-dot { display: inline-block; width: 5px; height: 5px; border: 1px solid var(--accent); border-radius: 50%; }
.corner-right { right: 18px; color: #b6c6bd; }
.head-arrow { color: var(--accent); font-size: 12px; margin-left: 4px; }
.canvas-legend { position: absolute; left: 16px; bottom: 14px; display: flex; gap: 14px; color: #9aaba8; font-size: 9px; pointer-events: none; }
.canvas-legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend-contact, .legend-lift { display: inline-block; width: 13px; height: 4px; border-radius: 4px; }
.legend-contact { background: var(--accent); box-shadow: 0 0 8px rgba(199,243,107,.45); }
.legend-lift { background: #53676c; }
.stage-caption { flex: 0 0 48px; display: flex; align-items: center; gap: 10px; padding: 0 18px; border-top: 1px solid rgba(134, 162, 163, .12); background: rgba(13, 22, 26, .65); }
.caption-mark { width: 22px; height: 22px; flex: 0 0 22px; display: grid; place-items: center; border-radius: 7px; color: var(--accent); background: var(--accent-dim); font-size: 14px; }
.stage-caption p { margin: 0; color: #b8c7c1; font-size: 11px; line-height: 1.4; }
.readouts { flex: 0 0 104px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.readout-card { min-width: 0; padding: 13px 14px 10px; border: 1px solid var(--line); border-radius: 12px; background: linear-gradient(140deg, #142127, #10191e); }
.readout-label { display: flex; align-items: center; justify-content: space-between; gap: 4px; color: #8fa3a3; font-size: 8px; letter-spacing: .12em; font-weight: 800; white-space: nowrap; }
.readout-label span { color: #667c7e; font-size: 7px; letter-spacing: .08em; }
.readout-value { margin-top: 8px; font-size: clamp(19px, 2vw, 25px); font-weight: 680; letter-spacing: -.045em; font-variant-numeric: tabular-nums; color: #eef5ef; white-space: nowrap; }
.readout-value small { font-size: 10px; color: #a3b4ae; font-weight: 600; letter-spacing: 0; margin-left: 3px; }
.readout-note { margin-top: 3px; color: #788c8d; font-size: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.readout-check .readout-value { color: var(--accent); }
.control-panel { min-height: 0; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #304249 transparent; padding: 18px 17px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(160deg, #142127, #10191e 72%); }
.control-panel::-webkit-scrollbar { width: 5px; }
.control-panel::-webkit-scrollbar-thumb { background: #304249; border-radius: 10px; }
.panel-intro { padding: 1px 2px 15px; border-bottom: 1px solid rgba(134, 162, 163, .13); }
.panel-intro h2 { margin: 7px 0 6px; font-size: 22px; line-height: 1.08; letter-spacing: -.045em; font-weight: 680; }
.panel-intro p { margin: 0; color: #95a8a6; font-size: 10px; line-height: 1.5; max-width: 290px; }
.preset-block, .controls-block { padding: 15px 0 14px; border-bottom: 1px solid rgba(134, 162, 163, .13); }
.section-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; color: #9fb0ad; font-size: 8px; font-weight: 800; letter-spacing: .15em; }
.section-meta { color: #62797b; font-size: 7px; letter-spacing: .1em; }
.preset-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.preset-btn { min-width: 0; display: flex; align-items: center; gap: 8px; text-align: left; border: 1px solid #2b3d43; border-radius: 10px; background: #111d22; padding: 9px 8px; cursor: pointer; transition: .2s ease; }
.preset-btn:hover { border-color: #607b72; background: #18272b; }
.preset-btn.active { border-color: var(--accent-line); background: linear-gradient(135deg, rgba(199,243,107,.11), rgba(199,243,107,.035)); box-shadow: inset 0 0 0 1px rgba(199,243,107,.04); }
.preset-icon { flex: 0 0 25px; width: 25px; height: 25px; display: grid; place-items: center; border-radius: 7px; background: #26383a; color: #d3e2d6; font-size: 17px; }
.preset-btn.active .preset-icon { background: var(--accent-dim); color: var(--accent); }
.preset-btn b { display: block; font-size: 9px; line-height: 1.25; font-weight: 700; white-space: nowrap; }
.preset-btn small { display: block; margin-top: 3px; color: #829694; font-size: 7px; line-height: 1.2; white-space: nowrap; }
.controls-block { padding-bottom: 12px; }
.control-row { margin-top: 12px; }
.control-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.control-top label { color: #d0dcd6; font-size: 10px; font-weight: 560; }
.control-top output { color: var(--accent); font-size: 10px; font-weight: 720; font-variant-numeric: tabular-nums; }
input[type="range"] { display: block; width: 100%; height: 15px; margin: 5px 0 1px; background: transparent; cursor: pointer; accent-color: var(--accent); }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 4px; background: linear-gradient(90deg, rgba(199,243,107,.68), #33464a); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 4px; background: linear-gradient(90deg, rgba(199,243,107,.68), #33464a); }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 12px; height: 12px; margin-top: -4.5px; border: 2px solid #0f181c; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px rgba(199,243,107,.18); }
input[type="range"]::-moz-range-thumb { width: 9px; height: 9px; border: 2px solid #0f181c; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px rgba(199,243,107,.18); }
input[type="range"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
.range-ends { display: flex; justify-content: space-between; color: #657a7c; font-size: 7px; letter-spacing: .02em; }
.transport-block { padding: 13px 0 11px; border-bottom: 1px solid rgba(134, 162, 163, .13); }
.transport-main { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 7px; }
.play-button, .transport-button { min-height: 34px; display: flex; align-items: center; justify-content: center; gap: 7px; border-radius: 8px; cursor: pointer; transition: .2s ease; }
.play-button { border: 1px solid var(--accent); color: #152015; background: var(--accent); font-size: 10px; font-weight: 800; }
.play-button:hover { filter: brightness(1.08); transform: translateY(-1px); }
.play-button span:first-child { font-size: 12px; }
.transport-button { border: 1px solid #30434a; color: #b7c6c1; background: #152329; font-size: 8px; letter-spacing: .08em; font-weight: 750; }
.transport-button b { color: var(--accent); font-size: 13px; }
.transport-button:hover { border-color: #789187; background: #1b2c31; }
.transport-bottom { margin-top: 10px; display: flex; align-items: center; justify-content: space-between; }
.time-readout { color: #718789; font-size: 7px; letter-spacing: .12em; font-weight: 750; }
.time-readout b { color: #c7d3ce; margin-left: 5px; font-size: 9px; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.quality-switch { display: inline-flex; padding: 2px; border: 1px solid #2c3e43; border-radius: 7px; background: #0e181c; }
.quality-switch button { border: 0; border-radius: 5px; padding: 4px 8px; color: #728789; background: transparent; font-size: 7px; font-weight: 800; letter-spacing: .1em; cursor: pointer; }
.quality-switch button[aria-pressed="true"] { color: #152015; background: var(--accent); }
.science-panel { margin-top: 12px; border: 1px solid #293c42; border-radius: 10px; background: rgba(10, 18, 22, .5); }
.science-panel summary { display: flex; justify-content: space-between; align-items: center; padding: 11px 12px; list-style: none; color: #b9c8c2; font-size: 8px; font-weight: 800; letter-spacing: .15em; cursor: pointer; }
.science-panel summary::-webkit-details-marker { display: none; }
.summary-plus { color: var(--accent); font-size: 15px; font-weight: 400; transition: transform .2s; }
.science-panel[open] .summary-plus { transform: rotate(45deg); }
.science-content { padding: 0 12px 13px; color: #93a6a2; font-size: 9px; line-height: 1.55; }
.science-content h3 { margin: 12px 0 4px; color: #dce7e0; font-size: 10px; letter-spacing: .01em; }
.science-content p { margin: 5px 0; }
.science-content b { color: #c5d3cc; }
.equation { margin: 7px 0; padding: 8px 9px; border-left: 2px solid var(--accent); border-radius: 0 6px 6px 0; background: rgba(199,243,107,.055); color: #d7e4d5; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 9px; overflow-wrap: anywhere; }
.disclaimer { margin-top: 10px !important; padding-top: 8px; border-top: 1px solid #293b40; color: #b3c1ba; font-style: italic; }
button:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
body.embed-mode { height: 100vh; height: 100dvh; overflow: hidden; }
@media (max-width: 1050px) and (min-width: 701px) {
  .workspace { grid-template-columns: minmax(0, 1fr) 340px; gap: 10px; padding: 10px; }
  .control-panel { padding: 15px 13px; }
  .readout-card { padding: 11px 10px 8px; }
  .readout-note { font-size: 7px; }
}
@media (max-width: 700px) {
  body { overflow: hidden; }
  .topbar { flex-basis: 58px; padding: 0 13px; }
  .brand-mark { width: 27px; height: 27px; }
  .eyebrow { font-size: 8px; }
  h1 { font-size: 15px; }
  .topbar-right { gap: 9px; }
  .model-tag { font-size: 7px; letter-spacing: .08em; }
  .icon-button { padding: 7px; }
  .icon-button span { display: none; }
  .workspace { display: flex; flex-direction: column; gap: 9px; padding: 9px; overflow: hidden; }
  .stage-column { flex: 0 0 45%; min-height: 275px; gap: 7px; }
  .stage-card { min-height: 0; }
  .stage-head { flex-basis: 48px; padding: 0 13px; }
  .stage-title { font-size: 11px; }
  .state-pill { font-size: 7px; padding: 5px 7px; }
  .canvas-corner { top: 10px; font-size: 7px; }
  .corner-left { left: 11px; }
  .corner-right { right: 11px; }
  .canvas-legend { left: 11px; bottom: 9px; gap: 10px; font-size: 8px; }
  .stage-caption { flex-basis: 39px; padding: 0 11px; gap: 8px; }
  .caption-mark { width: 19px; height: 19px; flex-basis: 19px; }
  .stage-caption p { font-size: 9px; }
  .readouts { flex-basis: 70px; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
  .readout-card { padding: 8px 6px 6px; border-radius: 9px; }
  .readout-label { font-size: 6px; letter-spacing: .07em; }
  .readout-label span { display: none; }
  .readout-value { margin-top: 6px; font-size: clamp(14px, 4.2vw, 18px); }
  .readout-value small { font-size: 8px; margin-left: 1px; }
  .readout-note { display: none; }
  .control-panel { flex: 1 1 auto; min-height: 0; padding: 13px 13px 18px; border-radius: 13px; }
  .panel-intro { padding-bottom: 10px; }
  .panel-intro h2 { font-size: 18px; margin: 5px 0 4px; }
  .panel-intro p { font-size: 9px; }
  .preset-block, .controls-block { padding: 11px 0 10px; }
  .preset-buttons { gap: 6px; }
  .preset-btn { padding: 7px 6px; gap: 6px; }
  .preset-icon { flex-basis: 22px; width: 22px; height: 22px; font-size: 15px; }
  .preset-btn b { font-size: 8px; }
  .preset-btn small { font-size: 6px; }
  .control-row { margin-top: 10px; }
  .control-top label, .control-top output { font-size: 9px; }
  .range-ends { font-size: 6px; }
  input[type="range"] { height: 14px; margin: 4px 0 1px; }
  .transport-block { padding: 10px 0; }
  .play-button, .transport-button { min-height: 32px; }
  .science-panel { margin-top: 9px; }
}
@media (max-height: 700px) and (min-width: 701px) {
  .workspace { padding: 10px; }
  .panel-intro { padding-bottom: 9px; }
  .panel-intro h2 { font-size: 19px; }
  .preset-block, .controls-block { padding: 10px 0; }
  .control-row { margin-top: 8px; }
  .readouts { flex-basis: 88px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
