/* Layout idea: full-bleed camera stage, one compact control sheet pinned to the bottom. */
  :root {
    color-scheme: dark;
    --bg: #0b0d10;
    --panel: rgba(16, 19, 24, 0.84);
    --line: rgba(255, 255, 255, 0.14);
    --text: #f2f4f7;
    --muted: #a3acb9;
    --accent: #d8b46a;
    --font: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  }
  * { box-sizing: border-box; }
  html, body { height: 100%; margin: 0; }
  body { background: var(--bg); color: var(--text); font-family: var(--font); overflow: hidden; }
  button, input { font: inherit; color: inherit; }
  a { color: var(--accent); }
  :focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  [hidden] { display: none !important; }

  #stage { position: fixed; inset: 0; background: #000; }
  #mirror { position: absolute; inset: 0; transform: scaleX(-1); }
  #video, #gl { position: absolute; inset: 0; width: 100%; height: 100%; }
  #video { object-fit: cover; }
  #gl { pointer-events: none; }

  #top { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between;
    align-items: center; gap: 12px; padding: 14px 16px; background: linear-gradient(rgba(0,0,0,.55), transparent); }
  .brand { color: var(--text); text-decoration: none; font-weight: 700; letter-spacing: .18em; font-size: 14px; }
  .brand span { color: var(--accent); font-weight: 600; letter-spacing: .08em; margin-left: 8px; font-size: 12px; }
  #snap { background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px;
    font-size: 13px; font-weight: 600; cursor: pointer; backdrop-filter: blur(10px); }

  #hint { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); background: var(--panel);
    border: 1px solid var(--line); border-radius: 12px; padding: 10px 16px; font-size: 14px; text-align: center;
    max-width: 80%; backdrop-filter: blur(10px); }

  #sheet { position: absolute; left: 0; right: 0; bottom: 0; padding: 12px 0 calc(12px + env(safe-area-inset-bottom));
    background: var(--panel); border-top: 1px solid var(--line); backdrop-filter: blur(14px);
    display: grid; gap: 10px; max-width: 620px; margin: 0 auto; border-radius: 18px 18px 0 0; }
  #sheet > * { padding: 0 16px; }
  #current { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
  #pname { font-weight: 700; font-size: 15px; }
  #pprice { color: var(--muted); font-size: 13px; margin-left: 8px; font-weight: 400; }
  #plink { font-size: 13px; font-weight: 600; white-space: nowrap; }
  #products { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
  #products::-webkit-scrollbar { display: none; }
  .prod { flex: none; width: 92px; border: 1px solid var(--line); background: rgba(255,255,255,.05); border-radius: 12px;
    padding: 6px 6px 7px; cursor: pointer; display: grid; gap: 4px; text-align: center; }
  .prod img { width: 100%; height: 44px; object-fit: contain; background: #fff; border-radius: 7px; }
  .prod span { font-size: 10.5px; line-height: 1.2; font-weight: 600; overflow: hidden; display: -webkit-box;
    -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .prod[aria-pressed="true"] { border-color: var(--accent); background: rgba(216,180,106,.16); }
  .row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
  .label { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); width: 50px; flex: none; }
  .chips { display: flex; gap: 8px; flex-wrap: wrap; }
  .chip { border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 6px 13px;
    font-size: 13px; font-weight: 600; cursor: pointer; }
  .chip[aria-pressed="true"] { background: var(--text); color: #0b0d10; border-color: var(--text); }
  #lift { flex: 1; min-width: 120px; accent-color: var(--accent); }
  .arrow { font-size: 11px; color: var(--muted); }

  #start { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; background: var(--bg); }
  #start .card { max-width: 380px; display: grid; gap: 16px; }
  #start h1 { font-size: 28px; line-height: 1.15; margin: 0; text-wrap: balance; }
  #start p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.55; }
  #go { background: var(--accent); color: #17130a; border: 0; border-radius: 12px; padding: 14px 18px;
    font-weight: 700; font-size: 16px; cursor: pointer; }
  #go:disabled { opacity: .6; cursor: progress; }
  #err { color: #ff9c8a; font-size: 14px; }

  #debug { position: absolute; inset: 0; overflow: auto; background: #caa98c; padding: 8px; display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; align-content: start; color: #000; font-size: 11px; }
  #debug canvas { width: 100%; height: auto; display: block; }
