:root {
  --bg-top: #fff5f9;
  --bg-bottom: #ffdce9;
  --accent: #ff5d9e;
  --accent-deep: #d93879;
  --accent-soft: #ffe3ef;
  --accent-glow: rgba(255, 93, 158, 0.32);
  --surface: rgba(255, 255, 255, 0.92);
  --surface-card: #ffffff;
  --border-soft: rgba(255, 93, 158, 0.24);
  --text-main: #2b192e;
  --text-muted: #785b73;
  --cam-border: #ff7eb3;
  --cam-filter: brightness(1.08) contrast(1.02) saturate(1.12);
  --safe-top: env(safe-area-inset-top, 10px);
  --safe-bottom: env(safe-area-inset-bottom, 12px);
}

[data-theme="kitty"] {
  --bg-top: #fff4f8; --bg-bottom: #ffd6e7;
  --accent: #ff5d9e; --accent-deep: #d93879; --accent-soft: #ffe3ef;
  --accent-glow: rgba(255, 93, 158, 0.32); --cam-border: #ff7eb3;
}
[data-theme="cinnamoroll"] {
  --bg-top: #f0f9ff; --bg-bottom: #ccebff;
  --accent: #38bdf8; --accent-deep: #0284c7; --accent-soft: #e0f2fe;
  --accent-glow: rgba(56, 189, 248, 0.32); --cam-border: #7dd3fc;
}
[data-theme="pikachu"] {
  --bg-top: #fffbeb; --bg-bottom: #fef08a;
  --accent: #f59e0b; --accent-deep: #d97706; --accent-soft: #fef3c7;
  --accent-glow: rgba(245, 158, 11, 0.32); --cam-border: #fbbf24;
}
[data-theme="kuromi"] {
  --bg-top: #f7f2ff; --bg-bottom: #e2d1ff;
  --accent: #9b5de5; --accent-deep: #7b3ec4; --accent-soft: #efe3ff;
  --accent-glow: rgba(155, 93, 229, 0.3); --cam-border: #b380f5;
}
[data-theme="doraemon"] {
  --bg-top: #eff6ff; --bg-bottom: #cbe2ff;
  --accent: #2563eb; --accent-deep: #1d4ed8; --accent-soft: #dbeafe;
  --accent-glow: rgba(37, 99, 235, 0.28); --cam-border: #60a5fa;
}
[data-theme="panda"] {
  --bg-top: #f0fdf4; --bg-bottom: #d1fae5;
  --accent: #22c55e; --accent-deep: #16a34a; --accent-soft: #dcfce7;
  --accent-glow: rgba(34, 197, 94, 0.3); --cam-border: #4ade80;
}
[data-theme="capybara"] {
  --bg-top: #fff7ed; --bg-bottom: #fed7aa;
  --accent: #f97316; --accent-deep: #ea580c; --accent-soft: #ffedd5;
  --accent-glow: rgba(249, 115, 22, 0.3); --cam-border: #fb923c;
}
[data-theme="bunny"] {
  --bg-top: #fdf2f8; --bg-bottom: #fbcfe8;
  --accent: #ec4899; --accent-deep: #db2777; --accent-soft: #fce7f3;
  --accent-glow: rgba(236, 72, 153, 0.32); --cam-border: #f472b6;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

body {
  font-family: 'Quicksand', -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(170deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
  color: var(--text-main);
  min-height: 100dvh;
  overflow: hidden;
  display: flex;
  justify-content: center;
}

.toast-pill {
  position: fixed;
  top: calc(var(--safe-top) + 52px);
  left: 50%;
  transform: translate3d(-50%, -14px, 0);
  background: rgba(43, 25, 46, 0.92);
  color: #ffffff;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  z-index: 300;
  transition: opacity 0.2s ease, transform 0.22s ease;
  white-space: nowrap;
}
.toast-pill.show { opacity: 1; transform: translate3d(-50%, 0, 0); }

.app-shell {
  width: 100%;
  max-width: 440px;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: calc(var(--safe-top) + 4px) 15px calc(var(--safe-bottom) + 4px);
  position: relative;
}

/* ====== TOP BAR ====== */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 42px;
  gap: 8px;
}

.icon-pill, .avatar-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px solid #ffffff;
  background: var(--surface);
  color: var(--text-main);
  font-size: 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}
.icon-pill:active, .avatar-btn:active { transform: scale(0.92); }

.friend-pill {
  flex: 1;
  max-width: 225px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 5px 14px;
  height: 40px;
  border-radius: 999px;
  border: 1.5px solid #ffffff;
  background: var(--surface);
  color: var(--text-main);
  font-family: inherit;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.slot-counter-badge {
  background: var(--accent);
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
}

/* ====== MAIN STAGE ====== */
.main-stage {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  margin: 4px 0;
}

.tab-view {
  display: none;
  flex-direction: column;
  height: 100%;
  width: 100%;
}
.tab-view.active {
  display: flex;
  justify-content: space-between;
}

/* ====== CHỌN SỐ Ô & THEME ====== */
.control-strips { display: flex; flex-direction: column; gap: 5px; }

.layout-pill-bar {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  background: var(--surface);
  padding: 3px;
  border-radius: 999px;
  border: 1.5px solid #ffffff;
}

.slot-btn {
  border: none;
  background: transparent;
  padding: 4px 0;
  border-radius: 999px;
  font-family: inherit;
  font-size: 11px;
  font-weight: 800;
  color: var(--text-muted);
  cursor: pointer;
}
.slot-btn.active { background: var(--accent); color: #ffffff; }

.theme-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding: 1px 1px 2px;
  scrollbar-width: none;
}
.theme-strip::-webkit-scrollbar { display: none; }

.theme-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--surface);
  border: 1.5px solid #ffffff;
  color: var(--text-main);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}
.theme-chip.active { background: var(--accent); color: #ffffff; border-color: var(--accent); }

/* ====== KHUNG CAMERA LOCKET ====== */
.camera-card {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 0.94;
  border-radius: 38px;
  overflow: hidden;
  background: #fff0f6;
  border: 4px solid #ffffff;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.08), 0 0 0 2.5px var(--cam-border);
}

#cameraVideo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
  filter: var(--cam-filter);
}
#cameraVideo.rear-cam { transform: scaleX(1); }

.cam-fallback-box {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  gap: 10px;
  background: radial-gradient(circle, #ffffff 0%, var(--accent-soft) 100%);
  z-index: 1;
}
.cam-fallback-box[hidden] { display: none; }
.fallback-mascot { font-size: 46px; }
.cam-fallback-box p { font-size: 12.5px; color: var(--text-muted); max-width: 240px; line-height: 1.4; }
.btn-enable-cam {
  padding: 9px 16px;
  border-radius: 999px;
  border: none;
  background: var(--accent);
  color: #ffffff;
  font-family: inherit;
  font-weight: 800;
  font-size: 12.5px;
  cursor: pointer;
  box-shadow: 0 4px 12px var(--accent-glow);
}

.theme-frame-overlay { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.custom-live-overlay { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; opacity: 0.85; }

.corner-deco {
  position: absolute;
  font-size: 22px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.14));
}
.corner-deco.top-left { top: 48px; left: 14px; }
.corner-deco.top-right { top: 48px; right: 14px; }
.corner-deco.bottom-left { bottom: 52px; left: 14px; }
.corner-deco.bottom-right { bottom: 52px; right: 14px; }

.cam-hud-top, .cam-hud-bottom {
  position: absolute;
  left: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 5;
}
.cam-hud-top { top: 10px; }
.cam-hud-bottom { bottom: 10px; }

.shot-prompt-pill {
  padding: 5px 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--accent-deep);
  font-size: 11.5px;
  font-weight: 800;
}

.session-tray {
  position: absolute;
  bottom: 50px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 5px;
  padding: 4px 7px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.86);
  z-index: 5;
}
.tray-slot {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1.5px dashed var(--accent);
  background: #ffffff;
  display: grid;
  place-items: center;
  font-size: 10.5px;
  font-weight: 800;
  color: var(--accent-deep);
  overflow: hidden;
}
.tray-slot.filled { border-style: solid; border-color: #ffffff; }
.tray-slot img { width: 100%; height: 100%; object-fit: cover; }

.hud-btn {
  min-width: 34px;
  height: 34px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid #ffffff;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text-main);
  font-family: inherit;
  font-weight: 800;
  font-size: 11.5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.hud-btn.active { background: var(--accent); color: #ffffff; border-color: var(--accent); }
.hud-btn[hidden] { display: none; }

.countdown-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 76px;
  font-weight: 800;
  color: #ffffff;
  text-shadow: 0 4px 18px rgba(0,0,0,0.45);
  background: rgba(0,0,0,0.18);
  z-index: 10;
}
.countdown-overlay[hidden] { display: none; }

.flash-fx { position: absolute; inset: 0; background: #ffffff; opacity: 0; pointer-events: none; z-index: 12; }
.flash-fx.active { animation: flashAnim 0.3s ease-out; }
@keyframes flashAnim { 0% { opacity: 0.9; } 100% { opacity: 0; } }

/* ====== FILTER BAR ====== */
.filter-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 4px 2px 2px;
  scrollbar-width: none;
}
.filter-bar::-webkit-scrollbar { display: none; }

.filter-pill {
  flex: 0 0 auto;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--surface);
  border: 1.5px solid #ffffff;
  color: var(--text-main);
  font-family: inherit;
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}
.filter-pill.active { background: var(--accent); color: #ffffff; border-color: var(--accent); }

/* ====== NÚT CHỤP HELLO KITTY ====== */
.shutter-dock {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 2px 10px 0;
}

.side-action-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--surface);
  border: 1.5px solid #ffffff;
  color: var(--text-main);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.side-action-btn:active { transform: scale(0.9); }

.kitty-shutter {
  position: relative;
  width: 76px;
  height: 76px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 0.16s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.kitty-shutter:active { transform: scale(0.88); }

.kitty-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #ffffff;
  border: 4px solid var(--accent);
  box-shadow: 0 6px 16px var(--accent-glow);
}

.kitty-face {
  position: relative;
  width: 52px;
  height: 42px;
  background: #ffffff;
  border-radius: 50% 50% 46% 46% / 56% 56% 44% 44%;
  border: 2.1px solid #3a2432;
  margin-top: 4px;
}
.kitty-ear {
  position: absolute;
  top: -9px;
  width: 14px;
  height: 14px;
  background: #ffffff;
  border-top: 2.1px solid #3a2432;
  border-left: 2.1px solid #3a2432;
  border-radius: 4px 10px 0 0;
}
.kitty-ear.left { left: 3px; transform: rotate(14deg); }
.kitty-ear.right { right: 3px; transform: rotate(76deg); }

.kitty-bow {
  position: absolute;
  top: -7px;
  right: -2px;
  width: 20px;
  height: 12px;
  transform: rotate(22deg);
  z-index: 3;
}
.bow-left, .bow-right {
  position: absolute;
  top: 1px;
  width: 8px;
  height: 10px;
  background: #ff3b7f;
  border: 1.5px solid #3a2432;
  border-radius: 50%;
}
.bow-left { left: 0; }
.bow-right { right: 0; }
.bow-center {
  position: absolute;
  top: 2.5px;
  left: 6px;
  width: 6.5px;
  height: 6.5px;
  background: #ff7eb3;
  border: 1.5px solid #3a2432;
  border-radius: 50%;
}
.kitty-eye { position: absolute; top: 18px; width: 4.2px; height: 5.5px; background: #3a2432; border-radius: 50%; }
.kitty-eye.left { left: 11px; }
.kitty-eye.right { right: 11px; }
.kitty-nose { position: absolute; top: 24px; left: 50%; transform: translateX(-50%); width: 5.5px; height: 4px; background: #facc15; border: 1.3px solid #3a2432; border-radius: 50%; }
.whisker { position: absolute; width: 8px; height: 1.6px; background: #3a2432; border-radius: 2px; }
.w-l1 { top: 19px; left: -4px; transform: rotate(8deg); }
.w-l2 { top: 25px; left: -3px; transform: rotate(-6deg); }
.w-r1 { top: 19px; right: -4px; transform: rotate(-8deg); }
.w-r2 { top: 25px; right: -3px; transform: rotate(6deg); }

/* ====== MENU GIỌT NƯỚC TELEGRAM GPU-ACCELERATED (MƯỢT & NHẸ) ====== */
.telegram-nav-wrapper {
  position: relative;
  width: 288px;
  height: 62px;
  margin: 2px auto 0;
  touch-action: pan-y;
}

.nav-glass-track {
  position: absolute;
  inset: 3px 0;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.08);
}

.liquid-pill {
  position: absolute;
  top: 7px;
  left: 6px;
  width: 90px;
  height: 48px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 4px 14px var(--accent-glow);
  transform: translate3d(93px, 0, 0);
  transition: transform 0.42s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.3s ease;
  will-change: transform;
  pointer-events: none;
  z-index: 2;
}
.liquid-pill.dragging { transition: none; }
.liquid-shine {
  position: absolute;
  top: 5px;
  left: 16px;
  width: 34px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.36);
}

.nav-items {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  height: 100%;
  padding: 3px 6px;
}

.nav-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 11px;
  font-weight: 800;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  transition: color 0.2s ease, transform 0.22s ease;
}
.nav-btn.active { color: #ffffff; transform: scale(1.04); }

/* ====== ALBUM & STUDIO ====== */
.section-header { display: flex; justify-content: space-between; align-items: center; padding: 4px 2px 10px; }
.section-header h2 { font-size: 17px; font-weight: 800; }
.sub-hint { font-size: 11.5px; color: var(--text-muted); font-weight: 600; }

.btn-mini {
  padding: 7px 13px; border-radius: 999px; border: none;
  background: var(--accent-soft); color: var(--accent-deep);
  font-family: inherit; font-weight: 800; font-size: 12px; cursor: pointer;
}

.photo-grid {
  flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 12px; padding-bottom: 12px;
}
.photo-item {
  position: relative; border-radius: 22px; overflow: hidden; aspect-ratio: 1 / 1.15;
  border: 3px solid #ffffff; background: #ffffff; box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08); cursor: pointer;
}
.photo-item img { width: 100%; height: 100%; object-fit: cover; }
.photo-badge-frame {
  position: absolute; top: 8px; right: 8px; background: rgba(255, 255, 255, 0.92);
  color: var(--accent-deep); font-size: 10.5px; font-weight: 800; padding: 3px 8px; border-radius: 999px;
}
.photo-caption-tag {
  position: absolute; bottom: 8px; left: 8px; right: 8px; background: rgba(255, 255, 255, 0.92);
  color: var(--text-main); padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 700;
  text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.empty-state { grid-column: 1 / -1; text-align: center; padding: 48px 20px; color: var(--text-muted); font-weight: 600; }
.empty-emoji { font-size: 46px; margin-bottom: 10px; }

.scrollable-panel {
  flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; padding-bottom: 12px; scrollbar-width: none;
}
.scrollable-panel::-webkit-scrollbar { display: none; }

.card-block {
  background: var(--surface-card); border-radius: 24px; padding: 14px;
  display: flex; flex-direction: column; gap: 10px; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}
.block-head { display: flex; align-items: center; justify-content: space-between; }
.block-head h3 { font-size: 14px; font-weight: 800; }
.badge-new { font-size: 10.5px; font-weight: 800; padding: 3px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-deep); }
.block-desc { font-size: 12px; color: var(--text-muted); line-height: 1.4; }

.btn-upload-frame {
  display: flex; align-items: center; justify-content: center; gap: 8px; padding: 11px;
  border-radius: 16px; border: 2px dashed var(--accent); background: var(--accent-soft);
  color: var(--accent-deep); font-weight: 800; font-size: 13px; cursor: pointer;
}
.toggle-chip { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; cursor: pointer; }
.toggle-chip input { accent-color: var(--accent); width: 16px; height: 16px; }

.custom-frames-list { display: flex; gap: 8px; overflow-x: auto; padding-top: 2px; }
.custom-frame-thumb {
  position: relative; flex: 0 0 62px; height: 80px; border-radius: 12px; border: 2px solid var(--border-soft);
  background: repeating-conic-gradient(#f3f4f6 0% 25%, #ffffff 0% 50%) 50% / 12px 12px; overflow: hidden; cursor: pointer;
}
.custom-frame-thumb.active { border-color: var(--accent); }
.custom-frame-thumb img { width: 100%; height: 100%; object-fit: contain; }
.hole-count-pill {
  position: absolute; bottom: 2px; right: 2px; background: var(--accent); color: #fff;
  font-size: 9px; font-weight: 800; padding: 1px 5px; border-radius: 999px;
}

.booth-preset-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.booth-preset-card {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px;
  border-radius: 16px; background: var(--bg-top); border: 1.5px solid var(--border-soft);
  cursor: pointer; font-family: inherit; color: var(--text-main);
}
.booth-preset-card.active { border-color: var(--accent); background: var(--accent-soft); }
.preset-icon { font-size: 20px; }
.preset-name { font-size: 11px; font-weight: 800; text-align: center; }
.preset-sub { font-size: 9.5px; color: var(--text-muted); font-weight: 700; }

.theme-catalog { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.catalog-card {
  display: flex; align-items: center; gap: 9px; padding: 10px; border-radius: 16px;
  background: var(--bg-top); border: 1.5px solid var(--border-soft); color: var(--text-main);
  font-family: inherit; text-align: left; cursor: pointer;
}
.catalog-card.active { border-color: var(--accent); background: var(--accent-soft); }
.catalog-icon { font-size: 22px; }
.catalog-info strong { display: block; font-size: 12.5px; }
.catalog-info small { font-size: 10.5px; color: var(--text-muted); }

.light-input, .light-textarea {
  width: 100%; padding: 10px 13px; border-radius: 14px; border: 1.5px solid var(--border-soft);
  background: #ffffff; color: var(--text-main); font-family: inherit; font-size: 12.5px; font-weight: 600; outline: none;
}
.light-input:focus, .light-textarea:focus { border-color: var(--accent); }
.light-textarea { resize: vertical; min-height: 78px; }

.btn-primary-full, .btn-primary, .btn-secondary, .btn-accent-soft {
  padding: 11px 12px; border-radius: 15px; border: none; font-family: inherit;
  font-weight: 800; font-size: 12.5px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
}
.btn-primary-full, .btn-primary { background: var(--accent); color: #ffffff; }
.btn-secondary { background: #f1f5f9; color: var(--text-main); }
.btn-accent-soft { background: var(--accent-soft); color: var(--accent-deep); }

.share-result {
  font-size: 12px; padding: 10px 12px; border-radius: 14px; background: var(--bg-top);
  border: 1px solid var(--border-soft); word-break: break-all; line-height: 1.5;
}

/* ====== MODAL LỒNG KHUNG ====== */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(43, 25, 46, 0.55);
  display: grid; place-items: center; padding: 16px; z-index: 120;
}
.modal-backdrop[hidden] { display: none; }
.modal-card {
  width: 100%; max-width: 380px; background: #ffffff; border-radius: 30px; padding: 16px;
  display: flex; flex-direction: column; gap: 10px; box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}
.modal-top { display: flex; justify-content: space-between; align-items: center; font-weight: 800; font-size: 15px; }
.close-btn {
  width: 32px; height: 32px; border-radius: 50%; border: none;
  background: var(--accent-soft); color: var(--accent-deep); font-weight: 800; cursor: pointer;
}
.booth-preview-stage {
  width: 100%; max-height: 48dvh;
  background: repeating-conic-gradient(#f8fafc 0% 25%, #f1f5f9 0% 50%) 50% / 14px 14px;
  border-radius: 20px; display: flex; align-items: center; justify-content: center; padding: 10px; overflow: hidden;
}
#framedResultCanvas { max-width: 100%; max-height: 44dvh; width: auto; height: auto; border-radius: 12px; }
.modal-frame-selector { display: flex; gap: 7px; overflow-x: auto; padding: 2px 0; scrollbar-width: none; }
.modal-frame-selector::-webkit-scrollbar { display: none; }
.mini-frame-pill {
  flex: 0 0 auto; padding: 6px 11px; border-radius: 999px; border: 1.5px solid var(--border-soft);
  background: var(--bg-top); font-family: inherit; font-size: 11.5px; font-weight: 800; color: var(--text-main); cursor: pointer;
}
.mini-frame-pill.active { background: var(--accent); color: #ffffff; border-color: var(--accent); }
.modal-actions-3 { display: grid; grid-template-columns: 1fr 1fr 1.1fr; gap: 8px; }

/* ====== PASSCODE & ADMIN PANE ====== */
.passcode-backdrop {
  position: fixed; inset: 0; background: linear-gradient(165deg, #fff4f9, #ffd6e8);
  display: grid; place-items: center; padding: 24px; z-index: 250;
}
.passcode-backdrop[hidden] { display: none; }
.passcode-sheet { width: 100%; max-width: 340px; display: flex; flex-direction: column; align-items: center; gap: 22px; }
.passcode-header { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.lock-icon-ring {
  width: 52px; height: 52px; border-radius: 50%; background: #ffffff;
  display: grid; place-items: center; font-size: 22px; box-shadow: 0 6px 16px var(--accent-glow);
}
.passcode-header h3 { font-size: 20px; font-weight: 800; }
.passcode-header p { font-size: 12px; color: var(--text-muted); font-weight: 600; }
.passcode-dots { display: flex; gap: 18px; }
.passcode-dots .dot { width: 15px; height: 15px; border-radius: 50%; border: 2px solid var(--accent); }
.passcode-dots .dot.filled { background: var(--accent); transform: scale(1.15); }
.passcode-dots.shake { animation: pinShake 0.35s ease; }
@keyframes pinShake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-10px); } 75% { transform: translateX(10px); } }

.passcode-keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px 20px; }
.key-btn {
  width: 72px; height: 72px; border-radius: 50%; border: 1.5px solid #ffffff; background: #ffffff;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.05); display: flex; flex-direction: column;
  align-items: center; justify-content: center; font-family: inherit; color: var(--text-main); cursor: pointer;
}
.key-btn:active { transform: scale(0.92); background: var(--accent); color: #ffffff; }
.key-btn strong { font-size: 24px; font-weight: 800; line-height: 1.05; }
.key-btn span { font-size: 8.5px; letter-spacing: 1.2px; font-weight: 800; opacity: 0.6; margin-top: 2px; }
.key-btn.ghost-key { background: transparent; border-color: transparent; box-shadow: none; font-size: 13px; font-weight: 800; color: var(--accent-deep); }

.admin-backdrop {
  position: fixed; inset: 0; background: rgba(43, 25, 46, 0.58);
  display: flex; align-items: flex-end; justify-content: center; z-index: 260;
}
.admin-backdrop[hidden] { display: none; }
.admin-sheet {
  width: 100%; max-width: 440px; max-height: 90dvh; background: #fff8fb;
  border-radius: 32px 32px 0 0; padding: 18px 16px calc(var(--safe-bottom) + 16px);
  display: flex; flex-direction: column; gap: 12px;
}
.admin-top { display: flex; justify-content: space-between; align-items: center; }
.admin-top h3 { font-size: 17px; font-weight: 800; }
.admin-top small { font-size: 11px; color: var(--accent-deep); font-weight: 700; }
.admin-body { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.admin-card { background: #ffffff; border-radius: 22px; padding: 13px; display: flex; flex-direction: column; gap: 8px; }
.admin-card h4 { font-size: 13.5px; font-weight: 800; color: var(--accent-deep); }
.admin-note { font-size: 11.5px; color: var(--text-muted); line-height: 1.4; }
.field-label { font-size: 11.5px; font-weight: 800; color: var(--text-main); margin-top: 2px; }
.var-chips-group { display: flex; flex-wrap: wrap; gap: 6px; }
.var-chip {
  padding: 4px 10px; border-radius: 999px; border: 1.5px solid var(--accent);
  background: var(--accent-soft); color: var(--accent-deep); font-family: monospace; font-size: 11.5px; font-weight: 800; cursor: pointer;
}
.live-msg-preview { background: var(--bg-top); border: 1px dashed var(--border-soft); border-radius: 14px; padding: 10px; font-size: 11.5px; }
.live-msg-preview pre { margin-top: 4px; white-space: pre-wrap; font-family: inherit; line-height: 1.45; }
.admin-footer { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; }
