/* Fotokiste – Improved CSS (Glassmorphism + Modern Design) */
/* ====================================================================== */

:root {
  --c-bg:       #05070f;
  --c-bg-alt:   #0a0e27;
  --c-surface:  #1a1f3a;
  --c-surface-light: #242d4a;
  --c-card:     #1f2438;
  --c-border:   rgba(255, 255, 255, 0.08);
  --c-accent:   #e44d26;
  --c-accent2:  #f06529;
  --c-green:    #22c55e;
  --c-text:     #f5f7fa;
  --c-muted:    #94a3b8;
  --c-success:  #22c55e;
  --c-warning:  #ff9800;
  --c-danger:   #f44336;
  --radius:     16px;
  --radius-sm:  8px;
  --shadow:     0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-sm:  0 4px 12px rgba(0, 0, 0, 0.2);
  --trans:      .2s ease;
  --safe-top:   env(safe-area-inset-top, 0px);
  --safe-bottom:env(safe-area-inset-bottom, 0px);
}

/* ── Reset ───────────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  background: linear-gradient(135deg, var(--c-bg) 0%, var(--c-bg-alt) 100%);
  color: var(--c-text);
  min-height: 100dvh;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  scrollbar-width: none;
  overflow-y: hidden;
}

body::-webkit-scrollbar { display: none; }

img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: inherit; }
a { color: var(--c-accent); text-decoration: none; }
input, select, textarea { font-family: inherit; font-size: 1rem; }

/* ── Layout ──────────────────────────────────────────────────────────── */
.app-wrapper {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  width: 100vw;
  padding-top: var(--safe-top);
  padding-bottom: var(--safe-bottom);
  overflow: hidden;
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: rgba(10, 14, 39, 0.5);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--c-border);
  position: sticky;
  top: 0;
  z-index: 100;
  flex-shrink: 0;
}

.navbar-brand {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--c-text);
  display: flex;
  align-items: center;
  gap: 10px;
}

.navbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.main-content {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ── Tabs ────────────────────────────────────────────────────────────── */
.tabs {
  display: flex;
  background: rgba(10, 14, 39, 0.3);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--c-border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  position: sticky;
  top: 57px;
  z-index: 90;
  flex-shrink: 0;
}
.tabs::-webkit-scrollbar { display: none; }

.tab-btn {
  flex: 1;
  min-width: 100px;
  padding: 14px 16px;
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  color: var(--c-muted);
  font-size: .9rem;
  font-weight: 600;
  text-align: center;
  transition: color var(--trans), border-color var(--trans);
  white-space: nowrap;
  letter-spacing: 0.3px;
}

.tab-btn:hover {
  color: var(--c-accent);
}

.tab-btn.active {
  color: var(--c-accent);
  border-bottom-color: var(--c-accent);
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Buttons ─────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  transition: all var(--trans);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.btn:active { transform: scale(.95); }
.btn:disabled { opacity: .5; pointer-events: none; }

.btn-primary {
  background: linear-gradient(135deg, var(--c-green) 0%, #16a34a 100%);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(34, 197, 94, 0.3);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--c-text);
  border: 1px solid var(--c-border);
}
.btn-secondary:hover {
  background: rgba(228, 77, 38, 0.1);
  border-color: var(--c-accent);
  color: var(--c-accent);
}

.btn-success { background: linear-gradient(135deg, var(--c-success) 0%, #16a34a 100%); color: #fff; }
.btn-danger { background: linear-gradient(135deg, var(--c-danger) 0%, #dc2626 100%); color: #fff; }
.btn-ghost { background: transparent; color: var(--c-text); border: 1px solid var(--c-border); }
.btn-lg { padding: 16px 32px; font-size: 1.1rem; border-radius: var(--radius); }
.btn-sm { padding: 8px 14px; font-size: .85rem; }
.btn-icon { padding: 12px; border-radius: 10px; width: 44px; height: 44px; }
.btn-full { width: 100%; }

/* ── Kamera-Panel ────────────────────────────────────────────────────── */
#cam-panel {
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 0;
  overflow: hidden;
  display: none;
  height: 100%;
}
#cam-panel.active {
  display: flex !important;
}

.video-wrapper {
  position: relative;
  width: 100%;
  max-width: 100%;
  border-radius: 0;
  overflow: hidden;
  background: #000;
  aspect-ratio: 4/3;
  flex: 1 1 auto;
  flex-shrink: 1;
  min-height: 220px;
  max-height: 60vh;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
}

#cam-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

#cam-canvas { display: none; }

.cam-overlay-info {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
  z-index: 10;
}

.countdown-display {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 6rem;
  font-weight: 900;
  color: white;
  text-shadow: 0 0 30px rgba(0,0,0,.8);
  pointer-events: none;
  opacity: 0;
  transition: opacity .3s;
  z-index: 20;
}

.countdown-display.visible { opacity: 1; }

.flash-overlay {
  position: absolute;
  inset: 0;
  background: white;
  opacity: 0;
  pointer-events: none;
  transition: opacity .1s;
  z-index: 19;
}

.flash-overlay.flash { opacity: 0.8; }

.cam-controls {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: center;
  width: 100%;
  flex-wrap: wrap;
  padding: 12px 16px 16px;
  background: linear-gradient(180deg, rgba(10,14,39,0) 0%, rgba(10,14,39,0.8) 50%, rgba(10,14,39,0.95) 100%);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--c-border);
  flex-shrink: 0;
  flex-grow: 0;
  box-shadow: none;
  position: relative;
  bottom: auto;
  z-index: 50;
  padding-bottom: max(16px, var(--safe-bottom));
}

.shutter-btn {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
  background: linear-gradient(135deg, var(--c-green) 0%, #16a34a 100%);
  box-shadow: 0 6px 24px rgba(34, 197, 94, 0.35), inset -2px -2px 8px rgba(0, 0, 0, 0.3);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}

.shutter-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
  border-radius: 50%;
}

.shutter-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 12px 40px rgba(34, 197, 94, 0.5), inset -2px -2px 8px rgba(0, 0, 0, 0.3);
}

.shutter-btn:active {
  transform: scale(0.92);
}

.shutter-btn.recording {
  background: linear-gradient(135deg, var(--c-danger) 0%, #dc2626 100%);
  animation: pulse 1s infinite;
  box-shadow: 0 0 0 4px rgba(244, 67, 54, 0.2), 0 8px 32px rgba(244, 67, 54, 0.4);
}

/* Hide iPhone info blocks (NOT the live frame or overlay-info!) */
#remote-cam-panel {
  display: none !important;
}

#iphone-wait-overlay {
  display: none !important;
}

/* iPhone-Fernkamera-Modus: Auslöser leuchtet grün + pulsiert */
.shutter-btn.shutter-remote {
  background: linear-gradient(135deg, var(--c-success) 0%, #16a34a 100%);
  animation: pulse-remote 2s ease-in-out infinite;
}

@keyframes pulse-remote {
  0%, 100% { box-shadow: 0 8px 32px rgba(34, 197, 94, 0.4), 0 0 0 0 rgba(34, 197, 94, 0.4); }
  50% { box-shadow: 0 8px 32px rgba(34, 197, 94, 0.3), 0 0 0 16px rgba(34, 197, 94, 0); }
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 8px 32px rgba(244, 67, 54, 0.4), 0 0 0 0 rgba(244, 67, 54, 0.4); }
  50% { box-shadow: 0 8px 32px rgba(244, 67, 54, 0.3), 0 0 0 16px rgba(244, 67, 54, 0); }
}

/* ── Vorschau / Preview ──────────────────────────────────────────────── */
.preview-section {
  width: 100%;
  max-width: 600px;
}

.preview-img-wrap {
  width: 100%;
  border-radius: var(--radius);
  overflow: hidden;
  border: 2px solid var(--c-border);
  aspect-ratio: 4/3;
  background: #000;
  position: relative;
  box-shadow: var(--shadow);
}

.preview-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.preview-actions {
  display: flex;
  gap: 10px;
  padding-top: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.upload-status-msg {
  font-size: .85rem;
  color: var(--c-muted);
  flex: 1;
}

/* ── Galerie ─────────────────────────────────────────────────────────── */
#gallery-panel {
  overflow: hidden;
  display: none;
  flex-direction: column;
  height: 100%;
}
#gallery-panel.active {
  display: flex !important;
}

.gallery-toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  align-items: center;
  padding: 12px 16px;
  background: rgba(10, 14, 39, 0.3);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--c-border);
}

.gallery-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  padding: 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.gallery-grid::-webkit-scrollbar { display: none; }

.gallery-item {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  aspect-ratio: 1;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: all var(--trans);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--trans);
  display: block;
}

.gallery-item:hover,
.gallery-item:focus-within {
  border-color: var(--c-accent);
  box-shadow: 0 0 0 2px rgba(228, 77, 38, 0.2);
}

.gallery-item:hover img,
.gallery-item:focus-within img {
  transform: scale(1.05);
}

.gallery-item.selected::after {
  content: '✓';
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  background: var(--c-accent);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .9rem;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(228, 77, 38, 0.3);
}

.gallery-item.selected::before {
  content: '';
  position: absolute;
  inset: 0;
  border: 3px solid var(--c-accent);
  border-radius: var(--radius-sm);
  pointer-events: none;
  z-index: 1;
}

.gallery-loading {
  grid-column: 1/-1;
  text-align: center;
  padding: 40px;
  color: var(--c-muted);
}

.gallery-pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--c-border);
  background: rgba(10, 14, 39, 0.3);
  flex-shrink: 0;
}

/* ── Lightbox ────────────────────────────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.95);
  z-index: 1000;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(4px);
}

.lightbox.open { display: flex; }

.lightbox-img {
  max-width: 100%;
  max-height: 80dvh;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.lightbox-toolbar {
  display: flex;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

.lightbox-close {
  position: absolute;
  top: max(16px, var(--safe-top));
  right: 16px;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(10px);
  border: 1px solid var(--c-border);
  color: white;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--trans);
}

.lightbox-close:hover {
  background: rgba(228, 77, 38, 0.2);
  border-color: var(--c-accent);
}

/* ── Effekte-Panel ───────────────────────────────────────────────────── */
.effects-strip {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 12px 16px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  background: rgba(10, 14, 39, 0.3);
  border-bottom: 1px solid var(--c-border);
  flex-shrink: 0;
}
.effects-strip::-webkit-scrollbar { display: none; }

.effect-btn {
  flex-shrink: 0;
  padding: 10px 18px;
  border-radius: 20px;
  border: 1px solid var(--c-border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--c-muted);
  font-size: .9rem;
  font-weight: 600;
  white-space: nowrap;
  transition: all var(--trans);
  cursor: pointer;
}

.effect-btn:hover {
  border-color: var(--c-accent);
  color: var(--c-accent);
  background: rgba(228, 77, 38, 0.1);
}

.effect-btn.active {
  background: linear-gradient(135deg, var(--c-accent) 0%, var(--c-accent2) 100%);
  border-color: var(--c-accent);
  color: white;
  box-shadow: 0 4px 12px rgba(228, 77, 38, 0.3);
}

/* ── Share-Panel ─────────────────────────────────────────────────────── */
.share-card {
  background: rgba(26, 31, 58, 0.5);
  backdrop-filter: blur(10px);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
}

.qr-wrapper {
  display: flex;
  justify-content: center;
  margin: 16px 0;
}

.qr-wrapper img {
  border-radius: var(--radius-sm);
  background: white;
  padding: 10px;
  box-shadow: var(--shadow-sm);
}

.share-link {
  font-size: .85rem;
  color: var(--c-muted);
  word-break: break-all;
  margin: 12px 0;
}

.share-modal-card {
  min-width: min(460px, 92vw);
  max-height: 90dvh;
  overflow-y: auto;
  position: relative;
}

.share-offline-hint {
  text-align: center;
  padding: 20px 12px 8px;
  color: var(--c-muted);
  line-height: 1.5;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: .8rem;
  font-weight: 600;
}

.status-badge.pending { background: rgba(255,152,0,.15); color: var(--c-warning); border: 1px solid rgba(255,152,0,.3); }
.status-badge.ready   { background: rgba(34,197,94,.15); color: var(--c-success); border: 1px solid rgba(34,197,94,.3); }
.status-badge.failed  { background: rgba(244,67,54,.15); color: var(--c-danger); border: 1px solid rgba(244,67,54,.3); }

/* ── Toast-Nachrichten ───────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  bottom: max(24px, var(--safe-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  pointer-events: none;
  width: min(400px, 90vw);
}

.toast {
  background: rgba(26, 31, 58, 0.8);
  backdrop-filter: blur(10px);
  border: 1px solid var(--c-border);
  color: var(--c-text);
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  font-size: .95rem;
  pointer-events: auto;
  animation: slideUp .3s ease;
  max-width: 100%;
  text-align: center;
}

.toast.success { border-color: rgba(34,197,94,.3); background: rgba(34,197,94,.1); }
.toast.error   { border-color: rgba(244,67,54,.3); background: rgba(244,67,54,.1); }
.toast.warning { border-color: rgba(255,152,0,.3); background: rgba(255,152,0,.1); }

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Lade-Spinner ────────────────────────────────────────────────────── */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--c-border);
  border-top-color: var(--c-accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
  display: inline-block;
}

@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.8);
  backdrop-filter: blur(4px);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 20px;
}

/* ── Help-Button ─────────────────────────────────────────────────────── */
.help-btn {
  position: fixed;
  bottom: max(24px, calc(var(--safe-bottom) + 12px));
  left: 20px;
  z-index: 200;
  background: linear-gradient(135deg, var(--c-warning) 0%, #f59e0b 100%);
  color: #000;
  border: none;
  border-radius: 50%;
  width: 56px;
  height: 56px;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .04em;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--trans);
}

.help-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 12px 40px rgba(255, 152, 0, 0.4);
}

/* ── Card / Forms ────────────────────────────────────────────────────── */
.card {
  background: rgba(26, 31, 58, 0.5);
  backdrop-filter: blur(10px);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: .9rem; color: var(--c-muted); margin-bottom: 8px; font-weight: 500; }

.form-input,
.form-select {
  width: 100%;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  color: var(--c-text);
  padding: 12px 14px;
  font-size: 1rem;
  transition: all var(--trans);
}

.form-input:focus,
.form-select:focus {
  outline: none;
  border-color: var(--c-accent);
  background: rgba(228, 77, 38, 0.05);
  box-shadow: 0 0 0 3px rgba(228, 77, 38, 0.1);
}

.form-input::placeholder { color: var(--c-muted); }

/* ── Effekt-Vorschau-Canvas ──────────────────────────────────────────── */
#fx-canvas {
  width: 100%;
  max-width: 600px;
  border-radius: var(--radius);
  display: none;
}

/* ── Galerie Placeholder Styles ──────────────────────────────────────── */
.gallery-item.placeholder {
  background: rgba(26, 31, 58, 0.5);
  border: 1px dashed var(--c-border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
  position: relative;
  overflow: hidden;
}

.placeholder-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.placeholder-avatars {
  display: flex;
  gap: 6px;
  opacity: 0.3;
  margin-bottom: 6px;
}

.placeholder-avatars svg {
  width: 24px;
  height: 24px;
  color: var(--c-muted);
}

.placeholder-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid var(--c-border);
  border-top-color: var(--c-accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.placeholder-text {
  font-size: 0.75rem;
  color: var(--c-muted);
  font-weight: 500;
}

/* ── Selection-Bar ───────────────────────────────────────────────────── */
.selection-bar {
  position: fixed;
  bottom: max(100px, calc(var(--safe-bottom) + 88px));
  left: 50%;
  transform: translateX(-50%);
  background: rgba(26, 31, 58, 0.8);
  backdrop-filter: blur(10px);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 12px 20px;
  display: flex;
  gap: 12px;
  align-items: center;
  box-shadow: var(--shadow);
  z-index: 150;
  flex-wrap: wrap;
  justify-content: center;
  max-width: min(500px, 96vw);
  display: none;
}

.selection-bar.visible { display: flex; }

/* ── Greenscreen-Controls ────────────────────────────────────────────── */
.bg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 10px;
  max-height: 200px;
  overflow-y: auto;
  padding: 8px;
}

.bg-thumb {
  aspect-ratio: 16/9;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--trans);
}

.bg-thumb:hover {
  border-color: var(--c-accent);
  box-shadow: 0 0 0 2px rgba(228, 77, 38, 0.2);
}

.bg-thumb.active {
  border-color: var(--c-accent);
  box-shadow: 0 0 0 3px rgba(228, 77, 38, 0.3);
}

.bg-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── AirPrint-Rahmen (unsichtbar außer beim Drucken) ─────────────────── */
#print-frame { display: none; }

@media print {
  body > *:not(#print-frame) { display: none !important; }
  #print-frame {
    display: block !important;
    position: fixed;
    inset: 0;
    background: #fff;
    z-index: 99999;
  }
  #print-frame img {
    display: block;
    max-width: 100%;
    max-height: 100vh;
    width: auto;
    height: auto;
    margin: 0 auto;
    page-break-after: always;
    object-fit: contain;
  }
}

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .navbar-brand { font-size: 1.2rem; }
  .gallery-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 10px; }
  .cam-controls { gap: 8px; padding: 8px 10px 10px; }
  .shutter-btn { width: 65px; height: 65px; font-size: 1.4rem; }
  .main-content { padding: 0; }
  .gallery-toolbar { flex-direction: column; }
  .btn-lg { padding: 14px 24px; font-size: 1rem; }
}

@media (min-width: 768px) {
  .navbar { padding: 16px 24px; }
  .main-content { padding: 20px; }
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .shutter-btn { width: 80px; height: 80px; font-size: 1.7rem; }
  .cam-controls { gap: 14px; padding: 12px 20px 16px; }
}

@media (min-width: 1024px) {
  .shutter-btn { width: 85px; height: 85px; font-size: 1.8rem; }
  #cam-panel { max-width: 1000px; margin: 0 auto; width: 100%; }
  .cam-controls { gap: 16px; padding: 14px 24px 20px; }
}

@media (orientation: landscape) and (max-height: 500px) {
  .tabs { top: 49px; }
  .shutter-btn { width: 70px; height: 70px; font-size: 1.5rem; }
  .cam-controls { padding: 8px 12px 10px; gap: 8px; }
  .navbar { padding: 8px 12px; }
}

/* ── Admin Layout ────────────────────────────────────────────────────── */
.admin-main {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.admin-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 20px;
}

.admin-content::-webkit-scrollbar { display: none; }

.sidebar {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.sidebar::-webkit-scrollbar { display: none; }
