:root {
  color-scheme: dark;
  --bg: #0b1116;
  --panel: #111a21;
  --panel-2: #151f27;
  --line: #25323b;
  --line-soft: #1d2a33;
  --text: #edf2f3;
  --muted: #91a0a8;
  --muted-2: #65747d;
  --accent: #e6b65d;
  --accent-2: #f2cb7d;
  --accent-dim: rgba(230, 182, 93, .13);
  --radius: 12px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}
* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; min-height: 100%; background: var(--bg); color: var(--text); }
body { min-height: 100vh; overflow-x: hidden; }
button, input { font: inherit; }
button { color: inherit; }
.app-shell { min-height: 100vh; height: 100vh; display: flex; flex-direction: column; background: radial-gradient(ellipse at 28% 0%, rgba(39,57,66,.24), transparent 45%), var(--bg); overflow: hidden; }
.topbar { flex: 0 0 64px; height: 64px; display: flex; align-items: center; gap: 14px; padding: 0 22px; border-bottom: 1px solid var(--line-soft); background: rgba(11,17,22,.96); z-index: 2; }
.brand-mark { width: 32px; height: 32px; border: 1px solid rgba(230,182,93,.45); border-radius: 9px; display: flex; align-items: center; justify-content: center; gap: 2px; transform: rotate(0deg); background: rgba(230,182,93,.06); }
.brand-mark span { width: 3px; border-radius: 4px; background: var(--accent); display: block; }
.brand-mark span:nth-child(1) { height: 10px; opacity: .55; }
.brand-mark span:nth-child(2) { height: 18px; }
.brand-mark span:nth-child(3) { height: 13px; opacity: .75; }
.brand-copy { min-width: 0; }
.eyebrow { font-size: 9px; font-weight: 750; letter-spacing: .16em; color: var(--muted); }
.eyebrow i { display: inline-block; width: 3px; height: 3px; border-radius: 50%; background: var(--accent); margin: 0 7px 2px; }
h1 { margin: 3px 0 0; font-size: 17px; letter-spacing: -.035em; font-weight: 650; }
.header-meta { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.meta-pill, .offline-pill { border: 1px solid var(--line); border-radius: 5px; padding: 6px 8px; color: #9aa8af; font-size: 8px; font-weight: 750; letter-spacing: .1em; white-space: nowrap; }
.offline-pill { color: #b7c4c8; }
.offline-pill b { display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: #9abf8b; margin: 0 5px 1px 0; box-shadow: 0 0 8px rgba(154,191,139,.5); }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 354px; gap: 0; flex: 1 1 auto; min-height: 0; }
.stage-panel { min-width: 0; min-height: 0; padding: 15px 18px 12px 20px; display: flex; flex-direction: column; border-right: 1px solid var(--line-soft); }
.stage-bar { flex: 0 0 32px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stage-bar-left { display: flex; align-items: center; min-width: 0; gap: 9px; }
.live-dot { width: 6px; height: 6px; flex: 0 0 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px rgba(230,182,93,.7); }
.stage-kicker { color: #87969e; font-size: 9px; font-weight: 800; letter-spacing: .14em; white-space: nowrap; }
.stage-divider { width: 1px; height: 13px; background: var(--line); margin: 0 3px; }
.stage-bar strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; font-weight: 600; color: var(--accent-2); }
.phase-count { font-variant-numeric: tabular-nums; font-size: 10px; color: #74838b; letter-spacing: .1em; }
.canvas-wrap { flex: 1 1 auto; min-height: 180px; position: relative; overflow: hidden; border: 1px solid #26343d; border-radius: 12px; background: #0d151b; box-shadow: inset 0 0 60px rgba(0,0,0,.16); }
#kilnCanvas { display: block; width: 100%; height: 100%; outline: none; }
.canvas-stamp { position: absolute; left: 13px; top: 12px; pointer-events: none; color: rgba(183,196,199,.62); font-size: 8px; letter-spacing: .12em; font-weight: 700; }
.canvas-stamp span { color: var(--accent); padding: 0 4px; }
.canvas-key { position: absolute; right: 14px; top: 12px; display: flex; align-items: center; gap: 6px; color: rgba(183,196,199,.65); font-size: 8px; letter-spacing: .1em; font-weight: 700; pointer-events: none; }
.key-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; margin-left: 5px; }
.key-heat { background: #e98754; box-shadow: 0 0 8px #e98754; }
.key-crystal { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.stage-track-wrap { flex: 0 0 30px; padding: 9px 2px 0; }
.stage-track { display: flex; height: 3px; gap: 4px; }
.track-segment { flex: 1; border-radius: 5px; background: #25323a; transition: background .25s ease; }
.track-segment.done, .track-segment.active { background: var(--accent); }
.track-segment.active { box-shadow: 0 0 8px rgba(230,182,93,.5); }
.track-labels { display: flex; justify-content: space-between; padding-top: 5px; color: #65747c; font-size: 7px; letter-spacing: .12em; font-weight: 750; }
.readout-grid { flex: 0 0 70px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 9px; background: rgba(17,26,33,.78); overflow: hidden; }
.readout-cell { padding: 10px 12px 8px; min-width: 0; border-right: 1px solid var(--line); }
.readout-cell:last-child { border-right: 0; }
.readout-label { color: #819099; font-size: 8px; letter-spacing: .1em; font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.readout-label small { display: inline-block; color: #687780; font-size: 6px; letter-spacing: .08em; margin-left: 4px; vertical-align: 1px; }
.readout-value { margin-top: 8px; font-size: 19px; line-height: 1; letter-spacing: -.04em; font-weight: 620; font-variant-numeric: tabular-nums; white-space: nowrap; }
.readout-cell:nth-child(4) .readout-value { font-size: 14px; }
.readout-value em { color: #9eabb1; font-size: 10px; font-style: normal; font-weight: 500; letter-spacing: 0; }
.caption-row { min-height: 42px; flex: 0 0 42px; display: flex; align-items: center; gap: 10px; padding: 5px 3px 0; }
.caption-icon { flex: 0 0 22px; width: 22px; height: 22px; display: grid; place-items: center; color: var(--accent); border: 1px solid rgba(230,182,93,.27); border-radius: 7px; font-size: 13px; }
.caption-row p { flex: 1; min-width: 0; margin: 0; color: #9aa8ae; font-size: 10px; line-height: 1.45; }
.sim-clock { flex: 0 0 auto; color: #d7e0e1; font-size: 10px; font-variant-numeric: tabular-nums; text-align: right; }
.sim-clock small { display: block; margin-top: 3px; color: #65747c; font-size: 6px; letter-spacing: .11em; }
.control-panel { min-width: 0; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 14px 17px 14px; background: linear-gradient(180deg, rgba(18,27,34,.98), rgba(13,21,27,.98)); scrollbar-color: #35444d transparent; scrollbar-width: thin; }
.panel-heading { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 10px; }
.panel-heading h2 { margin: 3px 0 0; font-size: 18px; font-weight: 650; letter-spacing: -.04em; }
.recipe-index { color: #829098; font-size: 10px; font-variant-numeric: tabular-nums; letter-spacing: .08em; }
.recipe-index i { color: #4f5c63; font-style: normal; padding: 0 3px; }
.preset-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.preset-button { min-width: 0; display: flex; align-items: center; gap: 8px; padding: 7px 8px; border: 1px solid var(--line); border-radius: 8px; background: rgba(18,29,36,.65); text-align: left; cursor: pointer; transition: border-color .2s, background .2s, transform .2s; }
.preset-button:hover { border-color: #65717a; }
.preset-button:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.preset-button.selected { border-color: rgba(230,182,93,.68); background: rgba(230,182,93,.08); }
.preset-glyph { flex: 0 0 27px; width: 27px; height: 27px; display: grid; place-items: center; border-radius: 7px; background: rgba(230,182,93,.12); color: var(--accent); font-size: 17px; }
.sparse-glyph { font-size: 21px; }
.preset-button strong { display: block; overflow: hidden; color: #e1e8e8; font-size: 9px; font-weight: 700; white-space: nowrap; text-overflow: ellipsis; }
.preset-button small { display: block; margin-top: 3px; color: #7d8b92; font-size: 8px; white-space: nowrap; }
.outcome-card { margin-top: 10px; padding: 9px 12px 8px; border: 1px solid rgba(230,182,93,.23); border-radius: 9px; background: linear-gradient(120deg, rgba(230,182,93,.075), rgba(230,182,93,.018)); }
.outcome-top { display: flex; align-items: center; justify-content: space-between; }
.outcome-top h3 { margin: 3px 0 0; color: #e4e9e8; font-size: 12px; font-weight: 620; }
.score-value { color: var(--accent-2); font-size: 24px; font-weight: 700; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.score-value span { color: #89969b; font-size: 10px; font-weight: 500; letter-spacing: 0; }
.quality-track { height: 5px; margin-top: 10px; border-radius: 8px; overflow: hidden; background: #28343a; }
.quality-track span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #9b7940, var(--accent-2)); box-shadow: 0 0 9px rgba(230,182,93,.34); transition: width .3s ease; }
.quality-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 7px; color: #a9b2b2; font-size: 8px; }
.quality-foot small { color: #78868b; font-size: 6px; letter-spacing: .1em; white-space: nowrap; }
.controls-heading { display: flex; align-items: center; justify-content: space-between; margin: 13px 0 8px; color: #a1adb1; font-size: 8px; font-weight: 800; letter-spacing: .13em; }
.controls-heading small { color: #66757d; font-size: 6px; letter-spacing: .09em; }
.slider-list { display: flex; flex-direction: column; gap: 8px; }
.control-item { min-width: 0; }
.control-label { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.control-label label { color: #dce4e4; font-size: 10px; font-weight: 580; }
.control-label output { color: var(--accent-2); font-size: 10px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
input[type="range"] { width: 100%; height: 14px; margin: 4px 0 0; appearance: none; background: transparent; cursor: pointer; touch-action: pan-y; }
input[type="range"]::-webkit-slider-runnable-track { height: 3px; border-radius: 4px; background: linear-gradient(90deg, rgba(230,182,93,.7), #3a464d); }
input[type="range"]::-moz-range-track { height: 3px; border-radius: 4px; background: linear-gradient(90deg, rgba(230,182,93,.7), #3a464d); }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 12px; height: 12px; margin-top: -4.5px; border-radius: 50%; border: 2px solid #151e24; background: var(--accent-2); box-shadow: 0 0 0 1px var(--accent); }
input[type="range"]::-moz-range-thumb { width: 9px; height: 9px; border-radius: 50%; border: 2px solid #151e24; background: var(--accent-2); box-shadow: 0 0 0 1px var(--accent); }
.range-ends { display: flex; justify-content: space-between; color: #65747c; font-size: 7px; font-variant-numeric: tabular-nums; }
.control-item p { margin: 2px 0 0; color: #78868d; font-size: 7px; line-height: 1.35; }
.action-row { display: grid; grid-template-columns: minmax(0,1fr) 76px 34px; gap: 7px; margin-top: 12px; }
.action-row button { min-height: 36px; border-radius: 7px; cursor: pointer; transition: background .18s, border-color .18s, transform .18s; }
.action-row button:active, .preset-button:active, .screenshot-button:active { transform: translateY(1px); }
.primary-action { display: flex; justify-content: center; align-items: center; gap: 9px; border: 1px solid #e7bb6d; background: linear-gradient(180deg, #efc879, #d8a84e); color: #1b1d1b; font-size: 10px; font-weight: 800; box-shadow: 0 4px 12px rgba(214,166,79,.13); }
.primary-action:hover { background: #f4d38c; }
.play-symbol { font-size: 9px; }
.secondary-action, .icon-action { border: 1px solid var(--line); background: #17232a; color: #dce4e4; font-size: 9px; font-weight: 650; }
.secondary-action:hover, .icon-action:hover { border-color: #68757b; background: #1c2a32; }
.secondary-action small { display: block; margin-top: 2px; color: #85939a; font-size: 7px; font-weight: 500; }
.icon-action { font-size: 20px; line-height: 1; }
.utility-row { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.quality-toggle { display: flex; align-items: center; gap: 7px; color: #a6b1b3; font-size: 8px; cursor: pointer; }
.quality-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle-track { position: relative; width: 24px; height: 13px; border-radius: 10px; background: #36434a; transition: background .2s; }
.toggle-track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 9px; height: 9px; border-radius: 50%; background: #b6c0c1; transition: transform .2s, background .2s; }
.quality-toggle input:checked + .toggle-track { background: rgba(230,182,93,.55); }
.quality-toggle input:checked + .toggle-track::after { transform: translateX(11px); background: #fff1cf; }
.quality-toggle input:focus-visible + .toggle-track { outline: 2px solid var(--accent); outline-offset: 3px; }
.screenshot-button { border: 0; padding: 5px 0 5px 8px; background: transparent; color: #b7c1c1; font-size: 11px; cursor: pointer; }
.screenshot-button span { font-size: 8px; }
.screenshot-button:hover { color: var(--accent-2); }
.status-line { display: flex; align-items: center; gap: 7px; margin-top: 7px; color: #7f8d93; font-size: 8px; line-height: 1.35; }
.status-dot { width: 5px; height: 5px; flex: 0 0 5px; border-radius: 50%; background: #9abf8b; }
.science-panel { margin-top: 9px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.science-panel summary { min-height: 42px; display: flex; align-items: center; gap: 8px; cursor: pointer; list-style: none; color: #dce4e4; font-size: 10px; font-weight: 650; }
.science-panel summary::-webkit-details-marker { display: none; }
.science-icon { width: 21px; height: 21px; display: grid; place-items: center; border-radius: 6px; color: var(--accent); background: rgba(230,182,93,.1); font-size: 13px; }
.summary-hint { margin-left: auto; color: #68767e; font-size: 6px; font-weight: 700; letter-spacing: .1em; }
.chevron { color: #8d9ba0; font-size: 15px; transition: transform .2s; }
.science-panel[open] .chevron { transform: rotate(180deg); }
.science-body { padding: 0 1px 13px; color: #9aa7ab; font-size: 8px; line-height: 1.5; }
.science-intro { margin: 0 0 10px; color: #b6c0c1; }
.equation-block { padding: 8px 9px; margin: 7px 0; border: 1px solid #26343c; border-radius: 7px; background: rgba(8,14,18,.35); }
.equation-block b { display: block; color: #c8d1d0; font-size: 8px; margin-bottom: 5px; }
.equation-block code { display: block; color: var(--accent-2); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 9px; white-space: normal; }
.equation-block p { margin: 5px 0 0; color: #829096; }
.equation-block em { color: #9da8aa; font-style: normal; }
.constant-note { display: flex; justify-content: space-between; gap: 8px; padding: 7px 0; border-bottom: 1px solid #25323a; }
.constant-note strong { color: #c8d1d0; white-space: nowrap; }
.constant-note span { text-align: right; }
.audit-card { margin-top: 9px; padding: 9px; border: 1px solid rgba(230,182,93,.24); border-radius: 7px; background: rgba(230,182,93,.055); }
.audit-card b, .audit-card span, .audit-card small { display: block; }
.audit-card b { color: var(--accent-2); font-size: 8px; }
.audit-card span { margin-top: 4px; color: #d5dfde; font-variant-numeric: tabular-nums; }
.audit-card small { margin-top: 3px; color: #829096; }
.model-limits { margin: 10px 0 0; color: #89969b; }
.disclaimer { margin: 8px 0 0; color: #b4bec0; font-size: 8px; }
.bottom-bar { flex: 0 0 24px; height: 24px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 20px; border-top: 1px solid var(--line-soft); color: #5e6d75; font-size: 7px; font-weight: 750; letter-spacing: .13em; }
.bottom-bar i { color: var(--accent); font-style: normal; padding: 0 3px; }

@media (max-width: 900px) and (min-width: 701px) {
  .workspace { grid-template-columns: minmax(0,1fr) 320px; }
  .stage-panel { padding-left: 14px; padding-right: 14px; }
  .control-panel { padding-left: 13px; padding-right: 13px; }
  .readout-cell { padding-left: 8px; padding-right: 8px; }
  .readout-label { font-size: 7px; }
  .readout-value { font-size: 16px; }
}
@media (max-width: 700px) {
  .app-shell { height: 100vh; height: 100dvh; }
  body.embed-mode { height: 100vh; height: 100dvh; overflow: hidden; }
  .topbar { flex-basis: 54px; height: 54px; padding: 0 12px; gap: 10px; }
  .brand-mark { width: 28px; height: 28px; }
  h1 { font-size: 14px; }
  .eyebrow { font-size: 8px; }
  .header-meta { gap: 5px; }
  .meta-pill { display: none; }
  .offline-pill { padding: 5px 6px; font-size: 7px; }
  .workspace { grid-template-columns: minmax(0,1fr); grid-template-rows: minmax(250px, 43dvh) minmax(0,1fr); gap: 0; }
  .stage-panel { grid-row: 1; padding: 8px 9px 7px; border-right: 0; border-bottom: 1px solid var(--line); }
  .stage-bar { flex-basis: 27px; }
  .stage-kicker { font-size: 8px; }
  .stage-bar strong { font-size: 10px; }
  .phase-count { font-size: 8px; }
  .canvas-wrap { min-height: 0; border-radius: 9px; }
  .canvas-stamp { left: 8px; top: 8px; font-size: 6px; }
  .canvas-key { right: 8px; top: 8px; font-size: 6px; }
  .stage-track-wrap { flex-basis: 25px; padding-top: 7px; }
  .track-labels { font-size: 6px; padding-top: 4px; }
  .readout-grid { flex-basis: 55px; border-radius: 7px; }
  .readout-cell { padding: 6px 7px 5px; }
  .readout-label { font-size: 6px; letter-spacing: .07em; }
  .readout-label small { font-size: 5px; margin-left: 2px; }
  .readout-value { margin-top: 6px; font-size: 15px; }
  .readout-cell:nth-child(4) .readout-value { font-size: 11px; }
  .readout-cell:nth-child(4) .readout-value em { font-size: 7px; }
  .readout-value em { font-size: 8px; }
  .caption-row { min-height: 31px; flex-basis: 31px; gap: 7px; padding-top: 3px; }
  .caption-icon { width: 18px; height: 18px; flex-basis: 18px; font-size: 10px; }
  .caption-row p { font-size: 8px; line-height: 1.3; }
  .sim-clock { font-size: 8px; }
  .sim-clock small { font-size: 5px; }
  .control-panel { grid-row: 2; padding: 12px 13px 18px; overscroll-behavior: contain; }
  .panel-heading { margin-bottom: 10px; }
  .panel-heading h2 { font-size: 16px; }
  .preset-button { padding: 8px 7px; }
  .preset-button strong { font-size: 8px; }
  .preset-button small { font-size: 7px; }
  .outcome-card { margin-top: 10px; padding: 9px 10px 8px; }
  .outcome-top h3 { font-size: 11px; }
  .score-value { font-size: 21px; }
  .controls-heading { margin: 13px 0 8px; }
  .slider-list { gap: 10px; }
  .control-label label, .control-label output { font-size: 9px; }
  .control-item p { font-size: 7px; }
  .action-row { margin-top: 13px; }
  .bottom-bar { display: none; }
}
@media (max-width: 370px) {
  .readout-label { letter-spacing: .03em; }
  .readout-label small { display: none; }
  .readout-value { font-size: 13px; }
  .sim-clock { display: none; }
  .control-panel { padding-left: 10px; padding-right: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
