:root {
  color-scheme: dark;
  --bg: #0d0e12;
  --surface: #151821;
  --surface-2: #1e2230;
  --border: #2e3448;
  --ink: #f5f5f2;
  --muted: #b4b9c9;
  --accent: #9be83b;
  --cyan: #2cc9e6;
  --pink: #f25287;
  --amber: #f6b93b;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0; width: 100%; height: 100%;
  overflow: hidden; background: var(--bg); color: var(--ink);
  font: 15px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  user-select: none; -webkit-user-select: none;
}
.ar-viewport {
  position: fixed; inset: 0; width: 100vw; height: 100dvh;
  overflow: hidden; background: #000;
}
.ar-camera-video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; z-index: 1;
}
.ar-reticle-layer {
  position: absolute; inset: 0; pointer-events: none; z-index: 2;
}
.ar-reticle-box {
  position: absolute; left: 50%; top: 48%;
  width: min(74vw, 340px); height: min(104vw, 480px);
  transform: translate(-50%, -50%);
  border: 2px dashed var(--cyan);
  transition: border-color 0.15s ease, opacity 0.2s ease;
}
.ar-reticle-box.locked {
  border-style: solid; border-color: var(--accent);
}
.ar-reticle-box.wrong-side {
  border-style: solid; border-color: var(--pink);
}
.ar-stage {
  position: absolute; inset: 0; z-index: 3;
  perspective: 900px; pointer-events: none;
}
.ar-anchor {
  position: absolute; left: 50%; top: 48%;
  width: 320px; height: 452px;
  margin-left: -160px; margin-top: -226px;
  transform-style: preserve-3d;
  pointer-events: auto;
  will-change: transform;
}
.ar-topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: max(10px, env(safe-area-inset-top)) 12px 10px;
  background: var(--bg); border-bottom: 2px solid var(--border);
}
.ar-back {
  color: var(--accent); text-decoration: none; font-weight: 700;
  font-size: 13px; padding: 6px 10px; border: 1px solid var(--border);
  background: var(--surface); white-space: nowrap;
}
.ar-title-group { min-width: 0; flex: 1; text-align: center; }
.ar-title {
  font-size: 14px; font-weight: 700; margin: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ar-status-pill {
  display: inline-block; padding: 4px 8px; font-size: 11px;
  font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
  background: var(--surface-2); color: var(--cyan); border: 1px solid var(--cyan);
  white-space: nowrap;
}
.ar-status-pill.locked { background: var(--accent); color: #0d0e12; border-color: var(--accent); }
.ar-status-pill.warn { background: var(--pink); color: #0d0e12; border-color: var(--pink); }
.ar-dock {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 10;
  padding: 12px 12px max(14px, env(safe-area-inset-bottom));
  background: var(--bg); border-top: 2px solid var(--border);
}
.ar-dock-row {
  display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap;
}
.ar-btn {
  appearance: none; border: 1px solid var(--border);
  background: var(--surface); color: var(--ink);
  font: 600 13px/1.2 -apple-system, BlinkMacSystemFont, sans-serif;
  padding: 9px 12px; cursor: pointer; white-space: nowrap;
}
.ar-btn.active, .ar-btn.primary {
  background: var(--accent); color: #0d0e12; border-color: var(--accent);
}
.ar-btn.cyan {
  background: var(--cyan); color: #0d0e12; border-color: var(--cyan);
}
.ar-card {
  background: var(--surface); border: 2px solid var(--accent);
  padding: 12px; margin-bottom: 10px; font-size: 13px;
}
.ar-card h3 { margin: 0 0 4px; font-size: 15px; color: var(--accent); }
.ar-card p { margin: 0; color: var(--muted); }
