/* Global visibility utility */
.hidden {
  display: none !important;
}

.dock-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── iOS Liquid Glass Design System ──────────────────────────────────── */
:root {
  --primary: #007AFF;
  --primary-hover: #0066d6;
  --secondary: rgba(255, 255, 255, 0.55);
  --bg-main: #dadada;
  --sidebar-bg: rgba(255, 255, 255, 0.9);
  --text-dark: #1c1c1e;
  --text-muted: #6e6e73;
  --border: rgba(255, 255, 255, 0.35);
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  --card-radius: 20px;
  --glass-bg: rgba(255, 255, 255, 0.9);
  --glass-border: 1px solid rgba(255, 255, 255, 0.8);
  --glass-blur: blur(24px) saturate(180%);
  --glass-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  --dock-item-bg: rgba(255, 255, 255, 0.9);
  --dock-item-hover: rgba(255, 255, 255, 1.0);
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);

  /* Fallback custom cursors until JS upscales them */
  --custom-default-cursor: url('../assets/mouse_pointers/default_pointer.svg') 2 2, default;
  --custom-hand-cursor: url('../assets/mouse_pointers/hand_pointer.svg') 4 1, pointer;
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, 'SF Pro Display', system-ui, sans-serif;
  background-color: var(--bg-main);
  background-image: radial-gradient(rgb(255, 255, 255) 0.8px, transparent 0.8px);
  background-size: 48px 48px;
  color: var(--text-dark);
  margin: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  cursor: var(--custom-default-cursor);
}

input,
button,
select,
textarea {
  font-family: inherit;
}

/* ── Top Docks (Split Bar) ─────────────────────────────────────────── */
.top-dock-wrapper {
  position: fixed;
  top: 12px;
  left: 0;
  width: 100vw;
  z-index: 1000;
  pointer-events: none;
  /* allow clicks to pass through empty space */
}

.dock-group {
  position: absolute;
  top: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: auto;
  /* re-enable clicks on the groups themselves */
}

.top-left-dock {
  left: 24px;
}

.top-center-dock {
  left: 50%;
  transform: translateX(-50%);
}

.top-right-dock {
  right: 24px;
}

.dock-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 16px;
  min-height: 38px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: 50px;
  color: var(--text-dark);
  font-weight: 600;
  font-size: 0.82rem;
  cursor: pointer;
  transition: transform var(--transition), background var(--transition), box-shadow var(--transition);
  white-space: nowrap;
  user-select: none;
  position: relative;
}

.dock-item i {
  font-size: 1.1rem;
}

.dock-item.icon-only {
  padding: 8px 12px;
  min-width: 38px;
}

button.dock-item:hover {
  background: #396afc;
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(57, 106, 252, 0.3);
}

button.dock-item:hover img {
  filter: brightness(0) invert(1);
}

button.dock-item.dock-item-danger:hover {
  background: #ef4444 !important;
  color: #ffffff !important;
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.3) !important;
}

button.dock-item.dock-item-danger:hover img {
  filter: brightness(0) invert(1) !important;
}

.dock-item:active {
  transform: scale(0.95) translateY(2px);
}

.dock-item:disabled,
.dock-item[disabled] {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

/* Pagination Arrow inside dock-item pill */
.pagination-arrow {
  transition: filter 0.2s ease, opacity 0.2s ease;
}

.pagination-arrow:not(.disabled):hover {
  /* Blue tint matching primary #007AFF/#396afc */
  filter: invert(36%) sepia(85%) saturate(3025%) hue-rotate(213deg) brightness(98%) contrast(97%);
}

.pagination-arrow.disabled {
  opacity: 0.3;
  pointer-events: none;
  cursor: default !important;
}

/* Mac Dock Magnification Effect — top bar shifts DOWN on hover */
.top-dock-wrapper button.dock-item:hover {
  transform: scale(1.12) translateY(3px);
}

/* Dock sibling adjacent scaling logic removed for exact hover isolation */

.dock-separator {
  width: 1px;
  height: 20px;
  background: rgba(0, 0, 0, 0.1);
  margin: 0 2px;
  flex-shrink: 0;
}

.dock-item input[type="text"] {
  background: transparent;
  border: none;
  color: var(--text-dark);
  font-weight: 600;
  font-size: 0.82rem;
  outline: none;
  width: 130px;
  font-family: inherit;
}

/* Profile dropdown inside dock */
.dock-profile-btn {
  display: flex;
  align-items: center;
  gap: 6px;
}

.dock-profile-btn .profile-btn-info {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.dock-profile-btn .profile-btn-label {
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.2;
}

.dock-profile-btn .profile-btn-desc {
  font-size: 0.62rem;
  opacity: 0.6;
  font-weight: 500;
  line-height: 1.1;
}

/* ── Profile Dropdown Panel (existing, restyled glass) ──────────── */
.custom-profile-dropdown {
  position: relative;
}

.profile-options-panel {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(-6px) scale(0.97);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
  min-width: 240px;
  z-index: 9999;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  padding: 6px;
}

.profile-options-panel.open {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
  pointer-events: all;
}

.profile-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s;
  color: var(--text-dark);
}

.profile-option:hover {
  background: rgba(0, 122, 255, 0.08);
}

.profile-option.popt-active {
  background: rgba(0, 122, 255, 0.12);
  color: var(--primary);
}

.profile-option .material-icons:first-child {
  font-size: 1.4rem;
  color: inherit;
  opacity: 0.85;
}

.popt-info {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.popt-label {
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.2;
}

.popt-desc {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 500;
}

.profile-option.popt-active .popt-desc {
  color: var(--primary);
  opacity: 0.75;
}

.popt-check {
  font-size: 1rem !important;
  color: var(--primary);
  opacity: 0;
  transition: opacity 0.15s;
}

.profile-option.popt-active .popt-check {
  opacity: 1;
}

.profile-chevron {
  font-size: 0.9rem !important;
  opacity: 0.5;
  transition: transform 0.25s ease;
}

.custom-profile-dropdown:has(#profileOptionsPanel.open) .profile-chevron {
  transform: rotate(180deg);
}

/* ── Download Options Panel (glass restyle) ──────────────────────── */
.download-options-panel {
  display: none !important;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
  background: var(--glass-bg) !important;
  backdrop-filter: var(--glass-blur) !important;
  -webkit-backdrop-filter: var(--glass-blur) !important;
  border: var(--glass-border) !important;
  border-radius: 16px !important;
}

.download-options-panel.open {
  display: block !important;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* ── Nav Rail (Left Glass Buttons) ─────────────────────────────── */
.studio-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
  margin-top: 0;
}

.nav-rail {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 72px;
  min-width: 72px;
  flex-shrink: 0;
  box-sizing: border-box;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 16px 12px;
  gap: 12px;
  z-index: 1000;
  pointer-events: none;
  /* Let clicks pass through empty space */
}

/* Allow clicks on children */
.nav-rail>* {
  pointer-events: auto;
}

.rail-item {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  box-shadow: var(--glass-shadow);
  position: relative;
  padding: 0 0 0 14px;
  font-size: 0.75rem;
  font-weight: 600;
  overflow: hidden;
  white-space: nowrap;
}

.rail-item i,
.rail-item .bi {
  font-size: 1.25rem;
  transition: transform 0.2s;
  flex-shrink: 0;
}

.rail-item span {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-left: 12px;
  opacity: 0;
  max-width: 0;
  transition: opacity 0.3s ease, max-width 0.3s ease;
}

/* Rail hover — scale up + shift RIGHT and expand to pill */
.rail-item:hover:not(.active) {
  width: 140px;
  border-radius: 24px;
  background: #396afc;
  color: #ffffff;
  box-shadow: 0 4px 20px rgba(57, 106, 252, 0.3);
}

.rail-item:hover img,
.rail-item:hover i {
  filter: brightness(0) invert(1) !important;
}

.rail-item:hover:not(.active) span {
  opacity: 1;
  max-width: 100px;
}

.rail-item:active {
  transform: scale(0.96);
}

.rail-item.active {
  background: #396afc;
  color: #ffffff;
  border-color: #396afc;
  box-shadow: 0 4px 24px rgba(57, 106, 252, 0.4);
}

.rail-item.active img,
.rail-item.active i {
  filter: brightness(0) invert(1) !important;
}

.rail-item.active::after {
  display: none;
}

/* ── Config Sidebar → Glass Floating Panel ──────────────────────── */
.config-sidebar {
  position: fixed;
  left: 82px;
  top: 50%;
  z-index: 900;
  width: 320px;
  max-width: 90%;
  height: calc(min(533.33px, 71.11vh) + 100px);
  /* Added 100px to perfectly match 1080/2400 aspect ratio cards plus extra breathing room */
  max-height: 800px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translate(-20px, -50%);
  transition: opacity 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.15);
}

.config-sidebar.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translate(0, -50%);
}

.config-sidebar.open {
  width: 330px;
  min-width: 330px;
  opacity: 1;
  margin-left: 4px;
}

.config-section {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  animation: panelFadeIn 0.3s ease-out;
  min-width: 300px;
}

@keyframes panelFadeIn {
  from {
    opacity: 0;
    transform: translateX(-8px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.sidebar-section {
  padding: 1.25rem 1rem;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.sidebar-section h3 {
  font-size: 0.82rem;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* ── Canvas Workspace ──────────────────────────────────────────── */
.canvas-workspace {
  flex: 1;
  padding: 0;
  background: transparent;
  position: relative;
  overflow: hidden;
  touch-action: none;
  transition: padding-left 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}



.horizontal-scroll-container {
  display: flex;
  gap: 1.5rem;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: flex-start;
  overflow: visible;
  will-change: transform;
  transform-origin: 0 0;
}

.horizontal-scroll-container::before,
.horizontal-scroll-container::after {
  content: '';
  flex: 0 0 calc(50vw - min(120px, 16vh));
  height: 1px;
}

.horizontal-scroll-container::-webkit-scrollbar {
  display: none;
}

/* ── Screenshot Card — Clean Minimal ───────────────────────────── */
.screenshot-card {
  border-radius: 15px;
  padding: 0;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  width: min(240px, 32vh);
  height: auto;
  flex-shrink: 0;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
  border: none;
  cursor: pointer;
  overflow: visible;
  position: relative;
}

.screenshot-card.landscape-card {
  width: 380px;
}

/* ── Add Screen Card ───────────────────────────────────────────── */
.add-screen-card {
  background: white;
  border-radius: 15px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: min(240px, 32vh);
  aspect-ratio: 1080 / 2400;
  flex-shrink: 0;
  border: 2px dashed rgba(0, 0, 0, 0.2);
  cursor: pointer;
  transition: all 0.3s ease;
  color: var(--text-muted);
}

.add-screen-card i {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  color: rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease, color 0.3s ease;
}

.add-screen-card span {
  font-weight: 500;
  font-size: 0.9rem;
  opacity: 0.8;
}

.add-screen-card:hover {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(0, 0, 0, 0.1);
  color: var(--text-dark);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transform: scale(1.02);
}

.add-screen-card:hover i {
  transform: scale(1.1);
  color: var(--primary);
}

/* Selected/Focused state */
.screenshot-card.focused {
  z-index: 10;
  border: none;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12), 0 2px 12px rgba(0, 0, 0, 0.08);
}

/* ── Screen Card Animations ────────────────────────────────────── */
@keyframes scaleInBouncy {
  0% {
    transform: scale(0.5);
    opacity: 0;
  }

  60% {
    transform: scale(1.05);
    opacity: 1;
  }

  80% {
    transform: scale(0.97);
  }

  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes scaleOutBouncy {
  0% {
    transform: scale(1);
    opacity: 1;
  }

  40% {
    transform: scale(1.05);
  }

  100% {
    transform: scale(0);
    opacity: 0;
  }
}

.card-enter {
  animation: scaleInBouncy 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.card-exit {
  animation: scaleOutBouncy 0.4s cubic-bezier(0.36, 0, 0.66, -0.56) forwards;
  pointer-events: none;
}

.screenshot-card:hover:not(.focused) {
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

.canvas-container {
  border-radius: 15px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;
  aspect-ratio: 1080 / 2400;
  width: 100%;
  flex: 1;
  min-height: 0;
}

/* Three.js 3D phone overlay */
.three-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: auto;
  z-index: 2;
}

.canvas-container canvas {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* Hide old card UI elements — controls are now in bottom dock */
.shot-label {
  display: none;
}

.card-controls {
  display: none;
}

.canvas-hints {
  display: none;
}

.size-badge {
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--primary);
  background: rgba(0, 122, 255, 0.08);
  border: 1px solid rgba(0, 122, 255, 0.15);
  border-radius: 20px;
  padding: 2px 7px;
  letter-spacing: 0.3px;
}

/* Per-card delete button */
.round-delete-btn {
  position: absolute;
  bottom: -40px;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 32px;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 50%;
  color: #ef4444;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 20;
  padding: 0;
  font-size: 1.25rem;
}

.round-delete-btn i {
  line-height: 0;
}

.round-delete-btn:hover {
  background: #ef4444;
  color: white;
  border-color: #ef4444;
  transform: translateX(-50%) scale(1.1);
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.25);
}

.round-delete-btn:active {
  transform: translateX(-50%) scale(0.95);
}

/* ── Bottom Dock (appears on page select) ──────────────────────── */
.bottom-dock-wrapper {
  position: fixed;
  bottom: 16px;
  left: 0;
  width: 100vw;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 24px;
  opacity: 0;
  pointer-events: none;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
  transform: translateY(80px);
}

.bottom-dock-wrapper.visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: none; /* Changed: Let clicks fall through empty space between buttons */
}

/* Ensure the child interactive containers actually receive clicks */
.bottom-dock-wrapper .dock-actions,
.bottom-dock-wrapper .dock-pagination {
  pointer-events: auto;
}

.dock-actions {
  display: flex;
  gap: 16px;
  align-items: center;
  max-width: calc(100vw - 200px);
  overflow-x: auto;
  scrollbar-width: none;
  padding: 4px;
}

.dock-actions::-webkit-scrollbar {
  display: none;
}

.dock-actions>* {
  flex-shrink: 0;
}

.hidden-important {
  display: none !important;
}

.dock-pagination {
  position: absolute;
  right: auto !important;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: max-content;
}

.bottom-dock-wrapper .dock-item {
  font-size: 0.78rem;
  padding: 7px 14px;
  transition: all 0.35s cubic-bezier(0.25, 1, 0.5, 1);
}

.bouncy-hover:hover {
  transform: scale(1.03) translateY(-3px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.10);
  background: rgba(255, 255, 255, 0.9);
}

.bottom-dock .dock-item.icon-only {
  padding: 7px 11px;
}

.bottom-dock .screen-name {
  padding: 7px 14px;
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--text-dark);
  cursor: default;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: 50px;
}

/* Bottom dock magnification */
.bottom-dock button.dock-item:hover+button.dock-item,
.bottom-dock button.dock-item:has(+ button.dock-item:hover) {
  transform: scale(1.03) translateY(-2px);
}

/* ── Typo Popup (Change Typo inline) ───────────────────────────── */
.typo-popup {
  position: fixed;
  z-index: 1100;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
  padding: 14px;
  width: 280px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.typo-popup.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.typo-popup textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  resize: none;
  font-family: inherit;
  font-size: 0.85rem;
  height: 80px;
  background: rgba(255, 255, 255, 0.7);
  outline: none;
  color: var(--text-dark);
  transition: border-color 0.2s;
}

.typo-popup textarea:focus {
  border-color: var(--primary);
}

.typo-popup .typo-save-btn {
  margin-top: 8px;
  width: 100%;
  padding: 8px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.2s;
}

.typo-popup .typo-save-btn:hover {
  background: var(--primary-hover);
}

/* ── Scroll FABs ──────────────────────────────────────────────── */
.scroll-fab {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--glass-bg) !important;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  color: var(--text-dark) !important;
  border: var(--glass-border) !important;
  box-shadow: var(--glass-shadow) !important;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 50 !important;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  pointer-events: auto !important;
}

.scroll-fab i {
  font-size: 1.4rem;
  font-weight: 700;
}

.scroll-fab:hover {
  background: var(--dock-item-hover) !important;
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12) !important;
}

.scroll-fab:active {
  transform: translateY(-50%) scale(0.92);
}

#scrollLeftBtn {
  left: 12px;
}

#scrollRightBtn {
  right: 12px;
}

/* ── Liquid Glass Bouncy Animations ────────────────────────── */
@keyframes bouncy-pop {
  0% {
    transform: translateY(30px) scale(0.8);
    opacity: 0;
  }

  60% {
    transform: translateY(-2px) scale(1.01);
  }

  100% {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

.dock-item {
  transition: opacity 0.4s ease, transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275), width 0.4s ease, margin 0.4s ease, padding 0.4s ease;
  display: flex !important;
  align-items: center;
  justify-content: center;
  opacity: 1;
  transform: translateY(0) scale(1);
}

.dock-item.hidden {
  opacity: 0;
  transform: translateY(20px) scale(0.8);
  pointer-events: none;
  width: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.dock-item.visible-bouncy {
  opacity: 1;
  transform: scale(1);
  animation: bouncy-pop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

/* ── General Buttons ──────────────────────────────────────────── */
.btn {
  padding: 0.6rem 1.25rem;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-bulk {
  background: var(--primary);
  color: white;
}

.btn-bulk:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 12px rgba(0, 122, 255, 0.2);
}

.btn-download {
  background: #34c759;
  color: white;
  width: 100%;
}

.btn-download:hover {
  background: #28a745;
}

.hidden {
  display: none !important;
}

.mt-2 {
  margin-top: 0.5rem;
}

/* ── Device Grid ─────────────────────────────────────────────── */
.device-scroll-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 10px;
}

.device-btn {
  padding: 0.75rem;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.6);
  text-align: left;
  cursor: pointer;
  transition: all 0.2s;
}

.device-btn:hover {
  border-color: var(--primary);
  background: rgba(0, 122, 255, 0.06);
}

.device-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.device-btn small {
  display: block;
  font-size: 0.7rem;
  opacity: 0.8;
}

/* ── Controls ────────────────────────────────────────────────── */
.control-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.control-item {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.control-item label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.control-item input[type="color"] {
  width: 100%;
  height: 38px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 8px;
  padding: 2px;
  cursor: pointer;
}

.range-group {
  margin-top: 1.25rem;
}

.range-group label {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

select {
  padding: 0.5rem;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(255, 255, 255, 0.7);
  outline: none;
}

/* ── Upload Mini Button ──────────────────────────────────────── */
.upload-btn-mini {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem;
  background: rgba(255, 255, 255, 0.6);
  border: 1px dashed var(--primary);
  border-radius: 10px;
  color: var(--primary);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.upload-btn-mini:hover {
  background: rgba(0, 122, 255, 0.06);
}

/* ── Apply All Button ────────────────────────────────────────── */
.apply-all-btn {
  width: 100%;
  padding: 0.55rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 10px;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
}

.apply-all-btn:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 12px rgba(0, 122, 255, 0.2);
}

/* ── Modals (Glass Restyle) ──────────────────────────────────── */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(12px);
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  width: 100%;
  max-width: 600px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  transform: translateY(20px) scale(0.98);
  transition: all 0.3s ease;
  margin: 20px;
  display: flex;
  flex-direction: column;
  max-height: 85vh;
}

.modal-overlay.active .modal-content {
  transform: translateY(0) scale(1);
}

.modal-header {
  background: var(--primary);
  color: white;
  padding: 18px 25px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: white !important;
}

.modal-body {
  padding: 25px;
  overflow-y: auto;
  background: transparent;
}

.close-btn {
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  opacity: 0.7;
  line-height: 1;
  transition: opacity 0.2s;
  background: none;
  border: none;
  padding: 0;
}

.close-btn:hover {
  opacity: 1;
}

/* ── Side Sheet (Glass) ──────────────────────────────────────── */
.side-sheet {
  position: fixed;
  top: 0;
  right: -100%;
  width: 500px;
  height: 100vh;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  z-index: 10500;
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.12);
  transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  border-left: var(--glass-border);
}

.side-sheet.active {
  right: 0;
}

.sheet-header {
  padding: 18px 24px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sheet-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sheet-body {
  flex: 1;
  padding: 20px 24px;
  overflow-y: auto;
  min-height: 0;
}

.sheet-footer {
  padding: 16px 24px;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ── Swatch Cards ────────────────────────────────────────────── */
.swatch-card {
  width: 100%;
  height: 34px;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.swatch-option {
  background: rgba(255, 255, 255, 0.6);
  border: 1.5px solid rgba(0, 0, 0, 0.06);
  border-radius: 8px;
  padding: 5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  min-height: 60px;
  width: 100%;
  min-width: 0;
}

.swatch-option:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 122, 255, 0.1);
}

.swatch-option.active {
  border-color: var(--primary);
  background: rgba(0, 122, 255, 0.08);
  border-width: 2px;
}

.swatch-option span {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--primary);
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
  text-align: center;
}

/* ── BG Cards ─────────────────────────────────────────────────── */
.bg-category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 10px;
}

.bg-card {
  height: 80px;
  background: rgba(255, 255, 255, 0.6);
  border: 1.5px solid rgba(0, 0, 0, 0.06);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.25s ease;
  padding: 8px;
  user-select: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  text-align: center;
}

.bg-card i {
  font-size: 1.3rem;
  color: var(--primary);
  background: rgba(0, 122, 255, 0.06);
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.bg-card span {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
}

.bg-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(0, 122, 255, 0.08);
}

.bg-card.active {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
  box-shadow: 0 4px 16px rgba(0, 122, 255, 0.2) !important;
  border-width: 2px;
}

.bg-card.active i {
  background: transparent !important;
  color: #ffffff !important;
}

.bg-card.active span {
  color: #ffffff !important;
  font-weight: 800;
}

.bg-card.device-opt.active {
  background: var(--primary) !important;
  border-color: var(--primary) !important;
}

.bg-card.active img,
.bg-card.selected img {
  filter: brightness(0) invert(1) !important;
  opacity: 0.95 !important;
}

.bg-card.pose-card.active img,
.bg-card.pose-card.selected img {
  filter: none !important;
  opacity: 1 !important;
}

.bg-card:not(.active):not(.selected):hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

/* ── Icon style overrides ────────────────────────────────────── */
.icon-style-opt.bg-card {
  height: 52px !important;
  padding: 6px 2px !important;
  gap: 3px !important;
  border-radius: 8px !important;
}

.icon-style-opt.bg-card i {
  width: auto !important;
  height: auto !important;
  background: transparent !important;
  border-radius: 0 !important;
  font-size: 1.2rem !important;
  color: var(--primary) !important;
}

.icon-style-opt.bg-card.active i {
  color: white !important;
}

.icon-style-opt.bg-card span {
  font-size: 0.58rem !important;
}

/* ── Font Cards ──────────────────────────────────────────────── */
.fnt-card {
  padding: 10px 14px;
  border: 1.5px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: rgba(255, 255, 255, 0.6);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  min-width: 0;
}

.fnt-preview {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.2s;
}

.fnt-name {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.4px;
  transition: color 0.2s;
}

.fnt-card:hover,
.lang-opt:hover {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 12px rgba(0, 122, 255, 0.15);
}

.fnt-card:hover .fnt-preview,
.fnt-card:hover .fnt-name {
  color: white;
}

.fnt-card.active,
.lang-opt.active,
.device-opt.active {
  border-color: var(--primary) !important;
  background: var(--primary) !important;
  color: #ffffff !important;
}

.fnt-card.active *,
.lang-opt.active *,
.device-opt.active * {
  color: #ffffff !important;
}

/* ── Language Options ────────────────────────────────────────── */
.lang-opt {
  padding: 8px 4px;
  border: 1.5px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  background: rgba(255, 255, 255, 0.6);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  min-width: 0;
  text-align: center;
}

.lang-code-pill {
  font-size: 0.62rem;
  font-weight: 800;
  color: var(--primary);
  background: rgba(0, 122, 255, 0.08);
  padding: 2px 5px;
  border-radius: 6px;
  white-space: nowrap;
  transition: all 0.2s;
}

.lang-opt.active .lang-code-pill,
.lang-opt:hover .lang-code-pill {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

.lang-name-lbl {
  font-size: 0.7rem;
  font-weight: 600;
  color: #475569;
  text-align: center;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.2;
}

.lang-opt:hover .lang-name-lbl,
.lang-opt.active .lang-name-lbl {
  color: #fff !important;
}

/* ── Premium Badge ───────────────────────────────────────────── */
.premium-badge {
  position: absolute;
  top: 1px;
  right: 1px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(2px);
  width: 13px;
  height: 13px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  z-index: 2;
}

.premium-badge i {
  font-size: 0.55rem !important;
  color: #f59e0b !important;
  font-weight: 900 !important;
  margin: 0 !important;
}

/* ── Color Grids ──────────────────────────────────────────────── */
#materialColorGrid,
#gradientGrid,
#sidebarColorGrid,
#sidebarGradientGrid {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 10px !important;
  padding: 6px !important;
  width: 100% !important;
}

.material-color-box,
.gradient-box {
  aspect-ratio: 1;
  border-radius: 10px;
  cursor: pointer;
  position: relative;
  border: 2px solid transparent;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  align-items: flex-end;
  padding: 5px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.material-color-box:hover,
.gradient-box:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 15px rgba(0, 0, 0, 0.12);
  z-index: 2;
}

.material-color-box span,
.gradient-box span {
  font-size: 0.52rem;
  font-weight: 800;
  color: white;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transition: opacity 0.2s;
}

.material-color-box:hover span,
.gradient-box:hover span {
  opacity: 1;
}

#geometricGrid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.geometric-card-item {
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.geometric-card-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
  border-color: var(--primary);
}

.geometric-card-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── Quick Controls on Canvas ─────────────────────────────────── */
.shot-quick-controls {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: var(--glass-border);
  border-radius: 14px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--glass-shadow);
  opacity: 0;
  transform: translateX(8px);
  transition: all 0.3s ease;
  z-index: 10;
}

.canvas-container:hover .shot-quick-controls {
  opacity: 1;
  transform: translateX(0);
}

.quick-control-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-dark);
}

.quick-control-item i {
  color: var(--primary);
  font-size: 1rem;
}

.quick-control-item input[type="range"] {
  width: 70px;
  height: 4px;
  cursor: pointer;
}

.quick-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.2s;
}

.quick-btn:hover {
  background: var(--primary-hover);
  transform: scale(1.05);
}

/* ── Input Styles ────────────────────────────────────────────── */
.wa-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 10px;
  outline: none;
  transition: all 0.2s ease;
  font-family: inherit;
  font-size: 0.92rem;
  color: #334155;
  background: rgba(255, 255, 255, 0.7);
}

.wa-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.08);
}

.wa-label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-dark);
  font-size: 0.88rem;
}

.custom-hex-group {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.7);
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  transition: all 0.2s;
  margin-bottom: 5px;
}

.custom-hex-group:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.08);
}

.custom-hex-group label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.custom-hex-group input[type="text"] {
  border: none;
  outline: none;
  font-family: monospace;
  font-weight: 600;
  color: var(--text-dark);
  width: 100%;
  background: transparent;
}

.color-preview-circle {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.08);
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.2s;
}

.color-preview-circle:hover {
  transform: scale(1.1);
}

.color-swatches,
.grad-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.color-preset,
.grad-preset {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  cursor: pointer;
  border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s ease;
}

.color-preset:hover,
.grad-preset:hover {
  transform: scale(1.15);
  z-index: 2;
}

.grad-preset {
  border-radius: 50%;
}

/* ── Scrollbar ───────────────────────────────────────────────── */
.custom-scrollbar::-webkit-scrollbar {
  width: 4px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
  border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.2);
}

/* ── Font Grid ───────────────────────────────────────────────── */
.font-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
}

.font-item {
  padding: 1rem 0.8rem;
  border: 1.5px solid rgba(0, 0, 0, 0.06);
  border-radius: 12px;
  cursor: pointer;
  text-align: center;
  background: rgba(255, 255, 255, 0.6);
  transition: all 0.2s ease;
}

.font-item:hover {
  border-color: var(--primary);
  background: rgba(0, 122, 255, 0.06);
  transform: translateY(-2px);
}

.modal-search {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 10px;
  margin-bottom: 1.2rem;
  font-family: inherit;
  font-size: 0.92rem;
  outline: none;
  background: rgba(255, 255, 255, 0.7);
}

.modal-search:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.08);
}

/* ── Old nav bar hide ─────────────────────────────────────────── */
.branded-nav {
  display: none !important;
}

/* ── Custom Range Sliders (#396afc Theme) ────────────────────── */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
}

input[type="range"]::-webkit-slider-runnable-track {
  width: 100%;
  height: 4px;
  background: rgba(57, 106, 252, 0.2);
  border-radius: 4px;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  height: 14px;
  width: 14px;
  border-radius: 50%;
  background: #396afc;
  cursor: pointer;
  margin-top: -5px;
  box-shadow: 0 2px 6px rgba(57, 106, 252, 0.4);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

input[type="range"]:focus {
  outline: none;
}

input[type="range"]:focus::-webkit-slider-thumb,
input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 0 0 3px rgba(57, 106, 252, 0.2);
}

/* ── Typography Panel Custom Font Items ────────────────────── */
.fnt-grid .font-item {
  padding: 12px 14px;
  border-radius: 12px;
  background: white;
  border: 1px solid #e2e8f0;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2px;
}

.fnt-grid .font-item:hover {
  border-color: var(--primary);
  background: #f8fafc;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04);
}

/* ── Fullscreen Preview Overlay (Premium Slideshow) ────────────────── */
.preview-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: #000; z-index: 9999999; display: none; flex-direction: column;
    overflow: hidden; opacity: 0; transition: opacity 0.3s ease;
}
.preview-overlay.active { display: flex; opacity: 1; }

.preview-header {
    position: absolute; top: 0; left: 0; width: 100%; height: 60px;
    padding: 0 24px; display: flex; align-items: center; justify-content: space-between;
    background: rgba(0,0,0,0.4); backdrop-filter: blur(10px); z-index: 2000;
}
.preview-title { color: white; font-weight: 700; font-size: 1.1rem; }
.preview-close {
    background: var(--primary); color: white; border: none; width: 44px; height: 44px;
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}
.preview-close:hover { background: var(--primary-hover); transform: scale(1.1) rotate(90deg); }
.preview-close img { filter: brightness(0) invert(1) !important; }

.preview-content {
    position: relative; width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}
.preview-slide {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden; transform: scale(0.9);
    transition: all 0.7s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1;
}
.preview-slide.active { 
    opacity: 1; visibility: visible; transform: scale(1);
    z-index: 10;
}

.preview-slide img {
    max-width: 90%; max-height: 80%; object-fit: contain;
    box-shadow: 0 40px 100px rgba(0,0,0,0.7); border-radius: 16px;
    background: transparent;
}

.preview-nav-controls {
    position: absolute; bottom: 40px; right: 40px; display: flex; gap: 12px; z-index: 10000;
}
.nav-btn {
    width: 60px; height: 60px; background: rgba(255,255,255,0.15); backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,0.25); border-radius: 50%;
    display: flex; align-items: center; justify-content: center; cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.nav-btn:hover { background: var(--primary); transform: translateY(-5px) scale(1.1); }
.nav-btn img { width: 24px; height: 24px; filter: invert(1); }

/* Hide Top Dock in Fullscreen for immersive experience */
:fullscreen .top-dock-wrapper { display: none; }

@keyframes fadeInSlide { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUpFadeSlide { from { opacity: 0; transform: translateY(40px) scale(0.9); } to { opacity: 1; transform: translateY(0) scale(1); } }

.fnt-grid .font-item.active {
  border-color: var(--primary);
  background: #eff6ff;
  box-shadow: 0 0 0 2px rgba(57, 106, 252, 0.15);
}

.fnt-grid .font-item .font-name {
  font-size: 0.95rem;
  color: #1e293b;
  font-weight: 500;
}

.lang-search-box:focus-within {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px rgba(57, 106, 252, 0.15) !important;
}

/* ── Custom Hand Pointer Override ────────────────────────────────────────── */
a,
button,
[role="button"],
input[type="button"],
input[type="submit"],
input[type="file"],
input[type="color"],
select,
label,
.dock-item,
.rail-item,
.bg-card,
.profile-option,
.upload-zone,
.clip-upload-zone,
.dl-opt,
.close-btn,
.screenshot-card,
.add-screen-card,
.typo-save-btn {
  cursor: var(--custom-hand-cursor) !important;
}

/* ── Phone Upload Button ──────────────────────────────────────── */
.phone-upload-btn {
  position: absolute;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1.5px solid rgba(255, 255, 255, 0.5) !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #1e3a8a !important;
  font-size: 1.2rem;
  cursor: pointer;
  z-index: 2000;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  pointer-events: auto;
  opacity: 0;
  transform: scale(0.6) translate(0, 0); 
  padding: 0;
  margin: 0;
}

.phone-upload-btn.visible {
  opacity: 1;
  transform: scale(1);
}

.phone-upload-btn:hover {
  background: rgba(255, 255, 255, 0.8) !important;
  transform: scale(1.1);
  box-shadow: 0 15px 45px rgba(0, 0, 0, 0.3);
  color: var(--primary) !important;
}

.phone-upload-btn:active {
  transform: scale(0.9);
}

.phone-upload-btn i {
  pointer-events: none;
}

/* --- Dock Number Input (Manual 3D Pose Entry) --- */
.dock-number-input {
  width: 44px;
  height: 24px;
  padding: 0 4px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-dark);
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 6px;
  text-align: center;
  transition: all 0.2s ease;
  outline: none;
  appearance: none;
  -moz-appearance: textfield;
}

.dock-number-input::-webkit-outer-spin-button,
.dock-number-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.dock-number-input:focus {
  background: white;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15);
}

.dock-number-input:hover {
  background: rgba(255, 255, 255, 0.6);
  border-color: rgba(0, 0, 0, 0.12);
}
/* ── Full Screen Preview Mode ────────────────────────────────────── */
.preview-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: fadeIn 0.3s ease-out;
}

.preview-header {
  padding: 20px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.preview-title {
  color: white;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.preview-close {
  background: var(--primary);
  color: white;
  border: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: all 0.2s;
  box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

.preview-close:hover {
  transform: scale(1.1) rotate(90deg);
  background: var(--primary-hover);
}

.preview-content {
  flex: 1;
  display: flex;
  gap: 40px;
  padding: 60px 40px;
  overflow-x: auto;
  overflow-y: hidden;
  align-items: center;
  justify-content: center;
  scroll-snap-type: x mandatory;
}

.preview-item {
  flex: 0 0 auto;
  height: 75vh;
  aspect-ratio: 1080 / 2400;
  border-radius: 20px;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow: hidden;
  position: relative;
  scroll-snap-align: center;
  animation: slideUpFade 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUpFade {
  from { opacity: 0; transform: translateY(40px) scale(0.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Hide Top Dock in Fullscreen for immersive experience */
:fullscreen .top-dock-wrapper {
  display: none;
}
. p r e m i u m - s e a r c h - c a r d   { 
