:root { --bg:#05080f; --panel:#0c1322; --line:#1d2a44; --txt:#dbe7ff; --mut:#8ea3c7; --acc:#7fd1ff; --ok:#7fffaa; --warn:#ffd27a; --bad:#ff8a80; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--txt); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
button, input, select { font: inherit; color: inherit; }
a { color: var(--acc); }
.top { display: flex; align-items: center; gap: 12px; padding: 8px 14px; border-bottom: 1px solid var(--line); background: #070c18; position: relative; z-index: 20; }
.brand { font-weight: 700; letter-spacing: .2px; white-space: nowrap; }
.brand small { color: var(--mut); font-weight: 400; margin-left: 6px; }
.logo { color: var(--acc); }
.searchbox { position: relative; flex: 1; max-width: 460px; }
.searchbox input { width: 100%; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); background: #0a1120; outline: none; }
.searchbox input:focus { border-color: var(--acc); }
.results { position: absolute; left: 0; right: 0; top: 100%; margin: 4px 0 0; padding: 4px; list-style: none; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; max-height: 55vh; overflow: auto; box-shadow: 0 10px 30px #0008; }
.results button { width: 100%; text-align: left; padding: 7px 10px; background: none; border: 0; border-radius: 7px; cursor: pointer; }
.results button:hover { background: #15213a; }
.results small { color: var(--mut); }
.results .none { padding: 8px 10px; color: var(--mut); }
.topbtns { display: flex; gap: 6px; margin-left: auto; }
.btn { padding: 7px 12px; border-radius: 10px; border: 1px solid var(--line); background: #101a2e; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: #33507f; }
.btn.primary { background: #15406a; border-color: #2a6aa8; }
.btn.on { background: #3a2a10; border-color: #a07a30; }
.btn.icon { display: none; }
.disclaimer { padding: 6px 14px; font-size: 13px; color: #cfdcf5; background: #0b1426; border-bottom: 1px solid var(--line); }
.wrap { display: flex; gap: 12px; padding: 12px; height: calc(100% - 96px); min-height: 0; }
.stage { position: relative; flex: 1; align-self: center; aspect-ratio: var(--ar); max-height: 100%; max-width: 100%; margin: auto; background: radial-gradient(ellipse at center, #0d1a30, #04070d 70%); border-radius: 14px; overflow: hidden; border: 1px solid var(--line); touch-action: manipulation; }
.stage video, .stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.stage video { object-fit: fill; filter: grayscale(1) contrast(1.15) brightness(.8); transition: opacity .2s; }
body[data-style="xray"] .stage video { filter: grayscale(1) invert(1) contrast(1.2) brightness(.55) sepia(.4) hue-rotate(170deg); }
body[data-style="contour"] .stage video { filter: grayscale(.6) contrast(1.05) brightness(.75); }
body[data-style="solid"] .stage video { filter: none; }
.stage.mirror video, .stage.mirror #gl { transform: scaleX(-1); }
.demo .stage video { display: none; }
.tip { position: absolute; pointer-events: none; padding: 4px 8px; font-size: 13px; background: #0c1830ee; border: 1px solid #2a5a8a; border-radius: 7px; white-space: nowrap; z-index: 5; }
.intro { position: absolute; inset: 0; display: grid; place-items: center; background: #04070dd0; z-index: 6; padding: 14px; overflow: auto; }
.intro[hidden] { display: none; }
.card { max-width: 520px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 20px 22px; }
.card h1 { margin: 0 0 8px; font-size: 24px; }
.bul { padding-left: 18px; color: #c6d5f1; }
.row { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 6px; }
.small { font-size: 12.5px; color: var(--mut); }
.muted { color: var(--mut); }
.panel { width: 290px; flex: none; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; overflow: auto; }
.panel h3 { margin: 14px 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .6px; color: var(--mut); }
.status { padding: 8px 10px; border-radius: 9px; background: #0a1120; border: 1px solid var(--line); font-size: 13.5px; }
.status.ok { border-color: #2c6a48; color: var(--ok); }
.status.warn { border-color: #6a5a2c; color: var(--warn); }
.status.bad { border-color: #7a3030; color: var(--bad); }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.tog { flex: 1 1 auto; padding: 7px 9px; border-radius: 9px; border: 1px solid var(--line); background: #0a1120; cursor: pointer; }
.tog.on { background: #13365a; border-color: #3a8ad0; color: #fff; }
.slider, .sel { display: block; margin: 10px 0 0; font-size: 13.5px; }
.slider input { width: 100%; }
.sel select { display: block; width: 100%; margin-top: 4px; padding: 6px; border-radius: 8px; background: #0a1120; border: 1px solid var(--line); }
.chk { display: flex; align-items: center; gap: 8px; margin: 6px 0; font-size: 14px; cursor: pointer; }
.chk small { color: var(--mut); }
.hint { margin-top: 14px; }
.info { position: fixed; right: 320px; bottom: 22px; width: min(380px, calc(100vw - 24px)); background: #0c1528f5; border: 1px solid #2a4a7a; border-radius: 14px; padding: 14px 16px; z-index: 30; box-shadow: 0 12px 40px #000a; }
.info h2 { margin: 2px 0 0; font-size: 20px; }
.info .en { color: var(--mut); font-size: 13px; font-style: italic; }
.info .layer { font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--acc); }
.info .fact { color: #e8d9b0; font-size: 14px; }
.x { position: absolute; right: 8px; top: 6px; background: none; border: 0; font-size: 24px; cursor: pointer; color: var(--mut); line-height: 1; }
.modal { position: fixed; inset: 0; background: #000b; display: grid; place-items: center; z-index: 40; padding: 14px; }
.modal[hidden], .info[hidden] { display: none; }
.sheet { position: relative; width: min(720px, 100%); max-height: 90vh; overflow: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px 22px; }
.sheet h2 { margin-top: 0; }
.sheet h4 { margin: 16px 0 6px; }
figure { margin: 8px 0; background: #070c18; border: 1px solid var(--line); border-radius: 12px; padding: 8px; }
.cellsvg { width: 100%; height: auto; display: block; max-height: 260px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { padding: 5px 10px; border-radius: 99px; border: 1px solid var(--line); background: #0a1120; cursor: pointer; font-size: 13px; }
.chip.on { background: #13365a; border-color: #3a8ad0; }
@media (max-width: 900px) {
  .brand small { display: none; }
  .btn.icon { display: inline-block; }
  .wrap { flex-direction: column; height: auto; padding: 8px; }
  .stage { width: 100%; max-height: 72vh; }
  .panel { width: 100%; }
  .panel-hidden .panel { display: none; }
  .info { right: 12px; left: 12px; width: auto; bottom: 12px; }
  .top { flex-wrap: wrap; }
  .searchbox { order: 3; flex-basis: 100%; max-width: none; }
  .disclaimer { font-size: 12px; }
}
