:root {
  color-scheme: dark;
  --ink: #07100c;
  --glass: rgba(6, 14, 10, .78);
  --cream: #fff4d4;
  --mint: #9ff2bd;
  --lime: #c9ff62;
  --line: rgba(255, 244, 212, .22);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: var(--ink); }
body { font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--cream); }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
.app-shell, .viewfinder { width: 100%; height: 100%; min-height: 100dvh; }
.viewfinder { position: relative; overflow: hidden; background: radial-gradient(circle at 50% 35%, #1f3629, #07100c 67%); touch-action: none; isolation: isolate; }
#cameraFeed { position: absolute; z-index: 0; inset: 0; width: 100%; height: 100%; object-fit: cover; transform-origin: 50% 50%; will-change: transform; background: #050806; opacity: 1; }
#infiniteFieldCanvas { position: absolute; z-index: 1; inset: 0; width: 100%; height: 100%; background: #050806; opacity: 0; pointer-events: none; }
.infinite-field-active #cameraFeed { opacity: 0; }
.infinite-field-active #infiniteFieldCanvas { opacity: 1; }
.empty-view { position: absolute; inset: 0; z-index: 2; display: grid; place-content: center; justify-items: center; padding: 76px 24px 210px; text-align: center; background: radial-gradient(circle at 50% 34%, rgba(76, 128, 89, .46), rgba(7, 16, 12, .96) 68%); transition: opacity .3s ease; }
.camera-live .empty-view { opacity: 0; pointer-events: none; }
.brand-mark { position: relative; width: 116px; height: 58px; margin-bottom: 20px; filter: drop-shadow(0 12px 26px rgba(0,0,0,.46)); }
.lens { position: absolute; top: 4px; width: 54px; height: 54px; border: 7px solid var(--cream); border-radius: 50%; box-shadow: inset 0 0 0 4px var(--ink), inset 0 0 0 7px var(--mint); }
.lens::after { content: ""; position: absolute; inset: 10px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #d7ffe1 0 4%, #3c8d5b 12%, #0b2014 48%, #020504 75%); }
.lens-left { left: 0; } .lens-right { right: 0; }
.bridge { position: absolute; z-index: -1; left: 48px; top: 24px; width: 22px; height: 12px; background: var(--cream); border-radius: 4px; }
.eyebrow { margin: 0 0 9px; font-size: 11px; font-weight: 850; letter-spacing: .2em; color: var(--mint); }
h1 { margin: 0; font-size: clamp(38px, 12vw, 66px); line-height: .94; letter-spacing: -.055em; }
.intro { max-width: 300px; margin: 15px auto 24px; color: rgba(255,244,212,.74); font-size: 15px; line-height: 1.45; }
.open-camera, .error-card button { min-width: 184px; min-height: 54px; padding: 0 22px; border: 0; border-radius: 999px; background: var(--lime); color: #0a120d; font-weight: 900; box-shadow: 0 12px 36px rgba(201,255,98,.24); cursor: pointer; }
.open-camera:active, .error-card button:active { transform: scale(.97); }
.privacy { margin: 15px 0 0; font-size: 11px; color: rgba(255,244,212,.58); }
.privacy span { color: var(--mint); font-size: 8px; }
.capability-note { max-width: 300px; margin: 9px 0 0; color: rgba(255,244,212,.46); font-size: 10px; line-height: 1.35; }
.vignette { position: absolute; inset: 0; z-index: 3; pointer-events: none; background: radial-gradient(ellipse 74% 68% at 50% 44%, transparent 48%, rgba(0,0,0,.22) 74%, rgba(0,0,0,.78) 100%); opacity: 0; transition: opacity .3s ease; }
.camera-live .vignette { opacity: 1; }
.reticle { position: absolute; z-index: 4; left: 50%; top: 43%; width: 72px; height: 72px; transform: translate(-50%,-50%); border: 1px solid rgba(255,244,212,.62); border-radius: 50%; opacity: 0; pointer-events: none; box-shadow: 0 0 0 1px rgba(0,0,0,.18); }
.reticle::before, .reticle::after { content: ""; position: absolute; background: rgba(255,244,212,.78); }
.reticle::before { left: -10px; right: -10px; top: 50%; height: 1px; }
.reticle::after { top: -10px; bottom: -10px; left: 50%; width: 1px; }
.reticle span { position: absolute; inset: 31px; border: 2px solid var(--lime); border-radius: 50%; }
.camera-live .reticle { opacity: 1; }
.topbar { position: absolute; z-index: 8; left: 0; right: 0; top: 0; display: grid; grid-template-columns: 48px 1fr 48px; align-items: center; gap: 10px; padding: calc(10px + var(--safe-top)) 14px 10px; background: linear-gradient(180deg, rgba(0,0,0,.58), transparent); pointer-events: none; }
.topbar > * { pointer-events: auto; }
.round-action { display: grid; place-items: center; width: 48px; height: 48px; min-width: 48px; min-height: 48px; border: 1px solid var(--line); border-radius: 50%; background: rgba(6,14,10,.64); color: var(--cream); text-decoration: none; font-size: 24px; backdrop-filter: blur(14px); cursor: pointer; }
.home-action { font-size: 38px; line-height: 1; padding-bottom: 5px; }
.wordmark { display: grid; justify-items: center; gap: 2px; text-shadow: 0 2px 8px #000; }
.wordmark strong { font-size: 13px; letter-spacing: .16em; }
.wordmark span { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; color: rgba(255,244,212,.72); }
.zoom-hud { position: absolute; z-index: 5; left: 50%; top: 21%; min-width: 220px; transform: translateX(-50%); display: grid; justify-items: center; text-shadow: 0 3px 18px #000; opacity: 0; transition: opacity .25s ease; pointer-events: none; }
.camera-live .zoom-hud { opacity: 1; }
.zoom-value { font-size: clamp(34px, 11vw, 58px); font-weight: 900; letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.zoom-mode { margin-top: -3px; color: var(--lime); font-size: 9px; font-weight: 900; letter-spacing: .22em; white-space: nowrap; }
.gesture-tip { position: absolute; z-index: 5; left: 50%; bottom: calc(310px + var(--safe-bottom)); transform: translateX(-50%); width: max-content; max-width: calc(100% - 34px); margin: 0; padding: 7px 12px; border-radius: 999px; background: rgba(0,0,0,.48); font-size: 11px; color: rgba(255,244,212,.72); opacity: 0; pointer-events: none; transition: opacity .3s ease; }
.camera-live .gesture-tip { opacity: 1; animation: tipFade 5s 2s forwards; }
.controls { position: absolute; z-index: 8; left: 10px; right: 10px; bottom: calc(10px + var(--safe-bottom)); display: grid; gap: 9px; padding: 12px; border: 1px solid var(--line); border-radius: 24px; background: var(--glass); backdrop-filter: blur(20px) saturate(1.2); box-shadow: 0 18px 40px rgba(0,0,0,.34); opacity: 0; pointer-events: none; transition: opacity .25s ease; }
.camera-live .controls { opacity: 1; pointer-events: auto; }
.quality-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.quality-toggle button { min-height: 44px; border: 1px solid rgba(255,244,212,.14); border-radius: 14px; background: rgba(255,255,255,.05); color: rgba(255,244,212,.74); font-size: 12px; font-weight: 900; cursor: pointer; }
.quality-toggle button.active { border-color: var(--mint); background: rgba(159,242,189,.18); color: var(--mint); }
.camera-select-wrap { display: grid; gap: 5px; min-width: 0; }
.camera-select-label { padding-left: 4px; color: rgba(255,244,212,.58); font-size: 9px; font-weight: 900; letter-spacing: .15em; text-transform: uppercase; }
#cameraDevice { width: 100%; min-height: 44px; padding: 0 12px; border: 1px solid rgba(255,244,212,.14); border-radius: 14px; background: #122219; color: var(--cream); font-size: 12px; font-weight: 800; }
#cameraDevice:disabled { opacity: .58; }
.quick-zooms { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.quick-zooms button { min-height: 44px; border: 1px solid rgba(255,244,212,.14); border-radius: 999px; background: rgba(255,255,255,.06); color: rgba(255,244,212,.78); font-size: 12px; font-weight: 800; cursor: pointer; }
.quick-zooms button.active { border-color: var(--lime); background: var(--lime); color: #07100c; }
.zoom-row { display: grid; grid-template-columns: 48px 1fr 48px; align-items: center; gap: 10px; }
.control-btn { min-width: 48px; min-height: 48px; border: 1px solid rgba(255,244,212,.18); border-radius: 16px; background: rgba(255,255,255,.08); color: var(--cream); font-size: 27px; font-weight: 500; cursor: pointer; }
.control-btn:active, .utility-btn:active, .round-action:active { background: rgba(201,255,98,.22); transform: scale(.96); }
.range-wrap { display: grid; min-width: 0; }
#zoomRange { width: 100%; height: 48px; margin: 0; accent-color: var(--lime); cursor: ew-resize; }
#zoomRange::-webkit-slider-thumb { width: 30px; height: 30px; }
.utility-row { display: grid; grid-template-columns: 1fr; gap: 8px; }
.utility-btn { min-height: 44px; border: 1px solid rgba(255,244,212,.13); border-radius: 14px; background: rgba(255,255,255,.04); color: rgba(255,244,212,.74); font-size: 12px; font-weight: 800; cursor: pointer; }
.stop-btn { color: #ffc6b8; }
.error-card { position: absolute; z-index: 12; left: 20px; right: 20px; top: 50%; transform: translateY(-50%); max-width: 380px; margin: auto; padding: 22px; border: 1px solid var(--line); border-radius: 24px; background: rgba(7,16,12,.96); text-align: center; box-shadow: 0 24px 70px #000; }
.error-card strong { font-size: 20px; }
.error-card p { color: rgba(255,244,212,.7); line-height: 1.45; }
.error-card button { min-height: 48px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }
@keyframes tipFade { 0%,55% { opacity: 1; } 100% { opacity: 0; } }
@media (max-height: 650px) {
  .controls { gap: 6px; padding: 9px; }
  .utility-row { display: none; }
  .gesture-tip { bottom: calc(240px + var(--safe-bottom)); }
  .reticle { top: 42%; width: 62px; height: 62px; }
  .reticle span { inset: 27px; }
  .zoom-hud { top: 18%; }
  .empty-view { padding-bottom: 150px; }
}
@media (min-width: 760px) {
  body { display: grid; place-items: center; background: #020604; }
  .app-shell { width: min(100vw, 520px); box-shadow: 0 0 90px rgba(73,141,94,.2); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .001ms !important; }
}
