:root {
  color-scheme: dark;
  --bg: #07101d;
  --panel: #0c1727;
  --panel-2: #101d30;
  --line: rgba(154, 183, 218, .13);
  --line-strong: rgba(154, 183, 218, .22);
  --text: #eaf2ff;
  --muted: #8fa2bb;
  --faint: #5f7189;
  --cyan: #62e3e3;
  --cyan-2: #2caebd;
  --violet: #a28bff;
  --amber: #f1b779;
  --radius: 14px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; background: var(--bg); color: var(--text); }
body { overflow: hidden; }
body.embed-mode { height: 100vh; height: 100dvh; overflow: hidden; }
button, input { font: inherit; }
button { color: inherit; }
.app { height: 100%; min-height: 0; display: flex; flex-direction: column; overflow: hidden; background: radial-gradient(ellipse at 25% 0%, rgba(33, 73, 108, .18), transparent 44%), var(--bg); }
.topbar { height: 66px; flex: 0 0 66px; display: flex; align-items: center; gap: 14px; padding: 0 22px; border-bottom: 1px solid var(--line); background: rgba(7, 16, 29, .9); position: relative; z-index: 2; }
.brand-mark { width: 30px; height: 30px; border: 1px solid rgba(98, 227, 227, .5); border-radius: 50%; display: flex; align-items: center; justify-content: center; gap: 3px; transform: rotate(-28deg); box-shadow: 0 0 22px rgba(98, 227, 227, .1); flex: 0 0 auto; }
.brand-mark span { width: 3px; border-radius: 3px; background: var(--cyan); display: block; }
.brand-mark span:nth-child(1) { height: 8px; opacity: .45; }
.brand-mark span:nth-child(2) { height: 15px; }
.brand-mark span:nth-child(3) { height: 8px; opacity: .7; }
.brand-copy { min-width: 0; }
.eyebrow { color: #7e9bb8; font-size: 9px; font-weight: 750; letter-spacing: .17em; margin-bottom: 4px; }
h1 { margin: 0; font-size: 15px; line-height: 1.15; letter-spacing: -.02em; font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
h1 span { color: var(--cyan); padding: 0 3px; }
.header-tag { margin-left: auto; color: #91a9c2; font-size: 9px; font-weight: 700; letter-spacing: .12em; border: 1px solid var(--line-strong); border-radius: 999px; padding: 7px 10px; white-space: nowrap; }
.header-tag i, .live-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 10px rgba(98, 227, 227, .65); margin-right: 6px; vertical-align: 1px; }
.workspace { flex: 1 1 auto; min-height: 0; display: flex; gap: 0; overflow: hidden; }
.stage-shell { flex: 1 1 auto; min-width: 0; min-height: 0; display: flex; flex-direction: column; padding: 14px 16px 10px 20px; background: linear-gradient(135deg, rgba(12, 27, 44, .35), rgba(8, 17, 30, .1)); }
.stage-topline { height: 25px; flex: 0 0 25px; display: flex; justify-content: space-between; align-items: flex-start; padding: 0 5px; }
.stage-kicker { color: #b8c9de; font-size: 9px; font-weight: 750; letter-spacing: .15em; }
.stage-hint { color: #647992; font-size: 10px; }
.canvas-wrap { position: relative; flex: 1 1 auto; min-height: 0; border: 1px solid rgba(131, 170, 208, .12); border-radius: 16px; overflow: hidden; background: radial-gradient(ellipse at 50% 42%, rgba(21, 47, 71, .4), rgba(8, 17, 29, .88) 75%); box-shadow: inset 0 1px 0 rgba(255,255,255,.025), 0 16px 45px rgba(0,0,0,.14); }
canvas { display: block; width: 100%; height: 100%; outline: none; }
.stage-bottomline { height: 25px; flex: 0 0 25px; display: flex; align-items: flex-end; gap: 18px; padding: 0 5px; color: #7e91a9; font-size: 9px; }
.legend-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 5px; vertical-align: 1px; }
.legend-dot.cyan { background: var(--cyan); box-shadow: 0 0 8px rgba(98,227,227,.7); }
.legend-dot.violet { background: var(--violet); }
.bottom-note { margin-left: auto; color: #61738a; }
.controls-panel { width: 330px; flex: 0 0 330px; min-height: 0; border-left: 1px solid var(--line); background: linear-gradient(180deg, rgba(12, 23, 39, .96), rgba(8, 17, 29, .98)); }
.panel-scroll { height: 100%; overflow-y: auto; overscroll-behavior: contain; padding: 15px 15px 20px; scrollbar-width: thin; scrollbar-color: #31465d transparent; }
.panel-scroll::-webkit-scrollbar { width: 6px; }
.panel-scroll::-webkit-scrollbar-thumb { background: #31465d; border-radius: 8px; }
.control-section { padding: 0 0 15px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.section-head { display: flex; align-items: center; justify-content: space-between; color: #9aadc3; font-size: 9px; letter-spacing: .14em; font-weight: 800; margin-bottom: 11px; }
.tiny-label { color: #637c97; font-size: 8px; letter-spacing: .12em; }
.preset-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.preset-btn { display: flex; align-items: center; gap: 8px; text-align: left; min-width: 0; border: 1px solid var(--line-strong); border-radius: 10px; padding: 9px 8px; background: rgba(17, 32, 51, .75); cursor: pointer; transition: border-color .18s ease, background .18s ease, transform .18s ease; }
.preset-btn:hover { border-color: rgba(98, 227, 227, .45); background: rgba(24, 48, 68, .9); }
.preset-btn:active { transform: translateY(1px); }
.preset-btn.active { border-color: rgba(98, 227, 227, .55); background: linear-gradient(135deg, rgba(36, 98, 109, .27), rgba(20, 40, 62, .86)); box-shadow: inset 0 0 0 1px rgba(98, 227, 227, .08); }
.preset-icon { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; flex: 0 0 auto; font-size: 15px; font-weight: 750; }
.free-icon { color: #9cb4ce; background: rgba(129, 160, 193, .12); }
.lock-icon { color: var(--cyan); background: rgba(98, 227, 227, .12); }
.preset-btn strong { display: block; font-size: 10px; font-weight: 700; color: #e3edf8; white-space: nowrap; }
.preset-btn small { display: block; margin-top: 3px; font-size: 8px; color: #8194ac; white-space: nowrap; }
.slider-block { margin: 0 0 14px; }
.slider-block:last-child { margin-bottom: 0; }
.slider-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.slider-head label { color: #d2dfed; font-size: 11px; font-weight: 600; }
.slider-head em { color: var(--cyan); font-style: italic; }
.slider-head output { color: var(--cyan); font-size: 10px; font-variant-numeric: tabular-nums; font-weight: 700; background: rgba(98, 227, 227, .08); border: 1px solid rgba(98, 227, 227, .14); border-radius: 6px; padding: 3px 6px; min-width: 42px; text-align: center; }
input[type="range"] { width: 100%; display: block; margin: 0; appearance: none; height: 4px; border-radius: 99px; background: linear-gradient(90deg, rgba(98,227,227,.82), rgba(98,227,227,.18)); outline: none; cursor: pointer; }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 13px; height: 13px; border-radius: 50%; background: #d9ffff; border: 3px solid #2baebb; box-shadow: 0 0 0 3px rgba(98, 227, 227, .12), 0 0 12px rgba(98, 227, 227, .4); }
input[type="range"]::-moz-range-thumb { width: 9px; height: 9px; border-radius: 50%; background: #d9ffff; border: 3px solid #2baebb; box-shadow: 0 0 0 3px rgba(98, 227, 227, .12); }
input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px rgba(98,227,227,.28); }
.range-ends { display: flex; justify-content: space-between; color: #63768d; font-size: 8px; margin-top: 7px; }
.readout-section { padding-bottom: 13px; }
.readout-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.readout-card { min-width: 0; padding: 9px 9px 8px; border: 1px solid rgba(148, 177, 208, .12); border-radius: 9px; background: rgba(16, 31, 49, .75); }
.primary-readout { grid-column: span 2; background: linear-gradient(110deg, rgba(25, 67, 78, .42), rgba(16, 31, 49, .82)); border-color: rgba(98, 227, 227, .2); }
.readout-label { display: block; color: #90a4bb; font-size: 9px; font-weight: 600; }
.readout-label em { color: var(--cyan); font-style: italic; }
.readout-card strong { display: block; color: #e9f6ff; font-size: 19px; line-height: 1.25; font-weight: 650; letter-spacing: -.03em; margin-top: 3px; font-variant-numeric: tabular-nums; }
.primary-readout strong { color: var(--cyan); font-size: 25px; }
.readout-card small { display: block; margin-top: 2px; color: #6f829a; font-size: 8px; line-height: 1.35; }
.state-caption { margin: 10px 1px 0; color: #9eafc3; font-size: 10px; line-height: 1.5; border-left: 2px solid rgba(98, 227, 227, .5); padding-left: 9px; }
.transport-section { border-bottom: 0; padding-bottom: 10px; }
.transport-row { display: grid; grid-template-columns: 1.15fr .9fr .9fr; gap: 7px; }
.action-btn { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 34px; border: 1px solid var(--line-strong); border-radius: 8px; background: rgba(19, 35, 55, .88); color: #c8d7e8; font-size: 10px; font-weight: 650; cursor: pointer; transition: background .18s ease, border-color .18s ease; }
.action-btn:hover { background: rgba(33, 59, 81, .9); border-color: rgba(98, 227, 227, .35); }
.play-btn { background: rgba(37, 115, 122, .25); border-color: rgba(98, 227, 227, .35); color: #d8ffff; }
.play-btn:hover { background: rgba(37, 115, 122, .4); }
.play-symbol { color: var(--cyan); font-size: 12px; }
kbd { font: 700 8px ui-monospace, SFMono-Regular, Menlo, monospace; color: #6e849e; background: rgba(7, 15, 27, .6); border: 1px solid rgba(135, 160, 189, .17); border-radius: 4px; padding: 2px 4px; }
.quality-row { display: flex; align-items: center; justify-content: space-between; margin: 12px 0 9px; color: #90a4bb; font-size: 9px; }
.quality-toggle { display: flex; border: 1px solid var(--line-strong); background: rgba(7, 15, 27, .65); padding: 2px; border-radius: 7px; gap: 2px; }
.quality-toggle button { border: 0; background: transparent; color: #8296ad; padding: 4px 9px; border-radius: 5px; font-size: 9px; cursor: pointer; }
.quality-toggle button.selected { background: rgba(98, 227, 227, .14); color: var(--cyan); }
.screenshot-btn { width: 100%; border: 1px solid rgba(162, 139, 255, .27); border-radius: 8px; background: rgba(87, 71, 143, .14); color: #c9c0ff; padding: 8px; font-size: 10px; font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 7px; }
.screenshot-btn:hover { background: rgba(87, 71, 143, .25); border-color: rgba(162,139,255,.5); }
.screenshot-btn span { font-size: 14px; }
.science-panel { border: 1px solid rgba(148, 177, 208, .13); border-radius: 10px; background: rgba(9, 19, 32, .8); overflow: hidden; }
.science-panel summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 11px 10px; color: #dce8f5; font-size: 10px; font-weight: 700; }
.science-panel summary::-webkit-details-marker { display: none; }
.science-panel summary::after { content: "+"; color: var(--cyan); font-size: 16px; margin-left: auto; font-weight: 400; }
.science-panel[open] summary::after { content: "−"; }
.science-glyph { display: grid; place-items: center; width: 21px; height: 21px; border-radius: 6px; color: var(--cyan); background: rgba(98, 227, 227, .1); font-size: 13px; }
.summary-meta { color: #657c95; font-size: 7px; letter-spacing: .1em; margin-left: auto; margin-right: 4px; }
.science-panel[open] .summary-meta { margin-left: 4px; }
.science-content { border-top: 1px solid var(--line); padding: 12px 12px 13px; color: #93a6bd; font-size: 9px; line-height: 1.55; }
.science-content h3 { color: #c8d8e9; font-size: 9px; letter-spacing: .07em; text-transform: uppercase; margin: 11px 0 5px; }
.science-content h3:first-child { margin-top: 0; }
.science-content p { margin: 5px 0 8px; }
.equation { color: #e5f4ff; background: rgba(98, 227, 227, .06); border: 1px solid rgba(98, 227, 227, .12); border-radius: 7px; padding: 8px; text-align: center; font-family: ui-serif, Georgia, serif; font-size: 12px; }
.fraction { font-size: 10px; }
.check-card { display: grid; grid-template-columns: 1fr 1fr; gap: 3px 10px; padding: 8px; border: 1px solid rgba(98, 227, 227, .16); border-radius: 7px; background: rgba(20, 54, 63, .2); }
.check-card span { color: #7393a7; font-size: 7px; letter-spacing: .1em; }
.check-card strong { color: #c8ffff; font-size: 12px; font-variant-numeric: tabular-nums; }
.check-card small { grid-column: span 2; color: var(--cyan); font-size: 8px; margin-top: 3px; }
.science-content ul { padding-left: 15px; margin: 6px 0 10px; }
.science-content li { margin: 4px 0; }
.disclaimer { color: #758ba2; font-style: italic; border-top: 1px solid var(--line); padding-top: 8px; margin-bottom: 0 !important; }
.footerbar { height: 27px; flex: 0 0 27px; display: flex; align-items: center; justify-content: space-between; padding: 0 18px; border-top: 1px solid var(--line); color: #5f738b; font-size: 8px; letter-spacing: .03em; background: rgba(6, 14, 25, .9); }
.footerbar b { color: #30485f; font-weight: 500; padding: 0 4px; }
button:focus-visible, summary:focus-visible, input:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }
@media (max-width: 980px) and (min-width: 701px) {
  .controls-panel { width: 300px; flex-basis: 300px; }
  .stage-shell { padding-left: 12px; padding-right: 12px; }
  .panel-scroll { padding-left: 12px; padding-right: 12px; }
}
@media (max-width: 700px) {
  .topbar { height: 57px; flex-basis: 57px; padding: 0 12px; gap: 9px; }
  .brand-mark { width: 25px; height: 25px; }
  .eyebrow { font-size: 7px; margin-bottom: 3px; }
  h1 { font-size: 12px; max-width: calc(100vw - 145px); }
  .header-tag { font-size: 7px; padding: 6px 7px; letter-spacing: .07em; }
  .header-tag i { width: 5px; height: 5px; margin-right: 3px; }
  .workspace { flex-direction: column; }
  .stage-shell { flex: 0 0 48%; min-height: 330px; max-height: 430px; padding: 8px 8px 6px; }
  .stage-topline { height: 20px; flex-basis: 20px; padding: 0 3px; }
  .stage-kicker { font-size: 8px; }
  .stage-hint { font-size: 8px; }
  .canvas-wrap { border-radius: 11px; }
  .stage-bottomline { height: 20px; flex-basis: 20px; gap: 10px; font-size: 7px; padding: 0 2px; }
  .bottom-note { display: none; }
  .controls-panel { width: 100%; flex: 1 1 auto; min-height: 0; border-left: 0; border-top: 1px solid var(--line); }
  .panel-scroll { padding: 12px 12px 18px; }
  .footerbar { height: 23px; flex-basis: 23px; padding: 0 10px; font-size: 7px; }
  .footerbar span:last-child { font-size: 6px; }
}
@media (max-width: 380px) {
  .header-tag { display: none; }
  h1 { max-width: calc(100vw - 70px); }
  .stage-hint { display: none; }
  .preset-btn { padding: 8px 6px; gap: 6px; }
  .preset-btn small { font-size: 7px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
