:root {
  color-scheme: dark;
  --back:#0D1117;
  --panel:#131E2B;
  --edge:#354556;
  --text:#F4F6F0;
  --lime:#CDEB8B;
  --muted:#a7b5c2;
  --fine:#222f3d;
  --radius:15px;
  font-family: "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
  background:var(--back);
  color:var(--text);
}
* { box-sizing:border-box }
[hidden] { display:none !important }
body { margin:0; min-width:320px; background:radial-gradient(ellipse at 45% 0%, #182432 0%, var(--back) 46%) }
.wrap { width:min(1360px, calc(100% - 96px)); margin-inline:auto }
.mast { border-bottom:1px solid #263541; background:#101720 }
.mast-inner { height:61px; display:flex; justify-content:space-between; align-items:center; gap:12px }
.brand { display:flex; align-items:center; gap:10px; color:var(--text); text-decoration:none; font:700 13px ui-monospace,Consolas,monospace; letter-spacing:.1em }
.brand-light { color:var(--muted); font-weight:500 }
.engine { color:var(--muted); font:500 12px ui-monospace,Consolas,monospace; display:flex; align-items:center; gap:8px }
.engine::before { content:""; width:7px; height:7px; background:#6d7f91; border-radius:50%; flex:none }
.engine.ready::before { background:var(--lime); box-shadow:0 0 10px #cdeb8b60 }
.title-row { display:flex; justify-content:space-between; align-items:end; gap:20px; padding:22px 0 16px }
h1 { font-size:clamp(46px, 6vw, 76px); line-height:.95; letter-spacing:-.077em; margin:0 0 12px; font-weight:760 }
h1 span { color:var(--lime); margin-left:.035em }
.title-row p { color:#b3c0ce; font-size:15px; margin:0; letter-spacing:.007em }
h2 { font-size:14px; letter-spacing:.015em; margin:0 0 14px; font-weight:650 }
button { cursor:pointer; font:inherit; border-radius:8px; border:1px solid transparent; color:inherit; background:transparent }
button:focus-visible, a:focus-visible { outline:2px solid var(--lime); outline-offset:3px }
button:disabled { opacity:.43; cursor:default }
.primary { color:#141b10; background:var(--lime); padding:0 18px; height:44px; font-size:14px; font-weight:760; white-space:nowrap }
.primary span { margin-right:5px; font-size:18px }
.primary:hover { background:#dbf5a5 }
.workspace { display:grid; grid-template-columns:minmax(0,1fr) 300px; align-items:start; gap:16px }
.panel { border:1px solid var(--edge); border-radius:var(--radius); background:var(--panel) }
.viewer { min-width:0; overflow:hidden; position:relative }
.view-bar { padding:12px 14px 12px 17px; display:flex; align-items:center; justify-content:space-between; gap:10px; min-height:59px }
.asset { display:grid; min-width:0; gap:3px }
.asset strong { font-size:13px; font-weight:650; overflow:hidden; white-space:nowrap; text-overflow:ellipsis }
.asset span { font:11px ui-monospace,Consolas,monospace; color:var(--muted) }
.view-tools { display:flex; align-items:center; gap:7px; flex:none }
.tool { padding:6px 9px; color:#c4d2df; border-color:#344454; font-size:12px; white-space:nowrap }
.tool[aria-pressed="true"] { border-color:#6f8958; color:var(--lime); background:#263529 }
.tool:hover:not(:disabled) { border-color:var(--lime) }
.stage { position:relative; height:clamp(335px, 55vh, 690px); border-block:1px solid #354556; background:#0a0f15; overflow:hidden; touch-action:none }
.stage::before { content:""; position:absolute; inset:0; background:repeating-linear-gradient(0deg, transparent 0 23px, #202d391e 23px 24px), repeating-linear-gradient(90deg,transparent 0 23px,#202d391e 23px 24px); pointer-events:none }
#view { position:absolute; inset:0; display:block; width:100%; height:100% }
.stage-empty { position:absolute; inset:0; display:grid; place-items:center; color:var(--muted); font-size:15px }
.comparison { position:absolute; pointer-events:none; inset:0; }
.side-label { position:absolute; top:12px; border:1px solid #596773; font:600 11px ui-monospace,Consolas,monospace; border-radius:6px; padding:6px 8px; background:#101720e8; z-index:1 }
.input-label { left:12px }
.output-label { right:12px; color:var(--lime) }
.split-line { position:absolute; top:0; bottom:0; width:1px; background:var(--lime); box-shadow:0 0 8px #0009; }
.split-line span { position:absolute; top:50%; transform:translate(-50%,-50%); display:grid; place-items:center; width:34px; height:34px; border-radius:50%; border:1px solid var(--lime); background:#131e2be8; color:var(--lime); font-size:19px }
.comparison:focus-within .split-line span { outline:2px solid var(--text); outline-offset:3px }
#split { position:absolute; inset:0; width:100%; height:100%; opacity:0; margin:0; cursor:ew-resize }
.viewer-foot { display:flex; justify-content:space-between; align-items:center; gap:12px; padding:11px 16px; min-height:39px; color:var(--muted); font-size:12px }
.mono, output { font-family:ui-monospace,Consolas,monospace; font-variant-numeric:tabular-nums }
.lens { position:absolute; bottom:56px; left:12px; background:#101720ee; border:1px solid #6f8958; border-radius:10px; padding:9px; display:grid; grid-template-columns:auto auto; gap:7px 9px; pointer-events:none }
.lens div { display:grid; gap:5px; color:var(--lime); font-size:10px; letter-spacing:.04em }
.lens canvas { border-radius:3px; border:1px solid var(--fine); display:block; image-rendering:pixelated }
.lens output { font-size:11px; grid-column:1/-1; color:var(--muted) }
.controls { display:grid; gap:12px; min-width:0 }
.controls .panel { padding:16px }
.mode-choice { display:grid; gap:7px }
.mode { display:grid; text-align:left; gap:4px; padding:10px 12px; color:var(--text); border-color:#344454; background:#101823; line-height:1.1 }
.mode span { font-size:14px; font-weight:700 }
.mode small { color:var(--muted); font-size:11px }
.mode[aria-pressed="true"] { color:var(--lime); background:#25332a; border-color:#7a925a }
.mode:hover:not(:disabled) { border-color:var(--lime) }
.mode-note { color:var(--muted); font-size:11px; line-height:1.4; margin:8px 0 0 }
.save { width:100%; display:flex; justify-content:space-between; align-items:center; margin-top:12px; padding:8px 11px; font-size:12px; border-color:var(--edge); }
.save:hover:not(:disabled) { border-color:var(--lime); color:var(--lime) }
.hero-stat { display:grid; padding:4px 0 12px; gap:5px; border-bottom:1px solid var(--edge) }
.hero-stat output { color:var(--lime); font-size:31px; font-weight:690; letter-spacing:-.07em; line-height:1.12 }
.hero-stat span { color:var(--muted); font-size:12px }
.stats { margin:5px 0 0; }
.stats div { min-height:30px; align-items:center; display:grid; grid-template-columns:auto 1fr; gap:8px }
.stats div + div { border-top:1px solid #263440 }
.stats dt { color:var(--muted); font-size:12px }
.stats dd { margin:0; text-align:right; font-size:12px; line-height:1.35 }
.layer-heading { display:flex; justify-content:space-between; align-items:center; margin-bottom:9px }
.layer-heading h2 { margin:0 }
.layer-list { display:grid; gap:5px; max-height:246px; overflow:auto; padding:2px }
.layer { display:grid; min-width:0; grid-template-columns:34px minmax(0,1fr) auto; gap:6px; align-items:center; min-height:34px }
.layer-name { overflow:hidden; white-space:nowrap; text-overflow:ellipsis; font-size:12px }
.layer-eye { font:14px ui-monospace,monospace }
.layer button { padding:5px 6px }
.footer { display:flex; justify-content:space-between; align-items:start; gap:12px; padding:11px 0 25px; color:var(--muted) }
.footer p { margin:3px 0 0; font-size:12px; max-width:68ch }
.footer .warning { color:#ffc69d }
.sample-links { display:flex; gap:8px; flex:none }
.sample { color:var(--muted); border-color:#293847; padding:5px 9px; font-size:12px }
.sample:hover { color:var(--lime); border-color:var(--lime) }
.drop-placeholder { position:fixed; z-index:8; inset:13px; display:grid; place-items:center; border:2px dashed var(--lime); background:#111a23ee; color:var(--lime); border-radius:18px; font-size:clamp(24px,4vw,48px); pointer-events:none }
@media (max-width:1000px) {
  .wrap { width:calc(100% - 52px) }
  .workspace { grid-template-columns:minmax(0,1fr) 248px }
}
@media (max-width:700px) {
  .wrap { width:calc(100% - 28px) }
  .mast-inner { height:50px }
  .engine { font-size:10px }
  .title-row { padding:25px 0 17px; align-items:center }
  .title-row p { font-size:13px }
  .primary { padding:0 10px; height:39px; font-size:12px }
  .workspace { grid-template-columns:minmax(0,1fr) }
  .stage { height:clamp(260px, 46vh, 490px) }
  .controls { grid-template-columns:repeat(2, minmax(0,1fr)); gap:8px }
  .controls .panel { padding:12px }
  .layer-panel, .layers-panel { grid-column:1/-1 }
  .hero-stat output { font-size:24px }
  .stats dt, .stats dd { font-size:11px }
  .footer { flex-wrap:wrap }
}
@media (max-width:410px) {
  .controls { grid-template-columns:minmax(0,1fr) }
  .asset span { font-size:10px }
  .viewer-foot { font-size:11px }
  .lens { left:6px; gap:5px; padding:6px }
}
@media (max-width:350px) {
  .lens { grid-template-columns:1fr }
}

.hdr-panel { padding: 16px; }
.hdr-panel h2 { margin: 0 0 14px; }
.hdr-panel label { color: var(--muted); font-size: .82rem; }
.hdr-panel select { display: block; width: 100%; margin: 6px 0 14px; padding: 7px; color: inherit; background: #131e2b; border: 1px solid #465666; border-radius: 4px; }
.exposure-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
#evValue { color: #cdeb8b; font-variant-numeric: tabular-nums; }
#exposure { margin: 9px 0 1px; width: 100%; accent-color: #cdeb8b; }
#tileTools { margin: 6px 0 10px; }
#rangeRead { margin-left: auto; color: #cdeb8b; }

/* Studio 2.4 */
:root { --radius:8px; --edge:#344453; font-family:Inter,"Noto Sans SC",system-ui,sans-serif; }
html { scroll-padding-top:16px }
body { background:var(--back) }
.wrap { width:min(1400px,calc(100% - clamp(28px,8vw,128px))) }
.mast { background:var(--back) }
.mast-inner { height:58px; justify-content:start; gap:38px }
.mast nav,.mast-right,.language,.lab-tabs,.sample-bar { display:flex; align-items:center }
.mast nav { gap:24px }
.mast nav a,.site-foot a { color:var(--muted); font-size:13px; text-decoration:none }
.mast nav a:hover,.site-foot a:hover { color:var(--lime) }
.mast-right { margin-left:auto; gap:22px }
.language { padding:2px; border:1px solid var(--edge); border-radius:5px }
.language button { padding:4px 9px; font:600 12px/1.2 Inter,"Noto Sans SC",system-ui,sans-serif; white-space:nowrap; border-radius:3px; color:var(--muted) }
.language button:hover,.language button:focus-visible { background:var(--lime); color:var(--back) }
.title-row { padding:clamp(22px,3vw,44px) 0 24px; align-items:center }
h1 { font-size:clamp(42px,4vw,66px); font-weight:670; line-height:1.04; margin-bottom:10px }
h1 span { margin:0; font-weight:380; letter-spacing:-.08em }
.title-row p,.lab-heading p { line-height:1.55 }
.primary { display:flex; gap:6px; align-items:center; border-radius:5px }
.primary span { font:inherit; margin:0 }
.primary span[aria-hidden] { font-size:21px }
.workspace { grid-template-columns:minmax(0,1fr) clamp(260px,23vw,338px); gap:16px }
.stage { height:clamp(315px,45vh,575px) }
.view-bar { min-height:54px; padding:10px 16px }
.viewer { background:#101922 }
.controls .panel { padding:16px 18px }
.controls h2 { font-size:16px; font-weight:620 }
.controls .hdr-panel { border-top:2px solid var(--lime); border-top-left-radius:2px; border-top-right-radius:2px }
.hdr-panel select { background:#0f1720; min-height:34px; margin-block:5px 12px }
.hdr-panel select:last-child { margin-bottom:0 }
#exposure { display:block; margin:7px 0 0 }
.ev-marks { display:flex; justify-content:space-between; font:10px ui-monospace,monospace; color:var(--muted); margin-bottom:10px }
.stats div { min-height:25px }
.hero-stat { padding:2px 0 9px; gap:3px }
.hero-stat output { font-size:28px }
.sample-bar { flex-wrap:wrap; gap:7px; margin:12px 0 0 }
.sample-bar > span { color:var(--muted); font-size:12px; margin-right:6px }
.sample { border-radius:4px; padding:5px 10px }
.sample[aria-pressed=true] { color:var(--lime); border-color:#657c50; background:#1c271f }
#status { min-height:17px; margin:7px 0 0; color:var(--muted); font-size:12px }
#status.warning { color:#ffc69d }
#lab { margin-top:clamp(24px,4vw,62px); padding:clamp(22px,3vw,42px) 0 12px; border-top:1px solid var(--edge) }
.lab-heading { display:flex; align-items:baseline; gap:30px; justify-content:space-between }
.lab-heading h2 { font-size:clamp(30px,3vw,48px); font-weight:620; line-height:1.12; letter-spacing:-.045em; margin:0 }
.lab-heading p { color:var(--muted); font-size:14px; max-width:62ch; margin:0 }
.lab-tabs { gap:clamp(6px,1.9vw,27px); border-bottom:1px solid var(--edge); margin-top:15px; flex-wrap:wrap }
.lab-tabs button { font-size:14px; padding:9px 2px 12px; color:var(--muted); border:0; border-bottom:2px solid transparent; border-radius:0 }
.lab-tabs button[aria-pressed=true] { color:var(--lime); border-bottom-color:var(--lime) }
.lab-content { padding:20px 0 8px }
.site-foot { margin-top:32px; border-top:1px solid var(--edge); padding:18px 0 28px; display:flex; justify-content:space-between; color:var(--muted); font-size:12px }
@media(max-width:800px) {
  .mast-inner { gap:18px }
  .mast nav { gap:10px }
  .mast-right { gap:8px }
  .lab-heading { display:block }
  .lab-heading p { margin-top:7px }
}
@media(max-width:700px) {
  .workspace {grid-template-columns:1fr}
  .mast-inner { height:auto; min-height:54px; flex-wrap:wrap; padding-block:6px; gap:6px 12px }
  .mast nav {order:3; width:100%; gap:18px}
  .mast nav a {font-size:12px}
  .mast-right {gap:9px}
  .title-row {padding-block:20px 16px}
  .title-row p {font-size:13px}
  .controls .panel {padding:13px}
  .stage {height:clamp(235px,55vw,370px)}
  .lab-tabs button {font-size:13px}
  .lab-content {padding-top:12px}
}
@media(max-width:410px) {
  .controls {grid-template-columns:1fr 1fr}
  .results .stats div {grid-template-columns:1fr auto;gap:2px}
  .view-tools {gap:4px}
  .tool {padding:5px}
  .primary {padding:0 9px}
  .title-row {align-items:start}
}
