:root {
  color-scheme: dark;
  --bg: #070a12;
  --bg-card: rgba(16, 22, 36, 0.72);
  --bg-card-hover: rgba(24, 33, 54, 0.85);
  --border: rgba(255, 255, 255, 0.12);
  --border-glass: rgba(255, 255, 255, 0.2);
  --border-glow: rgba(99, 246, 201, 0.45);
  --text: #f8faff;
  --muted: #9ba8c8;
  --subtle: #5f6b88;
  --accent: #62f6c9;
  --accent-blue: #4facfe;
  --accent-purple: #8b5cf6;
  --accent-orange: #ff7a5c;
  --danger: #ff4976;
  --success: #10b981;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  --radius-xl: 34px;
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
  --radius-pill: 9999px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  width: 100%;
  max-width: 100vw;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  touch-action: pan-y;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}

body {
  background:
    radial-gradient(circle at 10% 0%, rgba(98, 246, 201, 0.14), transparent 32%),
    radial-gradient(circle at 90% 10%, rgba(139, 92, 246, 0.16), transparent 34%),
    radial-gradient(circle at 50% 90%, rgba(79, 172, 254, 0.12), transparent 38%),
    linear-gradient(180deg, #070a12 0%, #0b101c 50%, #070a12 100%);
  background-attachment: fixed;
  padding-bottom: 104px; /* Space for iOS 26 dock */
}

/* Background Aurora Ambient Lights */
.aurora {
  position: fixed;
  z-index: 0;
  width: 420px;
  height: 420px;
  border-radius: var(--radius-pill);
  filter: blur(96px);
  opacity: 0.22;
  pointer-events: none;
  animation: drift 12s ease-in-out infinite alternate;
}

.aurora-a {
  top: -120px;
  left: -80px;
  background: var(--accent);
}

.aurora-b {
  right: -120px;
  top: 38%;
  background: var(--accent-purple);
  animation-delay: -3s;
}

@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(40px, 30px, 0) scale(1.12); }
}

/* Dynamic Island Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(36px) saturate(210%) contrast(106%);
  -webkit-backdrop-filter: blur(36px) saturate(210%) contrast(106%);
  background: linear-gradient(180deg, rgba(14, 18, 28, 0.88) 0%, rgba(8, 11, 18, 0.78) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), inset 0 -1px 0 rgba(255, 255, 255, 0.08);
  padding: max(12px, env(safe-area-inset-top)) 18px 12px;
}

.header-shell {
  max-width: 1040px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #62f6c9, #4facfe);
  color: #080b12;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 19px;
  box-shadow: 0 4px 16px rgba(98, 246, 201, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.5);
  transition: transform 0.2s cubic-bezier(0.32, 0.72, 0, 1);
}

.brand-logo:active {
  transform: scale(0.92);
}

.brand-name {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.brand-sub {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 5px;
}

.pulse-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: var(--accent);
  border-radius: var(--radius-pill);
  box-shadow: 0 0 8px var(--accent);
  animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.8); }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.support-chip {
  background: linear-gradient(135deg, rgba(98, 246, 201, 0.15) 0%, rgba(79, 172, 254, 0.12) 100%);
  border: 1px solid rgba(98, 246, 201, 0.38);
  color: var(--accent);
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 2px 10px rgba(98, 246, 201, 0.15), inset 0 1px 0.8px rgba(255, 255, 255, 0.35);
  transition: all 0.2s cubic-bezier(0.32, 0.72, 0, 1);
}

.support-chip:hover, .support-chip:active {
  background: rgba(98, 246, 201, 0.24);
  transform: scale(0.96);
  box-shadow: 0 4px 14px rgba(98, 246, 201, 0.28);
}

.plan-pill {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.04) 100%);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--text);
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), inset 0 1px 0.8px rgba(255, 255, 255, 0.3);
}

/* Shell Layout */
.shell {
  width: min(1040px, 100%);
  margin: 0 auto;
  padding: 16px 14px 24px;
}

/* Desktop Tabs Navigation */
.desktop-tabs {
  display: none;
  margin-bottom: 22px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%), rgba(14, 20, 36, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 28px;
  padding: 6px;
  gap: 6px;
  backdrop-filter: blur(36px) saturate(210%);
  -webkit-backdrop-filter: blur(36px) saturate(210%);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45), inset 0 1.5px 1px rgba(255, 255, 255, 0.35);
}

@media (min-width: 801px) {
  .desktop-tabs {
    display: flex;
  }
  body {
    padding-bottom: 28px;
  }
  .mobile-nav {
    display: none !important;
  }
}

.desktop-tabs .tab {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 14px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.32, 0.72, 0, 1);
  white-space: nowrap;
}

.desktop-tabs .tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.desktop-tabs .tab.active {
  color: #080b12;
  background: var(--accent);
  font-weight: 750;
  box-shadow: 0 4px 18px rgba(98, 246, 201, 0.42), inset 0 1px 1px rgba(255, 255, 255, 0.5);
}

/* Tab Panels with Fluid Native Animation */
.tab-panel {
  display: none;
  will-change: transform, opacity;
}

.tab-panel.active {
  display: block;
  animation: tabSpringIn 0.32s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes tabSpringIn {
  0% {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Cards Liquid Glassmorphism */
.card {
  position: relative;
  z-index: 1;
  background:
    radial-gradient(130% 120% at 15% 0%, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.02) 60%, transparent 100%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%),
    rgba(14, 20, 36, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-xl);
  padding: 22px;
  backdrop-filter: blur(38px) saturate(220%) contrast(108%);
  -webkit-backdrop-filter: blur(38px) saturate(220%) contrast(108%);
  box-shadow: 0 20px 52px rgba(0, 0, 0, 0.48), inset 0 1.5px 1px 0 rgba(255, 255, 255, 0.4), inset 0 -1.5px 1px 0 rgba(0, 0, 0, 0.28);
  margin-bottom: 18px;
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.25s ease, box-shadow 0.25s ease;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 42%;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0.02) 80%, transparent 100%);
  pointer-events: none;
  border-top-left-radius: inherit;
  border-top-right-radius: inherit;
}

.card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(420px circle at var(--pointer-x, 50%) var(--pointer-y, 50%), rgba(98, 246, 201, 0.14), transparent 68%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card:hover::after {
  opacity: 1;
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.58), inset 0 1.5px 1.2px rgba(255, 255, 255, 0.5);
}

.card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.eyebrow {
  margin: 0 0 4px 0;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--accent);
}

h1, h2, h3, h4 {
  margin: 0 0 6px 0;
  font-weight: 700;
  letter-spacing: -0.3px;
}

h1 { font-size: 22px; }
h2 { font-size: 18px; }
h3 { font-size: 16px; }
h4 { font-size: 14px; }

.muted {
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

.muted.small {
  font-size: 12px;
}

.pill {
  display: inline-block;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.03) 100%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--text);
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), inset 0 1px 0.8px rgba(255, 255, 255, 0.3);
}

.pill.success {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.22) 0%, rgba(16, 185, 129, 0.1) 100%);
  border-color: rgba(16, 185, 129, 0.4);
  color: var(--success);
}

/* Grids */
.grid {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
}

.grid.two { grid-template-columns: 1fr; }
.grid.three { grid-template-columns: 1fr; }
.grid.four { grid-template-columns: repeat(2, 1fr); }

@media (min-width: 680px) {
  .grid.two { grid-template-columns: repeat(2, 1fr); }
  .grid.three { grid-template-columns: repeat(3, 1fr); }
  .grid.four { grid-template-columns: repeat(4, 1fr); }
}

/* iOS 26 Cupertino Segmented Control */
.ios-segmented {
  display: flex;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 24px;
  padding: 4px;
  gap: 4px;
  margin-bottom: 16px;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 14px rgba(0, 0, 0, 0.2);
}

.ios-segmented.inner-seg {
  max-width: 480px;
  margin: 14px auto 8px;
}

.seg-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 14px;
  border-radius: 18px;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.32, 0.72, 0, 1);
  white-space: nowrap;
}

.seg-btn:active {
  transform: scale(0.97);
}

.seg-btn.active {
  background: var(--accent);
  color: #080b12;
  font-weight: 750;
  box-shadow: 0 4px 16px rgba(98, 246, 201, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.5);
}

/* CRITICAL: Strict 16px on ALL inputs/textareas to prevent iOS Safari auto-zoom/upscaling! */
input, textarea, select {
  font-size: 16px !important; /* Prevents auto-zoom on mobile WebKit / iOS */
  line-height: 1.45;
  font-family: inherit;
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  color: var(--text);
  background: rgba(0, 0, 0, 0.36);
  border: 1.5px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  outline: none;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4), 0 1px 1px rgba(255, 255, 255, 0.05);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

input:focus, textarea:focus, select:focus {
  font-size: 16px !important;
  border-color: var(--accent);
  background: rgba(0, 0, 0, 0.46);
  box-shadow: 0 0 0 3px rgba(98, 246, 201, 0.22), inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

/* Buttons with Liquid Glass & Smooth Squircles */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.03) 100%), rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--text);
  padding: 11px 18px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25), inset 0 1px 0.8px rgba(255, 255, 255, 0.3);
  transition: all 0.22s cubic-bezier(0.32, 0.72, 0, 1);
  touch-action: manipulation;
}

.btn:hover {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.06) 100%), rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.4);
}

.btn:active {
  transform: scale(0.96) translateY(0);
}

.btn.primary {
  background: linear-gradient(135deg, #78ffd8 0%, #4facfe 100%);
  color: #080b12;
  border: 1px solid rgba(255, 255, 255, 0.4);
  font-weight: 750;
  box-shadow: 0 6px 22px rgba(98, 246, 201, 0.4), inset 0 1.2px 1px rgba(255, 255, 255, 0.6);
}

.btn.primary:hover {
  background: linear-gradient(135deg, #8affdf 0%, #60bdff 100%);
  box-shadow: 0 8px 28px rgba(98, 246, 201, 0.55), inset 0 1.5px 1.2px rgba(255, 255, 255, 0.7);
}

.btn.secondary {
  background: linear-gradient(135deg, rgba(79, 172, 254, 0.22) 0%, rgba(139, 92, 246, 0.18) 100%);
  border-color: rgba(79, 172, 254, 0.45);
  color: #62d8ff;
  box-shadow: 0 4px 16px rgba(79, 172, 254, 0.2), inset 0 1px 1px rgba(255, 255, 255, 0.3);
}

.btn.outline {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.22);
}

.btn.small {
  padding: 7px 14px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

.btn.glow-btn {
  box-shadow: 0 6px 24px rgba(98, 246, 201, 0.4), inset 0 1.2px 1px rgba(255, 255, 255, 0.5);
}

.btn.glow-btn:hover {
  box-shadow: 0 8px 32px rgba(98, 246, 201, 0.6), inset 0 1.5px 1.2px rgba(255, 255, 255, 0.65);
}

.btn.w-full {
  width: 100%;
}

.btn.disabled, .btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* Copy Input Row */
.copy-input-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.copy-input-row input {
  flex: 1;
}

/* Stack Form */
.stack-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 10px;
}

/* Hero card */
.hero-card {
  background: linear-gradient(135deg, rgba(98, 246, 201, 0.15), rgba(79, 172, 254, 0.1), rgba(18, 24, 38, 0.88));
  border: 1px solid rgba(98, 246, 201, 0.35);
  border-radius: var(--radius-xl);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5), inset 0 1.5px 1px rgba(255, 255, 255, 0.45);
}

.hero-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hero-badge-tag {
  display: inline-block;
  background: rgba(98, 246, 201, 0.16);
  color: var(--accent);
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  border: 1px solid rgba(98, 246, 201, 0.3);
  margin-bottom: 8px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 2px 10px rgba(98, 246, 201, 0.18), inset 0 1px 0.8px rgba(255, 255, 255, 0.35);
}

.hero-quick-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Daily Bonus Card */
.bonus-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: linear-gradient(135deg, rgba(255, 122, 92, 0.15) 0%, rgba(139, 92, 246, 0.15) 100%), rgba(18, 24, 38, 0.75);
  border: 1px solid rgba(255, 122, 92, 0.38);
  border-radius: var(--radius-lg);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.45), inset 0 1.5px 1px rgba(255, 255, 255, 0.35);
}

.bonus-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bonus-icon {
  font-size: 32px;
  line-height: 1;
}

/* Metrics */
.limits-counter {
  font-size: 20px;
  font-weight: 800;
  color: var(--accent);
}

.progress-bar-wrap {
  width: 100%;
  height: 9px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-pill);
  overflow: hidden;
  margin: 10px 0 8px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4);
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #62f6c9, #4facfe);
  border-radius: var(--radius-pill);
  box-shadow: 0 0 12px rgba(98, 246, 201, 0.5);
  transition: width 0.4s ease;
}

.mini-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.mini-metric-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.m-val {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.m-lbl {
  font-size: 10px;
  color: var(--muted);
  margin-top: 2px;
}

.stats-line-group {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stats-line {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}

.stats-line span { color: var(--muted); }

/* 4 Stats counters */
.stat-pill-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%), rgba(18, 24, 38, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  backdrop-filter: blur(28px) saturate(200%);
  -webkit-backdrop-filter: blur(28px) saturate(200%);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.28);
  transition: transform 0.2s cubic-bezier(0.32, 0.72, 0, 1), border-color 0.2s ease;
}

.stat-pill-card:hover {
  transform: translateY(-2px);
  border-color: rgba(98, 246, 201, 0.35);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45), inset 0 1.2px 1.2px rgba(255, 255, 255, 0.38);
}

.stat-emoji {
  font-size: 24px;
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-info b {
  font-size: 16px;
  line-height: 1.2;
}

.stat-info small {
  font-size: 11px;
  color: var(--muted);
}

/* Chat Section */
.chat-window-card {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: calc(100vh - 200px);
  padding: 16px;
  border-radius: var(--radius-xl);
}

.chat-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  gap: 8px;
}

.chat-model-selector-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.model-select-lbl {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.styled-select {
  padding: 8px 12px;
  font-size: 13px !important;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.chat-messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 16px 6px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.chat-bubble {
  display: flex;
  gap: 10px;
  max-width: 88%;
  animation: bubblePop 0.26s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  will-change: transform, opacity;
  transform-origin: bottom center;
}

@keyframes bubblePop {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.chat-bubble.user-bubble {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chat-bubble.ai-bubble {
  align-self: flex-start;
}

.bubble-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #62f6c9, #4facfe);
  color: #080b12;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 15px;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(98, 246, 201, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.4);
}

.user-bubble .bubble-avatar {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.1) 100%);
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.25);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.bubble-body {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.09) 0%, rgba(255, 255, 255, 0.02) 100%), rgba(16, 22, 38, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 24px;
  padding: 13px 18px;
  font-size: 14.5px;
  line-height: 1.55;
  word-break: break-word;
  backdrop-filter: blur(28px) saturate(200%);
  -webkit-backdrop-filter: blur(28px) saturate(200%);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3), inset 0 1.2px 1px rgba(255, 255, 255, 0.3);
}

.user-bubble .bubble-body {
  background: linear-gradient(135deg, rgba(98, 246, 201, 0.26) 0%, rgba(79, 172, 254, 0.28) 100%), rgba(14, 24, 40, 0.72);
  border-color: rgba(98, 246, 201, 0.45);
  border-bottom-right-radius: 6px;
  box-shadow: 0 10px 28px rgba(98, 246, 201, 0.18), inset 0 1.2px 1.5px rgba(255, 255, 255, 0.45);
}

.ai-bubble .bubble-body {
  border-bottom-left-radius: 6px;
}

.chat-composer-form {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.chat-composer-form textarea {
  flex: 1;
  border-radius: var(--radius-md);
}

.send-btn {
  width: 50px;
  height: 50px;
  padding: 0;
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

.send-icon {
  font-size: 18px;
}

.chat-footer-note {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  margin-top: 8px;
}

.support-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

/* Image Studio */
.image-studio-card {
  background: linear-gradient(145deg, rgba(139, 92, 246, 0.08), rgba(18, 24, 38, 0.9));
}

.field-group {
  margin-bottom: 12px;
}

.field-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--muted);
}

.field-group textarea {
  width: 100%;
}

.style-chips-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 6px 12px;
  border-radius: 99px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.32, 0.72, 0, 1);
}

.chip:active {
  transform: scale(0.96);
}

.chip.active {
  background: var(--accent);
  color: #080b12;
  border-color: var(--accent);
  font-weight: 700;
}

.ratio-chips-wrap {
  display: flex;
  gap: 8px;
}

.ratio-btn {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.ratio-btn.active {
  background: var(--accent);
  color: #080b12;
  border-color: var(--accent);
}

.image-result-box {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.result-img-wrap img {
  max-width: 100%;
  max-height: 420px;
  border-radius: var(--radius-md);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5);
}

.image-result-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 12px;
}

/* ================= COMMUNITY & FORUM STYLES ================= */
.section-banner-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.community-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

@media (min-width: 640px) {
  .community-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.comm-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.32, 0.72, 0, 1);
}

.comm-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(98, 246, 201, 0.3);
  transform: translateY(-2px);
}

.comm-card:active {
  transform: scale(0.98);
}

.comm-card-top {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.comm-avatar {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(98, 246, 201, 0.2), rgba(79, 172, 254, 0.25));
  border: 1px solid rgba(98, 246, 201, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.comm-card-info {
  flex: 1;
  min-width: 0;
}

.comm-card-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.comm-card-desc {
  font-size: 12px;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

.comm-card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-size: 12px;
}

/* Community Detail Header */
.back-bar {
  margin-bottom: 14px;
}

.comm-header-card {
  background: linear-gradient(135deg, rgba(98, 246, 201, 0.08), rgba(18, 24, 38, 0.9));
  border-color: rgba(98, 246, 201, 0.25);
}

.comm-header-top {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.comm-badge-line {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
}

.comm-stats-bar {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

.comm-actions-group {
  display: flex;
  gap: 8px;
}

/* Post Composer */
.comm-post-composer {
  background: rgba(255, 255, 255, 0.03);
}

.composer-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  gap: 10px;
}

.composer-controls.right-align {
  justify-content: flex-end;
}

.anon-toggle-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
}

.anon-toggle-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
}

/* Posts Feed */
.comm-posts-feed {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.comm-post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  backdrop-filter: blur(20px);
}

.post-author-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 13px;
}

.post-author-name {
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 4px;
}

.post-date {
  font-size: 11px;
  color: var(--subtle);
}

.post-body-text {
  font-size: 14px;
  line-height: 1.55;
  color: #e2e8f0;
  white-space: pre-wrap;
  word-break: break-word;
}

.post-foot-row {
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
}

.like-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 5px 12px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s cubic-bezier(0.32, 0.72, 0, 1);
}

.like-btn:active {
  transform: scale(0.9);
}

.like-btn.liked {
  background: rgba(255, 73, 118, 0.15);
  border-color: rgba(255, 73, 118, 0.4);
  color: var(--danger);
  animation: heartPop 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

@keyframes heartPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.25); }
  100% { transform: scale(1); }
}

/* Forum Topics */
.forum-topics-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.forum-topic-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.32, 0.72, 0, 1);
}

.forum-topic-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(98, 246, 201, 0.3);
  transform: translateY(-2px);
}

.forum-topic-item:active {
  transform: scale(0.98);
}

.topic-title-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 6px;
}

.topic-meta-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}

.forum-posts-thread {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 16px 0;
}

.forum-msg-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
}

/* Plans & Store Styling */
.store-hero {
  text-align: center;
  background: linear-gradient(135deg, rgba(98, 246, 201, 0.08), rgba(139, 92, 246, 0.12));
}

.term-switcher {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 4px;
  gap: 4px;
  margin-top: 14px;
}

.term-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 99px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.32, 0.72, 0, 1);
}

.term-btn.active {
  background: var(--accent);
  color: #080b12;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(98, 246, 201, 0.3);
}

.plan-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.plan-card.featured {
  border-color: rgba(98, 246, 201, 0.4);
  background: linear-gradient(145deg, rgba(98, 246, 201, 0.08), rgba(18, 24, 38, 0.95));
}

.plan-card.pro-card {
  border-color: rgba(139, 92, 246, 0.45);
  background: linear-gradient(145deg, rgba(139, 92, 246, 0.12), rgba(18, 24, 38, 0.95));
}

.popular-tag {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--accent);
  color: #080b12;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.5px;
}

.popular-tag.pro-tag {
  background: var(--accent-purple);
  color: #fff;
}

.plan-price {
  font-size: 24px;
  font-weight: 800;
  margin: 8px 0 4px;
  letter-spacing: -0.5px;
}

.plan-price small {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
}

.plan-features {
  list-style: none;
  padding: 0;
  margin: 16px 0 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  line-height: 1.4;
}

.plan-btn-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Limit Packs Store */
.packs-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pack-group-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.pack-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.pack-item-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  transition: all 0.2s cubic-bezier(0.32, 0.72, 0, 1);
}

.pack-item-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(98, 246, 201, 0.3);
}

.pack-item-count {
  font-size: 18px;
  font-weight: 800;
}

.pack-item-price {
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
}

.pack-item-price small {
  font-size: 12px;
  color: var(--muted);
  font-weight: normal;
}

/* Character Bundle Card */
.character-bundle-card {
  background: linear-gradient(135deg, rgba(255, 122, 92, 0.12), rgba(139, 92, 246, 0.15));
  border-color: rgba(255, 122, 92, 0.35);
  text-align: center;
  padding: 26px 20px;
}

.bundle-price-box {
  margin: 16px 0;
}

.bundle-price-box .price-val {
  font-size: 28px;
  font-weight: 900;
  color: var(--accent);
}

/* Support Center */
.support-center-card {
  background: linear-gradient(135deg, rgba(79, 172, 254, 0.12), rgba(98, 246, 201, 0.08));
  border: 1px solid rgba(98, 246, 201, 0.3);
}

.support-center-head {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
}

.support-big-icon {
  width: 60px;
  height: 60px;
  border-radius: 18px;
  background: linear-gradient(135deg, #4facfe, #00f2fe);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  flex-shrink: 0;
}

.online-tag {
  display: inline-block;
  background: rgba(16, 185, 129, 0.15);
  color: var(--success);
  padding: 3px 8px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 6px;
}

.support-action-box {
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.support-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.meta-item {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}

.big-btn {
  padding: 14px;
  font-size: 15px;
}

/* FAQ */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.faq-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  transition: all 0.2s cubic-bezier(0.32, 0.72, 0, 1);
}

.faq-item summary {
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  outline: none;
}

.faq-item[open] {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.15);
}

.faq-item p {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.5;
}

/* Sub-nav in Tools */
.sub-nav {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  overflow-x: auto;
}

.sub-tab {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 8px 14px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.sub-tab.active {
  background: var(--accent);
  color: #080b12;
  border-color: var(--accent);
}

.sub-panel {
  display: none;
}

.sub-panel.active {
  display: block;
  animation: tabFadeIn 0.2s ease-out;
}

.action-buttons-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.result-box {
  margin-top: 14px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  font-size: 13px;
  line-height: 1.6;
}

/* iOS 26 Floating Frosted Glass Dock */
.mobile-nav {
  position: fixed;
  bottom: 12px;
  left: 12px;
  right: 12px;
  max-width: 520px;
  margin: 0 auto;
  z-index: 100;
  background: rgba(14, 18, 28, 0.88);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 26px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: space-around;
  padding: 8px 6px;
}

.m-tab {
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 8px;
  border-radius: 16px;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.32, 0.72, 0, 1);
  flex: 1;
  position: relative;
  touch-action: manipulation;
}

.m-tab:active {
  transform: scale(0.9);
}

.m-tab.active {
  color: var(--accent);
  background: rgba(98, 246, 201, 0.12);
  border-color: rgba(98, 246, 201, 0.22);
  box-shadow: 0 0 16px rgba(98, 246, 201, 0.2);
}

.m-tab.active .m-icon {
  animation: tabBounce 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform: scale(1.12);
}

@keyframes tabBounce {
  0% { transform: scale(0.85); }
  60% { transform: scale(1.22); }
  100% { transform: scale(1.12); }
}

.m-icon {
  font-size: 20px;
  line-height: 1;
}

.m-lbl {
  font-size: 9.5px;
  font-weight: 600;
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(16px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  animation: fadeIn 0.2s ease-out;
}

.modal-card {
  background: rgba(18, 24, 38, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 24px;
  padding: 22px;
  width: min(440px, 100%);
  max-height: min(88vh, calc(100dvh - 36px));
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.85);
  animation: modalSpring 0.28s cubic-bezier(0.32, 0.72, 0, 1);
  position: relative;
  overflow: hidden;
  margin: auto;
}

@keyframes modalSpring {
  from { opacity: 0; transform: scale(0.92) translateY(12px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  flex-shrink: 0;
}

.close-modal-btn {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: var(--muted);
  width: 32px;
  height: 32px;
  border-radius: 99px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
}

.close-modal-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: var(--text);
}

.type-radio-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 6px;
}

.type-radio-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
}

.type-radio-label input[type="radio"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 84px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(18, 24, 38, 0.95);
  border: 1px solid rgba(98, 246, 201, 0.4);
  color: var(--text);
  padding: 10px 20px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
  z-index: 250;
  animation: toastIn 0.25s ease-out;
  white-space: nowrap;
}

@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.hidden {
  display: none !important;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 12px;
}

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

/* ================= LIQUID GLASS: CHARACTERS & BOT BUY ================= */
.plan-bot-note {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  margin-top: 8px;
  margin-bottom: 0;
  line-height: 1.4;
}

/* Chat Character Floating Bar */
.chat-character-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%), rgba(18, 24, 38, 0.6);
  backdrop-filter: blur(24px) saturate(200%);
  -webkit-backdrop-filter: blur(24px) saturate(200%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chat-character-bar:hover {
  border-color: rgba(98, 246, 201, 0.35);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.12) 0%, rgba(255, 255, 255, 0.04) 100%), rgba(22, 30, 48, 0.7);
}

.char-current-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.char-avatar-mini {
  font-size: 1.3rem;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.char-meta-mini {
  display: flex;
  flex-direction: column;
}

.char-name-mini {
  font-weight: 600;
  font-size: 13px;
  color: var(--text);
}

.char-tag-mini {
  font-size: 10px;
  color: var(--muted);
}

.btn.glass-btn {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.03) 100%);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--text);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

/* 24 Characters Grid in Store & Modal */
.characters-store-grid,
.char-cards-modal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.char-card {
  position: relative;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%), rgba(16, 22, 36, 0.65);
  backdrop-filter: blur(28px) saturate(200%);
  -webkit-backdrop-filter: blur(28px) saturate(200%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.2);
  overflow: hidden;
}

.char-card:hover {
  transform: translateY(-2px);
  border-color: rgba(98, 246, 201, 0.4);
  box-shadow: 0 12px 30px rgba(98, 246, 201, 0.15);
}

.char-card.active-char {
  border-color: var(--accent);
  box-shadow: 0 0 18px rgba(98, 246, 201, 0.35), inset 0 1px 2px rgba(255, 255, 255, 0.4);
}

.char-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.char-card-emoji {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
}

.char-card-meta {
  flex: 1;
  min-width: 0;
}

.char-card-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.char-card-sub {
  font-size: 11px;
  color: var(--muted);
}

.char-card-body {
  font-size: 12px;
  color: #c0cbe0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.char-card-manner {
  font-size: 11px;
  color: var(--muted);
  font-style: italic;
  border-left: 2px solid var(--accent);
  padding-left: 6px;
  margin-top: 2px;
}

.char-card-actions {
  margin-top: auto;
  padding-top: 6px;
}

/* Modal Large for Characters */
.modal-large {
  max-width: 780px !important;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.char-modal-body {
  overflow-y: auto;
  padding-right: 4px;
  max-height: calc(85vh - 100px);
}

.char-reset-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%), rgba(18, 24, 38, 0.6);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.char-reset-box:hover {
  border-color: var(--accent);
}

.char-reset-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(98, 246, 201, 0.15);
  color: var(--accent);
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(98, 246, 201, 0.3);
  flex-shrink: 0;
}

.char-reset-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ================= 100,000X LIQUID GLASS SYSTEM ================= */
.card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(360px circle at var(--pointer-x, 50%) var(--pointer-y, 50%), rgba(255, 255, 255, 0.08), transparent 70%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  border-radius: inherit;
}

.card:hover::after,
.char-card:hover::after,
.art-preset-card:hover::after {
  opacity: 1;
}

/* Network Ping & Sound Toggle */
.ping-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 5px 9px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  font-family: ui-monospace, monospace;
}

.ping-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #62f6c9;
  box-shadow: 0 0 8px #62f6c9;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.sound-chip {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text);
  width: 32px;
  height: 32px;
  border-radius: 99px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s cubic-bezier(0.32, 0.72, 0, 1);
}

.sound-chip:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: scale(1.06);
}

.sound-chip:active {
  transform: scale(0.92);
}

/* Chat Quick Prompts Carousel */
.chat-chips-carousel {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 6px 2px 8px;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}

.chat-chips-carousel::-webkit-scrollbar {
  display: none;
}

.chat-chip {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #d1d9e8;
  padding: 6px 12px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.32, 0.72, 0, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
}

.chat-chip:hover {
  background: rgba(98, 246, 201, 0.15);
  border-color: rgba(98, 246, 201, 0.4);
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(98, 246, 201, 0.2);
}

.chat-chip:active {
  transform: scale(0.95);
}

/* Attachment & Voice Buttons */
.attach-btn {
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: var(--radius-md);
  flex-shrink: 0;
  position: relative;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--text);
  font-size: 19px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.32, 0.72, 0, 1);
}

.attach-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(98, 246, 201, 0.4);
  color: var(--accent);
  transform: translateY(-1px);
}

.attach-btn.has-file {
  background: rgba(98, 246, 201, 0.22);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 16px rgba(98, 246, 201, 0.3);
}

/* Chat Attachment Preview Chip */
.chat-attachment-preview {
  margin-top: 10px;
  display: flex;
  align-items: center;
  animation: fadeIn 0.2s ease-out;
}

.attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 8px;
  background: rgba(18, 24, 38, 0.95);
  border: 1px solid rgba(98, 246, 201, 0.35);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
  max-width: 100%;
}

.attachment-thumb {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

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

.attachment-meta {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.attachment-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 190px;
}

.attachment-size {
  font-size: 11px;
  color: var(--muted);
}

.attachment-remove-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: var(--muted);
  width: 24px;
  height: 24px;
  border-radius: 99px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  margin-left: 6px;
  flex-shrink: 0;
  transition: all 0.18s ease;
}

.attachment-remove-btn:hover {
  background: rgba(255, 73, 118, 0.3);
  color: #ff4976;
}

/* Chat bubble attachment styles */
.bubble-attachment {
  margin-bottom: 8px;
  border-radius: 14px;
  overflow: hidden;
}

.bubble-image-attachment img {
  max-width: min(280px, 100%);
  max-height: 240px;
  border-radius: 12px;
  display: block;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.18);
  cursor: pointer;
  transition: transform 0.2s ease;
}

.bubble-image-attachment img:hover {
  transform: scale(1.02);
}

.bubble-file-attachment {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  font-size: 13px;
  max-width: 100%;
}

.bubble-file-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.bubble-file-name {
  font-weight: 600;
  color: var(--text);
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Voice Input Button */
.mic-btn {
  width: 48px;
  height: 48px;
  padding: 0;
  border-radius: var(--radius-md);
  flex-shrink: 0;
  position: relative;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--text);
  font-size: 18px;
}

.mic-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}

.mic-btn.recording {
  background: rgba(255, 73, 118, 0.25);
  border-color: var(--danger);
  color: var(--danger);
  animation: micPulse 1.4s infinite;
}

@keyframes micPulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 73, 118, 0.7); }
  70% { box-shadow: 0 0 0 14px rgba(255, 73, 118, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 73, 118, 0); }
}

/* High-End Liquid Glass Code Blocks */
.code-block-wrapper {
  margin: 10px 0;
  background: rgba(8, 11, 18, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6), inset 0 1px 1px rgba(255, 255, 255, 0.1);
}

.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.code-block-lang {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent);
  letter-spacing: 0.6px;
  font-family: ui-monospace, monospace;
}

.copy-code-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 4px;
}

.copy-code-btn:hover {
  background: rgba(98, 246, 201, 0.2);
  border-color: var(--accent);
  color: #ffffff;
}

.copy-code-btn.copied {
  background: rgba(16, 185, 129, 0.25);
  border-color: var(--success);
  color: var(--success);
}

.code-block-body {
  padding: 12px 14px;
  overflow-x: auto;
  font-family: ui-monospace, "SF Mono", "Fira Code", Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.5;
  color: #e2e8f0;
  margin: 0;
  white-space: pre;
}

.bubble-body code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12.5px;
  padding: 2px 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: var(--accent);
}

/* Art Presets Gallery */
.art-presets-section {
  margin: 14px 0 18px;
}

.art-presets-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 10px;
}

.art-presets-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 6px 2px 14px;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}

.art-presets-scroll::-webkit-scrollbar {
  display: none;
}

.art-preset-card {
  position: relative;
  min-width: 170px;
  max-width: 170px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%), rgba(16, 22, 38, 0.75);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 18px;
  padding: 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35), inset 0 1px 1px rgba(255, 255, 255, 0.25);
  overflow: hidden;
  flex-shrink: 0;
}

.art-preset-card:hover {
  transform: translateY(-4px);
  border-color: rgba(98, 246, 201, 0.45);
  box-shadow: 0 14px 32px rgba(98, 246, 201, 0.2), inset 0 1px 2px rgba(255, 255, 255, 0.35);
}

.art-preset-card:active {
  transform: scale(0.96);
}

.preset-glow {
  position: absolute;
  top: -30px;
  right: -30px;
  width: 90px;
  height: 90px;
  border-radius: 50%;
  filter: blur(28px);
  opacity: 0.35;
  pointer-events: none;
}

.glow-cyan { background: #4facfe; }
.glow-purple { background: #8b5cf6; }
.glow-orange { background: #ff7a5c; }
.glow-emerald { background: #10b981; }
.glow-pink { background: #ec4899; }

.preset-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent);
  background: rgba(98, 246, 201, 0.12);
  padding: 3px 8px;
  border-radius: 99px;
  width: fit-content;
}

.preset-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
}

.preset-desc {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Character Search & Filter Chips */
.char-filter-bar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.char-search-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.35) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  border-radius: 14px !important;
  padding: 10px 14px !important;
}

.char-search-input:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 2px rgba(98, 246, 201, 0.2) !important;
}

.char-category-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}

.char-category-chips::-webkit-scrollbar {
  display: none;
}

.char-cat-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 99px;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.32, 0.72, 0, 1);
  flex-shrink: 0;
}

.char-cat-chip:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
}

.char-cat-chip.active {
  background: var(--accent);
  color: #080b12;
  font-weight: 700;
  border-color: var(--accent);
  box-shadow: 0 3px 12px rgba(98, 246, 201, 0.35);
}

/* ================= WEB STANDALONE & SYNC STYLES ================= */
.web-sync-chip {
  background: rgba(98, 246, 201, 0.12);
  border: 1px solid rgba(98, 246, 201, 0.35);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.2s cubic-bezier(0.32, 0.72, 0, 1);
  box-shadow: 0 2px 10px rgba(98, 246, 201, 0.15);
}

.web-sync-chip:hover {
  background: rgba(98, 246, 201, 0.22);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(98, 246, 201, 0.3);
}

.web-sync-chip.linked {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  color: #10b981;
}

.web-sync-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  margin-bottom: 20px;
  background: linear-gradient(135deg, rgba(98, 246, 201, 0.08) 0%, rgba(79, 172, 254, 0.08) 100%);
  border: 1px solid rgba(98, 246, 201, 0.25);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.web-sync-banner-content {
  display: flex;
  align-items: center;
  gap: 14px;
}

.web-sync-icon {
  font-size: 28px;
  line-height: 1;
}

.web-sync-title {
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  margin-bottom: 3px;
}

.web-sync-modal-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 4px;
  padding-bottom: 6px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  min-height: 0;
}

.sync-status-box {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

.sync-status-icon {
  font-size: 28px;
  line-height: 1;
}

.sync-status-title {
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
  margin-bottom: 3px;
}

.sync-methods-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sync-method-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius-md);
  padding: 16px;
  transition: all 0.2s ease;
  overflow: hidden;
  box-sizing: border-box;
}

.sync-method-card:hover {
  border-color: rgba(98, 246, 201, 0.3);
  background: rgba(255, 255, 255, 0.05);
}

.sync-method-card h4 {
  margin: 0 0 6px;
  font-size: 15px;
  color: var(--text);
}

.sync-method-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent);
  background: rgba(98, 246, 201, 0.12);
  border: 1px solid rgba(98, 246, 201, 0.25);
  padding: 2px 8px;
  border-radius: 99px;
  margin-bottom: 8px;
}

.sync-link-btn {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}

.sync-code-input-row {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  align-items: stretch;
  width: 100%;
}

.sync-code-field {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.45) !important;
  border: 1.5px solid rgba(255, 255, 255, 0.15) !important;
  border-radius: 12px !important;
  padding: 10px 12px !important;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace !important;
  font-size: 18px !important;
  font-weight: 700 !important;
  letter-spacing: 4px !important;
  text-align: center !important;
  text-transform: uppercase !important;
  color: var(--accent) !important;
}

#syncSubmitBtn {
  flex-shrink: 0;
  white-space: nowrap;
  padding: 10px 20px;
  border-radius: 12px;
}

.sync-code-field:focus {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 2px rgba(98, 246, 201, 0.25) !important;
}

.sync-feedback {
  margin-top: 8px;
  font-size: 12.5px;
  padding: 8px 12px;
  border-radius: 8px;
}

.sync-feedback.error {
  background: rgba(255, 73, 118, 0.15);
  color: #ff4976;
  border: 1px solid rgba(255, 73, 118, 0.3);
}

.sync-feedback.success {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.sync-linked-box {
  padding: 14px 16px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: var(--radius-md);
  text-align: center;
}

/* PWA Header Chip */
.pwa-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, rgba(98, 246, 201, 0.16) 0%, rgba(79, 172, 254, 0.12) 100%);
  border: 1px solid rgba(98, 246, 201, 0.35);
  box-shadow: 0 4px 14px rgba(98, 246, 201, 0.15), inset 0 1px 1px rgba(255, 255, 255, 0.4);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.pwa-chip:hover {
  transform: translateY(-1px) scale(1.03);
  background: linear-gradient(135deg, rgba(98, 246, 201, 0.25) 0%, rgba(79, 172, 254, 0.2) 100%);
  border-color: rgba(98, 246, 201, 0.6);
  box-shadow: 0 6px 20px rgba(98, 246, 201, 0.25), inset 0 1px 2px rgba(255, 255, 255, 0.6);
}

/* PWA Dashboard Install Banner */
.pwa-install-banner {
  background: linear-gradient(135deg, rgba(20, 28, 48, 0.85) 0%, rgba(12, 16, 30, 0.9) 100%) !important;
  border: 1.5px solid rgba(98, 246, 201, 0.3) !important;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5), inset 0 1.5px 1px rgba(255, 255, 255, 0.35), 0 0 25px rgba(98, 246, 201, 0.12) !important;
  border-radius: var(--radius-lg) !important;
  padding: 16px 20px !important;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}

.pwa-banner-content {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.pwa-banner-icon {
  font-size: 32px;
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(98, 246, 201, 0.2) 0%, rgba(139, 92, 246, 0.2) 100%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.pwa-banner-info {
  flex: 1;
  min-width: 220px;
}

.pwa-banner-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent);
  background: rgba(98, 246, 201, 0.14);
  border: 1px solid rgba(98, 246, 201, 0.3);
  padding: 2px 8px;
  border-radius: 99px;
  margin-bottom: 4px;
}

.pwa-banner-title {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.pwa-banner-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

/* PWA Modal */
.pwa-modal-card {
  max-width: 540px !important;
  width: 92% !important;
}

.pwa-modal-body {
  padding: 10px 4px 6px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pwa-direct-action-box {
  padding: 14px;
  background: rgba(98, 246, 201, 0.08);
  border: 1px solid rgba(98, 246, 201, 0.25);
  border-radius: var(--radius-md);
  text-align: center;
}

.pwa-platform-tabs {
  display: flex;
  gap: 8px;
  background: rgba(0, 0, 0, 0.35);
  padding: 4px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.pwa-tab-btn {
  flex: 1;
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pwa-tab-btn.active {
  background: linear-gradient(135deg, rgba(98, 246, 201, 0.25) 0%, rgba(79, 172, 254, 0.25) 100%);
  color: #fff;
  border: 1px solid rgba(98, 246, 201, 0.4);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), inset 0 1px 1px rgba(255, 255, 255, 0.4);
}

.pwa-tab-view {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pwa-step-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.1);
  transition: all 0.2s ease;
}

.pwa-step-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(98, 246, 201, 0.25);
}

.pwa-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-blue) 100%);
  color: #070a12;
  font-size: 14px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(98, 246, 201, 0.4);
}

.pwa-step-content h4 {
  margin: 0 0 3px;
  font-size: 14px;
  color: var(--text);
}

.ios-symbol, .android-symbol {
  display: inline-block;
  font-size: 15px;
  font-weight: bold;
  color: var(--accent);
  vertical-align: middle;
  padding: 0 3px;
}

.pwa-advantages-box {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.adv-pill {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--muted);
}

/* Standalone PWA Mode Tuning */
body.pwa-standalone {
  user-select: none;
  -webkit-user-select: none;
}

body.pwa-standalone .app-header {
  padding-top: max(14px, env(safe-area-inset-top));
}

/* ================= CHATGPT-STYLE SIDEBAR & MOBILE DRAWER ================= */
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 998;
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: opacity 0.25s ease;
}

.sidebar-backdrop.hidden {
  opacity: 0;
  pointer-events: none;
}

.app-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 999;
  width: min(320px, 84vw);
  background: linear-gradient(180deg, rgba(13, 18, 32, 0.96) 0%, rgba(7, 10, 18, 0.98) 100%);
  backdrop-filter: blur(40px) saturate(210%);
  -webkit-backdrop-filter: blur(40px) saturate(210%);
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 20px 0 60px rgba(0, 0, 0, 0.65), inset -1px 0 0 rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  padding: max(14px, env(safe-area-inset-top)) 14px max(14px, env(safe-area-inset-bottom));
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden;
}

.app-sidebar.open {
  transform: translateX(0);
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.sidebar-close-btn:hover {
  background: rgba(255, 255, 255, 0.14);
}

.sidebar-new-chat-box {
  margin: 14px 0 10px;
}

.new-chat-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 700;
  border-radius: var(--radius-pill);
}

.sidebar-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 6px 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
}

.clear-all-chats-link {
  background: none;
  border: none;
  color: var(--subtle);
  font-size: 11px;
  cursor: pointer;
  padding: 0;
  text-transform: none;
}

.clear-all-chats-link:hover {
  color: var(--danger);
}

.sidebar-chat-list {
  flex: 1;
  min-height: 120px;
  max-height: 38vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-right: 4px;
  margin-bottom: 8px;
}

.sidebar-chat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
}

.sidebar-chat-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-chat-item.active {
  background: linear-gradient(135deg, rgba(98, 246, 201, 0.16) 0%, rgba(79, 172, 254, 0.12) 100%);
  border-color: rgba(98, 246, 201, 0.35);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.3);
  font-weight: 600;
}

.sidebar-chat-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.sidebar-chat-icon {
  font-size: 14px;
  flex-shrink: 0;
}

.sidebar-chat-title {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-chat-del-btn {
  opacity: 0.45;
  background: none;
  border: none;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.sidebar-chat-item:hover .sidebar-chat-del-btn,
.sidebar-chat-item.active .sidebar-chat-del-btn {
  opacity: 1;
}

.sidebar-chat-del-btn:hover {
  color: var(--danger);
  background: rgba(255, 73, 118, 0.15);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: all 0.18s ease;
}

.sidebar-nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

.sidebar-nav-item.active {
  background: rgba(98, 246, 201, 0.12);
  color: var(--accent);
  font-weight: 600;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sidebar-quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.sidebar-action-btn {
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 11.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
}

.sidebar-action-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.18);
}

.sidebar-user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-blue) 100%);
  color: #080b12;
  font-size: 15px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.sidebar-user-meta {
  flex: 1;
  min-width: 0;
}

.sidebar-user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-plan {
  font-size: 11px;
  color: var(--accent);
}

/* ================= HEADER ADAPTATIONS ================= */
.sidebar-toggle-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.sidebar-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(98, 246, 201, 0.4);
}

.sidebar-toggle-btn .menu-bar {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.2s ease;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.header-center {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  min-width: 0;
}

.header-chat-title-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

.header-action-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text);
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.header-action-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: scale(1.04);
}

/* Studio-Grade Upscaling Control Bar & Badges */
.result-img-wrap {
  position: relative;
  display: inline-block;
  max-width: 100%;
  margin: 0 auto;
}

.result-img-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(7, 10, 18, 0.88);
  border: 1px solid rgba(98, 246, 201, 0.45);
  color: var(--accent);
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.2px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5), 0 0 10px rgba(98, 246, 201, 0.2);
  pointer-events: none;
}

.image-upscale-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 16px 0 12px;
  padding: 12px 18px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%), rgba(14, 18, 28, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 20px;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25), inset 0 1px 0.5px rgba(255, 255, 255, 0.2);
}

.upscale-label {
  font-size: 13px;
  color: var(--text);
  font-weight: 650;
  display: flex;
  align-items: center;
  gap: 6px;
}

.upscale-btn-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.upscale-btn {
  min-height: 40px;
  padding: 8px 16px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  color: var(--text) !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.32, 0.72, 0, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2), inset 0 1px 0.5px rgba(255, 255, 255, 0.25);
}

.upscale-btn:hover {
  background: rgba(98, 246, 201, 0.16) !important;
  border-color: rgba(98, 246, 201, 0.5) !important;
  color: var(--accent) !important;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(98, 246, 201, 0.25);
}

.upscale-btn:active {
  transform: scale(0.96);
}

.upscale-btn.active {
  background: linear-gradient(135deg, #62f6c9 0%, #4facfe 100%) !important;
  border-color: #62f6c9 !important;
  color: #070a12 !important;
  font-weight: 800 !important;
  box-shadow: 0 6px 20px rgba(98, 246, 201, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.6) !important;
}

/* Mobile Screen Edge & Overflow Fixes */
@media (max-width: 768px) {
  .desktop-tabs {
    display: none !important;
  }

  .header-chat-title-text {
    max-width: 140px;
  }

  .app-header {
    padding: max(10px, env(safe-area-inset-top)) 12px 10px;
  }

  .header-actions {
    gap: 6px;
  }

  .ping-chip {
    display: none;
  }

  .shell {
    padding: 10px 10px 20px;
  }
}

/* Native iOS & Android Bottom-Sheet Modals */
@media (max-width: 640px) {
  .modal-backdrop {
    align-items: flex-end !important;
    padding: 0 !important;
  }

  .modal-card {
    width: 100% !important;
    max-width: 100% !important;
    max-height: min(92dvh, calc(100vh - 40px)) !important;
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    border-top-left-radius: 28px !important;
    border-top-right-radius: 28px !important;
    border-left: none !important;
    border-right: none !important;
    border-bottom: none !important;
    margin: 0 !important;
    padding: 12px 18px max(24px, env(safe-area-inset-bottom)) 18px !important;
    animation: sheetSlideUp 0.32s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
    box-shadow: 0 -12px 48px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.25) !important;
  }

  .modal-card::before {
    content: "";
    display: block;
    width: 42px;
    height: 5px;
    background: rgba(255, 255, 255, 0.28);
    border-radius: 99px;
    margin: 0 auto 12px auto;
    flex-shrink: 0;
  }

  @keyframes sheetSlideUp {
    from {
      transform: translateY(100%);
      opacity: 0.8;
    }
    to {
      transform: translateY(0);
      opacity: 1;
    }
  }
}

/* ================= DESIGN & INTERFACE SETTINGS ================= */
.modal-settings {
  max-width: 480px;
}

.settings-modal-body {
  display: flex;
  flex-direction: column;
}

.setting-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.setting-item-row:last-child {
  border-bottom: none;
}

.setting-item-info {
  flex: 1;
}

.setting-item-title {
  font-size: 14px;
  font-weight: 650;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 3px;
}

.setting-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.setting-item-desc {
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
}

/* iOS 26 Glass Toggle Switch */
.switch-control {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 28px;
  flex-shrink: 0;
}

.switch-control input {
  opacity: 0;
  width: 0;
  height: 0;
}

.switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  transition: all 0.24s cubic-bezier(0.32, 0.72, 0, 1);
  border-radius: 34px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.switch-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: #ffffff;
  transition: all 0.24s cubic-bezier(0.32, 0.72, 0, 1);
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

.switch-control input:checked + .switch-slider {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 16px rgba(98, 246, 201, 0.45);
}

.switch-control input:checked + .switch-slider:before {
  transform: translateX(22px);
  background-color: #080b12;
}

/* Theme Picker Grid */
.setting-group-box {
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.theme-picker-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.theme-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  padding: 12px 8px;
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: all 0.2s cubic-bezier(0.32, 0.72, 0, 1);
}

.theme-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.theme-card.active {
  border-color: var(--accent);
  background: rgba(98, 246, 201, 0.12);
  box-shadow: 0 0 16px rgba(98, 246, 201, 0.22);
}

.theme-swatch {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  margin-bottom: 4px;
  border: 1.5px solid rgba(255, 255, 255, 0.35);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.glass-swatch {
  background: linear-gradient(135deg, #62f6c9, #4facfe);
}

.oled-swatch {
  background: #000000;
  border-color: #444444;
}

.cyber-swatch {
  background: linear-gradient(135deg, #ff007f, #00f0ff);
}

.theme-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}

.settings-actions-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* Applied Design Classes */
/* 1. Bottom Navigation Bar Toggle */
body.hide-bottom-bar .mobile-nav {
  display: none !important;
}

body.hide-bottom-bar {
  padding-bottom: max(14px, env(safe-area-inset-bottom)) !important;
}

@media (max-width: 800px) {
  body:not(.hide-bottom-bar) .mobile-nav {
    display: flex !important;
  }
}

/* 2. Aurora Toggle */
body.no-aurora .aurora {
  display: none !important;
}

/* 3. Font Size Toggle */
body.font-large .bubble-body {
  font-size: 16px !important;
  line-height: 1.6 !important;
}
body.font-large #chatInput {
  font-size: 16px !important;
}

/* 4. Compact Header */
body.compact-header .app-header {
  padding: max(6px, env(safe-area-inset-top)) 10px 6px !important;
}
body.compact-header .header-shell {
  height: 42px !important;
}
body.compact-header .brand-logo {
  width: 28px !important;
  height: 28px !important;
  font-size: 14px !important;
}

/* 5. Themes */
body.theme-oled {
  background: #05070a !important;
  --bg: #05070a;
}
body.theme-oled .aurora {
  display: none !important;
}
body.theme-oled .card,
body.theme-oled .app-header,
body.theme-oled .app-sidebar,
body.theme-oled .modal-card,
body.theme-oled .mobile-nav {
  background: rgba(12, 14, 20, 0.96) !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}

body.theme-cyber {
  --accent: #00f0ff;
  --accent-glow: rgba(0, 240, 255, 0.4);
}
body.theme-cyber .aurora-a {
  background: radial-gradient(circle, rgba(0, 240, 255, 0.28) 0%, transparent 65%) !important;
}
body.theme-cyber .aurora-b {
  background: radial-gradient(circle, rgba(255, 0, 127, 0.22) 0%, transparent 65%) !important;
}


