:root {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #f6faf8;
  background: #0d1513;
  font-synthesis: none;
  color-scheme: dark;
  --bg: #0d1513;
  --panel: rgba(16, 27, 24, .82);
  --panel-soft: rgba(255, 255, 255, .065);
  --panel-strong: rgba(12, 21, 19, .97);
  --line: rgba(255, 255, 255, .14);
  --line-strong: rgba(255, 255, 255, .24);
  --text: #f6faf8;
  --muted: rgba(240, 248, 245, .68);
  --accent: #7ed6b4;
  --accent-strong: #58bd96;
  --warning: #f1c875;
  --danger: #ff8d84;
  --shadow: 0 18px 52px rgba(0, 0, 0, .34);
}

* { box-sizing: border-box; }
html, body, #app { width: 100%; height: 100%; min-height: 100%; margin: 0; overflow: hidden; }
body { background: var(--bg); -webkit-tap-highlight-color: transparent; }
button, input, textarea, select { font: inherit; }
button { min-width: 44px; min-height: 44px; touch-action: manipulation; }
button:disabled { cursor: not-allowed; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid rgba(126, 214, 180, .46);
  outline-offset: 2px;
}
.hidden { display: none !important; }

.app-shell {
  position: relative;
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  background: radial-gradient(circle at 50% 20%, #20322d, var(--bg) 62%);
}
.camera-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #07100e;
}
.camera-shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(4, 10, 9, .68), transparent 23%, transparent 60%, rgba(4, 10, 9, .83));
}

.topbar {
  position: absolute;
  z-index: 20;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  gap: 8px;
  align-items: center;
  padding: calc(env(safe-area-inset-top) + 10px) 12px 10px;
}
.brand {
  min-width: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  color: var(--text);
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--line);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
  cursor: pointer;
}
.brand-mark {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  color: #0d1815;
  background: var(--accent);
  border-radius: 9px 9px 12px 12px;
  font-weight: 900;
}
.brand-name { font-weight: 800; letter-spacing: .09em; font-size: 12px; }
.location-pill {
  min-width: 0;
  flex: 1;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 11px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 999px;
  backdrop-filter: blur(16px);
  color: var(--muted);
  font-size: 12px;
}
.location-pill svg { width: 18px; height: 18px; flex: 0 0 auto; }
.location-pill span:last-child { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.mode-badge {
  min-width: auto;
  padding: 5px 7px;
  border: 1px solid rgba(241, 200, 117, .35);
  border-radius: 999px;
  color: #ffe7b0;
  background: rgba(74, 54, 17, .72);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .07em;
}
.icon-button {
  border: 1px solid var(--line);
  color: #fff;
  background: var(--panel);
  border-radius: 16px;
  display: inline-grid;
  place-items: center;
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
  cursor: pointer;
}
.icon-button:active, .layer-chip:active, .status-action:active { transform: scale(.97); }
.icon-button svg { width: 22px; height: 22px; }
.account-button { flex: 0 0 46px; width: 46px; height: 46px; }

.scan-status {
  position: absolute;
  z-index: 12;
  left: 50%;
  top: max(104px, calc(env(safe-area-inset-top) + 92px));
  transform: translateX(-50%);
  width: min(88vw, 430px);
  text-align: center;
  pointer-events: none;
}
.scan-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  max-width: 100%;
  padding: 9px 14px;
  border: 1px solid var(--line);
  background: rgba(8, 16, 14, .68);
  border-radius: 999px;
  backdrop-filter: blur(14px);
  font-size: 13px;
  line-height: 1.3;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .18);
}
.status-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--warning);
  box-shadow: 0 0 0 5px rgba(241, 200, 117, .14);
}
.status-dot.good { background: var(--accent); box-shadow: 0 0 0 5px rgba(126, 214, 180, .16); }
.status-dot.bad { background: var(--danger); box-shadow: 0 0 0 5px rgba(255, 141, 132, .15); }

.crosshair-wrap {
  position: absolute;
  z-index: 10;
  left: 50%;
  top: 47%;
  transform: translate(-50%, -50%);
  width: 112px;
  height: 112px;
  pointer-events: none;
}
.crosshair {
  position: absolute;
  inset: 19px;
  border: 2px solid rgba(255, 255, 255, .78);
  border-radius: 50%;
  transition: border-color .18s, box-shadow .18s, transform .18s;
}
.crosshair::before, .crosshair::after { content: ""; position: absolute; background: rgba(255, 255, 255, .9); }
.crosshair::before { width: 24px; height: 2px; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.crosshair::after { width: 2px; height: 24px; left: 50%; top: 50%; transform: translate(-50%, -50%); }
.crosshair[data-quality="good"] {
  border-color: var(--accent);
  box-shadow: 0 0 0 8px rgba(126, 214, 180, .09), inset 0 0 0 1px rgba(126, 214, 180, .25);
  transform: scale(1.03);
}
.crosshair[data-quality="bad"] { border-color: var(--danger); }
.quality-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(var(--accent) var(--progress, 0%), rgba(255, 255, 255, .12) 0);
  mask: radial-gradient(transparent 54%, #000 56%);
  opacity: .9;
}


.placement-cancel {
  position: absolute;
  z-index: 18;
  left: 50%;
  top: max(154px, calc(env(safe-area-inset-top) + 142px));
  transform: translateX(-50%);
  min-height: 38px;
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: rgba(8, 16, 14, .76);
  backdrop-filter: blur(14px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .2);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.hint-layer { position: absolute; inset: 0; z-index: 11; pointer-events: none; }
.hint-layer.placement-active { opacity: 0; pointer-events: none; }
.ar-pin {
  position: absolute;
  transform: translate(-50%, -100%);
  pointer-events: auto;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
  transition: opacity .2s, transform .18s;
}
.ar-pin .pin-head {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 18px 18px 18px 5px;
  transform: rotate(-45deg);
  background: var(--accent);
  color: #0b1613;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .34), 0 0 0 5px rgba(126, 214, 180, .14);
  border: 1px solid rgba(255, 255, 255, .42);
}
.ar-pin .pin-head span { transform: rotate(45deg); font-weight: 900; font-size: 18px; }
.ar-pin .pin-label {
  display: block;
  max-width: 190px;
  margin-top: 8px;
  padding: 7px 10px;
  border-radius: 10px;
  background: rgba(9, 17, 15, .88);
  border: 1px solid var(--line);
  backdrop-filter: blur(10px);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 10px 24px rgba(0, 0, 0, .24);
}

.bottom-controls {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 8px 12px calc(env(safe-area-inset-bottom) + 12px);
}
.layer-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 0 2px 11px;
  scroll-snap-type: x proximity;
}
.layer-row::-webkit-scrollbar { display: none; }
.layer-chip {
  min-height: 40px;
  min-width: auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  scroll-snap-align: start;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 11px;
  background: var(--panel);
  color: var(--muted);
  white-space: nowrap;
  backdrop-filter: blur(14px);
  cursor: pointer;
  transition: transform .15s, background .15s, color .15s;
}
.layer-chip.active { color: #0b1713; background: var(--accent); border-color: transparent; font-weight: 800; }
.chip-count {
  min-width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  font-size: 11px;
  font-weight: 800;
}
.layer-chip.active .chip-count { background: rgba(11, 23, 19, .13); }
.action-row { display: grid; grid-template-columns: 1fr 84px 1fr; align-items: end; gap: 10px; }
.action-side { display: flex; gap: 10px; justify-content: center; }
.action-stack { display: grid; justify-items: center; position: relative; }
.action-label { min-height: 15px; font-size: 11px; color: rgba(255, 255, 255, .76); margin-top: 5px; text-align: center; }
.action-button { width: 58px; height: 58px; border-radius: 20px; }
.add-button {
  width: 76px;
  height: 76px;
  border-radius: 27px;
  border: 1px solid rgba(255, 255, 255, .34);
  color: #0b1713;
  background: var(--accent);
  box-shadow: 0 18px 42px rgba(0, 0, 0, .38), 0 0 0 7px rgba(126, 214, 180, .12);
  cursor: pointer;
  transition: opacity .18s, transform .15s, filter .18s;
}
.add-button:disabled { opacity: .42; filter: saturate(.55); }
.add-button:not(:disabled):active { transform: scale(.96); }
.add-button svg { width: 30px; height: 30px; }
.button-count {
  position: absolute;
  top: -5px;
  right: -7px;
  min-width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  padding: 0 5px;
  border-radius: 999px;
  color: #0b1713;
  background: var(--accent);
  border: 2px solid #10201c;
  font-size: 10px;
  font-weight: 900;
}

.onboarding {
  position: absolute;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: end center;
  overflow: auto;
  padding: 28px 18px calc(env(safe-area-inset-bottom) + 24px);
  background: radial-gradient(circle at 50% 12%, #2a493f, #101917 62%);
}
.onboarding-card {
  width: min(100%, 480px);
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: rgba(15, 25, 22, .88);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
}
.hero-symbol {
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  border-radius: 22px 22px 26px 9px;
  background: var(--accent);
  color: #0b1713;
  font-size: 30px;
  font-weight: 900;
  margin-bottom: 20px;
}
.eyebrow {
  margin: 0 0 7px;
  color: #a8e9d0;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .11em;
  text-transform: uppercase;
}
h1 { margin: 0 0 12px; font-size: clamp(38px, 12vw, 58px); letter-spacing: -.055em; line-height: .95; }
.lead { margin: 0 0 22px; color: var(--muted); line-height: 1.55; font-size: 16px; }
.permission-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin: 0 0 18px; }
.permission-grid > div {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel-soft);
}
.permission-grid svg { width: 21px; height: 21px; color: var(--accent); flex: 0 0 auto; }
.permission-grid span { min-width: 0; display: grid; }
.permission-grid strong { font-size: 12px; }
.permission-grid small { color: var(--muted); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.setup-notice {
  display: grid;
  gap: 3px;
  margin: 0 0 14px;
  padding: 12px 13px;
  border: 1px solid rgba(241, 200, 117, .28);
  border-radius: 15px;
  color: #ffe8b6;
  background: rgba(72, 51, 15, .36);
  font-size: 12px;
  line-height: 1.4;
}
.setup-notice span { color: rgba(255, 235, 190, .75); }
.primary-button, .secondary-button, .danger-button {
  width: 100%;
  border: 0;
  border-radius: 16px;
  padding: 14px 18px;
  font-weight: 800;
  cursor: pointer;
  transition: transform .15s, background .15s, opacity .15s;
}
.primary-button { color: #0b1713; background: var(--accent); }
.primary-button:hover { background: var(--accent-strong); }
.secondary-button { color: #fff; background: rgba(255, 255, 255, .08); border: 1px solid var(--line); }
.danger-button { color: #24100e; background: var(--danger); }
.primary-button:active, .secondary-button:active, .danger-button:active { transform: scale(.99); }
.primary-button:disabled, .secondary-button:disabled, .danger-button:disabled { opacity: .55; }
.start-button { display: flex; align-items: center; justify-content: center; gap: 9px; }
.start-button svg { width: 21px; height: 21px; }
.privacy-note { display: flex; gap: 9px; align-items: flex-start; margin-top: 14px; color: rgba(255, 255, 255, .58); font-size: 12px; line-height: 1.45; }
.privacy-note svg { width: 17px; height: 17px; flex: 0 0 auto; margin-top: 1px; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-end;
  background: rgba(0, 0, 0, .54);
  backdrop-filter: blur(4px);
}
.sheet {
  width: 100%;
  max-height: 92%;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 12px 18px calc(env(safe-area-inset-bottom) + 22px);
  border-radius: 28px 28px 0 0;
  background: var(--panel-strong);
  border-top: 1px solid var(--line);
  box-shadow: 0 -22px 60px rgba(0, 0, 0, .42);
}
.sheet-handle { width: 46px; height: 5px; margin: 0 auto 18px; border-radius: 999px; background: rgba(255, 255, 255, .22); }
.sheet-header { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; margin-bottom: 18px; }
.sheet-header > div { min-width: 0; }
.sheet h2 { margin: 0; font-size: 25px; letter-spacing: -.035em; line-height: 1.08; }
.sheet-subtitle { margin: 6px 0 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.close-button { flex: 0 0 46px; width: 46px; height: 46px; background: rgba(255, 255, 255, .08); box-shadow: none; }

.modal-backdrop.capture-mode {
  background: linear-gradient(180deg, transparent 0 45%, rgba(3, 8, 7, .76) 100%);
  backdrop-filter: none;
  padding: 0 10px calc(env(safe-area-inset-bottom) + 10px);
}
.capture-sheet {
  max-height: 47vh;
  margin: 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: 24px;
  padding: 10px 16px 16px;
  background: rgba(10, 18, 16, .91);
  backdrop-filter: blur(18px);
}
.capture-sheet .sheet-handle { margin-bottom: 12px; }
.capture-header { margin-bottom: 12px; }
.capture-header h2 { font-size: 22px; }
.capture-panel { display: grid; gap: 12px; }
.capture-progress { height: 9px; border-radius: 999px; overflow: hidden; background: rgba(255, 255, 255, .1); }
.capture-progress > div { height: 100%; width: var(--capture, 0%); background: var(--accent); transition: width .2s; }
.capture-summary { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.capture-summary > div { padding: 10px 12px; border-radius: 14px; background: var(--panel-soft); border: 1px solid var(--line); }
.capture-summary b { display: block; font-size: 18px; }
.capture-summary span { color: var(--muted); font-size: 11px; }
.capture-message { min-height: 38px; margin: 0; color: #e7f3ee; font-size: 13px; line-height: 1.45; }
.capture-details { color: var(--muted); font-size: 12px; }
.capture-details summary { cursor: pointer; }
.capture-details .metric { margin-top: 8px; }

.form-grid { display: grid; gap: 14px; }
.form-section { display: grid; gap: 13px; padding: 14px; border: 1px solid var(--line); border-radius: 19px; background: rgba(255, 255, 255, .035); }
.field { display: grid; gap: 7px; }
.field label { font-size: 13px; color: var(--muted); font-weight: 750; }
.field input, .field textarea, .field select, .hint-card textarea {
  width: 100%;
  min-height: 48px;
  color: #fff;
  background: rgba(255, 255, 255, .075);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 13px 14px;
}
.field input::placeholder, .field textarea::placeholder, .hint-card textarea::placeholder { color: rgba(240, 248, 245, .4); }
.field textarea, .hint-card textarea { min-height: 104px; resize: vertical; }
.field input[type="file"] { min-height: auto; padding: 11px; font-size: 12px; }
.inline-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-actions { display: grid; gap: 10px; margin-top: 3px; }
.sticky-actions { padding-top: 5px; }
.optional { color: rgba(240, 248, 245, .42); font-weight: 500; }
.field-help { margin: 0; color: rgba(240, 248, 245, .5); font-size: 11px; line-height: 1.45; }
.code-input { text-transform: uppercase; letter-spacing: .12em; font-size: 18px; font-weight: 850; }
.auth-tabs { padding-bottom: 2px; }
.check-row { display: flex; align-items: flex-start; gap: 10px; color: var(--text); font-size: 14px; line-height: 1.35; font-weight: 600; }
.check-row input[type="checkbox"] { width: 20px; height: 20px; flex: 0 0 auto; margin: 0; accent-color: var(--accent); }
.advanced-options { display: grid; gap: 10px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 255, 255, .035); }
.advanced-options summary { cursor: pointer; color: var(--muted); font-size: 12px; font-weight: 750; }
.advanced-options[open] summary { margin-bottom: 10px; }
.advanced-options .check-row + .check-row { margin-top: 8px; }
.capture-result { display: grid; grid-template-columns: 42px 1fr auto; gap: 11px; align-items: center; padding: 12px; border: 1px solid rgba(126, 214, 180, .22); border-radius: 17px; background: rgba(126, 214, 180, .08); }
.capture-result > span { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px; color: #0b1713; background: var(--accent); }
.capture-result svg { width: 22px; height: 22px; }
.capture-result > div { min-width: 0; display: grid; gap: 2px; }
.capture-result small { color: var(--muted); }
.text-button { min-width: auto; min-height: 38px; padding: 6px 8px; border: 0; color: #baf0db; background: transparent; font-weight: 750; cursor: pointer; }

.notice { display: grid; gap: 4px; padding: 12px 13px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255, 255, 255, .045); font-size: 12px; line-height: 1.45; }
.notice span { color: var(--muted); }
.warning-notice { border-color: rgba(241, 200, 117, .25); background: rgba(86, 64, 19, .22); }
.warning-notice .check-row { margin-top: 7px; }
.subtle-notice { margin-top: 4px; }

.hint-card { display: grid; gap: 14px; }
.hint-body { margin: 0; color: rgba(246, 250, 248, .9); white-space: pre-wrap; line-height: 1.62; font-size: 15px; }
.hint-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.badge { padding: 6px 9px; border-radius: 999px; background: rgba(126, 214, 180, .13); color: #b9f3dc; border: 1px solid rgba(126, 214, 180, .2); font-size: 12px; }
.badge-warning, .priority-high { color: #ffe3aa; background: rgba(241, 200, 117, .11); border-color: rgba(241, 200, 117, .22); }
.priority-low { color: rgba(240, 248, 245, .68); background: rgba(255, 255, 255, .06); border-color: var(--line); }
.media-section { padding: 8px; }
.media-preview { display: block; width: 100%; max-height: 48vh; object-fit: contain; border-radius: 15px; background: #050a09; }
.audio-preview { width: 100%; }
.section-title { margin: 0; font-size: 14px; letter-spacing: -.01em; }
.status-action-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.status-action { min-height: 45px; border: 1px solid var(--line); border-radius: 13px; color: var(--muted); background: rgba(255, 255, 255, .045); font-weight: 750; cursor: pointer; }
.status-action.active { color: #0b1713; background: var(--accent); border-color: transparent; }
.status-action:disabled { opacity: .6; }

.zone-list { display: grid; gap: 18px; }
.zone-group { display: grid; gap: 9px; }
.zone-header { display: flex; justify-content: space-between; gap: 10px; align-items: center; padding: 0 3px; }
.zone-header strong { font-size: 14px; }
.zone-header span { color: var(--muted); font-size: 12px; }
.list { display: grid; gap: 9px; }
.list-item { width: 100%; text-align: left; padding: 14px 15px; color: #fff; border: 1px solid var(--line); border-radius: 16px; background: rgba(255, 255, 255, .055); cursor: pointer; }
.list-item strong { display: block; margin-bottom: 5px; }
.list-item span { color: var(--muted); font-size: 12px; line-height: 1.4; }
.empty-state { display: grid; justify-items: center; gap: 10px; text-align: center; padding: 18px 4px 4px; }
.empty-state p { max-width: 360px; margin: 0 0 5px; color: var(--muted); line-height: 1.5; }
.empty-state .form-actions { width: 100%; }
.empty-symbol { width: 62px; height: 62px; display: grid; place-items: center; border-radius: 21px; color: var(--accent); background: rgba(126, 214, 180, .1); border: 1px solid rgba(126, 214, 180, .18); }
.empty-symbol svg { width: 28px; height: 28px; }

.toast-stack { position: absolute; z-index: 120; left: 50%; bottom: calc(env(safe-area-inset-bottom) + 136px); transform: translateX(-50%); width: min(88%, 420px); display: grid; gap: 8px; pointer-events: none; }
.toast { padding: 12px 14px; border-radius: 14px; background: rgba(7, 14, 12, .94); border: 1px solid var(--line); box-shadow: var(--shadow); font-size: 13px; animation: toast-in .2s ease-out; }
.debug-panel { position: absolute; z-index: 25; left: 12px; top: 90px; max-width: 230px; padding: 10px; border-radius: 12px; background: rgba(0, 0, 0, .72); font: 11px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; pointer-events: none; }
.permission-error { position: absolute; inset: 0; z-index: 110; display: grid; place-items: center; padding: 22px; background: radial-gradient(circle at 50% 20%, #20322d, #101917 68%); }
.permission-error .card { width: min(100%, 440px); padding: 24px; border: 1px solid var(--line); border-radius: 24px; background: rgba(255, 255, 255, .055); }
.permission-error h2 { margin-top: 0; }

@keyframes toast-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }

@media (min-width: 760px) {
  .modal-backdrop:not(.capture-mode) { align-items: center; justify-content: center; padding: 24px; }
  .sheet:not(.capture-sheet) { width: min(620px, 100%); max-height: 88vh; border-radius: 28px; border: 1px solid var(--line); padding-bottom: 24px; }
  .capture-sheet { width: min(560px, 100%); }
}

@media (max-width: 360px) {
  .brand-name { display: none; }
  .permission-grid { grid-template-columns: 1fr; }
  .inline-fields { grid-template-columns: 1fr; }
  .onboarding-card { padding: 22px; }
  .action-row { grid-template-columns: 1fr 78px 1fr; }
  .add-button { width: 70px; height: 70px; }
}

@media (max-height: 720px) {
  .scan-status { top: max(84px, calc(env(safe-area-inset-top) + 78px)); }
  .crosshair-wrap { top: 43% !important; }
  .onboarding { place-items: center; padding-top: calc(env(safe-area-inset-top) + 18px); }
  .hero-symbol { width: 56px; height: 56px; margin-bottom: 14px; }
  .onboarding-card { padding: 21px; }
  .permission-grid { margin-bottom: 12px; }
  .privacy-note { margin-top: 10px; }
  .capture-sheet { max-height: 58vh; }
}

@media (orientation: landscape) and (max-height: 600px) {
  .bottom-controls { max-width: 520px; left: 50%; transform: translateX(-50%); }
  .layer-row { justify-content: center; }
  .scan-status { top: calc(env(safe-area-inset-top) + 68px); }
  .crosshair-wrap { top: 45% !important; }
  .capture-sheet { max-height: 75vh; }
}

@supports not (backdrop-filter: blur(1px)) {
  .brand, .location-pill, .icon-button, .layer-chip, .scan-status-badge, .onboarding-card, .capture-sheet { background: rgba(12, 21, 19, .95); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}

.add-button.placement-confirm { box-shadow: 0 14px 34px rgba(0, 0, 0, .32), 0 0 0 7px rgba(126, 214, 180, .14); }
