:root {
  color-scheme: dark;
  --bg: #071116;
  --panel: #0c1a20;
  --panel-2: #0e2027;
  --panel-3: #10252c;
  --line: rgba(158, 195, 198, .13);
  --line-strong: rgba(158, 195, 198, .23);
  --text: #e7f1ef;
  --muted: #91a9a9;
  --faint: #627a7d;
  --accent: #70e3ce;
  --accent-dim: rgba(112, 227, 206, .13);
  --accent-line: rgba(112, 227, 206, .42);
  --radius: 16px;
  --space: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body { min-width: 320px; }
button, input { font: inherit; }
button { color: inherit; }
.app-shell { min-height: 100vh; display: flex; flex-direction: column; background: radial-gradient(ellipse at 14% 0%, rgba(32, 90, 91, .15), transparent 34%), var(--bg); }
.topbar { min-height: 76px; padding: 14px 24px; display: flex; align-items: center; gap: 14px; border-bottom: 1px solid var(--line); background: rgba(7, 17, 22, .9); }
.brand-mark { width: 34px; height: 34px; border: 1px solid var(--accent-line); border-radius: 10px; display: flex; align-items: center; justify-content: center; gap: 3px; transform: rotate(-8deg); flex: 0 0 auto; }
.brand-mark span { width: 3px; border-radius: 4px; background: var(--accent); opacity: .9; }
.brand-mark span:nth-child(1) { height: 9px; opacity: .48; }
.brand-mark span:nth-child(2) { height: 17px; opacity: .72; }
.brand-mark span:nth-child(3) { height: 23px; }
.brand-mark span:nth-child(4) { height: 13px; opacity: .62; }
.brand-copy { min-width: 0; }
.eyebrow, .section-kicker, .preset-title, .quality-row > span, .footer-line, .model-chip, .calc-tag, .unit-tag { font-size: 9px; line-height: 1.3; letter-spacing: .15em; font-weight: 750; color: var(--muted); }
.eyebrow span { color: var(--accent); padding: 0 5px; }
.brand-copy h1 { margin: 4px 0 0; font-size: clamp(15px, 1.5vw, 19px); font-weight: 620; letter-spacing: -.035em; }
.top-meta { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: 9px; letter-spacing: .12em; color: #a8c2bf; font-weight: 700; white-space: nowrap; }
.live-dot, .chip-dot { width: 6px; height: 6px; display: inline-block; border-radius: 50%; background: var(--accent); box-shadow: 0 0 12px rgba(112, 227, 206, .65); }
.workspace { width: min(1600px, 100%); margin: 0 auto; padding: 18px 24px 14px; display: grid; grid-template-columns: minmax(0, 1fr) 348px; gap: 16px; flex: 1; min-height: 0; }
.stage-column { min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.control-column { min-width: 0; display: flex; flex-direction: column; gap: 12px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #27454a transparent; padding-right: 2px; }
.card { background: linear-gradient(155deg, rgba(15, 34, 41, .96), rgba(10, 24, 30, .98)); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 12px 32px rgba(0, 0, 0, .12); }
.visual-card { padding: 16px 18px 12px; min-height: 0; flex: 1 1 auto; display: flex; flex-direction: column; animation: rise-in .62s cubic-bezier(.2,.72,.22,1) both; }
.control-column { animation: rise-in .72s cubic-bezier(.2,.72,.22,1) both; }
@keyframes rise-in { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: translateY(0); } }
.section-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.section-head h2 { font-size: 18px; letter-spacing: -.035em; font-weight: 630; margin: 4px 0 0; }
.model-chip { border: 1px solid var(--line-strong); border-radius: 999px; padding: 7px 9px; display: inline-flex; gap: 7px; align-items: center; color: #9ab5b1; white-space: nowrap; }
.model-chip .chip-dot { width: 5px; height: 5px; }
.carpet-wrap { position: relative; min-height: 220px; flex: 1; margin-top: 10px; background: #061015; border: 1px solid rgba(134, 184, 182, .12); border-radius: 10px; overflow: hidden; }
#carpetCanvas { width: 100%; height: 100%; min-height: 220px; display: block; }
.carpet-overlay { pointer-events: none; position: absolute; top: 10px; left: 52px; right: 12px; display: flex; justify-content: space-between; align-items: center; font-size: 8px; letter-spacing: .13em; font-weight: 750; color: rgba(211, 234, 229, .62); }
.overlay-scale { display: inline-flex; align-items: center; gap: 6px; }
.overlay-scale i { width: 38px; height: 5px; border-radius: 5px; background: linear-gradient(90deg, #10232a, #236f70, #70e3ce); display: inline-block; }
.visual-legend { display: flex; justify-content: space-between; align-items: center; padding: 9px 2px 0; gap: 8px; font-size: 10px; color: var(--muted); }
.legend-line { display: inline-block; width: 18px; height: 2px; margin: 0 6px 3px 0; background: var(--accent); box-shadow: 0 0 8px rgba(112, 227, 206, .6); }
.legend-note { color: var(--faint); text-align: right; }
.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; flex: 0 0 152px; }
.chart-card { padding: 12px 14px 8px; min-width: 0; }
.chart-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.chart-head h3, .check-head h3 { margin: 3px 0 0; font-size: 13px; font-weight: 620; letter-spacing: -.02em; }
.chart-unit { color: var(--accent); font-size: 11px; font-weight: 700; white-space: nowrap; }
.chart-unit small { color: var(--faint); font-size: 9px; font-weight: 500; }
.chart-card canvas { display: block; width: 100%; height: 88px; margin-top: 5px; }
.caption-card { flex: 0 0 auto; padding: 12px 16px; display: flex; gap: 12px; align-items: center; background: linear-gradient(100deg, rgba(16, 43, 47, .92), rgba(11, 27, 33, .98)); }
.caption-icon { flex: 0 0 28px; height: 28px; border-radius: 9px; display: grid; place-items: center; color: var(--accent); border: 1px solid var(--accent-line); background: var(--accent-dim); font-size: 15px; }
.caption-card p { margin: 4px 0 0; color: #c2d4d0; font-size: 11px; line-height: 1.45; }
.compact-head { align-items: center; }
.compact-head h2 { font-size: 15px; }
.calc-tag, .unit-tag { color: var(--accent); font-size: 8px; border: 1px solid var(--accent-line); border-radius: 999px; padding: 5px 7px; white-space: nowrap; }
.metrics-card { padding: 14px 15px 13px; }
.metric-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 10px; margin-top: 14px; }
.metric { min-width: 0; padding-top: 10px; border-top: 1px solid var(--line); }
.metric-label { font-size: 9px; color: var(--muted); display: flex; flex-wrap: wrap; align-items: baseline; gap: 5px; }
.metric-label span { font-size: 7px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
.metric-value { font-size: clamp(19px, 2vw, 23px); line-height: 1.2; margin-top: 4px; font-weight: 650; letter-spacing: -.045em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.metric-value small { font-size: 10px; color: var(--accent); letter-spacing: 0; font-weight: 650; }
.controls-card { padding: 14px 15px 13px; }
.control-group { margin-top: 14px; }
.control-label-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.control-label-row label { font-size: 11px; color: #d4e3df; font-weight: 560; }
.symbol { color: var(--accent); font-family: Georgia, serif; font-size: 13px; margin-left: 4px; }
.symbol sub { font-size: 8px; }
.scale-note { color: var(--faint); font-size: 7px; letter-spacing: .1em; text-transform: uppercase; }
.control-label-row output { font-size: 11px; color: var(--accent); font-weight: 680; font-variant-numeric: tabular-nums; }
input[type="range"] { appearance: none; width: 100%; height: 16px; margin: 7px 0 0; background: transparent; cursor: pointer; display: block; }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 4px; background: linear-gradient(90deg, rgba(112, 227, 206, .68), rgba(112, 227, 206, .18)); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 4px; background: linear-gradient(90deg, rgba(112, 227, 206, .68), rgba(112, 227, 206, .18)); }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); border: 2px solid #092027; margin-top: -4.5px; box-shadow: 0 0 0 3px rgba(112, 227, 206, .12); }
input[type="range"]::-moz-range-thumb { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); border: 2px solid #092027; box-shadow: 0 0 0 3px rgba(112, 227, 206, .12); }
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: var(--faint); font-size: 8px; margin-top: 1px; }
.preset-block { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 12px; }
.preset-title { font-size: 8px; }
.preset-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 8px; }
.preset-btn { min-width: 0; background: #10252b; border: 1px solid var(--line-strong); border-radius: 8px; padding: 8px 8px; text-align: left; font-size: 9px; color: #c5d8d4; cursor: pointer; transition: border-color .18s ease, background .18s ease, transform .18s ease; }
.preset-btn span { display: block; color: var(--accent); font-size: 8px; margin-top: 4px; }
.preset-btn:hover { border-color: var(--accent-line); background: #143239; }
.preset-btn:active { transform: translateY(1px); }
.transport-row { display: grid; grid-template-columns: 1fr 38px 38px; gap: 7px; margin-top: 13px; }
.primary-btn, .icon-btn, .screenshot-btn { border: 1px solid var(--accent-line); border-radius: 9px; cursor: pointer; transition: background .18s ease, border-color .18s ease, transform .18s ease; }
.primary-btn { background: var(--accent); color: #06211f; display: flex; justify-content: center; align-items: center; gap: 8px; padding: 9px 12px; font-size: 10px; font-weight: 800; letter-spacing: .02em; }
.primary-btn:hover { background: #91f1df; }
.play-glyph { font-size: 10px; }
.icon-btn { background: #10272d; color: var(--accent); font-size: 18px; line-height: 1; }
.icon-btn:hover { background: #17373d; }
.primary-btn:active, .icon-btn:active, .screenshot-btn:active { transform: translateY(1px); }
.quality-row { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; }
.quality-row > span { font-size: 8px; }
.quality-switch { display: inline-flex; padding: 2px; gap: 2px; border-radius: 7px; background: #07151a; border: 1px solid var(--line); }
.quality-switch button { border: 0; border-radius: 5px; background: transparent; padding: 4px 10px; font-size: 9px; color: var(--muted); cursor: pointer; }
.quality-switch button[aria-pressed="true"] { background: var(--accent-dim); color: var(--accent); box-shadow: inset 0 0 0 1px rgba(112, 227, 206, .25); }
.screenshot-btn { width: 100%; margin-top: 11px; padding: 8px; background: transparent; color: #c1d4d0; border-color: var(--line-strong); font-size: 9px; font-weight: 650; }
.screenshot-btn span { color: var(--accent); margin-right: 5px; }
.screenshot-btn:hover { border-color: var(--accent-line); background: rgba(112, 227, 206, .06); }
.check-card { padding: 13px 15px 12px; }
.check-head { display: flex; justify-content: space-between; align-items: center; }
.check-mark { display: grid; place-items: center; width: 23px; height: 23px; border-radius: 8px; border: 1px solid var(--accent-line); background: var(--accent-dim); color: var(--accent); font-size: 12px; }
.check-values { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.check-values div { min-width: 0; }
.check-values span, .check-foot span { display: block; font-size: 8px; color: var(--muted); }
.check-values strong { display: block; font-size: 14px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.check-foot { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); padding-top: 8px; margin-top: 10px; }
.check-foot strong { color: var(--accent); font-size: 11px; font-variant-numeric: tabular-nums; }
.science-card { padding: 0 15px; }
.science-card summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; padding: 12px 0; }
.science-card summary::-webkit-details-marker { display: none; }
.science-card summary strong { display: block; font-size: 13px; margin-top: 3px; }
.chevron { color: var(--accent); font-size: 17px; transition: transform .2s ease; }
.science-card[open] .chevron { transform: rotate(180deg); }
.science-content { border-top: 1px solid var(--line); padding: 12px 0 14px; }
.science-content p { color: #a9bfbb; font-size: 10px; line-height: 1.55; margin: 8px 0; }
.science-content .equation-label { color: var(--accent); font-size: 8px; letter-spacing: .12em; font-weight: 750; margin: 12px 0 5px; }
.equation { background: #07151a; border: 1px solid var(--line); border-radius: 7px; padding: 9px; color: #dcebe7; font-family: Georgia, "Times New Roman", serif; font-size: 12px; overflow-wrap: anywhere; }
.disclaimer { color: var(--faint) !important; border-top: 1px solid var(--line); padding-top: 9px; margin-top: 12px !important; }
.footer-line { display: flex; justify-content: space-between; gap: 12px; padding: 0 26px 12px; color: #536a6e; font-size: 8px; }
.footer-line i { color: var(--accent); font-style: normal; padding: 0 4px; }
button:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

body.embed-mode { height: 100vh; height: 100dvh; overflow: hidden; }
body.embed-mode .app-shell { height: 100vh; height: 100dvh; min-height: 0; overflow: hidden; }
body.embed-mode .workspace { min-height: 0; overflow: hidden; }
body.embed-mode .stage-column { min-height: 0; }
body.embed-mode .control-column { min-height: 0; }

@media (min-width: 1500px) {
  .workspace { grid-template-columns: minmax(0, 1fr) 372px; gap: 18px; padding-left: 30px; padding-right: 30px; }
  .visual-card { padding: 19px 22px 14px; }
  .carpet-wrap { min-height: 270px; }
}
@media (max-width: 1050px) {
  .workspace { grid-template-columns: minmax(0, 1fr) 318px; padding-left: 16px; padding-right: 16px; gap: 12px; }
  .metric-value { font-size: 19px; }
  .footer-line { padding-left: 18px; padding-right: 18px; }
}
@media (max-width: 760px) {
  .topbar { min-height: 62px; padding: 10px 14px; }
  .brand-mark { width: 30px; height: 30px; }
  .top-meta { font-size: 7px; letter-spacing: .08em; gap: 6px; }
  .workspace { display: flex; flex-direction: column; gap: 12px; padding: 12px 12px 14px; overflow-y: auto; overscroll-behavior: contain; }
  body.embed-mode .workspace { overflow-y: auto; }
  .stage-column { flex: 0 0 auto; }
  .control-column { overflow: visible; flex: 0 0 auto; padding: 0; }
  .visual-card { padding: 13px 12px 10px; min-height: 0; flex: 0 0 auto; }
  .section-head h2 { font-size: 16px; }
  .model-chip { font-size: 7px; padding: 6px 7px; }
  .carpet-wrap { height: clamp(220px, 37vh, 300px); min-height: 220px; flex: 0 0 auto; margin-top: 8px; }
  #carpetCanvas { height: 100%; min-height: 0; }
  .carpet-overlay { left: 42px; top: 8px; font-size: 7px; }
  .visual-legend { font-size: 8px; flex-wrap: wrap; }
  .chart-grid { grid-template-columns: 1fr 1fr; gap: 8px; flex: 0 0 142px; }
  .chart-card { padding: 10px 9px 7px; }
  .chart-head h3 { font-size: 11px; }
  .chart-unit { font-size: 9px; }
  .chart-card canvas { height: 82px; }
  .caption-card { padding: 10px 12px; }
  .caption-card p { font-size: 10px; }
  .metrics-card, .controls-card, .check-card { padding-left: 13px; padding-right: 13px; }
  .footer-line { display: none; }
}
@media (max-width: 390px) {
  .brand-copy h1 { font-size: 14px; }
  .eyebrow { font-size: 8px; }
  .top-meta { max-width: 90px; white-space: normal; line-height: 1.25; }
  .chart-grid { grid-template-columns: 1fr; flex-basis: auto; }
  .chart-card { min-height: 132px; }
  .chart-card canvas { height: 88px; }
  .metric-value { font-size: 21px; }
  .visual-legend { align-items: flex-start; flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
