:root {

  --bg:  #070710;
  --bg2: #0c0c1c;


  --glass:              rgba(255,255,255,0.032);
  --glass-hover:        rgba(255,255,255,0.062);
  --glass-active:       rgba(255,255,255,0.088);
  --glass-border:       rgba(255,255,255,0.082);
  --glass-border-strong:rgba(255,255,255,0.145);
  --glass-inset:        rgba(255,255,255,0.018);


  --blur:    blur(20px) saturate(160%);
  --blur-sm: blur(12px) saturate(140%);


  --purple-1: #A855F7;
  --purple-2: #C084FC;
  --purple-3: #E879F9;
  --purple-4: #F0ABFC;

  --primary:        var(--purple-1);
  --primary-glass:  rgba(168,85,247,0.18);
  --primary-border: rgba(168,85,247,0.42);
  --accent:         var(--purple-3);
  --accent-glass:   rgba(232,121,249,0.15);


  --success:      #30D158;
  --success-glass:rgba(48,209,88,0.18);
  --error:        #FF453A;
  --error-glass:  rgba(255,69,58,0.18);
  --warn:         #FFD60A;


  --text:   #F5F5F7;
  --text-2: rgba(245,245,247,0.68);
  --text-3: rgba(245,245,247,0.42);
  --text-4: rgba(245,245,247,0.24);


  --radius-xs:  6px;
  --radius-sm:  10px;
  --radius:     16px;
  --radius-lg:  22px;
  --radius-xl:  32px;
  --radius-pill:100px;


  --shadow-glass: 0 8px 32px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.09);
  --shadow-float: 0 24px 72px rgba(0,0,0,0.72), 0 4px 16px rgba(0,0,0,0.4);


  --surface:      rgba(255,255,255,0.07);
  --surface-light:rgba(255,255,255,0.11);
  --border:       rgba(255,255,255,0.09);

}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
  touch-action: manipulation;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  text-align: center;
  line-height: 1.6;
}

/* Background layers */

body::after {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image:
    url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 0;
  opacity: 0.6;
  contain: strict;
}

/* Glass utilities */
.glass {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-glass);
}

.glass-sm {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-glass);
}


/* PDF Editor */
#pdf-editor-overlay {
  opacity: 0;
  transition: opacity 0.26s cubic-bezier(0.4, 0, 0.2, 1);
}
#pdf-editor-overlay.pme-visible {
  opacity: 1;
}

/* ── Eraser cursor overlay (global, fixed, follows pointer) ── */
#pme-eraser-cursor {
  position: fixed;
  pointer-events: none;
  z-index: 999999;
  display: none;
  border-radius: 50%;
  background: rgba(168, 85, 247, 0.12);
  border: 1.5px solid rgba(192, 132, 252, 0.85);
  box-shadow:
    0 0 0 1px rgba(0,0,0,0.35),
    0 0 12px rgba(168, 85, 247, 0.45),
    0 0 24px rgba(168, 85, 247, 0.18),
    inset 0 0 0 1px rgba(255,255,255,0.06);
  transform: translate(-50%, -50%);
  will-change: left, top, width, height;
  transition: width 0.06s cubic-bezier(0.34,1.4,0.64,1), height 0.06s cubic-bezier(0.34,1.4,0.64,1);
}
/* Center dot */
#pme-eraser-cursor::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 4px; height: 4px;
  background: rgba(192, 132, 252, 0.95);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.4), 0 0 6px rgba(168,85,247,0.7);
}
/* Barrel-button toast indicator */
#pme-barrel-toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  z-index: 999998;
  padding: 7px 16px;
  border-radius: 100px;
  background: rgba(30,20,50,0.92);
  border: 1px solid rgba(168,85,247,0.45);
  border-top-color: rgba(255,255,255,0.18);
  color: rgba(245,245,247,0.92);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  backdrop-filter: blur(12px);
  box-shadow: 0 4px 20px rgba(0,0,0,0.45), 0 0 0 0.5px rgba(168,85,247,0.2);
  display: none;
  opacity: 0;
  transition: opacity 0.22s ease, transform 0.22s cubic-bezier(0.34,1.2,0.64,1);
  white-space: nowrap;
  pointer-events: none;
}
#pme-barrel-toast.pme-barrel-toast-visible {
  display: block;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Navbar */
.navbar {
  position: fixed;
  top: 12px;
  left: 0;
  right: 0;
  margin: 0 auto;
  width: calc(100% - 32px);
  max-width: 1100px;
  z-index: 999;


  background: linear-gradient(
    135deg,
    rgba(255,255,255,0.048) 0%,
    rgba(168,85,247,0.055) 35%,
    rgba(255,255,255,0.022) 60%,
    rgba(232,121,249,0.038) 100%
  );
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(8px);


  border: 1px solid rgba(255,255,255,0.0);
  border-top: 1px solid rgba(255,255,255,0.22);
  border-bottom: 1px solid rgba(0,0,0,0.18);
  border-left: 1px solid rgba(168,85,247,0.14);
  border-right: 1px solid rgba(232,121,249,0.12);

  border-radius: var(--radius-pill);
  box-shadow:

    0 0 0 0.5px rgba(168,85,247,0.18),

    0 8px 32px rgba(0,0,0,0.38),
    0 2px 8px rgba(0,0,0,0.22),

    inset 0 1px 0 rgba(255,255,255,0.28),

    inset 0 -1px 0 rgba(0,0,0,0.14),

    inset 0 0 32px rgba(168,85,247,0.04);

  padding: 0;
  transition: opacity 0.28s ease;
  isolation: isolate;
}

.navbar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 8%;
  right: 8%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(168,85,247,0.6) 15%,
    rgba(255,255,255,0.75) 40%,
    rgba(240,171,252,0.85) 55%,
    rgba(255,255,255,0.65) 70%,
    rgba(168,85,247,0.4) 85%,
    transparent 100%
  );
  border-radius: 1px;
  pointer-events: none;
  z-index: 2;
}

.navbar::after {
  content: '';
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background: linear-gradient(
    160deg,
    rgba(255,255,255,0.065) 0%,
    rgba(255,255,255,0.0) 40%,
    rgba(168,85,247,0.03) 70%,
    rgba(255,255,255,0.018) 100%
  );
  pointer-events: none;
  z-index: 0;
}

.nav-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 18px;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 17px;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
}
.nav-logo img {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.35);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  position: relative;

  background: rgba(255,255,255,0.032);
  border: 1px solid rgba(255,255,255,0.072);
  border-top-color: rgba(255,255,255,0.13);
  border-radius: var(--radius-pill);
  padding: 3px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(7px);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.1),
    inset 0 -1px 0 rgba(0,0,0,0.12),
    0 2px 8px rgba(0,0,0,0.15);
}

.nav-indicator {
  position: absolute;
  top: 3px;
  height: calc(100% - 6px);
  border-radius: var(--radius-pill);


  background: linear-gradient(
    145deg,
    rgba(168,85,247,0.52) 0%,
    rgba(192,132,252,0.38) 40%,
    rgba(168,85,247,0.44) 100%
  );
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(8px);

  border: 1px solid rgba(168,85,247,0.50);
  border-top-color: rgba(255,255,255,0.38);
  border-bottom-color: rgba(168,85,247,0.28);

  box-shadow:
    0 0 0 0.5px rgba(168,85,247,0.22),
    0 3px 16px rgba(168,85,247,0.35),
    0 1px 4px rgba(0,0,0,0.2),
    inset 0 1px 0 rgba(255,255,255,0.35),
    inset 0 -1px 0 rgba(0,0,0,0.1);

  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  will-change: left, width;
  transition:
    left  0.38s cubic-bezier(0.34,1.2,0.64,1),
    width 0.38s cubic-bezier(0.34,1.2,0.64,1),
    opacity 0.2s ease;
}

.nav-indicator::before {
  content: '';
  position: absolute;
  top: 0; left: 12%; right: 12%; height: 1px;
  background: linear-gradient(90deg,
    transparent,
    rgba(255,255,255,0.6),
    rgba(255,255,255,0.85),
    rgba(255,255,255,0.6),
    transparent
  );
  border-radius: 1px;
}

.nav-indicator::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 55%;
  background: linear-gradient(180deg,
    rgba(255,255,255,0.18) 0%,
    rgba(255,255,255,0.0) 100%
  );
  border-radius: inherit;
}

.nav-link {
  color: rgba(245,245,247,0.62);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  padding: 6px 13px;
  border-radius: var(--radius-pill);
  transition: color 0.18s ease;
  white-space: nowrap;
  position: relative;
  z-index: 1;
  letter-spacing: 0.005em;
}
.nav-link:hover {
  color: rgba(245,245,247,0.88);
}
.nav-link.active {
  color: #EDE9FE;
  font-weight: 650;
  text-shadow: 0 0 12px rgba(216,180,254,0.45);
}

.nav-auth {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* Nav buttons */
.nav-button {
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 15px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.34,1.2,0.64,1);
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
  overflow: hidden;
  isolation: isolate;


  background: rgba(255,255,255,0.055);
  border: 1px solid rgba(255,255,255,0.10);
  border-top-color: rgba(255,255,255,0.18);
  color: var(--text);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow:
    0 2px 10px rgba(0,0,0,0.22),
    inset 0 1px 0 rgba(255,255,255,0.16),
    inset 0 -1px 0 rgba(0,0,0,0.1);
}

.nav-button::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 48%;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255,255,255,0.10) 0%, transparent 100%);
  pointer-events: none;
}
.nav-button:hover {
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.20);
  border-top-color: rgba(255,255,255,0.30);
  transform: translateY(-1px);
  box-shadow:
    0 5px 20px rgba(0,0,0,0.3),
    inset 0 1px 0 rgba(255,255,255,0.22),
    inset 0 -1px 0 rgba(0,0,0,0.1);
  filter: none;
}
.nav-button:active { transform: translateY(0) scale(0.97); }

.nav-button.login-btn {
  background: rgba(255,255,255,0.03);
  border-color: rgba(255,255,255,0.07);
  color: var(--text-2);
  box-shadow: none;
}
.nav-button.login-btn:hover {
  background: rgba(255,255,255,0.07);
  color: var(--text);
}

.nav-button.register-btn {
  background: linear-gradient(
    145deg,
    rgba(185,100,255,0.75) 0%,
    rgba(168,85,247,0.65) 50%,
    rgba(192,58,235,0.60) 100%
  );
  border-color: rgba(192,100,255,0.52);
  border-top-color: rgba(255,255,255,0.32);
  color: white;
  box-shadow:
    0 0 24px rgba(168,85,247,0.40),
    0 3px 12px rgba(0,0,0,0.25),
    inset 0 1px 0 rgba(255,255,255,0.30),
    inset 0 -1px 0 rgba(0,0,0,0.12);
}
.nav-button.register-btn:hover {
  background: linear-gradient(
    145deg,
    rgba(200,120,255,0.88) 0%,
    rgba(185,100,255,0.78) 50%,
    rgba(210,68,248,0.72) 100%
  );
  box-shadow:
    0 0 36px rgba(168,85,247,0.60),
    0 5px 20px rgba(0,0,0,0.32),
    inset 0 1px 0 rgba(255,255,255,0.34);
  filter: none;
}
.nav-button.settings-btn-mobile { display: none; }

.hamburger-menu {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 6px;
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  transition: background 0.2s;
}
.hamburger-menu:hover { background: rgba(255,255,255,0.08); }
.hamburger-menu span {
  display: block;
  width: 20px;
  height: 2px;
  background: rgba(245,245,247,0.7);
  border-radius: 2px;
  transition: all 0.3s ease;
}


/* iPad landscape & small laptops (769px – 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  .nav-content {
    padding: 8px 12px;
    gap: 8px;
  }
  .nav-links {
    gap: 1px;
  }
  .nav-link {
    font-size: 12px;
    padding: 5px 9px;
  }
  .nav-button {
    padding: 6px 10px;
    font-size: 12px;
  }
  .nav-auth {
    gap: 4px;
  }
  .nav-logo {
    font-size: 15px;
  }
  .nav-logo img {
    width: 26px;
    height: 26px;
  }
}

@media (max-width: 768px) {
  .navbar {
    top: 8px;
    width: calc(100% - 16px);
  }
  .nav-links {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    width: 100%;

    background: linear-gradient(
      160deg,
      rgba(168,85,247,0.14) 0%,
      rgba(8,7,20,0.96) 50%,
      rgba(232,121,249,0.08) 100%
    );
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.12);
    border-top-color: rgba(255,255,255,0.20);
    border-radius: var(--radius-xl);
    padding: 10px;
    flex-direction: column;
    gap: 3px;
    box-shadow:
      0 20px 50px rgba(0,0,0,0.55),
      0 0 0 0.5px rgba(168,85,247,0.12),
      inset 0 1px 0 rgba(255,255,255,0.14);
  }
  .nav-links.open, .nav-links.active { display: flex; }
  .nav-link {
    width: 100%;
    text-align: left;
    padding: 10px 16px;
    font-size: 15px;
    border-radius: var(--radius);
  }
  .nav-link.active {
    background: rgba(168,85,247,0.18);
    border: 1px solid rgba(168,85,247,0.22);
  }
  .nav-indicator { display: none; }
  .hamburger-menu { display: flex; }
  .nav-auth { gap: 4px; flex-shrink: 1; min-width: 0; }
  .nav-button { padding: 6px 10px; font-size: 11px; flex-shrink: 1; min-width: 0; }
  .nav-button.register-btn { padding: 6px 10px; }
  .settings-btn { display: none !important; }
  .settings-btn-mobile { display: flex !important; }
}

.user-nav-info { display: flex; align-items: center; gap: 8px; }
.email-display { display: flex; align-items: center; gap: 6px; }
.auth-buttons { display: flex; align-items: center; gap: 8px; }
.eye-icon { color: var(--text-3); }
#nav-logged-in-user { font-size: 13px; color: var(--text-2); }

/* Auth */
.auth-overlay {
  display: none;
  opacity: 0;
  transition: opacity 0.30s cubic-bezier(0.4, 0, 0.2, 1);
}
.auth-overlay.active {
  opacity: 1;
}
.auth-overlay[style*="flex"],
.auth-overlay[style*="block"] {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;

  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(7px);
  z-index: 1100;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.auth-overlay[style*="flex"],
.auth-overlay[style*="block"] {
  display: flex !important;
  align-items: center;
  justify-content: center;
}
.auth-overlay.active,
.auth-overlay[style*="flex"],
.auth-overlay[style*="block"] {
  display: flex !important;
}

.auth-dialog {
  background: linear-gradient(160deg,
    rgba(255,255,255,0.045) 0%,
    rgba(168,85,247,0.06) 40%,
    rgba(255,255,255,0.025) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.14);
  border-top-color: rgba(255,255,255,0.28);
  border-bottom-color: rgba(255,255,255,0.06);
  border-radius: var(--radius-xl);
  box-shadow:
    0 32px 96px rgba(0,0,0,0.80),
    0 8px 24px rgba(0,0,0,0.45),
    0 0 0 0.5px rgba(255,255,255,0.06),
    inset 0 1px 0 rgba(255,255,255,0.18),
    inset 0 -1px 0 rgba(0,0,0,0.12);
  width: min(420px, calc(100vw - 32px));
  overflow: hidden;
  position: relative;

  opacity: 0;
  transform: scale(0.88) translateY(20px);
  transition:
    opacity  0.32s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.38s cubic-bezier(0.34, 1.56, 0.64, 1);
  will-change: opacity, transform;
}

.auth-overlay.active .auth-dialog {
  opacity: 1;
  transform: scale(1) translateY(0);
}
.auth-dialog::before {
  content: '';
  position: absolute;
  top: 0; left: 5%; right: 5%;
  height: 1px;
  background: linear-gradient(90deg,
    transparent,
    rgba(168,85,247,0.65) 25%,
    rgba(255,255,255,0.60) 50%,
    rgba(232,121,249,0.65) 75%,
    transparent);
  pointer-events: none;
}
.auth-dialog::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255,255,255,0.04) 0%, transparent 40%);
  pointer-events: none;
}
@keyframes dialogIn {
  from { opacity: 0; transform: scale(0.88) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.auth-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px 0;
}
.auth-header h2 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}
.auth-close-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text-2);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  line-height: 1;
  transition: all 0.2s;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.10);
}
.auth-close-btn:hover {
  background: rgba(255,255,255,0.14);
  border-color: rgba(255,255,255,0.20);
  color: var(--text);
  transform: none;
  filter: none;
}

.auth-content {
  padding: 20px 28px 28px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.auth-input-group {
  position: relative;
  margin-bottom: 12px;
}

.auth-input {
  width: 100%;
  margin: 0;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: var(--radius);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  padding: 14px 16px;
  transition: all 0.22s ease;
  -webkit-user-select: auto;
  user-select: auto;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.15), inset 0 -1px 0 rgba(255,255,255,0.04);
}
.auth-input:focus {
  border-color: rgba(168,85,247,0.55);
  box-shadow: 0 0 0 3px rgba(168,85,247,0.15), inset 0 1px 3px rgba(0,0,0,0.15);
  background: rgba(168,85,247,0.06);
  outline: none;
}
.auth-input::placeholder { color: var(--text-3); }

.password-toggle {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  cursor: pointer;
}

.auth-button {
  width: 100%;
  margin: 6px 0;
  padding: 14px;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}
.auth-button-primary {
  background: linear-gradient(160deg, rgba(185,100,255,0.82) 0%, rgba(168,85,247,0.72) 50%, rgba(192,58,235,0.68) 100%);
  color: white;
  border: 1px solid rgba(192,100,255,0.45);
  box-shadow: 0 4px 24px rgba(168,85,247,0.40), inset 0 1px 0 rgba(255,255,255,0.25);
  position: relative;
  overflow: hidden;
}
.auth-button-primary::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.14) 0%, transparent 100%);
  pointer-events: none;
  border-radius: inherit;
}
.auth-button-primary:hover {
  background: linear-gradient(160deg, rgba(200,120,255,0.92) 0%, rgba(185,100,255,0.82) 50%, rgba(208,68,248,0.78) 100%);
  transform: translateY(-1px);
  box-shadow: 0 8px 32px rgba(168,85,247,0.55), inset 0 1px 0 rgba(255,255,255,0.30);
  filter: none;
}
.auth-button-primary:active { transform: scale(0.98); }
.auth-button-secondary {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  color: var(--text-2);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.07);
}
.auth-button-secondary:hover {
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.16);
  color: var(--text);
  filter: none;
}

.auth-divider {
  margin-top: 16px;
  text-align: center;
}
.auth-link {
  color: var(--primary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}
.auth-link:hover { text-decoration: underline; }

.auth-text {
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 16px;
}

.auth-loader-container {
  display: none;
  justify-content: center;
  padding: 8px 0;
}
.auth-loader-container.active { display: flex; }
.auth-loader {
  width: 24px;
  height: 24px;
  border: 2px solid var(--glass-border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.verification-code-container {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 12px 0;
}
.verification-box {
  width: 48px;
  height: 56px;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  background: var(--glass-inset);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  color: var(--text);
  margin: 0;
  padding: 0;
  -webkit-user-select: auto;
  user-select: auto;
}
.verification-box:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glass);
}

#home {
  position: relative;
  z-index: 1;
  padding: 160px 24px 80px;
  max-width: 860px;
  margin: 0 auto;
  contain: layout style;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, rgba(168,85,247,0.15), rgba(232,121,249,0.08));
  border: 1px solid rgba(168,85,247,0.25);
  border-top-color: rgba(255,255,255,0.14);
  border-radius: var(--radius-pill);
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--purple-4);
  margin-bottom: 28px;
  box-shadow: 0 2px 16px rgba(168,85,247,0.2), inset 0 1px 0 rgba(255,255,255,0.12);
  animation: badgeFloat 0.6s ease both;
}
@keyframes badgeFloat {
  from { opacity:0; transform: translateY(-10px); }
  to   { opacity:1; transform: translateY(0); }
}

.hero-title {
  font-size: clamp(36px, 6vw, 68px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: var(--text);
  margin-bottom: 20px;
}

.gradient-text {
  background: linear-gradient(135deg, #BF7FFF 0%, #D946EF 35%, #F0ABFC 65%, #C084FC 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-description {
  font-size: 17px;
  color: var(--text-2);
  max-width: 560px;
  margin: 0 auto 36px;
  line-height: 1.6;
}

.hero-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.cta-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.25s ease;
  cursor: pointer;
  border: none;
}
.cta-button.primary {
  background: linear-gradient(135deg, #A855F7 0%, #C026D3 60%, #E879F9 100%);
  color: white;
  box-shadow: 0 4px 28px rgba(168,85,247,0.50), inset 0 1px 0 rgba(255,255,255,0.25);
  border: 1px solid rgba(255,255,255,0.15);
  text-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.cta-button.primary:hover {
  background: linear-gradient(135deg, #B370F9 0%, #D340E8 60%, #F090FF 100%);
  transform: translateY(-3px);
  box-shadow: 0 10px 40px rgba(168,85,247,0.60), inset 0 1px 0 rgba(255,255,255,0.3);
}
.cta-button.secondary {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--text-2);
}
.cta-button.secondary:hover {
  background: var(--glass-hover);
  color: var(--text);
  transform: translateY(-2px);
}

.hero-features {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.feature-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: linear-gradient(135deg, rgba(168,85,247,0.10), rgba(255,255,255,0.025));
  border: 1px solid rgba(168,85,247,0.18);
  border-top-color: rgba(255,255,255,0.12);
  border-radius: var(--radius-pill);
  padding: 8px 16px;
  font-size: 13px;
  color: var(--text-2);
  box-shadow: 0 2px 10px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.10);
}
.feature-pill svg { color: var(--primary); flex-shrink: 0; }

.stats-section {
  position: relative;
  z-index: 1;
  padding: 0 24px 80px;
}
.stats-container {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  max-width: 800px;
  margin: 0 auto;
}
.stat-item {
  background: linear-gradient(160deg, rgba(168,85,247,0.055) 0%, rgba(255,255,255,0.016) 100%);
  border: 1px solid rgba(168,85,247,0.16);
  border-top-color: rgba(255,255,255,0.16);
  border-radius: var(--radius-lg);
  padding: 24px 32px;
  min-width: 140px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.1);
  transition: all 0.2s ease;
}
.stat-item:hover {
  transform: translateY(-3px);
  background: linear-gradient(160deg, rgba(255,255,255,0.10) 0%, rgba(255,255,255,0.05) 100%);
  box-shadow: 0 8px 32px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.15);
}
.stat-number {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}
.stat-label {
  font-size: 13px;
  color: var(--text-3);
  margin-top: 4px;
  font-weight: 500;
}

.section-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 900px;
  margin: 0 auto 0;
  padding: 0 24px 56px;
  position: relative;
  z-index: 1;
}
.section-divider-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(168,85,247,0.25) 30%,
    rgba(168,85,247,0.40) 50%,
    rgba(168,85,247,0.25) 70%,
    transparent 100%);
}
.section-divider-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  background: linear-gradient(135deg,
    rgba(168,85,247,0.18) 0%,
    rgba(192,132,252,0.10) 50%,
    rgba(168,85,247,0.14) 100%);
  border: 1px solid rgba(168,85,247,0.32);
  border-top-color: rgba(255,255,255,0.26);
  border-bottom-color: rgba(168,85,247,0.16);
  border-radius: 100px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #D8B4FE;
  white-space: nowrap;
  box-shadow:
    0 2px 16px rgba(168,85,247,0.20),
    inset 0 1px 0 rgba(255,255,255,0.20),
    inset 0 -1px 0 rgba(0,0,0,0.08);
  position: relative;
  overflow: hidden;
}
.section-divider-label::before {
  content: '';
  position: absolute;
  top: 0; left: 10%; right: 10%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.50), rgba(168,85,247,0.55), rgba(255,255,255,0.50), transparent);
}

main { position: relative; z-index: 1; }

.main-content {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 16px 80px;
  contain: layout style;
  opacity: 0;
  transition: opacity 0.5s cubic-bezier(0.4,0,0.2,1);
}
.main-content.visible {
  opacity: 1;
}

#app-section {
  background: linear-gradient(160deg,
    rgba(168,85,247,0.065) 0%,
    rgba(255,255,255,0.018) 50%,
    rgba(232,121,249,0.04) 100%);
  border: 1px solid rgba(168,85,247,0.16);
  border-top-color: rgba(255,255,255,0.14);
  border-radius: var(--radius-xl);
  box-shadow:
    0 0 0 1px rgba(168,85,247,0.06),
    0 20px 60px rgba(0,0,0,0.6),
    inset 0 1px 0 rgba(255,255,255,0.12),
    inset 0 -1px 0 rgba(0,0,0,0.08);
  padding: 40px 32px 32px;
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}
#app-section::before {
  content: '';
  position: absolute;
  top: 0; left: 8%; right: 8%;
  height: 1px;
  background: linear-gradient(90deg,
    transparent,
    rgba(168,85,247,0.55),
    rgba(240,171,252,0.7),
    rgba(168,85,247,0.55),
    transparent);
  pointer-events: none;
}

#app-section img {
  width: 80px;
  height: 80px;
  border-radius: 20px;
  margin-bottom: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

#app-section h1 {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 4px;
  letter-spacing: -0.02em;
}

#app-section p {
  color: var(--text-2);
  font-size: 14px;
  margin-top: 0 !important;
}

.fast-scan-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--accent-glass);
  border: 1px solid rgba(191,90,242,0.35);
  color: #d48cff;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin: 16px auto 8px;
  width: fit-content;
}
.fast-scan-btn:hover {
  background: rgba(191,90,242,0.35);
  transform: translateY(-1px);
  filter: none;
  box-shadow: 0 4px 20px rgba(191,90,242,0.3);
}

#letter-select {
  width: 100%;
  max-width: 100%;
  margin: 20px 0;
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}

.lp-shell {
  position: relative;
  background: linear-gradient(160deg,
    rgba(168,85,247,0.10) 0%,
    rgba(255,255,255,0.024) 45%,
    rgba(232,121,249,0.058) 100%);
  border: 1px solid rgba(168,85,247,0.20);
  border-top-color: rgba(255,255,255,0.17);
  border-radius: 28px;
  padding: 18px 16px 16px;
  box-shadow:
    0 0 0 1px rgba(168,85,247,0.07),
    0 8px 48px rgba(0,0,0,0.52),
    inset 0 1px 0 rgba(255,255,255,0.13),
    inset 0 -1px 0 rgba(0,0,0,0.18);
  overflow: visible;
  isolation: isolate;
}
.lp-shell::before {
  content: '';
  position: absolute;
  top: 0; left: 8%; right: 8%;
  height: 1px;
  background: linear-gradient(90deg,
    transparent, rgba(168,85,247,0.65), rgba(240,171,252,0.85), rgba(168,85,247,0.65), transparent);
  pointer-events: none;
}

.lp-top-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  position: relative;
  justify-content: center;
}

.lp-preview {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, rgba(168,85,247,0.38), rgba(192,58,235,0.22));
  border: 1px solid rgba(168,85,247,0.55);
  border-top-color: rgba(255,255,255,0.22);
  border-radius: 18px;
  box-shadow:
    0 0 0 1px rgba(168,85,247,0.18),
    0 0 28px rgba(168,85,247,0.35),
    inset 0 1px 0 rgba(255,255,255,0.22);
  position: absolute;
  left: 0;
}
.lp-preview-letter {
  font-size: 32px;
  font-weight: 700;
  color: white;
  text-shadow: 0 0 20px rgba(168,85,247,0.8);
  line-height: 1;
}

.lp-progress-area {
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: 60%;
  text-align: center;
  align-items: center;
}
.lp-progress-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-3);
  text-transform: uppercase;
}
.lp-progress-track {
  width: 100%;
  height: 5px;
  background: rgba(168,85,247,0.10);
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid rgba(168,85,247,0.12);
}
.lp-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #A855F7, #C084FC, #E879F9);
  background-size: 200% 100%;
  border-radius: 3px;
  transition: width 0.5s cubic-bezier(0.4,0,0.2,1);
  box-shadow: 0 0 8px rgba(168,85,247,0.6);
  animation: lpShimmer 3s linear infinite;
  will-change: background-position;
}
@keyframes lpShimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.lp-progress-count {
  font-size: 13px;
  font-weight: 700;
  color: var(--purple-2);
}

.lp-tabs {
  display: flex;
  gap: 0;
  background: rgba(255,255,255,0.05);
  border-radius: 100px;
  padding: 3px;
  border: 1px solid rgba(255,255,255,0.09);
  border-top-color: rgba(255,255,255,0.14);
  margin-bottom: 14px;
  position: relative;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.22), inset 0 -1px 0 rgba(255,255,255,0.04);
}
.lp-tab-indicator {
  position: absolute;
  top: 3px;
  bottom: 3px;
  border-radius: 100px;
  background: linear-gradient(135deg,
    rgba(168,85,247,0.22) 0%,
    rgba(192,132,252,0.14) 50%,
    rgba(168,85,247,0.18) 100%);
  border: 1px solid rgba(168,85,247,0.38);
  border-top-color: rgba(255,255,255,0.30);
  border-bottom-color: rgba(168,85,247,0.20);
  box-shadow:
    0 2px 16px rgba(168,85,247,0.22),
    0 1px 4px rgba(0,0,0,0.18),
    inset 0 1px 0 rgba(255,255,255,0.22),
    inset 0 -1px 0 rgba(0,0,0,0.08);
  transition:
    left 0.38s cubic-bezier(0.34,1.20,0.64,1),
    width 0.38s cubic-bezier(0.34,1.20,0.64,1);
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.lp-tab-indicator::before {
  content: '';
  position: absolute;
  top: 0; left: 10%; right: 10%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.55), rgba(168,85,247,0.6), rgba(255,255,255,0.55), transparent);
  border-radius: 1px;
  pointer-events: none;
}
.lp-tab {
  flex: 1;
  padding: 7px 6px;
  border-radius: 100px;
  border: none;
  background: transparent;
  color: var(--text-3);
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.22s ease;
  letter-spacing: 0.02em;
  white-space: nowrap;
  position: relative;
  z-index: 1;
  user-select: none;
  -webkit-user-select: none;
}
.lp-tab-active {
  color: #D8B4FE;
  font-weight: 600;
}
.lp-tab:hover:not(.lp-tab-active) {
  color: var(--text-2);
}

.lp-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-start;
  max-height: 212px;
  overflow-y: auto;
  overflow-x: visible;
  padding: 6px 4px 6px 6px;
  margin: -6px -4px -6px -6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(168,85,247,0.3) transparent;
}
.lp-grid::-webkit-scrollbar {
  width: 4px;
}
.lp-grid::-webkit-scrollbar-track { background: transparent; }
.lp-grid::-webkit-scrollbar-thumb {
  background: rgba(168,85,247,0.28);
  border-radius: 2px;
}
@keyframes lpGridIn {
  from { opacity:0; transform: translateY(6px); }
  to   { opacity:1; transform: translateY(0); }
}
.lp-grid-anim { animation: lpGridIn 0.22s cubic-bezier(0.4,0,0.2,1) both; }

.lp-pill {
  position: relative;
  min-width: 40px;
  height: 40px;
  padding: 0 10px;
  flex-shrink: 0;

  background: linear-gradient(180deg,
    rgba(255,255,255,0.095) 0%,
    rgba(255,255,255,0.042) 100%);
  border: 1px solid rgba(255,255,255,0.11);
  border-bottom-color: rgba(0,0,0,0.18);
  border-radius: 12px;

  color: var(--text);
  font-family: inherit;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;

  transition:
    transform  0.10s cubic-bezier(0.4,0,0.2,1),
    background 0.14s ease,
    box-shadow 0.14s ease;

  box-shadow:
    0 1px 0 rgba(0,0,0,0.35),
    0 2px 6px rgba(0,0,0,0.22),
    inset 0 1px 0 rgba(255,255,255,0.13);

  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.lp-pill:hover {
  background: linear-gradient(180deg,
    rgba(255,255,255,0.15) 0%,
    rgba(255,255,255,0.07) 100%);
  border-color: rgba(255,255,255,0.20);
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 5px 14px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.20);
  z-index: 2;
}
.lp-pill:active {
  transform: scale(0.92);
  transition-duration: 0.06s;
}

.lp-pill.lp-selected {
  background: linear-gradient(145deg,
    rgba(168,85,247,0.54) 0%,
    rgba(192,58,235,0.34) 100%) !important;
  border-color: rgba(168,85,247,0.72) !important;
  color: white !important;
  box-shadow:
    0 0 0 1px rgba(168,85,247,0.38),
    0 0 22px rgba(168,85,247,0.55),
    0 4px 10px rgba(0,0,0,0.38),
    inset 0 1px 0 rgba(255,255,255,0.30) !important;
  transform: translateY(-1px) scale(1.08) !important;
  z-index: 3 !important;
}

.lp-pill.lp-saved {
  background: linear-gradient(160deg,
    rgba(52,211,122,0.22) 0%,
    rgba(16,185,129,0.13) 100%) !important;
  border-color: rgba(52,211,122,0.45) !important;
  color: #6EFAAA !important;
  box-shadow:
    0 1px 0 rgba(0,0,0,0.35),
    0 2px 8px rgba(52,211,122,0.18),
    inset 0 1px 0 rgba(52,211,122,0.25) !important;
}
.lp-pill.lp-saved:hover {
  background: linear-gradient(160deg,
    rgba(52,211,122,0.32) 0%,
    rgba(16,185,129,0.20) 100%) !important;
  border-color: rgba(52,211,122,0.65) !important;
  box-shadow: 0 5px 16px rgba(52,211,122,0.30), inset 0 1px 0 rgba(52,211,122,0.30) !important;
}

.lp-pill.lp-saved::after {
  content: '✓';
  position: absolute;
  bottom: 1px; right: 3px;
  font-size: 8px;
  font-weight: 900;
  line-height: 1;
  color: #34D37A;
  text-shadow: 0 0 6px rgba(52,211,122,0.9);
  pointer-events: none;
}

.lp-pill.lp-selected.lp-saved {
  background: linear-gradient(145deg,
    rgba(168,85,247,0.54) 0%,
    rgba(192,58,235,0.34) 100%) !important;
  border-color: rgba(168,85,247,0.72) !important;
  color: white !important;
  box-shadow:
    0 0 0 1px rgba(168,85,247,0.38),
    0 0 22px rgba(168,85,247,0.55),
    0 4px 10px rgba(0,0,0,0.38),
    inset 0 1px 0 rgba(255,255,255,0.30) !important;
}
.lp-pill.lp-selected.lp-saved::after {
  color: rgba(255,255,255,0.85);
  text-shadow: 0 0 5px rgba(255,255,255,0.6);
}

@keyframes lpDotPulse {
  0%,100% { opacity:1; transform:scale(1); }
  50%     { opacity:0.4; transform:scale(0.65); }
}

@media (max-width: 600px) {
  .lp-grid { max-height: 170px; gap: 5px; }
  .lp-pill { min-width: 36px; height: 36px; font-size: 14px; padding: 0 8px; }
  .lp-preview { width: 52px; height: 52px; border-radius: 14px; }
  .lp-preview-letter { font-size: 26px; }
  .lp-tab { font-size: 10px; padding: 7px 2px; }
}

.show-more-link:hover {
  color: #B06FF9;
  filter: none;
  transform: none;
  background: transparent;
}

#saved-letters-container {
  background: linear-gradient(155deg, rgba(168,85,247,0.04), rgba(255,255,255,0.012));
  border: 1px solid rgba(168,85,247,0.12);
  border-top-color: rgba(255,255,255,0.09);
  border-radius: var(--radius-lg);
  padding: 16px;
  margin: 16px 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}
#saved-letters-container h2 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}
#saved-letters-container h2 #current-letter {
  text-transform: none;
  font-variant: normal;
  letter-spacing: normal;
}
#saved-letters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
#saved-letters img {
  border-radius: 8px;
  background: rgba(255,255,255,0.05);
  width: 64px !important;
  height: 64px !important;
  max-width: 64px !important;
  max-height: 64px !important;
  object-fit: contain !important;
}

/* Canvas */
.canvas-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 24px 16px;
  background: linear-gradient(170deg, rgba(168,85,247,0.05) 0%, rgba(255,255,255,0.015) 100%);
  border: 1px solid rgba(168,85,247,0.14);
  border-top-color: rgba(255,255,255,0.12);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 24px rgba(0,0,0,0.38), inset 0 1px 0 rgba(255,255,255,0.10);
  margin: 16px 0;
}

.canvas-wrapper {
  position: relative;
  width: 160px;
  height: 160px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: transparent;
  border: 1px solid rgba(168,85,247,0.30);
  box-shadow:
    0 0 0 1px rgba(168,85,247,0.14),
    0 8px 40px rgba(0,0,0,0.55),
    0 0 30px rgba(168,85,247,0.12),
    inset 0 1px 0 rgba(255,255,255,0.16);
  transition: box-shadow 0.3s ease;
  touch-action: none;
}
.canvas-wrapper:hover {
  box-shadow:
    0 0 0 1px rgba(168,85,247,0.22),
    0 10px 44px rgba(0,0,0,0.58),
    0 0 40px rgba(168,85,247,0.18),
    inset 0 1px 0 rgba(255,255,255,0.20);
}
.canvas-wrapper img,
.canvas-wrapper canvas {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
}
.canvas-wrapper img { opacity: 1; }
.canvas-wrapper canvas { z-index: 1; background: transparent !important; }

.canvas-info {
  font-size: 13px;
  color: var(--text-3);
}

.canvas-header-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-3);
  padding: 5px 12px;
  background: rgba(168,85,247,0.08);
  border: 1px solid rgba(168,85,247,0.18);
  border-radius: var(--radius-pill);
  user-select: none;
}

.canvas-buttons {
  display: flex;
  gap: 10px;
}

.canvas-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255,255,255,0.12);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.34,1.2,0.64,1);
  color: white;
  box-shadow: 0 4px 16px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.20), inset 0 -1px 0 rgba(0,0,0,0.10);
  position: relative;
  overflow: hidden;
}
.canvas-btn::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.12) 0%, transparent 100%);
  pointer-events: none;
  border-radius: inherit;
}
.canvas-btn:active { transform: scale(0.96); }
.canvas-btn-clear {
  background: linear-gradient(160deg, rgba(255,69,58,0.22) 0%, rgba(200,30,20,0.12) 100%);
  border-color: rgba(255,69,58,0.35);
  color: #FF453A;
  box-shadow: 0 4px 16px rgba(255,69,58,0.18), inset 0 1px 0 rgba(255,255,255,0.14), inset 0 -1px 0 rgba(0,0,0,0.08);
}
.canvas-btn-clear::before {
  content: '';
  position: absolute;
  top: 0; left: 5%; right: 5%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,69,58,0.45), rgba(255,255,255,0.30), rgba(255,69,58,0.45), transparent);
  pointer-events: none;
}
.canvas-btn-clear:hover {
  background: linear-gradient(160deg, rgba(255,69,58,0.35) 0%, rgba(200,30,20,0.22) 100%);
  border-color: rgba(255,69,58,0.58);
  box-shadow: 0 6px 22px rgba(255,69,58,0.28), inset 0 1px 0 rgba(255,255,255,0.18), inset 0 -1px 0 rgba(0,0,0,0.08);
  transform: translateY(-1px);
  filter: none;
}
.canvas-btn-save {
  background: linear-gradient(160deg, rgba(48,209,88,0.22) 0%, rgba(30,160,60,0.12) 100%);
  border-color: rgba(48,209,88,0.35);
  color: #30D158;
  box-shadow: 0 4px 16px rgba(48,209,88,0.18), inset 0 1px 0 rgba(255,255,255,0.14), inset 0 -1px 0 rgba(0,0,0,0.08);
}
.canvas-btn-save::before {
  content: '';
  position: absolute;
  top: 0; left: 5%; right: 5%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(48,209,88,0.45), rgba(255,255,255,0.30), rgba(48,209,88,0.45), transparent);
  pointer-events: none;
}
.canvas-btn-save:hover {
  background: linear-gradient(160deg, rgba(48,209,88,0.35) 0%, rgba(30,160,60,0.22) 100%);
  border-color: rgba(48,209,88,0.58);
  box-shadow: 0 6px 22px rgba(48,209,88,0.28), inset 0 1px 0 rgba(255,255,255,0.18), inset 0 -1px 0 rgba(0,0,0,0.08);
  transform: translateY(-1px);
  filter: none;
}

.brush-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--glass-inset);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 14px 20px;
  margin: 0 0 16px;
  flex-wrap: wrap;
  justify-content: center;
}
.brush-label {
  font-size: 13px;
  color: var(--text-2);
  font-weight: 500;
}
.brush-preview {
  width: 10px;
  height: 10px;
  background: var(--text);
  border-radius: 50%;
  transition: all 0.2s;
}
.brush-action-buttons {
  display: flex;
  gap: 8px;
}
.brush-btn {
  padding: 8px 15px;
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.06);
  color: var(--text-2);
  transition: all 0.22s cubic-bezier(0.34,1.2,0.64,1);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15), inset 0 1px 0 rgba(255,255,255,0.10);
  position: relative;
  overflow: hidden;
}
.brush-btn::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.07) 0%, transparent 100%);
  pointer-events: none;
  border-radius: inherit;
}
.brush-btn:hover { background: rgba(255,255,255,0.10); border-color: rgba(255,255,255,0.16); color: var(--text); filter: none; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.20), inset 0 1px 0 rgba(255,255,255,0.14); }
.brush-btn:active { transform: scale(0.96); }
.brush-btn:nth-child(1) {
  background: linear-gradient(160deg, rgba(48,209,88,0.22) 0%, rgba(30,160,60,0.12) 100%);
  border-color: rgba(48,209,88,0.35);
  color: #30D158;
  box-shadow: 0 2px 8px rgba(48,209,88,0.15), inset 0 1px 0 rgba(255,255,255,0.14);
}
.brush-btn:nth-child(1):hover {
  background: linear-gradient(160deg, rgba(48,209,88,0.35) 0%, rgba(30,160,60,0.22) 100%);
  border-color: rgba(48,209,88,0.58);
  box-shadow: 0 4px 16px rgba(48,209,88,0.28), inset 0 1px 0 rgba(255,255,255,0.18);
}
.brush-btn:nth-child(2) {
  background: linear-gradient(160deg, rgba(255,69,58,0.22) 0%, rgba(200,30,20,0.12) 100%);
  border-color: rgba(255,69,58,0.35);
  color: #FF453A;
  box-shadow: 0 2px 8px rgba(255,69,58,0.15), inset 0 1px 0 rgba(255,255,255,0.14);
}
.brush-btn:nth-child(2):hover {
  background: linear-gradient(160deg, rgba(255,69,58,0.35) 0%, rgba(200,30,20,0.22) 100%);
  border-color: rgba(255,69,58,0.58);
  box-shadow: 0 4px 16px rgba(255,69,58,0.28), inset 0 1px 0 rgba(255,255,255,0.18);
}
.brush-btn:nth-child(3) {
  background: linear-gradient(160deg, rgba(10,132,255,0.22) 0%, rgba(0,90,200,0.12) 100%);
  border-color: rgba(10,132,255,0.35);
  color: #3A9EFF;
  box-shadow: 0 2px 8px rgba(10,132,255,0.15), inset 0 1px 0 rgba(255,255,255,0.14);
}
.brush-btn:nth-child(3):hover {
  background: linear-gradient(160deg, rgba(10,132,255,0.35) 0%, rgba(0,90,200,0.22) 100%);
  border-color: rgba(10,132,255,0.58);
  box-shadow: 0 4px 16px rgba(10,132,255,0.28), inset 0 1px 0 rgba(255,255,255,0.18);
}

input[type="range"] {
  -webkit-appearance: none;
  width: 120px;
  height: 4px;
  background: linear-gradient(90deg, rgba(168,85,247,0.4), rgba(255,255,255,0.08));
  border-radius: 2px;
  outline: none;
  border: none;
  margin: 0;
  padding: 0;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: linear-gradient(145deg, #C084FC, #A855F7);
  border: 2px solid rgba(255,255,255,0.85);
  border-radius: 50%;
  box-shadow: 0 2px 10px rgba(168,85,247,0.55), 0 0 0 1px rgba(168,85,247,0.25);
  cursor: pointer;
  transition: transform 0.1s ease;
}

#pdf-section {
  background: linear-gradient(160deg,
    rgba(168,85,247,0.06) 0%,
    rgba(255,255,255,0.016) 55%,
    rgba(232,121,249,0.03) 100%);
  border: 1px solid rgba(168,85,247,0.15);
  border-top-color: rgba(255,255,255,0.13);
  border-radius: var(--radius-xl);
  box-shadow:
    0 0 0 1px rgba(168,85,247,0.05),
    0 16px 56px rgba(0,0,0,0.58),
    inset 0 1px 0 rgba(255,255,255,0.11),
    inset 0 -1px 0 rgba(0,0,0,0.07);
  padding: 32px;
  margin-bottom: 24px;
}

.relat {
  position: relative;
}

#pdf-section h2 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}

.pdf-container {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 24px;
  text-align: left;
  align-items: start;
}
@media (max-width: 700px) {
  .pdf-container { grid-template-columns: 1fr; }
}

.text-input-section, .pdf-preview-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  touch-action: pan-y;
}

#userText {
  width: 100%;
  min-height: 220px;
  background: var(--glass-inset) !important;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.6;
  padding: 14px;
  resize: vertical;
  margin: 0;
  transition: border-color 0.2s;
  -webkit-user-select: auto;
  user-select: auto;
}
#userText:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glass);
  outline: none;
}
#userText::placeholder { color: var(--text-4); }

.char-counter {
  font-size: 12px;
  color: var(--text-3);
  text-align: right;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.btn-clear-text {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 4px 10px 4px 7px;
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-3);
  background: rgba(255,255,255,0.038);
  border: 1px solid rgba(255,255,255,0.082);
  border-top-color: rgba(255,255,255,0.14);
  box-shadow:
    0 2px 6px rgba(0,0,0,0.18),
    inset 0 1px 0 rgba(255,255,255,0.10),
    inset 0 -1px 0 rgba(0,0,0,0.08);
  transition: all 0.20s cubic-bezier(0.34,1.2,0.64,1);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  flex-shrink: 0;
}
.btn-clear-text::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 50%;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255,255,255,0.07) 0%, transparent 100%);
  pointer-events: none;
}
.btn-clear-text:hover {
  background: rgba(255,69,58,0.18);
  border-color: rgba(255,69,58,0.38);
  border-top-color: rgba(255,120,112,0.45);
  color: rgba(255,120,110,1);
  box-shadow:
    0 3px 12px rgba(255,69,58,0.22),
    inset 0 1px 0 rgba(255,255,255,0.14),
    inset 0 -1px 0 rgba(0,0,0,0.08);
  transform: translateY(-1px);
}
.btn-clear-text:active {
  transform: translateY(0) scale(0.96);
}
.btn-clear-text svg {
  flex-shrink: 0;
  opacity: 0.7;
  transition: opacity 0.18s;
}
.btn-clear-text:hover svg { opacity: 1; }

.pdf-action-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.pdf-btn {
  flex: 1;
  min-width: 140px;
  padding: 9px 22px;
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.34,1.2,0.64,1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  position: relative;
  overflow: hidden;
}
.pdf-btn::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 50%;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255,255,255,0.08) 0%, transparent 100%);
  pointer-events: none;
}
.pdf-btn-bg {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text-2);
  box-shadow: 0 2px 8px rgba(0,0,0,0.18), inset 0 1px 0 rgba(255,255,255,0.10);
}
.pdf-btn-bg:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.20);
  color: var(--text);
  filter: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0,0,0,0.26), inset 0 1px 0 rgba(255,255,255,0.14);
}
.pdf-btn-generate {
  background: linear-gradient(160deg, rgba(185,100,255,0.80) 0%, rgba(168,85,247,0.70) 50%, rgba(192,58,235,0.65) 100%);
  border: 1px solid rgba(192,100,255,0.50);
  border-top-color: rgba(255,255,255,0.22);
  color: white;
  box-shadow: 0 4px 20px rgba(168,85,247,0.38), inset 0 1px 0 rgba(255,255,255,0.26);
}
.pdf-btn-generate:hover {
  transform: translateY(-2px);
  background: linear-gradient(160deg, rgba(200,120,255,0.90) 0%, rgba(185,100,255,0.80) 50%, rgba(208,68,248,0.75) 100%);
  box-shadow: 0 8px 28px rgba(168,85,247,0.52), inset 0 1px 0 rgba(255,255,255,0.30);
  filter: none;
}

.pdf-placeholder {
  background: var(--glass-inset);
  border: 1px dashed var(--glass-border);
  border-radius: var(--radius-lg);
  width: 100%;
  aspect-ratio: 1 / 1.414;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: pan-y;
}
.pdf-placeholder-text {
  color: var(--text-4);
  font-size: 14px;
}

#generation-canvas-container {
  border: 1px solid var(--glass-border) !important;
  border-radius: var(--radius-lg) !important;
  overflow: hidden;
  box-shadow: var(--shadow-glass) !important;
  background: white !important;
  width: 100%;
  aspect-ratio: 1 / 1.414;
  position: relative;
  touch-action: pan-y;
}
#generation-canvas-container canvas {
  display: block !important;
  width: 100% !important;
  height: auto !important;
  touch-action: pan-y;
  pointer-events: none;
}

#pdf-gen-overlay {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  background: rgba(7,7,16,0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  z-index: 10;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  padding: 28px 24px;
}
#pdf-gen-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.gen-spinner {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid rgba(168,85,247,0.18);
  border-top-color: var(--purple-1);
  border-right-color: var(--purple-3);
  animation: genSpin 1s linear infinite;
  box-shadow: 0 0 20px rgba(168,85,247,0.25), inset 0 0 20px rgba(168,85,247,0.05);
  flex-shrink: 0;
}
@keyframes genSpin {
  to { transform: rotate(360deg); }
}

.gen-step-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  letter-spacing: 0.04em;
  text-align: center;
  min-height: 1.4em;
  transition: opacity 0.18s ease;
}

.gen-percent {
  font-size: 32px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;

}

.gen-bar-track {
  width: 100%;
  max-width: 220px;
  height: 5px;
  background: rgba(255,255,255,0.09);
  border-radius: 100px;
  overflow: hidden;
  position: relative;
  will-change: transform;
}
.gen-bar-fill {
  height: 100%;
  border-radius: 100px;
  background: linear-gradient(90deg, var(--purple-1), var(--purple-3));
  transition: none;
  box-shadow: 0 0 8px rgba(168,85,247,0.55);
  width: 0%;
  will-change: width;
}

.gen-bar-fill::after {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 50%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.45), transparent);
  will-change: transform;
  animation: genShimmer 1.4s ease-in-out infinite;
  border-radius: 100px;
}
@keyframes genShimmer {
  0%   { transform: translateX(-120%); }
  100% { transform: translateX(340%); }
}

@keyframes pageFlash {
  0%   { opacity: 0.5; transform: scale(0.97); }
  60%  { opacity: 1;   transform: scale(1.005); }
  100% { opacity: 1;   transform: scale(1); }
}

#page-navigation {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 12px;
}

.page-nav-btn {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  color: var(--text-2);
  padding: 9px 18px;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.page-nav-btn:hover { background: var(--glass-hover); color: var(--text); filter: none; }
.page-nav-btn:disabled { opacity: 0.35; cursor: not-allowed; }

#page-info {
  font-size: 13px;
  color: var(--text-3);
  font-weight: 500;
}

#download-pdf-button {
  background: linear-gradient(160deg, rgba(185,100,255,0.80) 0%, rgba(168,85,247,0.70) 50%, rgba(192,58,235,0.65) 100%) !important;
  color: white !important;
  padding: 13px 28px !important;
  border-radius: var(--radius-pill) !important;
  font-family: inherit !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  border: 1px solid rgba(192,100,255,0.50) !important;
  border-top-color: rgba(255,255,255,0.22) !important;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(168,85,247,0.38), inset 0 1px 0 rgba(255,255,255,0.26) !important;
  transition: all 0.22s cubic-bezier(0.34,1.2,0.64,1) !important;
  margin: 12px 0 !important;
  position: relative;
  overflow: hidden;
}
#download-pdf-button::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 50%;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255,255,255,0.14) 0%, transparent 100%);
  pointer-events: none;
}
#download-pdf-button:hover {
  transform: translateY(-2px) !important;
  background: linear-gradient(160deg, rgba(200,120,255,0.90) 0%, rgba(185,100,255,0.80) 50%, rgba(208,68,248,0.75) 100%) !important;
  box-shadow: 0 8px 28px rgba(168,85,247,0.52), inset 0 1px 0 rgba(255,255,255,0.30) !important;
  filter: none !important;
}

#text-info-button, #history-button {
  position: absolute;
  background: var(--glass) !important;
  border: 1px solid var(--glass-border) !important;
  border-radius: var(--radius-sm) !important;
  color: var(--text-2) !important;
  width: 34px !important;
  height: 34px !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
  z-index: 10;
  margin: 0 !important;
}
#text-info-button { top: -8px; left: -8px; }
#history-button { top: -8px; right: -8px; }
#text-info-button:hover, #history-button:hover {
  background: var(--glass-hover) !important;
  color: var(--text) !important;
  filter: none;
}

#settings-section {
  background: linear-gradient(160deg,
    rgba(168,85,247,0.062) 0%,
    rgba(255,255,255,0.016) 55%,
    rgba(232,121,249,0.032) 100%);
  border: 1px solid rgba(168,85,247,0.16);
  border-top-color: rgba(255,255,255,0.13);
  border-radius: var(--radius-xl);
  box-shadow:
    0 0 0 1px rgba(168,85,247,0.05),
    0 16px 56px rgba(0,0,0,0.58),
    inset 0 1px 0 rgba(255,255,255,0.11),
    inset 0 -1px 0 rgba(0,0,0,0.07);
  padding: 32px;
  margin-bottom: 24px;
}

#settings-section h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}

.settings-button-group {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.settings-btn-item {
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid rgba(168,85,247,0.25);
  background: linear-gradient(160deg, rgba(168,85,247,0.14) 0%, rgba(232,121,249,0.07) 100%);
  color: var(--purple-4);
  transition: all 0.22s cubic-bezier(0.34,1.2,0.64,1);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15), inset 0 1px 0 rgba(255,255,255,0.12);
  position: relative;
  overflow: hidden;
}
.settings-btn-item::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.08) 0%, transparent 100%);
  pointer-events: none;
  border-radius: inherit;
}
.settings-btn-item:hover {
  background: linear-gradient(160deg, rgba(168,85,247,0.25) 0%, rgba(232,121,249,0.15) 100%);
  border-color: rgba(168,85,247,0.48);
  transform: translateY(-1.5px);
  box-shadow: 0 6px 20px rgba(168,85,247,0.28), inset 0 1px 0 rgba(255,255,255,0.16);
}
.settings-btn-item:active { transform: scale(0.97); }

#save-settings-button {
  background: linear-gradient(135deg, rgba(48,209,88,0.22), rgba(30,160,60,0.12));
  border-color: rgba(48,209,88,0.35);
  color: #30D158;
}
#save-settings-button:hover {
  background: linear-gradient(135deg, rgba(48,209,88,0.35), rgba(30,160,60,0.22));
  border-color: rgba(48,209,88,0.58);
  box-shadow: 0 4px 16px rgba(48,209,88,0.28);
}
#load-settings-button {
  background: linear-gradient(135deg, rgba(10,132,255,0.18), rgba(0,90,200,0.10));
  border-color: rgba(10,132,255,0.32);
  color: #0A84FF;
}
#load-settings-button:hover {
  background: linear-gradient(135deg, rgba(10,132,255,0.30), rgba(0,90,200,0.18));
  border-color: rgba(10,132,255,0.55);
  box-shadow: 0 4px 16px rgba(10,132,255,0.28);
}
#reset-settings-button {
  background: linear-gradient(135deg, rgba(255,69,58,0.22), rgba(200,30,20,0.12));
  border-color: rgba(255,69,58,0.35);
  color: #FF453A;
}
#reset-settings-button:hover {
  background: linear-gradient(135deg, rgba(255,69,58,0.35), rgba(200,30,20,0.22));
  border-color: rgba(255,69,58,0.58);
  box-shadow: 0 4px 16px rgba(255,69,58,0.28);
}
.color-picker-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--glass-inset);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill);
  padding: 10px 18px;
}
.color-picker-wrapper label {
  font-size: 13px;
  color: var(--text-2);
  font-weight: 500;
}
input[type="color"] {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  background: none;
  margin: 0;
}
input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; border-radius: 50%; }
input[type="color"]::-webkit-color-swatch { border: none; border-radius: 50%; }

.slider-container {
  background: linear-gradient(135deg, rgba(168,85,247,0.04), rgba(255,255,255,0.012));
  border: 1px solid rgba(168,85,247,0.11);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  transition: border-color 0.2s;
}
.slider-container:hover {
  border-color: rgba(168,85,247,0.22);
}
.slider-container label {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.slider-label-text {
  font-size: 13px;
  color: var(--text-2);
  font-weight: 500;
}
.slider-value {
  font-size: 12px;
  font-weight: 700;
  color: var(--purple-4);
  background: linear-gradient(135deg, rgba(168,85,247,0.22), rgba(232,121,249,0.12));
  border: 1px solid rgba(168,85,247,0.25);
  border-radius: var(--radius-pill);
  padding: 2px 10px;
  min-width: 42px;
  text-align: center;
}
.slider-container input[type="range"] {
  width: 100%;
}

.slider-container input[type="range"].slider-locked {
  pointer-events: none;
}

.faq-section {
  position: relative;
  z-index: 1;
  padding: 0 16px 80px;
  max-width: 760px;
  margin: 0 auto;
}
.faq-container {
  text-align: left;
}
.faq-title {
  font-size: 30px;
  font-weight: 800;
  text-align: center;
  margin-bottom: 28px;
  letter-spacing: -0.02em;
}
.faq-item {
  background: linear-gradient(160deg, rgba(168,85,247,0.045), rgba(255,255,255,0.014));
  border: 1px solid rgba(168,85,247,0.12);
  border-top-color: rgba(255,255,255,0.10);
  border-radius: var(--radius-lg);
  margin-bottom: 8px;
  overflow: hidden;
  transition: all 0.2s;
}
.faq-item.active {
  border-color: var(--primary-border);
  background: rgba(10,132,255,0.06);
}
.faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 22px;
  cursor: pointer;
  gap: 16px;
}
.faq-question h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
  text-align: left;
}
.faq-toggle {
  font-size: 20px;
  color: var(--primary);
  flex-shrink: 0;
  font-weight: 300;
  transition: transform 0.3s;
  line-height: 1;
}
.faq-item.active .faq-toggle { transform: rotate(45deg); }
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease, padding 0.2s;
  padding: 0 22px;
}
.faq-item.active .faq-answer {
  max-height: 300px;
  padding: 0 22px 18px;
}
.faq-answer p {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.65;
  margin: 0;
}

#legal {
  position: relative;
  z-index: 1;
  padding: 0 16px 40px;
}
.center-links {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.redirect-button {
  color: var(--text-2);
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  transition: all 0.2s;
}
.redirect-button:hover {
  color: var(--text-2);
  background: var(--glass);
}

.feedback-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  background: rgba(4,3,12,0.62);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.32s cubic-bezier(0.4,0,0.2,1);
  pointer-events: none;
}
.feedback-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
@media (min-width: 600px) {
  .feedback-overlay { align-items: center; padding: 20px; }
}

.feedback-container {
  position: relative;
  width: 100%;
  max-width: 460px;
  height: 76vh;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 36px 36px 0 0;


  background:
    linear-gradient(175deg,
      rgba(255,255,255,0.072) 0%,
      rgba(168,85,247,0.10)  18%,
      rgba(8,6,22,0.88)      48%,
      rgba(168,85,247,0.055) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(8px);


  border: 1px solid rgba(255,255,255,0.13);
  border-top-color: rgba(255,255,255,0.26);
  border-bottom: none;

  box-shadow:

    0 -8px 80px rgba(0,0,0,0.72),

    0 0 0 1px rgba(168,85,247,0.10),

    inset 0 1.5px 0 rgba(255,255,255,0.20),

    inset 0 -1px 0 rgba(0,0,0,0.28),

    inset 1px 0 0 rgba(255,255,255,0.05),
    inset -1px 0 0 rgba(255,255,255,0.05);

  transform: translateY(100%);
  transition: transform 0.44s cubic-bezier(0.32,0.72,0,1);
}
.feedback-overlay.active .feedback-container {
  transform: translateY(0);
}

@media (min-width: 600px) {
  .feedback-container {
    border-radius: 36px;
    border-bottom: 1px solid rgba(255,255,255,0.09);
    transform: translateY(28px) scale(0.94);
    opacity: 0;
    transition:
      transform 0.46s cubic-bezier(0.34,1.36,0.64,1),
      opacity   0.30s cubic-bezier(0.4,0,0.2,1);
  }
  .feedback-overlay.active .feedback-container {
    transform: translateY(0) scale(1);
    opacity: 1;
  }

  .feedback-overlay.closing .feedback-container {
    transform: translateY(18px) scale(0.96);
    opacity: 0;
    transition:
      transform 0.32s cubic-bezier(0.4,0,0.2,1),
      opacity   0.22s cubic-bezier(0.4,0,0.2,1);
  }

  .feedback-overlay.closing {
    transition: opacity 0.32s cubic-bezier(0.4,0,0.2,1) 0.08s;
  }
}

.feedback-container::before {
  content: '';
  position: absolute;
  top: 0; left: 6%; right: 6%;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(168,85,247,0.5) 20%,
    rgba(255,255,255,0.75) 50%,
    rgba(232,121,249,0.5) 80%,
    transparent 100%);
  pointer-events: none;
  z-index: 10;
}

.feedback-container::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 44%;
  background: linear-gradient(180deg,
    rgba(255,255,255,0.055) 0%,
    rgba(255,255,255,0.015) 60%,
    transparent 100%);
  pointer-events: none;
  z-index: 1;
  border-radius: 36px 36px 0 0;
}

.feedback-handle {
  width: 44px;
  height: 5px;
  background: rgba(255,255,255,0.22);
  border-radius: 3px;
  margin: 14px auto 0;
  flex-shrink: 0;
  position: relative;
  z-index: 5;
}
@media (min-width: 600px) { .feedback-handle { display: none; } }

.fb-tabs {
  display: flex;
  margin: 16px 18px 0;
  background: rgba(255,255,255,0.052);
  border: 1px solid rgba(255,255,255,0.09);
  border-top-color: rgba(255,255,255,0.16);
  border-radius: 100px;
  padding: 3px;
  flex-shrink: 0;
  position: relative;
  z-index: 5;
  box-shadow: inset 0 1px 0 rgba(0,0,0,0.18), 0 1px 0 rgba(255,255,255,0.04);
}
.fb-tab {
  flex: 1;
  padding: 10px 12px;
  border-radius: 100px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: rgba(245,245,247,0.48);
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.28s cubic-bezier(0.34,1.2,0.64,1);
  letter-spacing: 0.01em;
  position: relative;
  z-index: 1;
}
.fb-tab.active {
  color: #fff;
}
.fb-indicator {
  position: absolute;
  top: 3px;
  height: calc(100% - 6px);
  border-radius: var(--radius-pill);
  background: linear-gradient(
    145deg,
    rgba(168,85,247,0.52) 0%,
    rgba(192,132,252,0.38) 40%,
    rgba(168,85,247,0.44) 100%
  );
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(168,85,247,0.50);
  border-top-color: rgba(255,255,255,0.38);
  border-bottom-color: rgba(168,85,247,0.28);
  box-shadow:
    0 0 0 0.5px rgba(168,85,247,0.22),
    0 3px 16px rgba(168,85,247,0.35),
    0 1px 4px rgba(0,0,0,0.2),
    inset 0 1px 0 rgba(255,255,255,0.35),
    inset 0 -1px 0 rgba(0,0,0,0.1);
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  will-change: left, width;
  transition:
    left  0.38s cubic-bezier(0.34,1.2,0.64,1),
    width 0.38s cubic-bezier(0.34,1.2,0.64,1);
}
.fb-indicator::before {
  content: '';
  position: absolute;
  top: 0; left: 12%; right: 12%; height: 1px;
  background: linear-gradient(90deg,
    transparent,
    rgba(255,255,255,0.6),
    rgba(255,255,255,0.85),
    rgba(255,255,255,0.6),
    transparent
  );
  border-radius: 1px;
}
.fb-indicator::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 55%;
  background: linear-gradient(180deg,
    rgba(255,255,255,0.18) 0%,
    rgba(255,255,255,0.0) 100%
  );
  border-radius: inherit;
}

.fb-panels {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  position: relative;
  z-index: 2;
}
.fb-panel {
  display: none;
  padding: 22px 20px 32px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  height: 100%;
  box-sizing: border-box;
}
.fb-panel.active {
  display: block;
  animation: fbPanelIn 0.26s cubic-bezier(0.4,0,0.2,1) forwards;
}
@keyframes fbPanelIn {
  from { opacity: 0; transform: translateX(12px); }
  to   { opacity: 1; transform: translateX(0); }
}

.fb-write-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.fb-write-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.025em;
  background: linear-gradient(135deg, #d8b4fe 0%, #f0abfc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.fb-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.13);
  border-top-color: rgba(255,255,255,0.22);
  color: rgba(245,245,247,0.55);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  line-height: 1;
  flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.15), 0 2px 8px rgba(0,0,0,0.28);
}
.fb-close-btn:hover {
  background: rgba(255,255,255,0.15);
  color: #fff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.22), 0 4px 12px rgba(0,0,0,0.32);
}

.fb-subtitle {
  font-size: 13px;
  color: rgba(245,245,247,0.42);
  margin-bottom: 24px;
}

.fb-stars {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 6px 0 26px;
}
.fb-star {
  font-size: 40px;
  color: rgba(255,255,255,0.10);
  cursor: pointer;
  transition: color 0.16s, transform 0.18s cubic-bezier(0.34,1.56,0.64,1), filter 0.16s;
  line-height: 1;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.fb-star.active {
  color: #FFD60A;
  filter: drop-shadow(0 0 10px rgba(255,214,0,0.6));
}
.fb-star:hover { transform: scale(1.28); }
.fb-star.pop {
  animation: fbStarPop 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes fbStarPop {
  0%  { transform: scale(1); }
  55% { transform: scale(1.5); }
  100%{ transform: scale(1); }
}

.fb-textarea-wrap {
  position: relative;
  margin-bottom: 16px;
}
#feedback-text {
  width: 100%;
  min-height: 96px;
  background: rgba(255,255,255,0.038);
  border: 1px solid rgba(255,255,255,0.10);
  border-top-color: rgba(255,255,255,0.06);
  border-radius: 18px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  line-height: 1.6;
  padding: 14px 16px;
  margin: 0;
  resize: none;
  -webkit-user-select: auto;
  user-select: auto;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-shadow:
    inset 0 2px 6px rgba(0,0,0,0.22),
    inset 0 1px 0 rgba(0,0,0,0.15);
}
#feedback-text::placeholder { color: rgba(245,245,247,0.26); }
#feedback-text:focus {
  border-color: rgba(168,85,247,0.58);
  outline: none;
  box-shadow:
    0 0 0 3px rgba(168,85,247,0.14),
    inset 0 2px 6px rgba(0,0,0,0.22),
    inset 0 1px 0 rgba(0,0,0,0.15);
}

.feedback-buttons {
  display: flex;
  gap: 10px;
}
.btn-cancel {
  flex: 0 0 auto;
  padding: 13px 20px;
  border-radius: 18px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  background: rgba(255,255,255,0.068);
  border: 1px solid rgba(255,255,255,0.12);
  border-top-color: rgba(255,255,255,0.18);
  color: rgba(245,245,247,0.72);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.1), 0 2px 8px rgba(0,0,0,0.24);
}
.btn-cancel:hover {
  background: rgba(255,255,255,0.11);
  color: #fff;
  filter: none;
}
.btn-submit {
  flex: 1;
  padding: 13px 20px;
  border-radius: 18px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.22s;
  background: linear-gradient(140deg,
    rgba(168,85,247,0.92) 0%,
    rgba(192,58,235,0.78) 100%);
  border: 1px solid rgba(168,85,247,0.55);
  border-top-color: rgba(255,255,255,0.24);
  color: white;
  box-shadow:
    0 4px 24px rgba(168,85,247,0.42),
    inset 0 1.5px 0 rgba(255,255,255,0.28),
    inset 0 -1px 0 rgba(0,0,0,0.18);
  letter-spacing: 0.01em;
}
.btn-submit:hover:not(:disabled) {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow:
    0 8px 32px rgba(168,85,247,0.55),
    inset 0 1.5px 0 rgba(255,255,255,0.28),
    inset 0 -1px 0 rgba(0,0,0,0.18);
}
.btn-submit:disabled { opacity: 0.32; cursor: not-allowed; }

.fb-reviews-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.fb-reviews-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #d8b4fe 0%, #f0abfc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.average-rating {
  position: relative;
  background: rgba(168,85,247,0.10);
  border: 1px solid rgba(168,85,247,0.22);
  border-top-color: rgba(255,255,255,0.16);
  border-radius: 22px;
  padding: 20px 16px 16px;
  text-align: center;
  margin-bottom: 16px;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.12),
    inset 0 -1px 0 rgba(0,0,0,0.14),
    0 4px 24px rgba(168,85,247,0.14);
  overflow: hidden;
}
.average-rating::before {
  content: '';
  position: absolute;
  top: 0; left: 15%; right: 15%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.40), transparent);
}
.average-rating-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: rgba(245,245,247,0.38);
  margin-bottom: 10px;
}
.average-rating-stars {
  font-size: 22px;
  color: #FFD60A;
  filter: drop-shadow(0 0 8px rgba(255,214,0,0.45));
  margin-bottom: 8px;
  letter-spacing: 3px;
}
.average-rating-number {
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, #d8b4fe 0%, #f0abfc 55%, #e879f9 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 4px;
}
.average-rating-count {
  font-size: 12px;
  color: rgba(245,245,247,0.36);
}

.feedbacks-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.feedback-item {
  background: rgba(255,255,255,0.042);
  border: 1px solid rgba(255,255,255,0.08);
  border-top-color: rgba(255,255,255,0.12);
  border-radius: 16px;
  padding: 13px 15px;
  transition: background 0.18s;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.06);
}
.feedback-item:hover { background: rgba(255,255,255,0.07); }
.feedback-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 5px;
}
.feedback-username {
  font-size: 12px;
  font-weight: 600;
  color: rgba(245,245,247,0.52);
}
.feedback-stars {
  font-size: 12px;
  color: #FFD60A;
  letter-spacing: 1px;
  filter: drop-shadow(0 0 4px rgba(255,214,0,0.35));
}
.feedback-comment {
  font-size: 13px;
  color: rgba(245,245,247,0.78);
  line-height: 1.55;
  margin-bottom: 6px;
}
.feedback-date {
  font-size: 11px;
  color: rgba(245,245,247,0.28);
}
.no-feedbacks {
  text-align: center;
  padding: 36px 0;
  color: rgba(245,245,247,0.32);
  font-size: 14px;
}

/* ── Admin reply ─────────────────────────────────────────── */
.fb-reply {
  margin-top: 10px;
  border-radius: 12px;
  background: linear-gradient(135deg,
    rgba(168,85,247,0.10) 0%,
    rgba(232,121,249,0.07) 100%);
  border: 1px solid rgba(168,85,247,0.28);
  border-top-color: rgba(255,255,255,0.14);
  padding: 10px 13px 10px 12px;
  position: relative;
  overflow: hidden;
}
.fb-reply::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 3px; height: 100%;
  background: linear-gradient(180deg, #a855f7, #e879f9);
  border-radius: 3px 0 0 3px;
}
.fb-reply-header {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 5px;
}
.fb-reply-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px 2px 6px;
  border-radius: 100px;
  background: rgba(168,85,247,0.20);
  border: 1px solid rgba(168,85,247,0.38);
  font-size: 10.5px;
  font-weight: 700;
  color: #c084fc;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.fb-reply-badge-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: #a855f7;
  box-shadow: 0 0 5px rgba(168,85,247,0.9);
  flex-shrink: 0;
}
.fb-reply-author {
  font-size: 12px;
  font-weight: 700;
  color: #c084fc;
}
.fb-reply-date {
  font-size: 10.5px;
  color: rgba(245,245,247,0.28);
  margin-left: auto;
}
.fb-reply-text {
  font-size: 12.5px;
  color: rgba(245,245,247,0.78);
  line-height: 1.55;
  padding-left: 0;
}

/* admin reply form */
.fb-reply-form {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.fb-reply-textarea {
  width: 100%;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(168,85,247,0.28);
  border-top-color: rgba(255,255,255,0.10);
  border-radius: 10px;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 12px;
  color: var(--text);
  resize: none;
  outline: none;
  transition: border-color 0.18s;
  box-sizing: border-box;
}
.fb-reply-textarea:focus {
  border-color: rgba(168,85,247,0.6);
}
.fb-reply-textarea::placeholder { color: rgba(245,245,247,0.3); }
.fb-reply-submit {
  align-self: flex-end;
  padding: 6px 16px;
  border-radius: 100px;
  background: linear-gradient(135deg, rgba(168,85,247,0.80), rgba(192,132,252,0.70));
  border: 1px solid rgba(168,85,247,0.50);
  color: #fff;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(168,85,247,0.28), inset 0 1px 0 rgba(255,255,255,0.20);
  transition: all 0.18s ease;
}
.fb-reply-submit:hover {
  background: linear-gradient(135deg, rgba(168,85,247,1), rgba(192,132,252,0.9));
  box-shadow: 0 4px 18px rgba(168,85,247,0.42);
  transform: translateY(-1px);
}
.fb-reply-submit:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

.fb-reply-edit-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  padding: 2px 9px;
  border-radius: 100px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(245,245,247,0.45);
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  flex-shrink: 0;
}
.fb-reply-edit-btn:hover {
  background: rgba(168,85,247,0.18);
  border-color: rgba(168,85,247,0.38);
  color: #c084fc;
}
.fb-reply-edit-row {
  display: flex;
  gap: 6px;
  margin-top: 7px;
}
.fb-reply-cancel-btn {
  padding: 6px 14px;
  border-radius: 100px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(245,245,247,0.55);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}
.fb-reply-cancel-btn:hover { background: rgba(255,255,255,0.10); color: var(--text); }

.existing-feedbacks, .feedback-dialog { display: none !important; }
.close-btn { display: none !important; }

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(0);
  background: rgba(20,20,36,0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(7px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill);
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  z-index: 9999;
  opacity: 1;
  white-space: nowrap;
  max-width: calc(100vw - 48px);
  text-overflow: ellipsis;
  overflow: hidden;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast.success { border-color: rgba(48,209,88,0.4); box-shadow: 0 0 24px rgba(48,209,88,0.15); }
.toast.error   { border-color: rgba(255,69,58,0.4); box-shadow: 0 0 24px rgba(255,69,58,0.15); }

.modern-dialog-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(7px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modern-dialog {
  background: linear-gradient(160deg, rgba(168,85,247,0.10) 0%, rgba(255,255,255,0.022) 55%, rgba(232,121,249,0.06) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.13);
  border-top-color: rgba(255,255,255,0.22);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-float);
  width: min(400px, calc(100vw - 32px));
  padding: 32px;
  animation: dialogIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.modern-dialog-icon {
  font-size: 40px;
  margin-bottom: 12px;
}
.modern-dialog-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}
.modern-dialog-message {
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.6;
  margin-bottom: 24px;
}
.modern-dialog-buttons {
  display: flex;
  gap: 10px;
}
.dialog-btn {
  flex: 1;
  padding: 12px;
  border-radius: var(--radius);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}
.dialog-btn.primary {
  background: linear-gradient(160deg, rgba(185,100,255,0.75) 0%, rgba(168,85,247,0.65) 100%);
  border: 1px solid rgba(168,85,247,0.45);
  color: white;
  box-shadow: 0 4px 16px rgba(168,85,247,0.30), inset 0 1px 0 rgba(255,255,255,0.22);
}
.dialog-btn.primary:hover {
  background: linear-gradient(160deg, rgba(200,120,255,0.85) 0%, rgba(185,100,255,0.75) 100%);
  filter: none; transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(168,85,247,0.45), inset 0 1px 0 rgba(255,255,255,0.28);
}
.dialog-btn.secondary {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.10);
  color: var(--text-2);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.07);
}
.dialog-btn.secondary:hover { background: rgba(255,255,255,0.10); border-color: rgba(255,255,255,0.16); color: var(--text); filter: none; }
.dialog-btn.danger {
  background: linear-gradient(135deg, rgba(255,69,58,0.22), rgba(200,30,20,0.12));
  border: 1px solid rgba(255,69,58,0.35);
  color: #FF453A;
  box-shadow: 0 2px 8px rgba(255,69,58,0.15), inset 0 1px 0 rgba(255,255,255,0.10);
}
.dialog-btn.danger:hover {
  background: linear-gradient(135deg, rgba(255,69,58,0.35), rgba(200,30,20,0.22));
  border-color: rgba(255,69,58,0.58);
  filter: none; transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(255,69,58,0.28), inset 0 1px 0 rgba(255,255,255,0.12);
}

.account-settings-dialog {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.60);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1500;
  display: flex !important;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s;
  padding: 16px;
  pointer-events: none;
}
.account-settings-dialog.visible { opacity: 1; pointer-events: auto; }

.account-settings-content {
  background: linear-gradient(160deg,
    rgba(255,255,255,0.065) 0%,
    rgba(168,85,247,0.08) 50%,
    rgba(255,255,255,0.035) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.16);
  border-top-color: rgba(255,255,255,0.28);
  border-bottom-color: rgba(255,255,255,0.07);
  border-radius: var(--radius-xl);
  box-shadow:
    0 32px 96px rgba(0,0,0,0.78),
    0 8px 24px rgba(0,0,0,0.42),
    inset 0 1px 0 rgba(255,255,255,0.20),
    inset 0 -1px 0 rgba(0,0,0,0.10);
  width: min(440px, calc(100vw - 32px));
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px;
  animation: dialogIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
}
.account-settings-content::before {
  content: '';
  position: absolute;
  top: 0; left: 8%; right: 8%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(168,85,247,0.65), rgba(255,255,255,0.50), rgba(168,85,247,0.65), transparent);
  pointer-events: none;
}
.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.settings-header h3 {
  font-size: 20px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
}
.close-button {
  width: 32px;
  height: 32px;
  cursor: pointer;
  color: var(--text-3);
  transition: color 0.2s;
}
.close-button:hover { color: var(--text); }
.email-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--glass-inset);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 12px;
}
.email-content { display: flex; flex-direction: column; gap: 2px; align-items: flex-start; }
.email-label { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.06em; }
.email-value { font-size: 14px; color: var(--text); font-weight: 500; }
.edit-icon { width: 18px; height: 18px; color: var(--primary); cursor: pointer; }
.language-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--glass-inset);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 12px;
}
.language-section label { font-size: 14px; color: var(--text-2); font-weight: 500; }
.custom-select { position: relative; }
.language-select {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  padding: 7px 28px 7px 12px;
  cursor: pointer;
  margin: 0;
  -webkit-appearance: none;
  -webkit-user-select: auto;
  user-select: auto;
}
.custom-arrow {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-3);
  font-size: 10px;
  pointer-events: none;
}
.action-button {
  width: 100%;
  margin: 6px 0;
  padding: 13px 16px;
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(160deg, rgba(255,255,255,0.07) 0%, rgba(255,255,255,0.03) 100%);
  border: 1px solid rgba(255,255,255,0.12);
  color: var(--text-2);
  text-align: left;
  transition: all 0.22s cubic-bezier(0.34,1.2,0.64,1);
  box-shadow: 0 2px 8px rgba(0,0,0,0.18), inset 0 1px 0 rgba(255,255,255,0.12);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: flex-start;
}
.action-button::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.07) 0%, transparent 100%);
  pointer-events: none;
  border-radius: inherit;
}
.action-button:hover { background: linear-gradient(160deg, rgba(255,255,255,0.12) 0%, rgba(255,255,255,0.06) 100%); border-color: rgba(255,255,255,0.20); color: var(--text); filter: none; transform: translateY(-1px); box-shadow: 0 4px 14px rgba(0,0,0,0.26), inset 0 1px 0 rgba(255,255,255,0.16); }
.action-button:active { transform: scale(0.98); }
.stats-button {
  background: linear-gradient(160deg, rgba(168,85,247,0.16) 0%, rgba(168,85,247,0.07) 100%);
  border-color: rgba(168,85,247,0.35);
  color: var(--purple-4);
  box-shadow: 0 2px 8px rgba(168,85,247,0.15), inset 0 1px 0 rgba(255,255,255,0.14);
}
.stats-button:hover {
  background: linear-gradient(160deg, rgba(168,85,247,0.28) 0%, rgba(168,85,247,0.14) 100%);
  border-color: rgba(168,85,247,0.55);
  box-shadow: 0 4px 16px rgba(168,85,247,0.28), inset 0 1px 0 rgba(255,255,255,0.18);
}
.action-button.danger {
  background: linear-gradient(160deg, rgba(255,69,58,0.22) 0%, rgba(200,30,20,0.12) 100%);
  border-color: rgba(255,69,58,0.35);
  color: #FF453A;
  box-shadow: 0 2px 8px rgba(255,69,58,0.15), inset 0 1px 0 rgba(255,255,255,0.12);
}
.action-button.danger:hover {
  background: linear-gradient(160deg, rgba(255,69,58,0.35) 0%, rgba(200,30,20,0.22) 100%);
  border-color: rgba(255,69,58,0.58);
  box-shadow: 0 4px 16px rgba(255,69,58,0.28), inset 0 1px 0 rgba(255,255,255,0.16);
}
.action-button.cancel {
  background: linear-gradient(160deg, rgba(255,255,255,0.07) 0%, rgba(255,255,255,0.03) 100%);
  border-color: rgba(255,255,255,0.14);
  color: var(--text-3);
}
.action-button.purple {
  background: linear-gradient(160deg, rgba(168,85,247,0.22) 0%, rgba(168,85,247,0.10) 100%);
  border-color: rgba(168,85,247,0.40);
  color: var(--purple-4);
  box-shadow: 0 2px 8px rgba(168,85,247,0.18), inset 0 1px 0 rgba(255,255,255,0.16);
  justify-content: center !important;
  text-align: center !important;
  display: flex;
  align-items: center;
}
.action-button.purple:hover {
  background: linear-gradient(160deg, rgba(168,85,247,0.36) 0%, rgba(168,85,247,0.20) 100%);
  border-color: rgba(168,85,247,0.58);
  box-shadow: 0 4px 18px rgba(168,85,247,0.32), inset 0 1px 0 rgba(255,255,255,0.20);
}

.fast-scan-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1600;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
#fastScanCanvas {
  touch-action: none;
  cursor: crosshair;
}
canvas { cursor: crosshair; touch-action: none; }

.background-selector-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.8);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1400;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

input, textarea, select {
  font-family: 'Plus Jakarta Sans', inherit;
}
input:focus, textarea:focus, select:focus { outline: none; }

#nav-guest-info {
  font-size: 12px;
  color: var(--text-3);
  padding: 4px 10px;
  background: var(--glass);
  border-radius: var(--radius-pill);
  border: 1px solid var(--glass-border);
}

#loading-screen {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #070710;
  opacity: 1;
  transition: opacity 0.55s cubic-bezier(0.4,0,0.2,1), visibility 0.55s;
  visibility: visible;
}
#loading-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.ls-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 15% 10%,  rgba(168,85,247,0.28) 0%, transparent 55%),
    radial-gradient(ellipse 60% 50% at 85% 5%,   rgba(232,121,249,0.18) 0%, transparent 50%),
    radial-gradient(ellipse 55% 45% at 50% 100%,  rgba(168,85,247,0.16) 0%, transparent 55%);
  pointer-events: none;
}
.ls-content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  z-index: 1;
}

.ls-logo-wrap {
  position: relative;
  width: 96px;
  height: 96px;
  margin-bottom: 28px;
}
.ls-logo-ring {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 1.5px solid transparent;
  background:
    linear-gradient(#070710, #070710) padding-box,
    conic-gradient(from 0deg, rgba(168,85,247,0.9) 0%, rgba(232,121,249,0.6) 40%, rgba(255,255,255,0.08) 60%, rgba(168,85,247,0.9) 100%) border-box;
  animation: lsRingSpin 1.8s linear infinite;
}
.ls-ring2 {
  inset: -18px;
  border-width: 1px;
  background:
    linear-gradient(#070710, #070710) padding-box,
    conic-gradient(from 180deg, rgba(232,121,249,0.5) 0%, rgba(168,85,247,0.15) 45%, rgba(255,255,255,0.04) 55%, rgba(232,121,249,0.5) 100%) border-box;
  animation: lsRingSpin 2.8s linear infinite reverse;
}
@keyframes lsRingSpin {
  to { transform: rotate(360deg); }
}
.ls-owl {
  position: absolute;
  inset: 0;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: contain;
  background: radial-gradient(circle, rgba(168,85,247,0.15) 0%, rgba(255,255,255,0.03) 100%);
  box-shadow:
    0 0 0 1px rgba(168,85,247,0.25),
    0 8px 32px rgba(168,85,247,0.30),
    0 2px 8px rgba(0,0,0,0.6);
  will-change: transform;
  animation: lsOwlPulse 2.4s ease-in-out infinite;
  padding: 8px;
}
@keyframes lsOwlPulse {
  0%, 100% { transform: scale(1);    box-shadow: 0 0 0 1px rgba(168,85,247,0.25), 0 8px 32px rgba(168,85,247,0.30), 0 2px 8px rgba(0,0,0,0.6); }
  50%       { transform: scale(1.04); box-shadow: 0 0 0 1px rgba(168,85,247,0.45), 0 8px 44px rgba(168,85,247,0.50), 0 2px 8px rgba(0,0,0,0.6); }
}

.ls-wordmark {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, #F5F5F7 0%, #C084FC 50%, #E879F9 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 6px;
  animation: lsFadeUp 0.7s cubic-bezier(0.4,0,0.2,1) both;
  animation-delay: 0.1s;
}
.ls-tagline {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: rgba(245,245,247,0.40);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 40px;
  animation: lsFadeUp 0.7s cubic-bezier(0.4,0,0.2,1) both;
  animation-delay: 0.2s;
}
@keyframes lsFadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.ls-bar-wrap {
  width: 180px;
  margin-bottom: 28px;
  animation: lsFadeUp 0.7s cubic-bezier(0.4,0,0.2,1) both;
  animation-delay: 0.3s;
}
.ls-bar-track {
  width: 100%;
  height: 3px;
  background: rgba(255,255,255,0.08);
  border-radius: 99px;
  overflow: hidden;
}
.ls-bar-fill {
  height: 100%;
  width: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #A855F7, #E879F9);
  box-shadow: 0 0 8px rgba(168,85,247,0.7);
  transform-origin: left center;
  will-change: transform, opacity;
  animation: lsBarAnim 2.2s cubic-bezier(0.4,0,0.2,1) infinite;
}
@keyframes lsBarAnim {
  0%   { transform: scaleX(0);    opacity: 1; }
  60%  { transform: scaleX(0.8);  opacity: 1; }
  90%  { transform: scaleX(1);    opacity: 0.8; }
  100% { transform: scaleX(1);    opacity: 0; }
}

.ls-dots {
  display: flex;
  gap: 7px;
  animation: lsFadeUp 0.7s cubic-bezier(0.4,0,0.2,1) both;
  animation-delay: 0.35s;
}
.ls-dots span {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(168,85,247,0.6);
  animation: lsDotPulse 1.2s ease-in-out infinite;
}
.ls-dots span:nth-child(2) { animation-delay: 0.18s; background: rgba(192,132,252,0.6); }
.ls-dots span:nth-child(3) { animation-delay: 0.36s; background: rgba(232,121,249,0.6); }
@keyframes lsDotPulse {
  0%, 100% { transform: scale(1);   opacity: 0.5; }
  50%       { transform: scale(1.6); opacity: 1;   }
}

.text-formatting-popup {
  background: linear-gradient(160deg, rgba(255,255,255,0.06) 0%, rgba(168,85,247,0.07) 50%, rgba(255,255,255,0.03) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.14);
  border-top-color: rgba(255,255,255,0.24);
  border-bottom-color: rgba(255,255,255,0.06);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-float), inset 0 1px 0 rgba(255,255,255,0.14);
  position: relative;
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--glass-border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--glass-border-strong); }

.email-input,
.styled-input {
  width: 100%;
  display: block;
  margin-bottom: 10px;
  padding: 13px 16px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: var(--radius);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  transition: all 0.22s ease;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.18), inset 0 -1px 0 rgba(255,255,255,0.04);
  -webkit-user-select: auto;
  user-select: auto;
}
.email-input:focus,
.styled-input:focus {
  border-color: rgba(168,85,247,0.55);
  box-shadow: 0 0 0 3px rgba(168,85,247,0.15), inset 0 1px 3px rgba(0,0,0,0.15);
  background: rgba(168,85,247,0.06);
  outline: none;
}
.email-input::placeholder,
.styled-input::placeholder { color: var(--text-4); }
.email-input[readonly] {
  color: var(--text-3);
  cursor: default;
}
.input-container {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 4px;
}
.button-container {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.button-container .action-button,
.account-settings-content .action-button.purple {
  justify-content: center;
  text-align: center;
}

.email-change-button {
  width: 100%;
  padding: 13px 16px;
  border-radius: var(--radius-pill);
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  background: linear-gradient(160deg, rgba(168,85,247,0.52) 0%, rgba(168,85,247,0.36) 100%);
  border: 1px solid rgba(168,85,247,0.50);
  color: white;
  transition: all 0.22s cubic-bezier(0.34,1.2,0.64,1);
  box-shadow: 0 4px 18px rgba(168,85,247,0.30), inset 0 1px 0 rgba(255,255,255,0.22);
  margin-top: 12px;
  position: relative;
  overflow: hidden;
  text-align: center;
}
.email-change-button::before {
  content: '';
  position: absolute;
  top: 0; left: 8%; right: 8%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.45), transparent);
  pointer-events: none;
}
.email-change-button:hover {
  background: linear-gradient(160deg, rgba(168,85,247,0.72) 0%, rgba(168,85,247,0.54) 100%);
  border-color: rgba(168,85,247,0.70);
  box-shadow: 0 6px 24px rgba(168,85,247,0.45), inset 0 1px 0 rgba(255,255,255,0.28);
  transform: translateY(-1px);
}

.email-label {
  font-size: 11px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  text-align: left !important;
  align-self: flex-start;
  width: 100%;
}
.email-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: flex-start !important;
  text-align: left;
  flex: 1;
}

.confirmation-text {
  font-size: 16px;
  color: var(--text-2);
  text-align: center;
  line-height: 1.6;
  margin: 0 0 12px;
}
.warning-text {
  font-size: 13px;
  color: rgba(255,69,58,0.85);
  text-align: left;
  line-height: 1.6;
  margin: 0 0 20px;
  padding: 12px 14px;
  background: rgba(255,69,58,0.08);
  border: 1px solid rgba(255,69,58,0.22);
  border-radius: var(--radius);
}

#confirm-delete-btn.enabled {
  background: linear-gradient(135deg, rgba(255,69,58,0.22), rgba(200,30,20,0.12));
  border-color: rgba(255,69,58,0.35);
  color: #FF453A;
  box-shadow: 0 4px 16px rgba(255,69,58,0.18), inset 0 1px 0 rgba(255,255,255,0.14);
  cursor: pointer;
}
#confirm-delete-btn:not(.enabled) {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.canvas-wrapper {
  position: relative;
  overflow: hidden;
}
.canvas-wrapper img {
  position: absolute !important;
  top: 0 !important; left: 0 !important;
  width: 100% !important; height: 100% !important;
  object-fit: cover;
  display: block;
  opacity: 1;
  pointer-events: none;
  z-index: 0;
  border-radius: 0;
  margin: 0;
  padding: 0;
  transform: none;
}
.canvas-wrapper canvas {
  position: absolute !important;
  top: 0 !important; left: 0 !important;
  width: 100% !important; height: 100% !important;
  z-index: 1;
  background: transparent !important;
}

#fast-scan-ui .nav-button {
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 600px) {
  #app-section { padding: 28px 16px 20px; }
  #pdf-section  { padding: 24px 16px; }
  #settings-section { padding: 24px 16px; }
  .faq-section { padding: 0 8px 60px; }
  #home { padding: 130px 16px 60px; }
  .lp-shell { padding: 14px 12px 12px; }
  .lp-tabs  { gap: 3px; }
}

.background-selection-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0; z-index: 9999;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(6px);
  display: flex !important; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; transition: opacity 0.25s ease;
  pointer-events: none;
}
.background-selection-overlay.active { opacity: 1; pointer-events: auto; }
.background-selection-dialog {
  background: linear-gradient(160deg, rgba(168,85,247,0.10) 0%, rgba(255,255,255,0.025) 50%, rgba(232,121,249,0.06) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.12);
  border-top-color: rgba(255,255,255,0.20);
  border-radius: 28px;
  padding: 24px;
  width: 100%; max-width: 560px; max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 24px 72px rgba(0,0,0,0.72), 0 4px 16px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.14);
  position: relative;
}
.background-selection-dialog::before {
  content:''; position:absolute; top:0; left:8%; right:8%; height:1px;
  background: linear-gradient(90deg, transparent, rgba(168,85,247,0.65), rgba(255,255,255,0.5), rgba(168,85,247,0.65), transparent);
  pointer-events:none;
}
.bg-dialog-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.bg-dialog-header h3 { margin:0; font-size:18px; font-weight:700; color:var(--text); }
.bg-close-btn {
  width:32px; height:32px; border-radius:50%;
  background:rgba(255,255,255,0.08); border:1px solid rgba(255,255,255,0.12);
  color:var(--text); font-size:16px; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  transition:all 0.2s;
}
.bg-close-btn:hover { background:rgba(255,255,255,0.16); }
.bg-section { margin-bottom: 20px; }
.bg-section-title {
  font-size:12px; font-weight:700; color:var(--text-3);
  text-transform:uppercase; letter-spacing:0.08em;
  margin-bottom:10px;
}
.bg-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px;
}
.bg-item {
  position:relative; aspect-ratio: 1/1.414; border-radius:10px; overflow:hidden;
  cursor:pointer; border:2px solid transparent;
  transition:all 0.22s cubic-bezier(0.34,1.2,0.64,1); background:rgba(255,255,255,0.05);
  box-shadow: 0 2px 10px rgba(0,0,0,0.35);
}
.bg-item:hover { border-color:rgba(168,85,247,0.5); transform:scale(1.04); box-shadow: 0 4px 18px rgba(168,85,247,0.25); }
.bg-item.selected { border-color:#A855F7; box-shadow:0 0 0 2px rgba(168,85,247,0.45), 0 4px 18px rgba(168,85,247,0.30); }
.bg-item img { width:200%; height:200%; object-fit:cover; display:block; position:absolute; top:-50%; left:-50%; }
.bg-item-overlay {
  position:absolute; top:0; left:0; right:0; bottom:0;
  background:rgba(0,0,0,0.35);
  display:flex; align-items:center; justify-content:center;
  opacity:0; transition:opacity 0.2s;
}
.bg-item:hover .bg-item-overlay, .bg-item.selected .bg-item-overlay { opacity:1; }
.bg-item-check {
  width:28px; height:28px; border-radius:50%;
  background:#A855F7; color:white;
  display:flex; align-items:center; justify-content:center;
  font-size:14px; font-weight:700;
}
.bg-delete-btn {
  position:absolute; top:4px; right:4px;
  width:22px; height:22px; border-radius:50%;
  background:rgba(255,69,58,0.8); border:none;
  color:white; font-size:12px; cursor:pointer;
  display:flex; align-items:center; justify-content:center;
  opacity:0; transition:opacity 0.2s;
}
.bg-item:hover .bg-delete-btn { opacity:1; }
.custom-bg-placeholder {
  aspect-ratio: 1/1.414; border-radius:10px;
  border:2px dashed rgba(168,85,247,0.35);
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  cursor:pointer; gap:6px; transition:all 0.2s;
  background:rgba(168,85,247,0.05);
}
.custom-bg-placeholder:hover { border-color:rgba(168,85,247,0.65); background:rgba(168,85,247,0.10); }
.bg-upload-container { margin-top:10px; }
.bg-upload-btn {
  width:100%; padding:10px; border-radius:12px;
  border:2px dashed rgba(168,85,247,0.35);
  background:rgba(168,85,247,0.05); color:var(--text-2);
  font-family:inherit; font-size:13px; font-weight:600;
  cursor:pointer; transition:all 0.2s;
}
.bg-upload-btn:hover { border-color:rgba(168,85,247,0.65); background:rgba(168,85,247,0.12); }
.bg-upload-info { font-size:11px; color:var(--text-3); margin-top:6px; text-align:center; }

.slider-warning-overlay {
  position:fixed; top:0; left:0; right:0; bottom:0; z-index:20000000;
  background:rgba(0,0,0,0.60);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(8px);
  display:flex !important; align-items:center; justify-content:center; padding:20px;
  opacity:0; transition:opacity 0.25s ease;
  pointer-events: none;
}
.slider-warning-overlay.active { opacity:1; pointer-events: auto; }
.slider-warning-dialog {
  --popup-accent: 168,85,247;
  background: linear-gradient(160deg,
    rgba(255,255,255,0.048) 0%,
    rgba(var(--popup-accent),0.07) 50%,
    rgba(255,255,255,0.028) 100%);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(8px);
  border:1px solid rgba(255,255,255,0.14);
  border-top-color:rgba(255,255,255,0.26);
  border-bottom-color:rgba(255,255,255,0.06);
  border-radius:28px; padding:32px 28px;
  width:100%; max-width:400px; text-align:center;
  box-shadow:
    0 32px 96px rgba(0,0,0,0.80),
    0 8px 24px rgba(0,0,0,0.45),
    inset 0 1px 0 rgba(255,255,255,0.18),
    inset 0 -1px 0 rgba(0,0,0,0.12);
  position:relative;
  animation: dialogIn 0.35s cubic-bezier(0.34,1.56,0.64,1) both;
}
.slider-warning-dialog::before {
  content:''; position:absolute; top:0; left:8%; right:8%; height:1px;
  background:linear-gradient(90deg,transparent,rgba(var(--popup-accent),0.75),rgba(255,255,255,0.55),rgba(var(--popup-accent),0.75),transparent);
  pointer-events:none;
}
.slider-warning-icon {
  width:60px; height:60px; border-radius:50%;
  background:rgba(var(--popup-accent),0.15);
  border:1px solid rgba(var(--popup-accent),0.30);
  display:flex; align-items:center; justify-content:center;
  margin:0 auto 16px; font-size:26px;
}
.slider-warning-title { font-size:20px; font-weight:700; color:rgba(245,245,247,1); margin-bottom:10px; }
.slider-warning-msg { font-size:14px; color:rgba(245,245,247,0.65); line-height:1.6; margin-bottom:24px; }
.slider-warning-btns { display:flex; gap:10px; justify-content:center; }
.slider-btn-cancel {
  padding:11px 22px; border-radius:100px;
  background:rgba(255,255,255,0.07); border:1px solid rgba(255,255,255,0.14);
  color:rgba(245,245,247,0.80); font-family:inherit; font-size:14px; font-weight:600;
  cursor:pointer; transition:all 0.22s cubic-bezier(0.34,1.2,0.64,1); flex:1;

  box-shadow: 0 2px 8px rgba(0,0,0,0.20), inset 0 1px 0 rgba(255,255,255,0.12);
  position:relative; overflow:hidden;
}
.slider-btn-cancel::after {
  content:''; position:absolute; top:0; left:0; right:0; height:50%;
  background:linear-gradient(180deg,rgba(255,255,255,0.08) 0%,transparent 100%);
  pointer-events:none; border-radius:inherit;
}
.slider-btn-cancel:hover { background:rgba(255,255,255,0.13); border-color:rgba(255,255,255,0.20); color:rgba(245,245,247,1); transform:translateY(-1px); box-shadow:0 4px 14px rgba(0,0,0,0.28),inset 0 1px 0 rgba(255,255,255,0.16); }
.slider-btn-confirm {
  padding:11px 22px; border-radius:100px;
  background:linear-gradient(135deg,rgba(var(--popup-accent),0.60),rgba(var(--popup-accent),0.40));
  border:1px solid rgba(var(--popup-accent),0.52);
  color:white; font-family:inherit; font-size:14px; font-weight:700;
  cursor:pointer; transition:all 0.22s cubic-bezier(0.34,1.2,0.64,1); flex:1;
  box-shadow:0 4px 16px rgba(var(--popup-accent),0.30), inset 0 1px 0 rgba(255,255,255,0.22);
  position:relative; overflow:hidden;
}
.slider-btn-confirm::before {
  content:''; position:absolute; top:0; left:8%; right:8%; height:1px;
  background:linear-gradient(90deg,transparent,rgba(255,255,255,0.55),transparent);
  pointer-events:none;
}
.slider-btn-confirm::after {
  content:''; position:absolute; top:0; left:0; right:0; height:50%;
  background:linear-gradient(180deg,rgba(255,255,255,0.13) 0%,transparent 100%);
  pointer-events:none; border-radius:inherit;
}
.slider-btn-confirm:hover { filter:brightness(1.15); box-shadow:0 6px 22px rgba(var(--popup-accent),0.48), inset 0 1px 0 rgba(255,255,255,0.28); transform:translateY(-1px); }

.auth-overlay,
[id$="-overlay"]:not(#pme-lasso-canvas),
[class$="-overlay"],
[class*="overlay"][style*="fixed"] {
  transform: translateZ(0);
  contain: layout style;
}


body > *:not(.navbar):not([class*="overlay"]):not([id*="overlay"]):not(.toast-container):not(.auth-overlay) {
  touch-action: pan-x pan-y pinch-zoom;
}

/* Toasts */

[class*="popup"], [class*="overlay"], [class*="modal"], [class*="dialog"],
[class*="toast"], [class*="drawer"], [class*="panel"] {
  contain: layout style;
  -webkit-transform: translateZ(0);
}

[class*="grid"], [class*="list"], [class*="feed"] {
  -webkit-overflow-scrolling: touch;
  overflow-anchor: none;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }
}

@supports (-webkit-backdrop-filter: blur(6px)) {
  .glass, .glass-sm, .navbar, [class*="popup"], [class*="overlay"],
  [class*="modal"], [class*="card"], [class*="btn"] {
    -webkit-transform: translateZ(0);
    isolation: isolate;
  }
}
