:root {
  --bg: #05070a;
  --panel: #0b0f14;
  --line: #1c2530;
  --ink: #d7e3ec;
  --dim: #7d8fa0;
  --cyan: #22e6ff;
  --amber: #ffbf2e;
  --green: #2eff8f;
  --red: #ff4d5e;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  min-height: 100vh; display: flex; flex-direction: column; align-items: center;
}
header { width: 100%; max-width: 1180px; padding: 20px 20px 0; }
.title-row { display: flex; align-items: center; gap: 12px; }
.product-banner { display: flex; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.product-logo { width: 72px; height: 72px; border-radius: 14px; flex: none; }
.cwi-badge { width: 64px; height: 64px; border-radius: 50%; margin-left: auto; flex: none; }
.ver-badge { background: var(--green); color: #06130b; font-weight: 700; font-size: 12px; padding: 3px 10px; border-radius: 4px; letter-spacing: 1px; }
.tagline { margin: 6px 0 4px; font-size: 14px; color: var(--ink); }
.license-line { margin: 0; font-size: 12px; color: var(--dim); }
.license-line a { color: var(--cyan); }
@media (max-width: 700px) { .cwi-badge { display: none; } .product-logo { width: 56px; height: 56px; } }
h1 { margin: 0; font-size: 26px; letter-spacing: 1px; }
.subtitle { color: var(--dim); margin: 6px 0 0; font-size: 13px; }
.sim-badge {
  background: var(--amber); color: #111; font-weight: 700; font-size: 12px;
  padding: 3px 10px; border-radius: 4px; letter-spacing: 1.5px;
}
.sim-badge.small { font-size: 10px; padding: 2px 7px; }
main {
  width: 100%; max-width: 1180px; padding: 18px 20px;
  display: grid; grid-template-columns: minmax(320px, 640px) 1fr; gap: 22px;
}
@media (max-width: 900px) { main { grid-template-columns: 1fr; } }
.lens-wrap { display: flex; flex-direction: column; gap: 8px; }
.lens-meta { display: flex; justify-content: space-between; align-items: center; color: var(--dim); font-size: 12px; }
#lens {
  width: 100%; aspect-ratio: 1 / 1; max-width: 600px; background: #000;
  border: 2px solid var(--line); border-radius: 18px; overflow: hidden;
  position: relative;
}
/* Additive stack: environment behind, app frame composited with screen blend
   (pure black contributes zero light -> transparent, like the waveguide). */
.lens-bg {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
}
#lens-cam { width: 100%; height: 100%; object-fit: cover; }
.lens-frame { position: absolute; inset: 0; mix-blend-mode: screen; }
.lens-frame svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 0 6px rgba(34,230,255,.35)); }
/* Display-frame overlay (official "Show Display Frame" toggle): a translucent
   rounded rectangle marking the physical lens boundary. Chrome only — never
   intercepts pointer input. Style text comes from sim-lab.displayFrameStyle. */
.lens-boundary { z-index: 40; }
.lens-bg.animated {
  background: linear-gradient(120deg, #0a1420, #123043, #0a1420, #1a2f1a, #0a1420);
  background-size: 400% 400%;
  animation: envdrift 14s ease-in-out infinite;
}
@keyframes envdrift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
#lens::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,.022) 0 1px, transparent 1px 3px);
}
.lens-caption { display: flex; justify-content: space-between; color: var(--dim); font-size: 12px; }
.panel { display: flex; flex-direction: column; gap: 16px; }
.control-group {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px;
}
.control-group label { display: block; font-size: 12px; color: var(--dim); margin-bottom: 8px; letter-spacing: .5px; }
.hint { color: var(--dim); font-size: 12px; margin: 8px 0 0; line-height: 1.5; }
.hint code { color: var(--cyan); }
select, input[type=text] {
  width: 100%; background: #06090d; color: var(--ink); border: 1px solid var(--line);
  border-radius: 6px; padding: 10px; font: inherit; font-size: 14px;
}
.btn-row { display: flex; gap: 8px; margin-top: 10px; align-items: center; flex-wrap: wrap; }
button {
  background: var(--cyan); color: #04141a; border: none; border-radius: 6px;
  padding: 10px 16px; font: inherit; font-weight: 700; cursor: pointer;
}
button:disabled { opacity: .35; cursor: not-allowed; }
/* Meta web-app QA: visible focus styles (D-pad focus must be obvious). */
button:focus-visible, select:focus-visible, input[type=text]:focus-visible,
input[type=range]:focus-visible {
  outline: 3px solid var(--cyan); outline-offset: 2px;
}
select:focus-visible, input[type=text]:focus-visible { border-color: var(--cyan); }
button.ghost { background: transparent; color: var(--dim); border: 1px solid var(--line); font-weight: 400; margin-top: 8px; }
button.yes { background: var(--green); }
button.no { background: var(--red); color: #fff; }
.countdown { color: var(--amber); font-weight: 700; }
/* ---- Simulator lab ---- */
.sub { font-size: 11px; color: var(--dim); margin: 10px 0 6px; display: block; letter-spacing: .5px; }
.slider-row { display: grid; grid-template-columns: 1fr 130px 52px; gap: 10px; align-items: center; margin: 8px 0; font-size: 12px; color: var(--dim); }
.slider-row b { color: var(--ink); font-weight: 400; text-align: right; }
input[type=range] { width: 100%; accent-color: var(--cyan); }
.file-btn {
  display: inline-block; background: transparent; color: var(--dim);
  border: 1px solid var(--line); border-radius: 6px; padding: 10px 16px;
  font: inherit; cursor: pointer;
}
.file-btn:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }
.dpad {
  display: grid; grid-template-columns: repeat(3, 56px); grid-auto-rows: 56px;
  gap: 6px; justify-content: start; margin: 4px 0;
}
.dpad button { padding: 0; font-size: 18px; border-radius: 10px; }
.dpad button.sel { background: var(--amber); }
.dpad button.back { grid-column: 1 / 4; font-size: 13px; }
a.dl {
  display: inline-block; background: var(--green); color: #04140a; border-radius: 6px;
  padding: 10px 16px; font: inherit; font-weight: 700; text-decoration: none;
}
ul.qa { list-style: none; margin: 10px 0 0; padding: 0; font-size: 12px; line-height: 1.5; }
ul.qa li { padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; margin-bottom: 6px; }
ul.qa li.pass { border-color: #1f5c3a; }
ul.qa li.pass::before { content: "✔ "; color: var(--green); font-weight: 700; }
ul.qa li.fail { border-color: #6b2230; }
ul.qa li.fail::before { content: "✘ "; color: var(--red); font-weight: 700; }
ul.qa li.warn { border-color: #6b5320; }
ul.qa li.warn::before { content: "⚠ "; color: var(--amber); font-weight: 700; }
ul.qa .d { color: var(--dim); display: block; margin-top: 2px; }
.hidden { display: none; }
.confirm-prompt { font-size: 15px; color: var(--amber); }
#log {
  height: 300px; overflow-y: auto; background: #06090d; border: 1px solid var(--line); border-radius: 6px; padding: 10px; font-size: 12px; line-height: 1.65;
}
#log .t { color: var(--dim); }
#log .ev-state { color: var(--cyan); }
#log .ev-decision { color: var(--amber); }
#log .ev-tool { color: var(--green); }
#log .ev-err { color: var(--red); }
footer { width: 100%; max-width: 1180px; padding: 0 20px 30px; color: var(--dim); font-size: 12px; line-height: 1.6; }
footer a { color: var(--cyan); }
/* ---- View on Glasses: honest fallback modal ---- */
.modal {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(3, 5, 8, .78);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal-sheet {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  max-width: 440px; width: 100%; padding: 20px;
  max-height: 90vh; overflow-y: auto;
}
.modal-head { display: flex; align-items: center; gap: 10px; }
.modal-head h2 { margin: 0; font-size: 18px; letter-spacing: .5px; }
.modal-x { margin-left: auto; padding: 8px 12px; }
.modal-note { color: var(--dim); font-size: 12px; margin: 6px 0 0; }
.qr-box { display: flex; flex-direction: column; align-items: center; margin: 14px 0; gap: 8px; }
#glasses-qr { background: #fff; border-radius: 8px; image-rendering: pixelated; }
.qr-box .hint { text-align: center; }
.req-box {
  border: 1px solid var(--amber); border-radius: 8px; padding: 10px 12px;
  font-size: 12px; line-height: 1.55; color: var(--ink); margin: 0 0 4px;
  background: rgba(255, 191, 46, .06);
}
.req-box b { color: var(--amber); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--cyan); word-break: break-all; }
.hint.tiny { font-size: 11px; }

/* OS-fit retrofit: commercial-license CTA */
.cta-license{display:inline-block;background:#e8b13c;color:#111;font-weight:700;border-radius:999px;padding:4px 14px;margin-left:6px;text-decoration:none}
.cta-license:hover{background:#f5d67b;text-decoration:none}
