.tools { display: flex; gap: 8px; align-items: center; }
.ar-btn {
  padding: .7em 1.2em;
  background: var(--glass);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: var(--ink);
  border: 0;
  border-radius: 40px;
  font: 300 clamp(11px, 1.2vw, 18px)/1.2 var(--font);
  letter-spacing: .08em;
  cursor: pointer;
}
.ar-btn[hidden] { display: none; }
@media (max-aspect-ratio: 1/1) { .ar-btn { font-size: 12px; padding: .7em 1em; } }
@media (orientation: landscape) and (max-height: 520px) { .ar-btn { font-size: 11px; padding: .55em 1em; } }

.ar-sheet, .cam {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: calc(16px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) calc(16px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: #0e0e0d;
  color: #fff;
  font-family: var(--font);
}
.ar-sheet[hidden], .cam[hidden] { display: none; }
.ar-sheet h2 { margin: 0; padding-right: 48px; font-size: 20px; font-weight: 700; }
.ar-x, .cam-btn {
  background: var(--glass);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: #fff;
  border: 0;
  border-radius: 40px;
  font: 300 14px/1.2 var(--font);
  padding: .7em 1.1em;
  cursor: pointer;
}
.ar-x { position: absolute; top: calc(12px + env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right)); width: 40px; height: 40px; padding: 0; border-radius: 50%; font-size: 24px; background: rgba(255, 255, 255, .12); }
.ar-stage { position: relative; flex: 1; min-height: 0; background: #1a1a19; border-radius: 10px; overflow: hidden; }
.ar-stage model-viewer { width: 100%; height: 100%; }
.ar-msg { position: absolute; left: 12px; right: 12px; bottom: 12px; margin: 0; text-align: center; font-size: 14px; z-index: 2; }
.ar-msg[hidden] { display: none; }
.ar-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.ar-actions button { flex: 1 1 150px; padding: .9em 1em; background: none; color: #fff; border: 1px solid rgba(255, 255, 255, .35); border-radius: 40px; font: inherit; cursor: pointer; }
.ar-actions .ar-primary { background: #fff; color: #111; border-color: #fff; font-weight: 700; }
.ar-actions button:disabled { opacity: .4; cursor: default; }
.ar-note { margin: 0; font-size: 12px; line-height: 1.4; color: rgba(255, 255, 255, .6); }

/* Режим камеры */
.cam { padding: 0; gap: 0; background: #000; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
.cam video, .cam #camPhoto { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cam-top { position: absolute; top: 0; left: 0; right: 0; z-index: 3; display: flex; justify-content: space-between; gap: 8px; padding: calc(12px + env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 0 max(12px, env(safe-area-inset-left)); }
.cam-mid { display: flex; gap: 8px; }
.cam-a4 { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; align-items: flex-end; justify-content: center; border: 2px dashed rgba(255, 255, 255, .9); box-shadow: 0 0 0 1px rgba(0, 0, 0, .4); color: #fff; font: 12px/1.6 var(--font); text-shadow: 0 1px 4px #000; pointer-events: none; }
.cam-a4[hidden] { display: none; }
.cam-hint { position: absolute; left: 16px; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); margin: 0; text-align: center; font-size: 13px; line-height: 1.4; text-shadow: 0 1px 8px #000; pointer-events: none; z-index: 2; }
.cam-err { position: absolute; left: 24px; right: 24px; top: 40%; margin: 0; text-align: center; z-index: 2; text-shadow: 0 1px 8px #000; }
.cam-err[hidden] { display: none; }
@media (orientation: landscape) and (max-height: 520px) { .ar-sheet h2 { font-size: 16px; } .ar-note { display: none; } .cam-hint { font-size: 11px; } }

.cam-mid { flex-wrap: wrap; justify-content: flex-end; }
.cam-zoom { position: absolute; right: max(12px, env(safe-area-inset-right)); top: 50%; transform: translateY(-50%); z-index: 3; display: flex; flex-direction: column; gap: 8px; }
.cam-zoom .cam-btn { width: 44px; height: 44px; padding: 0; border-radius: 50%; font-size: 22px; }
.ar-btn:hover { background: rgba(18, 18, 17, .85); }
