/* ==========================================================================
   THEME SYSTEM: Mental Health Vision Support System (Default Theme)
   ========================================================================== */
:root,
[data-theme="mental-health"] {
  --theme-mode: 'mental-health';
  --bg-main: #09111e;
  --bg-sidebar: rgba(11, 20, 34, 0.84);
  --bg-header: rgba(11, 20, 34, 0.86);
  --bg-card: rgba(14, 25, 42, 0.82);
  --bg-card-hover: rgba(20, 36, 60, 0.92);
  --bg-card-border: rgba(45, 212, 191, 0.22);
  --bg-input: rgba(12, 22, 38, 0.92);
  --bg-input-focus: rgba(16, 30, 52, 0.98);

  --border-subtle: rgba(45, 212, 191, 0.16);
  --border-hover: rgba(56, 189, 248, 0.35);
  --border-accent: rgba(45, 212, 191, 0.55);

  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #889db5;

  /* Mental Health Vision Support Healing & Mindful Palette */
  --accent-cyan: #2dd4bf;
  /* Soothing Mind Teal */
  --accent-blue: #38bdf8;
  /* Serene Sky Blue */
  --accent-teal: #14b8a6;
  /* Deep Healing Teal */
  --accent-purple: #a78bfa;
  /* Mindful Lavender */
  --accent-indigo: #6366f1;
  /* Deep Neural Indigo */
  --accent-rose: #fb7185;
  /* Compassion Coral Rose */
  --accent-emerald: #34d399;
  /* Botanical Vitality Mint */

  --accent-glow: rgba(45, 212, 191, 0.32);
  --accent-gradient: linear-gradient(135deg, #14b8a6 0%, #38bdf8 38%, #a78bfa 74%, #fb7185 100%);
  --button-gradient: linear-gradient(135deg, #0d9488 0%, #0284c7 52%, #7c3aed 100%);

  --pill-bg: rgba(12, 22, 38, 0.88);
  --pill-border: rgba(45, 212, 191, 0.3);
  --pill-shadow: 0 8px 32px rgba(0, 0, 0, 0.55), 0 2px 10px rgba(45, 212, 191, 0.14);
  --pill-focus-glow: 0 0 28px rgba(45, 212, 191, 0.35);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow-glow: 0 0 24px rgba(45, 212, 191, 0.28);
  --shadow-card: 0 8px 28px -4px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(45, 212, 191, 0.08);

  --transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);

  /* Calming ambient grid tokens */
  --tile-hue: 178;
  --tile-size: 56px;
  --tile-line: hsla(178, 80%, 45%, 0.06);
  --tile-line-bold: hsla(178, 80%, 45%, 0.12);
  --tile-accent-1: hsla(178, 85%, 55%, 0.06);
  --tile-accent-2: hsla(200, 85%, 60%, 0.05);
  --tile-accent-3: hsla(260, 80%, 65%, 0.05);
  --tile-border: hsla(178, 75%, 50%, 0.22);
  --tile-glow: hsla(178, 90%, 55%, 0.3);
}

[data-theme="white"] {
  --theme-mode: 'white';
  --bg-main: #f8fafc;
  --bg-sidebar: #ffffff;
  --bg-header: rgba(255, 255, 255, 0.88);
  --bg-card: #ffffff;
  --bg-card-hover: #f1f5f9;
  --bg-card-border: #e2e8f0;
  --bg-input: #ffffff;
  --bg-input-focus: #ffffff;

  --border-subtle: #e2e8f0;
  --border-hover: #cbd5e1;
  --border-accent: rgba(59, 130, 246, 0.4);

  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;

  --accent-cyan: #0284c7;
  --accent-rose: #e11d48;
  --accent-purple: #7c3aed;
  --accent-blue: #2563eb;
  --accent-indigo: #4f46e5;
  --accent-glow: rgba(37, 99, 235, 0.15);
  --accent-gradient: linear-gradient(135deg, #2563eb 0%, #7c3aed 55%, #0284c7 100%);
  --button-gradient: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);

  --pill-bg: #ffffff;
  --pill-border: #e2e8f0;
  --pill-shadow: 0 4px 24px -2px rgba(0, 0, 0, 0.08), 0 2px 6px -1px rgba(0, 0, 0, 0.04);
  --pill-focus-glow: 0 8px 30px rgba(37, 99, 235, 0.16);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.05);
  --shadow-glow: 0 0 20px rgba(37, 99, 235, 0.18);
  --shadow-card: 0 4px 20px -2px rgba(0, 0, 0, 0.06), 0 2px 6px -1px rgba(0, 0, 0, 0.03);

  --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);

  /* Light tile lines */
  --tile-hue: 215;
  --tile-size: 56px;
  --tile-line: hsla(var(--tile-hue), 80%, 45%, 0.05);
  --tile-line-bold: hsla(var(--tile-hue), 80%, 45%, 0.10);
  --tile-accent-1: hsla(var(--tile-hue), 85%, 60%, 0.04);
  --tile-accent-2: hsla(calc(var(--tile-hue) + 60), 75%, 60%, 0.03);
  --tile-accent-3: hsla(calc(var(--tile-hue) + 120), 70%, 50%, 0.02);
  --tile-border: hsla(var(--tile-hue), 75%, 55%, 0.15);
  --tile-glow: hsla(var(--tile-hue), 90%, 55%, 0.2);
}

[data-theme="colorful"] {
  --theme-mode: 'colorful';
  --bg-main: #f0f4ff;
  --bg-sidebar: rgba(255, 255, 255, 0.95);
  --bg-header: rgba(255, 255, 255, 0.88);
  --bg-card: rgba(255, 255, 255, 0.95);
  --bg-card-hover: #ffffff;
  --bg-card-border: rgba(139, 92, 246, 0.2);
  --bg-input: #ffffff;
  --bg-input-focus: #ffffff;

  --border-subtle: rgba(139, 92, 246, 0.18);
  --border-hover: rgba(139, 92, 246, 0.35);
  --border-accent: rgba(236, 72, 153, 0.5);

  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;

  --accent-cyan: #06b6d4;
  --accent-rose: #f43f5e;
  --accent-purple: #8b5cf6;
  --accent-blue: #3b82f6;
  --accent-indigo: #6366f1;
  --accent-glow: rgba(139, 92, 246, 0.25);
  --accent-gradient: linear-gradient(135deg, #ec4899 0%, #8b5cf6 50%, #06b6d4 100%);
  --button-gradient: linear-gradient(135deg, #ec4899 0%, #8b5cf6 100%);

  --pill-bg: #ffffff;
  --pill-border: rgba(139, 92, 246, 0.35);
  --pill-shadow: 0 8px 30px rgba(139, 92, 246, 0.15), 0 2px 10px rgba(6, 182, 212, 0.1);
  --pill-focus-glow: 0 8px 35px rgba(236, 72, 153, 0.25);

  --tile-hue: 270;
  --tile-size: 56px;
  --tile-line: hsla(270, 80%, 65%, 0.08);
  --tile-line-bold: hsla(270, 85%, 65%, 0.15);
  --tile-accent-1: hsla(270, 85%, 65%, 0.06);
  --tile-accent-2: hsla(330, 85%, 65%, 0.06);
  --tile-accent-3: hsla(190, 85%, 65%, 0.06);
  --tile-border: hsla(270, 80%, 60%, 0.25);
  --tile-glow: hsla(270, 90%, 60%, 0.3);
}

[data-theme="dark"] {
  --theme-mode: 'dark';
  --bg-main: #08090d;
  --bg-sidebar: #0c0d14;
  --bg-header: rgba(12, 13, 18, 0.7);
  --bg-card: rgba(18, 20, 29, 0.78);
  --bg-card-hover: rgba(26, 29, 41, 0.92);
  --bg-card-border: rgba(255, 255, 255, 0.08);
  --bg-input: #12141d;
  --bg-input-focus: #171925;

  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.18);
  --border-accent: rgba(244, 63, 94, 0.45);

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-cyan: #38bdf8;
  --accent-rose: #f43f5e;
  --accent-purple: #a855f7;
  --accent-blue: #3b82f6;
  --accent-indigo: #6366f1;
  --accent-glow: rgba(244, 63, 94, 0.28);
  --accent-gradient: linear-gradient(135deg, #f43f5e 0%, #8b5cf6 55%, #38bdf8 100%);
  --button-gradient: linear-gradient(135deg, #ffffff 0%, #cbd5e1 100%);

  --pill-bg: #12141e;
  --pill-border: rgba(255, 255, 255, 0.12);
  --pill-shadow: 0 4px 24px rgba(0, 0, 0, 0.6);
  --pill-focus-glow: 0 0 25px rgba(244, 63, 94, 0.28);

  --tile-hue: 200;
  --tile-size: 56px;
  --tile-line: hsla(var(--tile-hue), 85%, 65%, 0.08);
  --tile-line-bold: hsla(var(--tile-hue), 85%, 65%, 0.16);
  --tile-accent-1: hsla(var(--tile-hue), 80%, 55%, 0.07);
  --tile-accent-2: hsla(calc(var(--tile-hue) + 60), 75%, 60%, 0.05);
  --tile-accent-3: hsla(calc(var(--tile-hue) + 120), 70%, 50%, 0.04);
  --tile-border: hsla(var(--tile-hue), 75%, 60%, 0.16);
  --tile-glow: hsla(var(--tile-hue), 90%, 60%, 0.25);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: #060d17;
  background-image:
    radial-gradient(ellipse at 50% 10%, rgba(45, 212, 191, 0.20) 0%, transparent 60%),
    radial-gradient(circle at 85% 85%, rgba(167, 139, 250, 0.16) 0%, transparent 50%),
    linear-gradient(180deg, rgba(6, 13, 23, 0.38) 0%, rgba(9, 17, 30, 0.65) 100%),
    url('mental_health_bg.jpg');
  background-size: cover, cover, cover, cover;
  background-position: center center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body[data-theme="white"] {
  background-image: none;
  background-color: var(--bg-main);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(45, 212, 191, 0.2);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(45, 212, 191, 0.4);
}

/* App Layout - Transparent to reveal crisp Mindful Background */
.app-layout {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  position: relative;
  background: transparent;
  transition: background 0.4s ease, border-color 0.4s ease;
}

/* Ambient Radial Glow Follower across Tiles */
.app-layout::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 30%), hsla(var(--tile-hue), 85%, 60%, 0.08) 0%, transparent 60%);
  pointer-events: none;
  z-index: 1;
  transition: opacity 0.3s ease;
}

/* Mental Health Theme Layout Overrides - Transparent to show body mental_health_bg.jpg */
body[data-theme="mental-health"] .app-layout,
:root:not([data-theme="white"]):not([data-theme="colorful"]):not([data-theme="dark"]) .app-layout {
  background-color: transparent;
  background-image: none;
}

body[data-theme="white"] .app-layout {
  background-image:
    linear-gradient(to right, var(--tile-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--tile-line) 1px, transparent 1px);
  background-color: var(--bg-main);
}

/* Tile Pattern 1: Cyber Matrix Tiles (Fallback) */
body[data-tile-pattern="cyber"][data-theme="dark"] .app-layout {
  background-color: var(--bg-main);
  background-image:
    linear-gradient(to right, var(--tile-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--tile-line) 1px, transparent 1px),
    radial-gradient(circle at 50% 50%, var(--tile-accent-1) 12%, transparent 55%),
    linear-gradient(45deg, var(--tile-accent-2) 25%, transparent 25%),
    linear-gradient(-45deg, var(--tile-accent-3) 25%, transparent 25%);
  background-size:
    var(--tile-size) var(--tile-size),
    var(--tile-size) var(--tile-size),
    calc(var(--tile-size) * 3) calc(var(--tile-size) * 3),
    calc(var(--tile-size) * 2) calc(var(--tile-size) * 2),
    calc(var(--tile-size) * 2) calc(var(--tile-size) * 2);
}

/* Tile Pattern 2: Isometric 3D Cubes */
body[data-tile-pattern="cubes"] .app-layout {
  background-color: var(--bg-main);
  background-image:
    linear-gradient(30deg, var(--tile-accent-1) 12%, transparent 12.5%, transparent 87%, var(--tile-accent-1) 87.5%, var(--tile-accent-1)),
    linear-gradient(150deg, var(--tile-accent-1) 12%, transparent 12.5%, transparent 87%, var(--tile-accent-1) 87.5%, var(--tile-accent-1)),
    linear-gradient(30deg, var(--tile-accent-2) 12%, transparent 12.5%, transparent 87%, var(--tile-accent-2) 87.5%, var(--tile-accent-2)),
    linear-gradient(150deg, var(--tile-accent-2) 12%, transparent 12.5%, transparent 87%, var(--tile-accent-2) 87.5%, var(--tile-accent-2)),
    linear-gradient(60deg, var(--tile-accent-3) 25%, transparent 25.5%, transparent 75%, var(--tile-accent-3) 75%, var(--tile-accent-3)),
    linear-gradient(60deg, var(--tile-accent-3) 25%, transparent 25.5%, transparent 75%, var(--tile-accent-3) 75%, var(--tile-accent-3));
  background-size: var(--tile-size) calc(var(--tile-size) * 1.732);
}

/* Tile Pattern 3: Diamond Prism Tiles */
body[data-tile-pattern="diamond"] .app-layout {
  background-color: var(--bg-main);
  background-image:
    linear-gradient(135deg, var(--tile-accent-1) 25%, transparent 25%),
    linear-gradient(225deg, var(--tile-accent-2) 25%, transparent 25%),
    linear-gradient(315deg, var(--tile-accent-3) 25%, transparent 25%),
    linear-gradient(45deg, var(--tile-accent-1) 25%, transparent 25%),
    linear-gradient(to right, var(--tile-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--tile-line) 1px, transparent 1px);
  background-size:
    var(--tile-size) var(--tile-size),
    var(--tile-size) var(--tile-size),
    var(--tile-size) var(--tile-size),
    var(--tile-size) var(--tile-size),
    var(--tile-size) var(--tile-size),
    var(--tile-size) var(--tile-size);
  background-position:
    calc(var(--tile-size) / 2) 0,
    calc(var(--tile-size) / 2) 0,
    0 0,
    0 0,
    0 0,
    0 0;
}

/* Tile Pattern 4: Circuit Hex Matrix Tiles */
body[data-tile-pattern="hex"] .app-layout {
  background-color: var(--bg-main);
  background-image:
    radial-gradient(circle at 0% 50%, var(--tile-accent-1) 8px, transparent 9px),
    radial-gradient(circle at 100% 50%, var(--tile-accent-2) 8px, transparent 9px),
    radial-gradient(circle at 50% 0%, var(--tile-accent-3) 8px, transparent 9px),
    radial-gradient(circle at 50% 100%, var(--tile-accent-1) 8px, transparent 9px),
    linear-gradient(to right, var(--tile-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--tile-line) 1px, transparent 1px);
  background-size: var(--tile-size) var(--tile-size);
}

/* Tile Pattern 5: Blueprint Grid Tiles */
body[data-tile-pattern="blueprint"] .app-layout {
  background-color: var(--bg-main);
  background-image:
    linear-gradient(var(--tile-line-bold) 1.5px, transparent 1.5px),
    linear-gradient(90deg, var(--tile-line-bold) 1.5px, transparent 1.5px),
    linear-gradient(var(--tile-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--tile-line) 1px, transparent 1px),
    radial-gradient(circle at 50% 50%, var(--tile-accent-1) 15%, transparent 60%);
  background-size:
    calc(var(--tile-size) * 3) calc(var(--tile-size) * 3),
    calc(var(--tile-size) * 3) calc(var(--tile-size) * 3),
    var(--tile-size) var(--tile-size),
    var(--tile-size) var(--tile-size),
    calc(var(--tile-size) * 3) calc(var(--tile-size) * 3);
}

/* Tile Pattern 6: Neon Mosaic Tiles */
body[data-tile-pattern="mosaic"] .app-layout {
  background-color: var(--bg-main);
  background-image:
    radial-gradient(circle at 100% 150%, transparent 24%, var(--tile-accent-1) 25%, var(--tile-accent-1) 28%, transparent 29%),
    radial-gradient(circle at 0 150%, transparent 24%, var(--tile-accent-2) 25%, var(--tile-accent-2) 28%, transparent 29%),
    radial-gradient(circle at 50% 100%, transparent 10%, var(--tile-accent-3) 11%, var(--tile-accent-3) 14%, transparent 15%),
    linear-gradient(to right, var(--tile-line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--tile-line) 1px, transparent 1px);
  background-size:
    calc(var(--tile-size) * 2) calc(var(--tile-size) * 2),
    calc(var(--tile-size) * 2) calc(var(--tile-size) * 2),
    var(--tile-size) var(--tile-size),
    var(--tile-size) var(--tile-size),
    var(--tile-size) var(--tile-size);
}

/* Left Sidebar */
.sidebar {
  width: 260px;
  min-width: 260px;
  flex-shrink: 0;
  height: 100%;
  background: var(--bg-sidebar);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1),
    min-width 0.25s cubic-bezier(0.16, 1, 0.3, 1),
    left 0.25s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 50;
  overflow: hidden;
  position: relative;
}

/* Collapsed Sidebar (Desktop) */
.sidebar.collapsed {
  width: 72px;
  min-width: 72px;
}

.sidebar.collapsed .logo-title-wrap,
.sidebar.collapsed .logo-text,
.sidebar.collapsed .badge-uncensored,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .sidebar-section,
.sidebar.collapsed .status-info,
.sidebar.collapsed .btn-refresh {
  display: none !important;
}

.sidebar.collapsed .sidebar-header {
  padding: 14px 0;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
}

.sidebar.collapsed .logo {
  cursor: pointer;
  justify-content: center;
}

.sidebar.collapsed #btnToggleSidebar {
  margin: 0 auto;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.04);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

[data-theme="dark"] .sidebar.collapsed #btnToggleSidebar {
  background: rgba(255, 255, 255, 0.06);
}

.sidebar.collapsed #btnToggleSidebar:hover {
  background: var(--accent-gradient);
  color: #fff;
  transform: scale(1.05);
}

.sidebar.collapsed .sidebar-nav {
  padding: 12px 0;
  align-items: center;
}

.sidebar.collapsed .nav-item {
  width: 44px;
  height: 44px;
  padding: 0;
  margin: 3px auto;
  justify-content: center;
  border-radius: var(--radius-md);
}

.sidebar.collapsed .sidebar-footer {
  margin-top: auto;
  padding: 14px 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.sidebar.collapsed .engine-status {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .sidebar.collapsed .engine-status {
  background: rgba(255, 255, 255, 0.06);
}

.sidebar.collapsed .engine-status:hover {
  transform: scale(1.1);
  border-color: var(--accent-cyan);
}

.sidebar.collapsed .status-dot {
  margin: 0;
  width: 10px;
  height: 10px;
}

.sidebar-header {
  padding: 16px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  min-height: 64px;
  box-sizing: border-box;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  cursor: pointer;
}

.logo-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.4);
}

.logo-text {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #fff;
}

.logo-sub {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 800;
  margin-left: 2px;
}

.icon-btn-ghost {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.icon-btn-ghost:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.sidebar-nav {
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.nav-item:hover {
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.nav-item.active {
  color: var(--accent-blue);
  background: rgba(37, 99, 235, 0.08);
  font-weight: 600;
}

[data-theme="dark"] .nav-item.active {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

.nav-item.active svg {
  color: var(--accent-blue);
}

[data-theme="dark"] .nav-item.active svg {
  color: var(--accent-cyan);
}

.sidebar-section {
  padding: 12px 14px;
  flex: 1;
  overflow-y: auto;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 0 4px;
}

.new-chat-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: 6px;
  padding: 4px 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.new-chat-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--border-hover);
}

.sessions-list,
.canvases-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 4px;
}

.empty-state-text {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 8px 4px;
  font-style: italic;
}

.session-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.84rem;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.session-item:hover,
.session-item.active {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}

.sidebar-footer {
  margin-top: auto;
  padding: 14px 16px;
  border-top: 1px solid var(--border-subtle);
}

.engine-status {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 9px 12px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .engine-status {
  background: rgba(255, 255, 255, 0.04);
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: var(--transition);
}

.status-dot.online {
  background: #10b981;
  box-shadow: 0 0 10px #10b981;
}

.status-dot.offline {
  background: #ef4444;
  box-shadow: 0 0 8px #ef4444;
}

.status-dot.busy {
  background: #f59e0b;
  box-shadow: 0 0 10px #f59e0b;
  animation: pulse-busy 1s infinite alternate;
}

@keyframes pulse-busy {
  from {
    opacity: 0.4;
  }

  to {
    opacity: 1;
  }
}

.status-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
}

.status-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.status-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.btn-refresh {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: var(--transition);
}

.btn-refresh:hover {
  color: var(--text-primary);
  transform: rotate(180deg);
}

/* Main Workspace */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  position: relative;
}

/* Top Header */
.top-header {
  height: 64px;
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-header);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 40;
  transition: background 0.3s ease, border-color 0.3s ease;
}

.header-left,
.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mobile-menu-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.mobile-menu-btn:hover {
  color: var(--accent-blue);
  background: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .mobile-menu-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

/* On desktop: show sidebar toggle button in top header when sidebar is collapsed */
.sidebar.collapsed~.main-content .mobile-menu-btn {
  display: flex !important;
}

.model-select-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: 0.82rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  overflow: visible !important;
}

.model-select-wrapper.loading {
  border-color: #2dd4bf !important;
  box-shadow: 0 0 14px rgba(45, 212, 191, 0.45) !important;
  animation: modelSelectPulse 1.2s ease-in-out infinite alternate;
}

@keyframes modelSelectPulse {
  0% { box-shadow: 0 0 8px rgba(45, 212, 191, 0.3); }
  100% { box-shadow: 0 0 20px rgba(45, 212, 191, 0.7); }
}

.model-select-wrapper:hover {
  border-color: var(--border-hover);
  background: var(--bg-card-hover);
}

.model-select {
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 500;
  outline: none;
  cursor: pointer;
  max-width: 220px;
}

.model-select option {
  background: var(--bg-card);
  color: var(--text-primary);
}

.btn-reset-default {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.btn-reset-default:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.btn-reset-default:active {
  transform: translateY(0);
}

/* Theme Switcher Button */
.btn-theme-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.btn-theme-toggle:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.btn-header-tool {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.btn-header-tool:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.btn-speed-toggle {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.25);
  color: #d97706;
}

[data-theme="dark"] .btn-speed-toggle {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.35);
  color: #fbbf24;
}

.btn-speed-toggle:hover {
  background: rgba(245, 158, 11, 0.18);
  border-color: #f59e0b;
  color: #b45309;
}

.btn-speed-toggle.mode-turbo {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(239, 68, 68, 0.15));
  border-color: #f59e0b;
  color: #d97706;
}

[data-theme="dark"] .btn-speed-toggle.mode-turbo {
  color: #fde047;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.25);
}

/* Mode Toggle (Generate / Canvas) */
.mode-toggle {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 3px;
  gap: 2px;
}

.mode-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 7px 22px;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
}

.mode-btn.active {
  background: #ffffff;
  color: #0c0d12;
  box-shadow: 0 2px 10px rgba(255, 255, 255, 0.25);
}

.credit-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-subtle);
}

.credit-icon {
  color: var(--accent-cyan);
}

.badge-pro {
  background: var(--accent-gradient);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.icon-btn {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.icon-btn:hover {
  color: #fff;
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.05);
}

.user-avatar {
  cursor: pointer;
}

.avatar-gradient {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255, 255, 255, 0.15);
}

/* Workspace Scroll Area */
.workspace-scrollable {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px 20px 96px;
  scroll-behavior: smooth;
}

@media (max-width: 768px) {
  .workspace-scrollable {
    padding: 16px 14px 120px;
  }
}

.workspace-inner {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Gemini / ChatGPT Welcome Hero Screen */
.gemini-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 36px 16px 16px;
  max-width: 760px;
  margin: 0 auto;
  animation: fadeIn 0.4s ease-out;
}

.welcome-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.18);
  color: var(--accent-blue);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 18px;
}

[data-theme="colorful"] .welcome-badge {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.12), rgba(139, 92, 246, 0.12));
  border-color: rgba(139, 92, 246, 0.25);
  color: var(--accent-purple);
}

.welcome-title {
  font-size: 2.35rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.025em;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.welcome-title-accent {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.welcome-subtitle {
  font-size: 0.98rem;
  color: var(--text-secondary);
  max-width: 580px;
  line-height: 1.6;
  margin-bottom: 30px;
}

.welcome-suggestions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  width: 100%;
}

@media (max-width: 640px) {
  .welcome-suggestions {
    grid-template-columns: 1fr;
  }
}

.suggestion-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  text-align: left;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.suggestion-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-blue);
  box-shadow: 0 8px 24px -4px rgba(37, 99, 235, 0.14);
}

.suggestion-icon {
  font-size: 1.45rem;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(37, 99, 235, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

[data-theme="colorful"] .suggestion-icon {
  background: rgba(139, 92, 246, 0.12);
}

.suggestion-text h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.suggestion-text p {
  font-size: 0.76rem;
  color: var(--text-muted);
}

/* Chat Feed (ChatGPT / Gemini style results) */
.chat-feed {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 8px;
}

.chat-turn {
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.user-bubble {
  align-self: flex-end;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 18px 18px 4px 18px;
  padding: 12px 18px;
  max-width: 80%;
  color: var(--text-primary);
  font-size: 0.95rem;
  line-height: 1.5;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.user-bubble-ref-img {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--border-subtle);
}

.assistant-card {
  align-self: flex-start;
  width: 100%;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 16px;
  color: var(--text-primary);
}

/* Modern Sampling Box & Breathable Shining icon-512.png Container */
.generation-progress-box,
.modern-sampling-box {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 0;
  background: transparent;
  border: none;
  width: 100%;
}

/* Container matching default result container size & aspect-ratio */
.sampling-motion-container {
  width: 100%;
  aspect-ratio: 1 / 1;
  max-width: 512px;
  max-height: 512px;
  min-height: 320px;
  margin: 0 auto;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-lg);
  background: radial-gradient(circle at 50% 50%, rgba(14, 25, 42, 0.72) 0%, rgba(6, 13, 23, 0.94) 100%);
  border: 1px solid rgba(45, 212, 191, 0.28);
  box-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.65), 0 0 32px rgba(45, 212, 191, 0.16);
  overflow: hidden;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}

@media (max-width: 640px) {
  .sampling-motion-container {
    max-height: 360px;
    min-height: 220px;
  }
}

/* Blurry Light Motion Aura Background */
.blurry-light-motion-aura {
  position: absolute;
  inset: -20%;
  pointer-events: none;
  z-index: 1;
  filter: blur(48px);
  opacity: 0.85;
  animation: blurryLightRotate 10s linear infinite;
}

.aura-orb {
  position: absolute;
  border-radius: 50%;
  mix-blend-mode: screen;
}

.aura-orb-1 {
  width: 55%;
  height: 55%;
  top: 15%;
  left: 10%;
  background: radial-gradient(circle, rgba(45, 212, 191, 0.75) 0%, rgba(20, 184, 166, 0.1) 70%, transparent 100%);
  animation: blurryMotionOrb1 5s ease-in-out infinite alternate;
}

.aura-orb-2 {
  width: 60%;
  height: 60%;
  bottom: 10%;
  right: 10%;
  background: radial-gradient(circle, rgba(167, 139, 250, 0.70) 0%, rgba(99, 102, 241, 0.1) 70%, transparent 100%);
  animation: blurryMotionOrb2 6.5s ease-in-out infinite alternate;
}

.aura-orb-3 {
  width: 45%;
  height: 45%;
  top: 30%;
  right: 25%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.65) 0%, rgba(251, 113, 133, 0.2) 70%, transparent 100%);
  animation: blurryMotionOrb3 4.2s ease-in-out infinite alternate;
}

@keyframes blurryLightRotate {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

@keyframes blurryMotionOrb1 {
  0% {
    transform: translate(0, 0) scale(0.9);
  }

  50% {
    transform: translate(25px, 35px) scale(1.15);
  }

  100% {
    transform: translate(-20px, 15px) scale(0.95);
  }
}

@keyframes blurryMotionOrb2 {
  0% {
    transform: translate(0, 0) scale(1.05);
  }

  50% {
    transform: translate(-30px, -20px) scale(0.85);
  }

  100% {
    transform: translate(15px, -35px) scale(1.2);
  }
}

@keyframes blurryMotionOrb3 {
  0% {
    transform: translate(0, 0) scale(0.95);
  }

  50% {
    transform: translate(-25px, 20px) scale(1.25);
  }

  100% {
    transform: translate(30px, -15px) scale(0.9);
  }
}

/* Live Sampling Preview Layer */
.sampling-live-preview-wrap {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
}

.sampling-live-preview-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.65;
  transition: filter 0.3s ease, opacity 0.4s ease;
}

/* Breathable Shining Hero Icon */
.breathable-icon-wrapper {
  position: relative;
  z-index: 3;
  width: clamp(140px, 35vw, 220px);
  height: clamp(140px, 35vw, 220px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: breathShineMotion 3s ease-in-out infinite alternate;
}

.breathable-shining-icon {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 28px;
  filter: drop-shadow(0 0 28px rgba(45, 212, 191, 0.55));
  transition: filter 0.3s ease;
}

/* Angled glossy shine sweep passing over the icon */
.icon-shine-sweep {
  position: absolute;
  top: -20%;
  left: -40%;
  width: 50%;
  height: 140%;
  background: linear-gradient(90deg,
      transparent 0%,
      rgba(255, 255, 255, 0.45) 50%,
      transparent 100%);
  transform: rotate(25deg);
  pointer-events: none;
  animation: shineGleamSweep 2.8s ease-in-out infinite;
}

@keyframes breathShineMotion {
  0% {
    transform: scale(0.94);
    filter: drop-shadow(0 0 16px rgba(45, 212, 191, 0.45)) brightness(0.98);
  }

  50% {
    transform: scale(1.05);
    filter: drop-shadow(0 0 38px rgba(167, 139, 250, 0.75)) drop-shadow(0 0 18px rgba(45, 212, 191, 0.6)) brightness(1.22);
  }

  100% {
    transform: scale(0.94);
    filter: drop-shadow(0 0 16px rgba(45, 212, 191, 0.45)) brightness(0.98);
  }
}

@keyframes shineGleamSweep {
  0% {
    transform: translateX(-140%) rotate(25deg);
    opacity: 0;
  }

  20% {
    opacity: 0.8;
  }

  60% {
    transform: translateX(340%) rotate(25deg);
    opacity: 0;
  }

  100% {
    transform: translateX(340%) rotate(25deg);
    opacity: 0;
  }
}

/* Pulsing energy ring */
.icon-energy-ring {
  position: absolute;
  inset: -12px;
  border-radius: 36px;
  border: 2px solid rgba(45, 212, 191, 0.35);
  box-shadow: 0 0 20px rgba(45, 212, 191, 0.3), inset 0 0 15px rgba(167, 139, 250, 0.25);
  pointer-events: none;
  animation: ringPulse 3s ease-in-out infinite alternate;
}

@keyframes ringPulse {
  0% {
    transform: scale(0.96);
    opacity: 0.4;
    border-color: rgba(45, 212, 191, 0.25);
  }

  50% {
    transform: scale(1.06);
    opacity: 0.95;
    border-color: rgba(167, 139, 250, 0.65);
    box-shadow: 0 0 28px rgba(167, 139, 250, 0.5), inset 0 0 20px rgba(45, 212, 191, 0.4);
  }

  100% {
    transform: scale(0.96);
    opacity: 0.4;
    border-color: rgba(45, 212, 191, 0.25);
  }
}

/* ======================================================================
   WAITING SURPRISE 🎁 SAMPLING & PROGRESS BAR SYSTEM
   Positioned clearly ABOVE preview container, sleek festive ribbon glow
   ====================================================================== */
.sampling-step-container,
.surprise-gift-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(14, 25, 42, 0.92) 0%, rgba(22, 33, 54, 0.96) 100%);
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.55), 0 0 24px rgba(251, 191, 36, 0.12);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  max-width: 512px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
  position: relative;
  z-index: 10;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.surprise-gift-container:hover {
  border-color: rgba(251, 191, 36, 0.55);
  box-shadow: 0 12px 36px -5px rgba(0, 0, 0, 0.65), 0 0 32px rgba(251, 191, 36, 0.2);
}

.step-counter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.surprise-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.surprise-gift-icon {
  font-size: 1.45rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 0 10px rgba(251, 191, 36, 0.65));
  animation: surpriseGiftBounce 2s ease-in-out infinite;
  transform-origin: bottom center;
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
}

@keyframes surpriseGiftBounce {

  0%,
  100% {
    transform: translateY(0) rotate(0deg) scale(1);
  }

  20% {
    transform: translateY(-5px) rotate(-6deg) scale(1.15);
  }

  40% {
    transform: translateY(0) rotate(4deg) scale(1.05);
  }

  60% {
    transform: translateY(-3px) rotate(-3deg) scale(1.1);
  }

  80% {
    transform: translateY(0) rotate(1deg) scale(1);
  }
}

.step-counter-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
  flex-wrap: wrap;
}

.step-count-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  background: rgba(251, 191, 36, 0.16);
  border: 1px solid rgba(251, 191, 36, 0.4);
  border-radius: var(--radius-full);
  color: #fbbf24;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  white-space: nowrap;
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.15);
}

.step-count-badge.surprise-complete {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.25), rgba(245, 158, 11, 0.25));
  border-color: rgba(245, 158, 11, 0.7);
  color: #fef08a;
  text-shadow: 0 0 10px rgba(245, 158, 11, 0.6);
  animation: surpriseUnboxedPulse 0.8s ease-in-out infinite alternate;
}

@keyframes surpriseUnboxedPulse {
  0% {
    transform: scale(1);
    filter: brightness(1);
  }

  100% {
    transform: scale(1.06);
    filter: brightness(1.25);
  }
}

.step-phase-label {
  font-size: 0.84rem;
  color: var(--text-secondary);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.surprise-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.step-pct-badge,
.surprise-pct-badge {
  font-size: 1rem;
  font-weight: 800;
  color: #fbbf24;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 14px rgba(251, 191, 36, 0.55);
}

.btn-surprise-close {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--text-muted);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 0;
  line-height: 1;
}

.btn-surprise-close:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.5);
  transform: scale(1.12);
}

.progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Glowing Sleek Progress Track: Festive Surprise Ribbon with Sparkle Leader */
.progress-bar-track,
.surprise-ribbon-track {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.25);
  border-radius: 6px;
  overflow: visible;
  position: relative;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.5);
}

.progress-bar-fill,
.surprise-ribbon-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #10b981 0%, #2dd4bf 28%, #f59e0b 60%, #ec4899 85%, #a855f7 100%);
  border-radius: 5px;
  transition: width 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  box-shadow: 0 0 18px rgba(245, 158, 11, 0.65), inset 0 1px 1px rgba(255, 255, 255, 0.4);
}

.progress-bar-fill::after,
.surprise-ribbon-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.65) 50%, transparent 100%);
  animation: surpriseRibbonShimmer 1.8s infinite;
  border-radius: 5px;
}

@keyframes surpriseRibbonShimmer {
  0% {
    transform: translateX(-100%);
  }

  100% {
    transform: translateX(100%);
  }
}

.surprise-ribbon-sparkle {
  position: absolute;
  right: -7px;
  top: -7px;
  font-size: 13px;
  line-height: 1;
  pointer-events: none;
  filter: drop-shadow(0 0 6px #f59e0b);
  animation: sparkleSpin 1.4s ease-in-out infinite alternate;
  z-index: 2;
}

@keyframes sparkleSpin {
  0% {
    transform: scale(0.85) rotate(-12deg);
    opacity: 0.85;
  }

  100% {
    transform: scale(1.25) rotate(16deg);
    opacity: 1;
  }
}

/* Floating surprise particles in sampling container */
.surprise-floating-sparkles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 2;
}

.surprise-floating-sparkles .sparkle-item {
  position: absolute;
  font-size: 16px;
  filter: drop-shadow(0 0 8px rgba(251, 191, 36, 0.6));
  opacity: 0.75;
  user-select: none;
}

.surprise-floating-sparkles .sp-1 {
  top: 12%;
  left: 14%;
  animation: floatSparkle1 4s ease-in-out infinite alternate;
}

.surprise-floating-sparkles .sp-2 {
  top: 20%;
  right: 15%;
  animation: floatSparkle2 4.5s ease-in-out infinite alternate;
}

.surprise-floating-sparkles .sp-3 {
  bottom: 18%;
  left: 18%;
  animation: floatSparkle2 5s ease-in-out infinite alternate;
}

.surprise-floating-sparkles .sp-4 {
  bottom: 14%;
  right: 16%;
  animation: floatSparkle1 3.8s ease-in-out infinite alternate;
}

@keyframes floatSparkle1 {
  0% {
    transform: translate(0, 0) scale(0.85) rotate(0deg);
    opacity: 0.5;
  }

  50% {
    transform: translate(12px, -18px) scale(1.15) rotate(15deg);
    opacity: 0.95;
  }

  100% {
    transform: translate(-8px, 10px) scale(0.9) rotate(-10deg);
    opacity: 0.6;
  }
}

@keyframes floatSparkle2 {
  0% {
    transform: translate(0, 0) scale(1.1) rotate(0deg);
    opacity: 0.9;
  }

  50% {
    transform: translate(-14px, 16px) scale(0.8) rotate(-20deg);
    opacity: 0.5;
  }

  100% {
    transform: translate(10px, -12px) scale(1.05) rotate(10deg);
    opacity: 0.85;
  }
}

/* Surprise Gift Center Badge inside Breathable Icon */
.surprise-gift-center-box {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.surprise-hero-gift {
  position: absolute;
  font-size: clamp(48px, 12vw, 72px);
  filter: drop-shadow(0 0 24px rgba(251, 191, 36, 0.85));
  z-index: 4;
  animation: surpriseGiftBounce 2.4s ease-in-out infinite;
}

.surprise-badge-icon {
  opacity: 0.35;
  filter: blur(2px) drop-shadow(0 0 20px rgba(45, 212, 191, 0.4));
}

.surprise-ribbon-ring {
  border-color: rgba(251, 191, 36, 0.45);
  box-shadow: 0 0 24px rgba(251, 191, 36, 0.35), inset 0 0 16px rgba(236, 72, 153, 0.25);
}

/* Graceful Closing Animation after generation finish or close button click */
.surprise-closing {
  opacity: 0 !important;
  transform: scale(0.92) translateY(-14px) !important;
  filter: blur(6px) !important;
  max-height: 0 !important;
  margin-top: 0 !important;
  margin-bottom: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  overflow: hidden !important;
  border-width: 0 !important;
  pointer-events: none !important;
  transition:
    opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
    filter 0.35s ease-out,
    max-height 0.38s cubic-bezier(0.4, 0, 0.2, 1),
    padding 0.3s ease-out,
    margin 0.3s ease-out !important;
}

.result-image-wrapper {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: 600px;
  cursor: zoom-in;
}

.result-image-wrapper img {
  max-width: 100%;
  max-height: 560px;
  object-fit: contain;
  display: block;
  transition: transform 0.3s ease;
}

.result-image-wrapper:hover img {
  transform: scale(1.01);
}

.result-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 6px;
  border-top: 1px solid var(--border-subtle);
}

.result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.76rem;
  color: var(--text-muted);
}

.meta-chip {
  background: rgba(255, 255, 255, 0.05);
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.result-buttons {
  display: flex;
  gap: 8px;
}

.action-pill-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
  text-decoration: none;
}

.action-pill-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

/* Bottom Dock (ChatGPT / Gemini style fixed prompt at bottom) */
.bottom-dock {
  position: relative;
  width: 100%;
  flex-shrink: 0;
  z-index: 35;
  background: linear-gradient(180deg, transparent 0%, var(--bg-main) 30%);
  padding: 8px 24px 18px;
}

.bottom-dock-inner {
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Skills Chips Row */
.skills-chips-row {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px;
  scrollbar-width: none;
}

.skills-chips-row::-webkit-scrollbar {
  display: none;
}

.skill-chip {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: var(--radius-full);
  padding: 5px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.skill-chip:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.skill-chip-more {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
  white-space: nowrap;
  transition: var(--transition);
}

.skill-chip-more:hover {
  color: var(--text-primary);
}

/* Gemini Pill Container & Capsule Bar (Exact Match with Image 2) */
.gemini-pill-container {
  position: relative;
  width: 100%;
}

.gemini-pill-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  min-height: 84px;
  background: var(--pill-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--pill-border);
  border-radius: 22px;
  padding: 14px 16px 12px 16px;
  box-shadow: var(--pill-shadow);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.gemini-pill-bar:hover {
  box-shadow: 0 6px 28px -2px rgba(0, 0, 0, 0.10), 0 2px 8px -1px rgba(0, 0, 0, 0.04);
}

.gemini-pill-bar:focus-within {
  border-color: var(--accent-blue);
  box-shadow: var(--pill-focus-glow);
  transform: translateY(-1px);
}

[data-theme="colorful"] .gemini-pill-bar:focus-within {
  border-color: var(--accent-purple);
  box-shadow: 0 0 0 2px rgba(139, 92, 246, 0.25), 0 8px 30px rgba(139, 92, 246, 0.18);
}

/* Top Attached Reference Images Row (Exact Match with Screenshot 2) */
.pill-attachments-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  overflow-x: auto;
  padding: 2px 2px 6px 2px;
  scrollbar-width: thin;
  animation: fadeIn 0.2s ease-out;
}

.pill-attachments-row::-webkit-scrollbar {
  height: 4px;
}

.pill-attachments-row::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 4px;
}

[data-theme="dark"] .pill-attachments-row::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
}

/* Individual Attached Image Thumbnail Card (Matching Screenshot 2) */
.pill-attachment-card {
  position: relative;
  width: 78px;
  height: 78px;
  min-width: 78px;
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  background: #09090b;
  border: 1.5px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.10);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, border-color 0.2s ease;
  flex-shrink: 0;
}

.pill-attachment-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.16);
  border-color: var(--accent-blue);
}

.pill-attachment-card.is-anchor {
  border-color: #f59e0b;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.35), 0 4px 12px rgba(245, 158, 11, 0.2);
}

.pill-attachment-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  user-select: none;
  pointer-events: none;
}

/* Delete ✕ button on top-right of attachment card (Matching Screenshot 2) */
.attachment-card-del-btn {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  z-index: 5;
  line-height: 1;
  padding: 0;
}

.attachment-card-del-btn:hover {
  background: #ef4444;
  border-color: #ef4444;
  transform: scale(1.15);
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.5);
}

.attachment-anchor-icon {
  position: absolute;
  bottom: 4px;
  left: 4px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 6px;
  z-index: 4;
  color: #fbbf24;
  line-height: 1.2;
}

/* Left + Plus Button */
.pill-plus-btn {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.04);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), background 0.2s ease, color 0.2s ease;
}

[data-theme="dark"] .pill-plus-btn {
  background: rgba(255, 255, 255, 0.08);
}

.pill-plus-btn:hover {
  background: rgba(0, 0, 0, 0.08);
  transform: scale(1.06);
}

[data-theme="dark"] .pill-plus-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.pill-plus-btn.active {
  transform: rotate(45deg);
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
}

/* Center Textarea inside Prompt Card (Auto-resizable) */
.pill-input-wrap {
  width: 100%;
  display: flex;
  align-items: flex-start;
  min-height: 38px;
}

.pill-input-wrap textarea {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 0.98rem;
  font-family: inherit;
  resize: none;
  min-height: 36px;
  max-height: 200px;
  line-height: 1.5;
  padding: 4px 2px;
  overflow-y: hidden;
  scrollbar-width: thin;
  transition: height 0.08s ease;
}

.pill-input-wrap textarea::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

.pill-input-wrap textarea::-webkit-scrollbar {
  width: 6px;
}

.pill-input-wrap textarea::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
}

[data-theme="dark"] .pill-input-wrap textarea::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
}

.pill-clear-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  padding: 4px 8px;
  margin-top: 4px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  line-height: 1;
}

.pill-clear-btn:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.15);
}

.pill-btn-raw {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  height: 28px;
  background: transparent;
  border: none;
  cursor: pointer;
}

.pill-raw-badge {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 3px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: all 0.2s ease;
}

.pill-btn-raw.raw-active .pill-raw-badge {
  background: #e50914 !important;
  color: #ffffff !important;
  border-color: #ff334b !important;
  box-shadow: 0 0 10px rgba(229, 9, 20, 0.5);
}

.btn-card-done {
  background: rgba(16, 185, 129, 0.12) !important;
  color: #10b981 !important;
  border-color: rgba(16, 185, 129, 0.3) !important;
}

.btn-card-done:hover {
  background: rgba(16, 185, 129, 0.22) !important;
}

/* Bottom Toolbar of the Prompt Card */
.pill-bottom-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 10px;
  padding-top: 2px;
}

.pill-toolbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Reference Options Toggle Pill */
.pill-options-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 32px;
  padding: 0 10px;
  border-radius: 9999px;
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.22);
  color: var(--accent-blue);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.pill-options-toggle-btn:hover {
  background: rgba(37, 99, 235, 0.16);
  border-color: var(--accent-blue);
  transform: translateY(-1px);
}

.pill-options-toggle-btn.active {
  background: var(--accent-blue);
  color: #ffffff;
  border-color: var(--accent-blue);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.pill-options-toggle-btn .options-chevron {
  font-size: 0.7rem;
  transition: transform 0.2s ease;
}

/* Compatibility chip styles */
.pill-ref-chip {
  display: none !important;
}

/* Right Side Actions inside Pill */
.pill-actions-right {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.pill-action-btn {
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  height: 36px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
  transition: var(--transition);
}

[data-theme="dark"] .pill-action-btn {
  background: rgba(255, 255, 255, 0.06);
}

.pill-action-btn:hover {
  background: rgba(0, 0, 0, 0.08);
  color: var(--text-primary);
  border-color: var(--border-hover);
  transform: translateY(-1px);
}

.pill-btn-ghost {
  position: relative !important;
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  padding: 0 !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex-shrink: 0 !important;
}

.gallery-badge-count {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 9999px;
  background: #2563eb;
  color: #ffffff;
  font-size: 0.62rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
  pointer-events: none;
  line-height: 1;
  z-index: 2;
}

.pill-action-btn.seed-locked {
  background: rgba(37, 99, 235, 0.15) !important;
  border-color: #3b82f6 !important;
  color: #3b82f6 !important;
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.3) !important;
}

.pill-btn-settings {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.3);
  color: var(--accent-blue, #2563eb);
  padding: 0 12px;
  border-radius: var(--radius-full);
  height: 36px;
  cursor: pointer;
  transition: var(--transition);
}

.pill-btn-settings:hover {
  background: rgba(37, 99, 235, 0.16);
  border-color: var(--accent-blue, #2563eb);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
}

[data-theme="dark"] .pill-btn-settings {
  background: rgba(59, 130, 246, 0.15);
  border-color: rgba(59, 130, 246, 0.45);
  color: #60a5fa;
}

.form-textarea {
  width: 100%;
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.85rem;
  padding: 8px 10px;
  outline: none;
  resize: vertical;
  transition: var(--transition);
}

[data-theme="dark"] .form-textarea {
  background: rgba(255, 255, 255, 0.04);
}

.form-textarea:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.pill-ratio-badge {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-primary);
}

.pill-multigen-badge {
  font-size: 0.76rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  background: rgba(37, 99, 235, 0.08);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
  transition: all 0.2s ease;
  white-space: nowrap;
}

.pill-multigen-badge.active-multi {
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.15), rgba(168, 85, 247, 0.15));
  color: var(--accent-blue);
  border-color: rgba(37, 99, 235, 0.35);
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.2);
}

[data-theme="dark"] .pill-multigen-badge.active-multi {
  color: #93c5fd;
  border-color: rgba(96, 165, 250, 0.4);
}

.multigen-options-row {
  display: flex;
  gap: 8px;
  margin-top: 6px;
  width: 100%;
}

.multigen-btn {
  flex: 1;
  padding: 8px 10px;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  background: var(--bg-hover);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.multigen-btn:hover {
  border-color: var(--accent-blue);
  color: var(--text-primary);
}

.multigen-btn.active {
  background: rgba(37, 99, 235, 0.12);
  border-color: var(--accent-blue);
  color: var(--accent-blue);
  font-weight: 700;
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.18);
}

/* Pill Send & Stop Buttons (Vibrant Royal Blue matching Screenshot 2) */
.pill-send-btn {
  width: 36px;
  height: 36px;
  min-width: 36px;
  border-radius: 50%;
  border: none;
  background: #2563eb;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

.pill-send-btn:hover {
  background: #1d4ed8;
  transform: scale(1.08);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.45);
}

.pill-send-btn:active {
  transform: scale(0.95);
}

.pill-stop-btn {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 50%;
  border: none;
  background: #ef4444;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  animation: pulse-stop 1.2s infinite;
  box-shadow: 0 2px 10px rgba(239, 68, 68, 0.4);
}

/* Plus Popup Menu */
.plus-popup-menu {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 6px;
  width: 310px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  padding: 8px;
  box-shadow: 0 16px 40px -4px rgba(0, 0, 0, 0.18), 0 2px 8px rgba(0, 0, 0, 0.05);
  backdrop-filter: blur(20px);
  display: flex;
  flex-direction: column;
  gap: 3px;
  z-index: 50;
  animation: popupSlide 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes popupSlide {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.plus-menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
  transition: var(--transition);
}

.plus-menu-item:hover {
  background: var(--bg-card-hover);
  transform: translateX(2px);
}

.menu-item-icon {
  font-size: 1.2rem;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

[data-theme="dark"] .menu-item-icon {
  background: rgba(255, 255, 255, 0.06);
}

.menu-item-info {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.menu-item-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
}

.menu-item-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Disclaimer at very bottom */
.dock-disclaimer {
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-muted);
  padding-top: 6px;
}

.upload-preview {
  position: relative;
  width: 58px;
  height: 58px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1.5px solid var(--accent-cyan);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.3);
}

.upload-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.remove-ref-btn {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.input-text-container {
  flex: 1;
}

.input-text-container textarea {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  color: #fff;
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.55;
  resize: none;
  min-height: 54px;
}

.input-text-container textarea::placeholder {
  color: var(--text-muted);
}

/* Gallery Popup Modal (Action Continuity & Multi-Reference) */
.settings-modal-card.gallery-modal-card {
  max-width: 1240px;
  width: 94vw;
  height: 88vh;
  max-height: 880px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 22px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.75), 0 0 1px 1px rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.gallery-modal-card .modal-header {
  padding: 18px 26px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  flex-shrink: 0;
}

.gallery-modal-card .modal-title-group h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.gallery-modal-card .modal-title-group p {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 3px;
}

.gallery-modal-card .modal-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 16px 26px;
  overflow: hidden;
  gap: 12px;
  background: rgba(0, 0, 0, 0.15);
}

[data-theme="white"] .gallery-modal-card .modal-body {
  background: #f8fafc;
}

[data-theme="colorful"] .gallery-modal-card .modal-body {
  background: rgba(241, 245, 249, 0.7);
}

/* Gallery Toolbar & Multi-Select */
.gallery-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  flex-shrink: 0;
  flex-wrap: wrap;
  gap: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.gallery-selection-info {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.gallery-count-pill {
  background: rgba(37, 99, 235, 0.12);
  color: var(--accent-blue);
  border: 1px solid rgba(37, 99, 235, 0.28);
  padding: 2px 9px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
}

.gallery-hint-text {
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--text-muted);
}

.gallery-toolbar-btns {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-text-action {
  background: var(--bg-hover);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-text-action:hover {
  background: rgba(37, 99, 235, 0.12);
  color: var(--accent-blue);
  border-color: var(--accent-blue);
  transform: translateY(-1px);
}

/* Wide, Non-Overlapping Grid with Explicit Row Sizing */
.gallery-modal-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  grid-auto-rows: 250px;
  gap: 18px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px 4px 18px 4px;
  align-content: start;
}

.gallery-modal-grid::-webkit-scrollbar {
  width: 8px;
}

.gallery-modal-grid::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 4px;
}

.gallery-modal-grid::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.gallery-modal-grid::-webkit-scrollbar-thumb:hover {
  background: var(--accent-blue);
}

/* Gallery Item Card */
.gallery-modal-item {
  position: relative;
  width: 100%;
  height: 250px;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  border: 2px solid var(--border-subtle);
  background: #090a0f;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.2s ease,
    box-shadow 0.22s ease;
  display: flex;
  flex-direction: column;
}

.gallery-modal-item:hover {
  transform: translateY(-5px) scale(1.02);
  border-color: var(--accent-blue);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.4), 0 0 16px rgba(37, 99, 235, 0.3);
  z-index: 10;
}

.gallery-modal-item.multi-selected {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 2px var(--accent-blue), 0 8px 24px rgba(37, 99, 235, 0.45);
  transform: translateY(-2px);
}

.gallery-modal-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
  transition: transform 0.35s ease;
}

.gallery-modal-item:hover img {
  transform: scale(1.06);
}

/* Quick Zoom Inspect Button (Top Left) */
.gallery-item-zoom-btn {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transform: scale(0.85);
  transition: all 0.2s ease;
  z-index: 6;
}

.gallery-modal-item:hover .gallery-item-zoom-btn {
  opacity: 1;
  transform: scale(1);
}

.gallery-item-zoom-btn:hover {
  background: rgba(37, 99, 235, 0.9);
  border-color: #fff;
  transform: scale(1.1);
}

/* Selection Checkbox Badge (Top Right) */
.gallery-check-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(8px);
  border: 2px solid rgba(255, 255, 255, 0.35);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
  z-index: 6;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.gallery-modal-item:hover .gallery-check-badge {
  border-color: rgba(255, 255, 255, 0.8);
}

.gallery-modal-item.multi-selected .gallery-check-badge,
.gallery-check-badge.checked {
  background: var(--accent-blue);
  border-color: #ffffff;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.6);
  animation: popIn 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
  from {
    transform: scale(0.4);
    opacity: 0;
  }

  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* Bottom Label with Gradient Scrim */
.gallery-modal-badge {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.4) 65%, transparent 100%);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 16px 8px 6px 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  pointer-events: none;
  z-index: 4;
}

.gallery-empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.gallery-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 26px;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-card);
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .settings-modal-card.gallery-modal-card {
    width: 96vw;
    height: 94vh;
  }

  .gallery-modal-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    grid-auto-rows: 190px;
    gap: 10px;
  }

  .gallery-modal-item {
    height: 190px;
  }
}


/* Reference Image Active Control Bar */
.ref-control-bar {
  display: flex;
  flex-direction: column;
  padding: 12px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 18px;
  box-shadow: var(--shadow-card);
  font-size: 0.8rem;
  gap: 10px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  animation: fadeIn 0.25s ease-out;
}

/* Multi-Reference Board & Stability Controls */
.multi-ref-board {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-subtle);
}

.multi-ref-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  flex-wrap: wrap;
  gap: 8px;
}

.multi-ref-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.multi-ref-count-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 9999px;
  background: rgba(37, 99, 235, 0.1);
  color: var(--accent-blue);
  border: 1px solid rgba(37, 99, 235, 0.25);
}

.stability-tag {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 9999px;
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.multi-ref-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-ref-tool {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: var(--radius-sm);
  background: var(--bg-hover);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-ref-tool:hover {
  background: rgba(37, 99, 235, 0.1);
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

.btn-ref-tool.danger {
  color: #ef4444;
}

.btn-ref-tool.danger:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: #ef4444;
}

/* Multi-Reference Horizontal Strip */
.multi-ref-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  padding: 4px 2px 6px 2px;
  scrollbar-width: thin;
}

.multi-ref-strip::-webkit-scrollbar {
  height: 4px;
}

.multi-ref-strip::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 4px;
}

.multi-ref-card {
  position: relative;
  width: 76px;
  min-width: 76px;
  height: 98px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid var(--border-subtle);
  background: #000;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

.multi-ref-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-blue);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.multi-ref-card.is-anchor {
  border-color: #f59e0b;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

.multi-ref-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ref-card-anchor-badge {
  position: absolute;
  top: 4px;
  left: 4px;
  background: rgba(245, 158, 11, 0.9);
  color: #fff;
  font-size: 0.58rem;
  font-weight: 800;
  padding: 1px 4px;
  border-radius: 4px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  z-index: 2;
}

.ref-card-del-btn {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  border: none;
  font-size: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.2s ease, background 0.2s ease;
  z-index: 3;
}

.ref-card-del-btn:hover {
  opacity: 1;
  background: #ef4444;
}

.ref-card-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2px;
  z-index: 2;
}

.btn-make-anchor {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #fff;
  font-size: 0.65rem;
  border-radius: 3px;
  padding: 1px 4px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-make-anchor:hover {
  background: rgba(245, 158, 11, 0.95);
}

.ref-weight-tag {
  font-size: 0.6rem;
  font-weight: 700;
  color: #fff;
  opacity: 0.95;
}

.ref-bar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  flex-wrap: wrap;
  gap: 8px;
}

.ref-indicator {
  font-weight: 700;
  color: var(--accent-blue);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

[data-theme="colorful"] .ref-indicator {
  color: var(--accent-purple);
}

.ref-auto-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  cursor: pointer;
  margin-left: 8px;
}

.ref-auto-label input {
  accent-color: var(--accent-blue);
  cursor: pointer;
}

.ref-action-btn {
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.22);
  color: var(--accent-blue);
  border-radius: var(--radius-full);
  padding: 3px 10px;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  margin-left: 8px;
  transition: var(--transition);
}

.ref-action-btn:hover {
  background: rgba(37, 99, 235, 0.16);
  border-color: var(--accent-blue);
}

.ref-bar-presets {
  display: flex;
  gap: 6px;
}

.preset-pill {
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 0.72rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

[data-theme="dark"] .preset-pill {
  background: rgba(255, 255, 255, 0.08);
}

.preset-pill:hover,
.preset-pill.active {
  background: rgba(37, 99, 235, 0.12);
  border-color: var(--accent-blue);
  color: var(--text-primary);
  font-weight: 600;
}

/* Quick Action Prompt Pills Row */
.ref-action-pills-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  overflow-x: auto;
  padding: 6px 0 2px 0;
  border-top: 1px solid var(--border-subtle);
  scrollbar-width: thin;
}

.ref-action-pills-row::-webkit-scrollbar {
  height: 4px;
}

.ref-action-pills-row::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 4px;
}

.action-pills-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent-blue);
  white-space: nowrap;
}

[data-theme="colorful"] .action-pills-label {
  color: var(--accent-purple);
}

.action-pill {
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  border-radius: 16px;
  padding: 3px 12px;
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

[data-theme="dark"] .action-pill {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.12);
}

.action-pill:hover {
  background: rgba(37, 99, 235, 0.10);
  border-color: var(--accent-blue);
  transform: translateY(-1px);
}

.action-pill.active {
  background: rgba(37, 99, 235, 0.16);
  border-color: var(--accent-blue);
  color: var(--text-primary);
  font-weight: 600;
  box-shadow: 0 0 10px rgba(37, 99, 235, 0.15);
}

.ref-hint {
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-left: 8px;
}

.ref-bar-slider {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ref-bar-slider label {
  color: var(--text-secondary);
}

.slider-val {
  font-weight: 700;
  color: var(--text-primary);
  min-width: 32px;
}

.badge-safe {
  font-size: 0.7rem;
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 1px 6px;
  border-radius: 4px;
}

/* Bottom Tools Bar */
.prompt-bottom-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-top: 1px solid var(--border-subtle);
}

.bottom-tools-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tool-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition);
}

.tool-btn:hover {
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
  border-color: var(--border-hover);
}

.tool-badge {
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-cyan);
  font-size: 0.7rem;
  padding: 1px 6px;
  border-radius: 4px;
}

.at-symbol {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-muted);
}

.bottom-tools-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-generate {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--button-gradient);
  color: #0c0d12;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(255, 255, 255, 0.3);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
}

.btn-generate:hover {
  transform: scale(1.06);
  box-shadow: 0 6px 20px rgba(255, 255, 255, 0.45);
}

.btn-generate:active {
  transform: scale(0.96);
}

.btn-stop {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #ef4444;
  color: #fff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.4);
}

/* Skills Chips Row */
.skills-chips-row {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0;
}

.skill-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 7px 14px;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.skill-chip:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-hover);
  color: #fff;
  transform: translateY(-1px);
}

.chip-tag {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 1px 5px;
  border-radius: 3px;
}

.chip-tag.new {
  background: rgba(56, 189, 248, 0.2);
  color: var(--accent-cyan);
}

.chip-tag.hot {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

.skill-chip-more {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  padding: 6px 10px;
  transition: var(--transition);
}

.skill-chip-more:hover {
  color: var(--text-primary);
}



.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

.feature-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow-sm);
}

/* Banner Card (Featured) */
.banner-card {
  grid-column: span 2;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.8) 0%, rgba(15, 23, 42, 0.9) 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 24px;
  justify-content: space-between;
  min-height: 140px;
  position: relative;
}

.banner-badge {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--accent-cyan);
}

.banner-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
}

.banner-sub {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.banner-dots {
  display: flex;
  gap: 5px;
  margin-top: 6px;
}

.banner-dots .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
}

.banner-dots .dot.active {
  background: #fff;
  width: 16px;
  border-radius: 4px;
}

/* Mini Cards */
.mini-card {
  min-height: 140px;
}

.card-thumb {
  height: 75px;
  position: relative;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: flex-start;
  padding: 8px;
}

.thumb-tag {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  font-size: 0.65rem;
  font-weight: 700;
  color: #fff;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.thumb-edit {
  background: linear-gradient(135deg, #1e3a8a, #0369a1);
}

.thumb-upscale {
  background: linear-gradient(135deg, #4338ca, #3b82f6);
}

.thumb-3d {
  background: linear-gradient(135deg, #78350f, #d97706);
}

.thumb-segment {
  background: linear-gradient(135deg, #065f46, #059669);
}

.thumb-clip {
  background: linear-gradient(135deg, #581c87, #9333ea);
}

.thumb-angles {
  background: linear-gradient(135deg, #831843, #db2777);
}

.card-info {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.card-info h4 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.card-info p {
  font-size: 0.72rem;
  color: var(--text-muted);
}

/* Canvas Mode */
.canvas-view {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  background: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.02) 1px, transparent 1px) 0 0 / 24px 24px;
}

.canvas-toolbar {
  position: absolute;
  top: 16px;
  left: 16px;
  display: flex;
  gap: 6px;
  background: rgba(18, 20, 29, 0.8);
  backdrop-filter: blur(12px);
  padding: 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  z-index: 10;
}

.canvas-tool-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
}

.canvas-tool-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.canvas-workspace {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.canvas-empty {
  text-align: center;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

/* Modals */
/* Centered Floating Modals (Desktop, Tablet & Mobile) */
.modal-backdrop,
#settingsModal.modal-backdrop {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  width: 100dvw !important;
  height: 100vh !important;
  height: 100dvh !important;
  background: rgba(0, 0, 0, 0.75) !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
  display: none;
  /* Hidden by default until trigger */
  align-items: center !important;
  justify-content: center !important;
  z-index: 1200 !important;
  padding: 16px !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  animation: fadeIn 0.2s ease-out;
}

/* Strictly hide when closed or initialized */
.modal-backdrop[style*="display: none"],
.modal-backdrop[style*="display:none"],
.modal-backdrop.hidden {
  display: none !important;
}

/* Strictly show ONLY when triggered to popup */
.modal-backdrop[style*="display: flex"],
.modal-backdrop[style*="display:flex"],
.modal-backdrop.active,
.modal-backdrop.show {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* Floating Center Cards for ALL Modals (Settings, Gallery, Skills, Inpaint, PNG Info) */
.settings-modal-card,
#settingsModal .settings-modal-card {
  width: min(92vw, 480px) !important;
  max-width: 480px !important;
  height: auto !important;
  max-height: min(72vh, 72dvh) !important;
  background: #121422 !important;
  color: #f8fafc !important;
  border: 1px solid rgba(255, 255, 255, 0.18) !important;
  border-radius: 20px !important;
  box-shadow: 0 25px 70px -10px rgba(0, 0, 0, 0.9), 0 0 35px rgba(59, 130, 246, 0.25) !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
  margin: auto !important;
  padding: 0 !important;
  animation: modalPopIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.gallery-modal-card {
  width: min(94vw, 840px) !important;
  max-width: 840px !important;
  max-height: min(76vh, 76dvh) !important;
}

.skills-modal-card {
  width: min(92vw, 560px) !important;
  max-width: 560px !important;
  max-height: min(74vh, 74dvh) !important;
}

.inpaint-modal-card {
  width: min(94vw, 720px) !important;
  max-width: 720px !important;
  max-height: min(76vh, 76dvh) !important;
}

/* Pinned Modal Header */
.modal-header,
#settingsModal .modal-header {
  flex: 0 0 auto !important;
  padding: 14px 18px !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12) !important;
  background: rgba(255, 255, 255, 0.03) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
}

.modal-title-group h3,
#settingsModal .modal-title-group h3 {
  color: #ffffff !important;
  font-size: 1.05rem !important;
  font-weight: 700 !important;
  margin: 0 !important;
}

.modal-title-group p,
#settingsModal .modal-title-group p {
  color: #94a3b8 !important;
  font-size: 0.74rem !important;
  margin: 3px 0 0 0 !important;
}

/* Scrollable Modal Body (Smooth Scrolling with Pinned Header & Footer) */
.modal-body,
#settingsModal .modal-body {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch !important;
  padding: 16px 18px !important;
  display: flex !important;
  flex-direction: column !important;
  gap: 16px !important;
}

/* High-Contrast Readable Labels & Text */
.settings-modal-card .setting-group label,
.settings-modal-card label,
#settingsModal label {
  color: #f8fafc !important;
  font-weight: 700 !important;
  font-size: 0.84rem !important;
  margin-bottom: 4px !important;
  display: block !important;
}

.settings-modal-card .setting-hint,
#settingsModal .setting-hint {
  color: #94a3b8 !important;
  font-size: 0.74rem !important;
  line-height: 1.4 !important;
  margin-top: 3px !important;
}

.settings-modal-card .value-badge,
#settingsModal .value-badge {
  background: rgba(56, 189, 248, 0.2) !important;
  color: #38bdf8 !important;
  font-weight: 700 !important;
  font-size: 0.78rem !important;
  padding: 2px 8px !important;
  border-radius: 6px !important;
}

.settings-modal-card .form-select,
.settings-modal-card select,
.settings-modal-card input[type="number"],
.settings-modal-card textarea,
#settingsModal select,
#settingsModal input,
#settingsModal textarea {
  background: #181d2e !important;
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  border-radius: 10px !important;
  padding: 8px 12px !important;
  font-size: 0.84rem !important;
}

.settings-modal-card .ratio-btn,
#settingsModal .ratio-btn {
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  color: #cbd5e1 !important;
  border-radius: 10px !important;
}

.settings-modal-card .ratio-btn.active,
#settingsModal .ratio-btn.active {
  background: rgba(37, 99, 235, 0.3) !important;
  border-color: #3b82f6 !important;
  color: #ffffff !important;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.4) !important;
}

.settings-modal-card .multigen-btn,
#settingsModal .multigen-btn {
  background: rgba(255, 255, 255, 0.06) !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  color: #cbd5e1 !important;
  border-radius: 8px !important;
  padding: 8px 12px !important;
}

.settings-modal-card .multigen-btn.active,
#settingsModal .multigen-btn.active {
  background: rgba(37, 99, 235, 0.3) !important;
  border-color: #3b82f6 !important;
  color: #ffffff !important;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.35) !important;
}

/* Pinned Modal Footer (ALWAYS Visible with Emerald Confirm Button) */
.modal-footer,
#settingsModal .modal-footer {
  flex: 0 0 auto !important;
  padding: 12px 18px !important;
  border-top: 1px solid rgba(255, 255, 255, 0.12) !important;
  background: #0d0f18 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
}

.modal-footer .btn-primary,
#settingsModal .modal-footer .btn-primary {
  flex: 1 !important;
  padding: 11px 18px !important;
  background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
  color: #ffffff !important;
  font-size: 0.88rem !important;
  font-weight: 700 !important;
  border: none !important;
  border-radius: 12px !important;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.45) !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  text-align: center !important;
}

.modal-footer .btn-secondary,
#settingsModal .modal-footer .btn-secondary {
  padding: 11px 16px !important;
  background: rgba(255, 255, 255, 0.08) !important;
  color: #cbd5e1 !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  border-radius: 12px !important;
  font-size: 0.84rem !important;
  font-weight: 600 !important;
  cursor: pointer !important;
}

@keyframes modalPopIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.skills-modal-card {
  max-width: 720px;
}

.gallery-modal-card {
  max-width: 1240px;
  width: 94vw;
}

.inpaint-modal-card {
  max-width: 880px;
  width: 92vw;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-title-group h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
}

.modal-title-group p {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 3px;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
}

.modal-close-btn:hover {
  color: #fff;
}

/* Settings Tabs Navigation */
.settings-tabs-nav {
  display: flex;
  background: rgba(0, 0, 0, 0.25);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0 16px;
}

.settings-tab-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 0.84rem;
  font-weight: 600;
  padding: 12px 16px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
}

.settings-tab-btn:hover {
  color: #fff;
}

.settings-tab-btn.active {
  color: #fff;
  border-bottom-color: var(--accent-cyan);
}

.settings-tab-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Global Negative Prompt Panel Styles */
.global-neg-banner {
  display: flex;
  gap: 12px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.2);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  align-items: flex-start;
}

.global-neg-banner .banner-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.global-neg-banner .banner-text h4 {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--accent-cyan);
  margin-bottom: 3px;
}

.global-neg-banner .banner-text p {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.neg-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}

.switch-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
}

.switch-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--accent-cyan);
  cursor: pointer;
}

.neg-actions {
  display: flex;
  gap: 12px;
}

.modal-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-height: 70vh;
  overflow-y: auto;
}

.setting-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.setting-group label {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-primary);
}

.label-with-value,
.label-with-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.value-badge {
  font-size: 0.8rem;
  font-weight: 700;
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-cyan);
  padding: 2px 8px;
  border-radius: 4px;
}

.btn-text-action {
  background: transparent;
  border: none;
  color: var(--accent-cyan);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-text-action:hover {
  text-decoration: underline;
}

.setting-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Aspect Ratio Buttons */
.aspect-ratio-selector {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.ratio-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.ratio-btn:hover {
  border-color: var(--border-hover);
  background: rgba(255, 255, 255, 0.06);
}

.ratio-btn.active {
  border-color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.08);
  color: #fff;
}

.ratio-box {
  border: 1.5px solid currentColor;
  border-radius: 3px;
}

.ratio-box.square {
  width: 22px;
  height: 22px;
}

.ratio-box.portrait {
  width: 16px;
  height: 26px;
}

.ratio-box.landscape {
  width: 26px;
  height: 16px;
}

.ratio-box.photo {
  width: 18px;
  height: 24px;
}

/* Range Sliders */
input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
  transition: transform 0.1s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.slider-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  font-weight: 600;
  margin-top: 2px;
}

.slider-ticks .tick.safe {
  color: #38bdf8;
}

.slider-ticks .tick.recommended {
  color: #10b981;
}

.slider-ticks .tick.danger {
  color: #f87171;
}

.form-select,
textarea {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: #fff;
  font-family: inherit;
  font-size: 0.85rem;
  padding: 10px 12px;
  outline: none;
  transition: var(--transition);
}

.form-select option {
  background: #181a24;
  color: #fff;
}

.form-select:focus,
textarea:focus {
  border-color: var(--accent-cyan);
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.btn-primary {
  background: var(--button-gradient);
  border: none;
  color: #0c0d12;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.2);
  transition: var(--transition);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(255, 255, 255, 0.3);
}

/* Skills Grid */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.skill-preset-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 14px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.skill-preset-card:hover {
  border-color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.04);
}

.skill-preset-card h4 {
  font-size: 0.9rem;
  font-weight: 600;
  color: #fff;
}

.skill-preset-card p {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Lightbox Modal */
.lightbox-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 30px;
}

.lightbox-close {
  position: absolute;
  top: 24px;
  right: 24px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  font-size: 1.4rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.lightbox-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  max-width: 90vw;
  max-height: 90vh;
}

.lightbox-content img {
  max-width: 85vw;
  max-height: 75vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.8);
}

.lightbox-actions {
  display: flex;
  gap: 12px;
}

/* Uncensored Badge */
.logo-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.logo-icon-uncensored {
  background: linear-gradient(135deg, #f43f5e, #8b5cf6) !important;
  box-shadow: 0 0 18px rgba(244, 63, 94, 0.45) !important;
}

.badge-uncensored {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  background: linear-gradient(90deg, #f43f5e, #fb7185, #a855f7);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.ref-action-btn {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.3);
  color: var(--accent-cyan);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
  margin-left: 8px;
}

.ref-action-btn:hover {
  background: rgba(56, 189, 248, 0.25);
  border-color: var(--accent-cyan);
}

/* Inpaint Canvas Modal - Exact Match with Reference Screenshot */
.settings-modal-card.inpaint-modal-card {
  max-width: 880px;
  width: 92vw;
  height: min(780px, 92vh);
  background: #141722;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.85), 0 0 1px 1px rgba(255, 255, 255, 0.08);
}

.inpaint-modal-card .modal-header {
  padding: 18px 24px;
  background: #141722;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.inpaint-modal-card .modal-title-group h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.inpaint-modal-card .modal-title-group p {
  font-size: 0.82rem;
  color: #8b92a5;
  margin: 3px 0 0 0;
}

.inpaint-modal-card .modal-close-btn {
  background: transparent;
  border: none;
  color: #8b92a5;
  font-size: 1.15rem;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.inpaint-modal-card .modal-close-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.inpaint-canvas-container {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 480px;
  background: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  user-select: none;
}

.inpaint-canvas-container canvas {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

#inpaintDrawCanvas {
  cursor: crosshair;
}

.inpaint-toolbar {
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: #141722;
  flex-shrink: 0;
}

.brush-size-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.85rem;
  font-weight: 500;
  color: #8b92a5;
}

.brush-size-wrap label {
  color: #8b92a5;
  font-size: 0.85rem;
}

.brush-size-wrap input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 160px;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.brush-size-wrap input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  transition: transform 0.15s ease;
}

.brush-size-wrap input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.brush-size-wrap input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  cursor: pointer;
  border: none;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

#brushSizeVal {
  color: #8b92a5;
  font-size: 0.85rem;
  min-width: 38px;
}

.inpaint-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

#btnClearMask {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #cbd5e1;
  padding: 8px 18px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

#btnClearMask:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.35);
  color: #ffffff;
}

#btnApplyMask {
  background: #132247;
  border: 1px solid rgba(37, 99, 235, 0.4);
  color: #60a5fa;
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

#btnApplyMask:hover {
  background: #1c3268;
  border-color: var(--accent-blue);
  color: #93c5fd;
  box-shadow: 0 0 12px rgba(37, 99, 235, 0.3);
}

/* Multi-Image Batch Grid */
.result-batch-grid {
  display: grid;
  gap: 12px;
  width: 100%;
}

.result-batch-grid.count-2 {
  grid-template-columns: repeat(2, 1fr);
}

.result-batch-grid.count-3,
.result-batch-grid.count-4 {
  grid-template-columns: repeat(2, 1fr);
}

.batch-image-item {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
  aspect-ratio: 1 / 1;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.batch-image-item:hover {
  transform: scale(1.02);
  border-color: var(--accent-cyan);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.6);
}

.batch-image-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.batch-item-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.15);
  z-index: 2;
}

.batch-item-hover-actions {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 4;
}

.batch-image-item:hover .batch-item-hover-actions {
  opacity: 1;
  pointer-events: auto;
}

.batch-hover-btn {
  background: rgba(255, 255, 255, 0.92);
  border: none;
  color: #0f172a;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 5px 9px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.batch-hover-btn:hover {
  background: #ffffff;
  color: var(--accent-blue);
  transform: translateY(-2px);
}

.meta-seed-chip {
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

.meta-seed-chip:hover {
  color: #38bdf8 !important;
  background: rgba(56, 189, 248, 0.1) !important;
}

/* Header PNG Info Button */
.btn-header-tool {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.btn-header-tool:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: var(--border-hover);
}

/* Random Tile Theme Button in Header */
.btn-tile-theme {
  background: hsla(var(--tile-hue), 80%, 55%, 0.1);
  border-color: var(--tile-border);
  color: var(--text-primary);
  box-shadow: 0 0 10px hsla(var(--tile-hue), 80%, 55%, 0.1);
}

.btn-tile-theme:hover {
  background: hsla(var(--tile-hue), 80%, 55%, 0.22);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 16px var(--tile-glow);
  transform: translateY(-1px);
  color: #fff;
}

.theme-dice-icon {
  display: inline-block;
  font-size: 0.95rem;
  transition: transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-tile-theme:active .theme-dice-icon,
.theme-dice-icon.spinning {
  transform: rotate(360deg) scale(1.3);
}

/* PNG Info Modal */
.png-info-card {
  max-width: 680px;
}

.png-drop-zone {
  width: 100%;
  height: 160px;
  border: 2px dashed rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.02);
  transition: var(--transition);
}

.png-drop-zone:hover,
.png-drop-zone.dragover {
  border-color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.05);
}

.png-info-preview-wrap {
  display: flex;
  gap: 16px;
  margin-top: 16px;
}

.png-info-thumb {
  width: 130px;
  height: 130px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid var(--border-subtle);
}

.png-info-details {
  flex: 1;
  background: rgba(0, 0, 0, 0.3);
  padding: 12px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.5;
  max-height: 140px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

/* Sidebar Backdrop Overlay on Mobile */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 90;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

/* Responsive */
@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    left: -280px;
    top: 0;
    height: 100%;
    z-index: 100;
    box-shadow: none;
    transition: left 0.28s cubic-bezier(0.16, 1, 0.3, 1),
      transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .sidebar.mobile-open {
    left: 0;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
  }

  /* When opened on mobile, always show full 260px drawer content */
  .sidebar.collapsed {
    width: 260px;
    min-width: 260px;
  }

  .sidebar.collapsed .logo-title-wrap,
  .sidebar.collapsed .logo-text,
  .sidebar.collapsed .badge-uncensored,
  .sidebar.collapsed .nav-item span,
  .sidebar.collapsed .sidebar-section,
  .sidebar.collapsed .status-info,
  .sidebar.collapsed .btn-refresh {
    display: flex !important;
  }

  .sidebar.collapsed .sessions-list,
  .sidebar.collapsed .canvases-list {
    display: flex !important;
  }

  .sidebar.collapsed .sidebar-header {
    flex-direction: row;
    padding: 16px;
    justify-content: space-between;
  }

  .sidebar.collapsed .nav-item {
    width: 100%;
    height: auto;
    padding: 10px 14px;
    justify-content: flex-start;
  }

  .sidebar.collapsed .sidebar-footer {
    padding: 14px 16px;
  }

  .sidebar.collapsed .engine-status {
    width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    padding: 9px 12px;
  }

  .sidebar-backdrop.active {
    display: block;
    opacity: 1;
    pointer-events: auto;
  }

  .mobile-menu-btn {
    display: flex !important;
  }

  .hero-title {
    font-size: 2.1rem;
  }

  .hero-title .italic-serif {
    font-size: 2.5rem;
  }

  .banner-card {
    grid-column: span 1;
  }

  .skills-grid {
    grid-template-columns: 1fr;
  }
}

/* Sintaker Toast Notification (Clean High-Contrast Black & White Pill) */
.sintaker-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #ffffff !important;
  padding: 10px 22px;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  box-shadow: 0 12px 36px -4px rgba(0, 0, 0, 0.55), 0 0 1px 1px rgba(255, 255, 255, 0.15);
  z-index: 9999;
  opacity: 0;
  transform: translateY(12px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  gap: 8px;
}

[data-theme="dark"] .sintaker-toast {
  background: rgba(24, 24, 27, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff !important;
  box-shadow: 0 12px 36px -4px rgba(0, 0, 0, 0.75), 0 0 1px 1px rgba(255, 255, 255, 0.2);
}

.sintaker-toast.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

/* ==========================================================================
   SMART WORKLOAD CHIP BAR (Automatic Workload / Robust Same-Model Adaptation)
   ========================================================================== */
.workload-chip-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 6px 8px 6px;
  margin-bottom: 4px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  user-select: none;
}

.workload-chip-bar::-webkit-scrollbar {
  display: none;
}

.workload-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-secondary, #94a3b8);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.workload-chip:hover {
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.22);
  color: #ffffff;
  transform: translateY(-1px);
}

.workload-chip:active {
  transform: scale(0.96);
}

.workload-chip.active {
  background: linear-gradient(135deg, rgba(229, 9, 20, 0.25), rgba(168, 85, 247, 0.25));
  border-color: rgba(229, 9, 20, 0.6);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(229, 9, 20, 0.25), 0 0 0 1px rgba(229, 9, 20, 0.4);
}

.workload-chip .wl-icon {
  font-size: 0.85rem;
  line-height: 1;
}

.workload-chip .wl-label {
  font-weight: 700;
}

.workload-chip .wl-sub {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  background: rgba(229, 9, 20, 0.35);
  color: #ff8585;
  padding: 1px 5px;
  border-radius: 6px;
  letter-spacing: 0.04em;
  margin-left: 2px;
  transition: all 0.2s ease;
}

.workload-chip.active .wl-sub {
  background: #e50914;
  color: #ffffff;
}

/* Silk Couture Chip Special Glow */
.workload-chip[data-workload="silk_couture"].active {
  background: linear-gradient(135deg, rgba(88, 28, 135, 0.45), rgba(168, 85, 247, 0.35));
  border-color: rgba(192, 132, 252, 0.8);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(168, 85, 247, 0.35), 0 0 0 1px rgba(192, 132, 252, 0.5);
}

.workload-chip[data-workload="silk_couture"] .wl-sub {
  background: rgba(168, 85, 247, 0.25);
  color: #d8b4fe;
}

.workload-chip[data-workload="silk_couture"].active .wl-sub {
  background: #9333ea;
  color: #ffffff;
}

/* Silk Couture Specialized Badge Bar */
.silk-couture-badge-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
  margin-bottom: 8px;
  padding: 8px 14px;
  background: linear-gradient(135deg, rgba(88, 28, 135, 0.4), rgba(168, 85, 247, 0.22));
  border: 1px solid rgba(192, 132, 252, 0.45);
  border-radius: 12px;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 16px rgba(88, 28, 135, 0.25);
  animation: fadeInDown 0.25s ease-out;
}

.silk-badge-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.silk-badge-icon {
  font-size: 1.15rem;
}

.silk-badge-title {
  font-weight: 700;
  font-size: 0.82rem;
  color: #f3e8ff;
}

.silk-badge-desc {
  font-size: 0.74rem;
  color: #d8b4fe;
  opacity: 0.95;
}

.silk-pose-cycle-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.silk-pose-cycle-btn:hover {
  background: rgba(168, 85, 247, 0.35);
  border-color: rgba(216, 180, 254, 0.7);
  transform: translateY(-1px);
}

.silk-pose-cycle-btn:active {
  transform: scale(0.96);
}

@media (max-width: 768px) {
  .workload-chip-bar {
    padding: 2px 2px 6px 2px;
    gap: 5px;
  }

  .workload-chip {
    padding: 4px 10px;
    font-size: 0.74rem;
  }

  .silk-couture-badge-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 10px;
  }

  .silk-badge-right {
    width: 100%;
  }

  .silk-pose-cycle-btn {
    width: 100%;
    justify-content: center;
  }
}

/* ==========================================================================
   MINDFUL AUTH GATE MODAL (RSA-OAEP 2048-bit & Salted Digest Obfuscation)
   ========================================================================== */
body:not(.session-authenticated) .app-layout {
  display: none !important;
}

.auth-gate-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(5, 10, 18, 0.75);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  padding: 18px 16px;
  overflow-y: auto;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-gate-overlay::before {
  content: '';
  position: absolute;
  inset: -40px;
  background: radial-gradient(circle at 50% 38%, rgba(45, 212, 191, 0.32) 0%, rgba(15, 118, 110, 0.18) 42%, rgba(5, 10, 18, 0.94) 80%),
    url('app-logo.png') center/cover no-repeat;
  filter: blur(36px);
  opacity: 0.70;
  z-index: -1;
  pointer-events: none;
  animation: authBreathPulse 5.5s ease-in-out infinite alternate;
}

@keyframes authBreathPulse {
  0% {
    transform: scale(1.02);
    opacity: 0.55;
    filter: blur(32px) brightness(0.9);
  }

  100% {
    transform: scale(1.12);
    opacity: 0.85;
    filter: blur(40px) brightness(1.1);
  }
}

.auth-gate-overlay.auth-gate-hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.97);
}

.auth-gate-card {
  width: 100%;
  max-width: 860px;
  margin: auto;
  max-height: calc(100vh - 36px);
  overflow-y: auto;
  background: linear-gradient(155deg, rgba(14, 26, 43, 0.96) 0%, rgba(9, 17, 30, 0.99) 100%);
  border: 1px solid rgba(45, 212, 191, 0.35);
  border-radius: 28px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.85), 0 0 60px rgba(45, 212, 191, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  padding: 30px 34px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  color: var(--text-primary, #f8fafc);
  animation: authCardPopIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: rgba(45, 212, 191, 0.25) transparent;
}

.auth-gate-card::-webkit-scrollbar {
  width: 6px;
}

.auth-gate-card::-webkit-scrollbar-track {
  background: transparent;
}

.auth-gate-card::-webkit-scrollbar-thumb {
  background: rgba(45, 212, 191, 0.25);
  border-radius: 4px;
}

.auth-gate-card::before {
  content: '';
  position: absolute;
  top: -120px;
  left: 20%;
  width: 380px;
  height: 240px;
  background: radial-gradient(circle, rgba(45, 212, 191, 0.16) 0%, transparent 70%);
  filter: blur(50px);
  pointer-events: none;
}

@keyframes authCardPopIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ------------------------------------------------------------
   PART 1: HUGE 1:1 RATIO LOGO & CENTER-WIDE BRAND HERO SECTION
   ------------------------------------------------------------ */
.auth-part-logo.auth-hero-section {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 22px 24px 20px 24px;
  background: radial-gradient(ellipse at 50% 25%, rgba(45, 212, 191, 0.14) 0%, rgba(12, 22, 38, 0.65) 60%, rgba(8, 15, 27, 0.85) 100%);
  border: 1px solid rgba(45, 212, 191, 0.24);
  border-radius: 22px;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 12px 32px rgba(0, 0, 0, 0.35);
}

.auth-part-logo.auth-hero-section::before {
  content: '';
  position: absolute;
  top: -70px;
  left: 50%;
  transform: translateX(-50%);
  width: 340px;
  height: 180px;
  background: radial-gradient(circle, rgba(45, 212, 191, 0.25) 0%, transparent 70%);
  filter: blur(40px);
  pointer-events: none;
}

/* Strict 1:1 Aspect Ratio Huge Logo Box */
.auth-logo-1x1-wrap {
  width: clamp(135px, 20vw, 180px);
  aspect-ratio: 1 / 1;
  border-radius: 28px;
  background: radial-gradient(circle at 50% 35%, rgba(45, 212, 191, 0.32) 0%, rgba(14, 26, 43, 0.95) 75%);
  border: 2px solid rgba(45, 212, 191, 0.6);
  box-shadow: 0 0 38px rgba(45, 212, 191, 0.38), 0 0 75px rgba(56, 189, 248, 0.22), inset 0 0 24px rgba(45, 212, 191, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  margin: 0 auto 16px auto;
  animation: authLogoBreathe 4s ease-in-out infinite alternate;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
}

.auth-logo-1x1-wrap:hover {
  transform: scale(1.03);
  box-shadow: 0 0 50px rgba(45, 212, 191, 0.5), 0 0 100px rgba(56, 189, 248, 0.3), inset 0 0 30px rgba(45, 212, 191, 0.3);
}

.auth-logo-1x1-wrap::after {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 50%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22), transparent);
  transform: skewX(-25deg);
  animation: logoShineSweep 5s ease-in-out infinite;
  pointer-events: none;
}

@keyframes logoShineSweep {

  0%,
  70% {
    left: -100%;
  }

  100% {
    left: 200%;
  }
}

@keyframes authLogoBreathe {
  0% {
    box-shadow: 0 0 30px rgba(45, 212, 191, 0.3), 0 0 60px rgba(56, 189, 248, 0.15);
    border-color: rgba(45, 212, 191, 0.45);
  }

  100% {
    box-shadow: 0 0 45px rgba(45, 212, 191, 0.45), 0 0 85px rgba(56, 189, 248, 0.28);
    border-color: rgba(45, 212, 191, 0.75);
  }
}

.auth-huge-logo-img {
  width: 82%;
  height: 82%;
  object-fit: contain;
  border-radius: 18px;
  filter: drop-shadow(0 14px 28px rgba(0, 0, 0, 0.65));
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-logo-1x1-wrap:hover .auth-huge-logo-img {
  transform: scale(1.06);
}

.auth-brand-name {
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  background: linear-gradient(135deg, #ffffff 15%, #2dd4bf 65%, #38bdf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 0 0 4px 0;
}

.auth-brand-tagline {
  font-size: 0.84rem;
  color: #94a3b8;
  margin: 0 0 12px 0;
  line-height: 1.45;
}

.auth-brand-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.auth-pill-tag {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 9999px;
  background: rgba(45, 212, 191, 0.12);
  border: 1px solid rgba(45, 212, 191, 0.28);
  color: #2dd4bf;
  letter-spacing: 0.02em;
}

.auth-pill-tag.blue {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.28);
  color: #38bdf8;
}

/* ------------------------------------------------------------
   PROTOCOL DIVIDER ACCENT
   ------------------------------------------------------------ */
.auth-sections-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  margin: 2px 0;
}

.auth-divider-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(45, 212, 191, 0.25), transparent);
}

.auth-divider-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #64748b;
  padding: 3px 12px;
  border-radius: 9999px;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* ------------------------------------------------------------
   DUAL ACTION GRID: PART 2 (LOGIN) & PART 3 (SSO MODE)
   ------------------------------------------------------------ */
.auth-gate-actions-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: stretch;
}

.auth-section-card {
  display: flex;
  flex-direction: column;
  padding: 24px 22px;
  background: linear-gradient(180deg, rgba(12, 22, 38, 0.68) 0%, rgba(8, 15, 27, 0.82) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  position: relative;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.auth-section-card:hover {
  border-color: rgba(45, 212, 191, 0.25);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.auth-section-header {
  margin-bottom: 14px;
}

.auth-section-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #2dd4bf;
  margin-bottom: 4px;
}

.auth-section-badge.sso-badge {
  color: #38bdf8;
}

.auth-section-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 2px 0;
}

.auth-section-desc {
  font-size: 0.78rem;
  color: #889db5;
  margin: 0;
  line-height: 1.4;
}

/* ------------------------------------------------------------
   PART 2: CREDENTIALS LOGIN FORM CONTROLS
   ------------------------------------------------------------ */
.auth-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.auth-form-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary, #cbd5e1);
}

.auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.auth-input-icon {
  position: absolute;
  left: 12px;
  font-size: 0.95rem;
  color: #64748b;
  pointer-events: none;
  transition: color 0.2s;
}

.auth-input {
  width: 100%;
  padding: 12px 14px 12px 38px;
  background: rgba(10, 18, 32, 0.95);
  border: 1px solid rgba(45, 212, 191, 0.22);
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.9rem;
  color: #ffffff;
  outline: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-input:focus {
  border-color: #2dd4bf;
  box-shadow: 0 0 16px rgba(45, 212, 191, 0.28);
  background: rgba(14, 26, 44, 0.98);
}

.auth-input-wrap:focus-within .auth-input-icon {
  color: #2dd4bf;
}

.auth-toggle-pass-btn {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.95rem;
  opacity: 0.65;
  transition: opacity 0.2s;
  padding: 4px;
  color: #cbd5e1;
}

.auth-toggle-pass-btn:hover {
  opacity: 1;
}

.auth-actions-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
}

.auth-btn-primary {
  width: 100%;
  padding: 13px 16px;
  background: linear-gradient(135deg, #0d9488 0%, #0284c7 60%, #38bdf8 100%);
  border: none;
  border-radius: 12px;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(13, 148, 136, 0.4);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.auth-btn-primary:hover:not(:disabled) {
  transform: translateY(-1.5px);
  box-shadow: 0 6px 24px rgba(45, 212, 191, 0.45);
}

.auth-btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.auth-btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.auth-feedback-text {
  font-size: 0.74rem;
  text-align: center;
  min-height: 18px;
  margin-top: 8px;
  color: #2dd4bf;
  transition: color 0.2s;
}

/* ------------------------------------------------------------
   PART 3: SINGLE SIGN-ON (SSO) MODE SECTION
   ------------------------------------------------------------ */
.auth-sso-cards-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 4px;
}

.auth-sso-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(14, 26, 43, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
  width: 100%;
}

.auth-sso-card:hover {
  transform: translateY(-1.5px);
  border-color: rgba(45, 212, 191, 0.5);
  background: rgba(18, 34, 56, 0.85);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4), 0 0 16px rgba(45, 212, 191, 0.2);
}

.auth-sso-card.nluta-sso {
  border-color: rgba(45, 212, 191, 0.35);
  background: linear-gradient(135deg, rgba(45, 212, 191, 0.12) 0%, rgba(14, 26, 43, 0.8) 100%);
}

.auth-sso-card.google-sso {
  border-color: rgba(255, 255, 255, 0.14);
}

.auth-sso-icon-box {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 1.15rem;
  flex-shrink: 0;
}

.auth-sso-card.nluta-sso .auth-sso-icon-box {
  background: rgba(45, 212, 191, 0.2);
  border-color: rgba(45, 212, 191, 0.4);
  color: #2dd4bf;
}

.auth-sso-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-grow: 1;
}

.auth-sso-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #ffffff;
}

.auth-sso-sub {
  font-size: 0.72rem;
  color: #94a3b8;
}

.auth-sso-arrow {
  color: #64748b;
  font-size: 0.95rem;
  transition: transform 0.2s, color 0.2s;
}

.auth-sso-card:hover .auth-sso-arrow {
  transform: translateX(3px);
  color: #2dd4bf;
}

.auth-sso-footer-note {
  margin-top: auto;
  padding-top: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.68rem;
  color: #64748b;
  line-height: 1.4;
}

/* ------------------------------------------------------------
   RESPONSIVE LAYOUT (TABLET & MOBILE)
   ------------------------------------------------------------ */
@media (max-width: 820px) {
  .auth-gate-card {
    max-width: 520px;
    padding: 24px 20px;
    gap: 16px;
  }

  .auth-gate-actions-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .auth-part-logo.auth-hero-section {
    padding: 18px 16px;
  }

  .auth-logo-1x1-wrap {
    width: clamp(120px, 26vw, 160px);
  }
}

@media (max-width: 480px) {
  .auth-gate-card {
    padding: 18px 14px;
    border-radius: 20px;
  }

  .auth-brand-name {
    font-size: 1.35rem;
  }

  .auth-logo-1x1-wrap {
    width: 125px;
  }
}

/* ==========================================================================
   AUTHENTICATED SESSION LOGOUT CONTROLS & USER BADGE
   ========================================================================== */
.btn-logout-tool {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(251, 113, 133, 0.12);
  border: 1px solid rgba(251, 113, 133, 0.35);
  border-radius: 8px;
  color: #fb7185;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-logout-tool:hover {
  background: rgba(251, 113, 133, 0.24);
  border-color: #fb7185;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(251, 113, 133, 0.28);
}

.sidebar-user-card {
  margin-top: 10px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sidebar-user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

.sidebar-user-avatar {
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: rgba(45, 212, 191, 0.12);
  border: 1px solid rgba(45, 212, 191, 0.25);
}

.sidebar-user-meta {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  line-height: 1.25;
}

.sidebar-user-name {
  font-size: 12px;
  font-weight: 700;
  color: #f1f5f9;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

.sidebar-user-role {
  font-size: 10px;
  color: #2dd4bf;
  letter-spacing: 0.3px;
}

.sidebar-logout-btn {
  padding: 5px 9px;
  border-radius: 6px;
  background: rgba(251, 113, 133, 0.12);
  border: 1px solid rgba(251, 113, 133, 0.3);
  color: #fb7185;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s;
  white-space: nowrap;
}

.sidebar-logout-btn:hover {
  background: rgba(251, 113, 133, 0.25);
  color: #fff;
  border-color: #fb7185;
}

/* ========================================================
   GLOBAL SCREEN-TOP REALTIME PROGRESS BAR
   ======================================================== */
.global-top-progress-wrap {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100vw;
  height: 4px;
  background: rgba(0, 0, 0, 0.2);
  z-index: 999999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.global-top-progress-wrap.active {
  opacity: 1;
}

.global-top-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #0ea5e9, #2dd4bf, #10b981, #f59e0b, #ec4899);
  box-shadow: 0 0 12px rgba(45, 212, 191, 0.9), 0 0 24px rgba(14, 165, 233, 0.7);
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ========================================================
   MODEL SWITCHING PROGRESS BAR & BADGES
   ======================================================== */
.model-loading-progress-wrap {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 100%;
  min-width: 280px;
  max-width: 380px;
  background: rgba(8, 14, 26, 0.98);
  border: 1px solid rgba(45, 212, 191, 0.6);
  border-radius: 10px;
  padding: 10px 14px;
  box-shadow: 0 12px 30px -5px rgba(0, 0, 0, 0.85), 0 0 20px rgba(45, 212, 191, 0.35);
  z-index: 10000;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  animation: modelBarSlideDown 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.model-loading-progress-wrap.settings-model-progress {
  position: relative !important;
  top: auto !important;
  left: auto !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  margin-top: 10px !important;
  box-sizing: border-box;
}

@keyframes modelBarSlideDown {
  from { opacity: 0; transform: translateY(-8px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.model-loading-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  margin-bottom: 7px;
}

.model-loading-label {
  font-weight: 700;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.model-loading-pct {
  font-weight: 800;
  color: #2dd4bf;
  font-family: monospace;
  font-size: 12px;
}

.model-loading-bar-track {
  width: 100%;
  height: 7px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.model-loading-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #0ea5e9, #2dd4bf, #10b981);
  border-radius: 4px;
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 12px rgba(45, 212, 191, 0.7);
}

.model-loading-bar-fill.success {
  background: #10b981;
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.9);
}

/* Step Model Badge inside Generation Progress Header */
.step-model-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(45, 212, 191, 0.16);
  border: 1px solid rgba(45, 212, 191, 0.45);
  color: #2dd4bf;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 6px;
  letter-spacing: 0.2px;
  white-space: nowrap;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 0 10px rgba(45, 212, 191, 0.25);
}

/* ========================================================
   CONVERT TO AVIF BUTTON & BADGE STYLING
   ======================================================== */
.action-pill-btn.btn-convert-avif {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.4);
  color: #34d399;
  font-weight: 600;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.action-pill-btn.btn-convert-avif:hover {
  background: rgba(16, 185, 129, 0.22);
  border-color: #10b981;
  color: #6ee7b7;
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.35);
  transform: translateY(-1px);
}

.action-pill-btn.btn-convert-avif.converting {
  pointer-events: none;
  opacity: 0.75;
  border-color: #f59e0b;
  color: #fbbf24;
}

.action-pill-btn.btn-convert-avif.saved {
  background: rgba(16, 185, 129, 0.25);
  border-color: #10b981;
  color: #a7f3d0;
}

.batch-hover-btn.btn-batch-avif {
  background: rgba(16, 185, 129, 0.3);
  border: 1px solid rgba(16, 185, 129, 0.5);
  color: #a7f3d0;
}

.batch-hover-btn.btn-batch-avif:hover {
  background: rgba(16, 185, 129, 0.55);
  border-color: #34d399;
  color: #ffffff;
}

.avif-stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
}

/* ==========================================================================
   CIVITAI-STYLE MODEL SELECTION GRID & THUMBNAILS
   ========================================================================== */
.btn-model-grid-picker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 4px 12px 4px 6px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  color: #ffffff;
  outline: none;
}

.btn-model-grid-picker:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(45, 212, 191, 0.45);
  box-shadow: 0 0 14px rgba(45, 212, 191, 0.2);
}

.model-picker-thumb {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  background: #1e293b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.model-picker-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.model-picker-label {
  font-size: 13px;
  font-weight: 600;
  color: #f8fafc;
  max-width: 170px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.model-picker-chevron {
  stroke: rgba(255, 255, 255, 0.55);
  transition: transform 0.2s ease;
}

.btn-model-grid-picker:hover .model-picker-chevron {
  stroke: #2dd4bf;
  transform: translateY(1px);
}

.btn-browse-models-grid {
  background: rgba(45, 212, 191, 0.12);
  color: #2dd4bf;
  border: 1px solid rgba(45, 212, 191, 0.35);
  border-radius: 8px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-browse-models-grid:hover {
  background: rgba(45, 212, 191, 0.22);
  border-color: #2dd4bf;
  box-shadow: 0 0 10px rgba(45, 212, 191, 0.25);
}

/* Model Grid Modal Card */
.model-grid-modal-card {
  max-width: 1020px;
  width: 92vw;
  max-height: 86vh;
  border-radius: 24px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.85), 0 0 1px 1px rgba(255, 255, 255, 0.08);
}

.model-grid-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  gap: 16px;
  flex-shrink: 0;
}

.model-grid-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 7px 12px;
  flex: 1;
  max-width: 380px;
  color: rgba(255, 255, 255, 0.6);
}

.model-grid-search input {
  background: transparent;
  border: none;
  outline: none;
  color: #ffffff;
  font-size: 13px;
  width: 100%;
}

.model-grid-search input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.model-grid-meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.model-grid-count {
  font-size: 12px;
  color: var(--text-muted, #94a3b8);
}

.model-grid-badge-civ {
  background: rgba(99, 102, 241, 0.18);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.35);
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}

.model-grid-modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
  min-height: 380px;
}

/* The Cards Grid matching reference image */
.model-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 20px;
}

/* Individual Model Card */
.model-card-item {
  position: relative;
  aspect-ratio: 1.25;
  border-radius: 22px;
  overflow: hidden;
  cursor: pointer;
  background: #1e293b;
  border: 2px solid rgba(255, 255, 255, 0.08);
  transition: all 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.model-card-item:hover {
  transform: translateY(-4px) scale(1.02);
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.7), 0 0 20px rgba(45, 212, 191, 0.3);
}

.model-card-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 20px;
  transition: transform 0.4s ease;
  display: block;
}

.model-card-item:hover .model-card-thumb {
  transform: scale(1.06);
}

.model-card-scrim {
  position: absolute;
  inset: 0;
  border-radius: 20px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0.45) 45%, rgba(0, 0, 0, 0.05) 75%, transparent 100%);
  pointer-events: none;
}

.model-card-label {
  position: absolute;
  bottom: 14px;
  left: 16px;
  right: 16px;
  font-weight: 700;
  font-size: 1.05rem;
  color: #ffffff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
  letter-spacing: -0.01em;
  z-index: 2;
  pointer-events: none;
  line-height: 1.25;
}

/* Active State with glowing border and checkmark badge */
.model-card-item.active {
  border-color: #2dd4bf !important;
  box-shadow: 0 0 28px rgba(45, 212, 191, 0.45), inset 0 0 15px rgba(45, 212, 191, 0.2);
}

.model-card-active-pill {
  position: absolute;
  top: 12px;
  right: 12px;
  background: #2dd4bf;
  color: #0f172a;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 9px;
  border-radius: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 4px;
}


/* ==========================================================================
   SHARE MODAL & SOCIAL MEDIA BUTTONS
   ========================================================================== */
.btn-top-buy-credits {
  background: rgba(45, 212, 191, 0.18);
  color: #2dd4bf;
  border: 1px solid rgba(45, 212, 191, 0.4);
  border-radius: 6px;
  padding: 2px 7px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  margin-left: 6px;
  transition: all 0.2s;
}

.btn-top-buy-credits:hover {
  background: #2dd4bf;
  color: #0f172a;
  box-shadow: 0 0 10px rgba(45, 212, 191, 0.5);
}

.share-modal-card {
  max-width: 640px;
  width: 92vw;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.85);
}

.share-modal-body {
  padding: 20px 24px;
}

.share-preview-card {
  display: flex;
  gap: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 12px;
  margin-bottom: 20px;
  align-items: center;
}

.share-preview-card img {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.share-preview-info {
  flex: 1;
  min-width: 0;
}

.share-preview-prompt {
  font-size: 13px;
  font-weight: 600;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.share-preview-meta {
  font-size: 11px;
  color: #94a3b8;
}

.share-grid-platforms {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

@media (max-width: 600px) {
  .share-grid-platforms {
    grid-template-columns: repeat(2, 1fr);
  }
}

.share-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 14px 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.22s ease;
  color: #f8fafc;
}

.share-btn:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
}

.share-btn-x:hover { border-color: #ffffff; }
.share-btn-bluesky:hover { border-color: #0285ff; color: #38bdf8; }
.share-btn-discord:hover { border-color: #5865f2; color: #818cf8; }
.share-btn-instagram:hover { border-color: #e1306c; color: #f472b6; }
.share-btn-reddit:hover { border-color: #ff4500; color: #fb923c; }
.share-btn-whatsapp:hover { border-color: #25d366; color: #4ade80; }
.share-btn-telegram:hover { border-color: #229ed9; color: #38bdf8; }
.share-btn-copy:hover { border-color: #2dd4bf; color: #2dd4bf; }

.share-btn-icon {
  font-size: 20px;
}

.share-btn-name {
  font-size: 11.5px;
  font-weight: 600;
}

.share-feedback-notice {
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(45, 212, 191, 0.15);
  color: #2dd4bf;
  border: 1px solid rgba(45, 212, 191, 0.35);
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}

/* ==========================================================================
   MIDTRANS CREDITS MODAL
   ========================================================================== */
.credits-modal-card {
  max-width: 880px;
  width: 92vw;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  overflow: hidden;
}

.credits-packages-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

@media (max-width: 768px) {
  .credits-packages-grid {
    grid-template-columns: 1fr;
  }
}

.credit-package-card {
  position: relative;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 18px;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  transition: all 0.25s ease;
}

.credit-package-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5);
}

.credit-package-card.featured {
  border-color: #2dd4bf;
  background: rgba(45, 212, 191, 0.04);
  box-shadow: 0 0 25px rgba(45, 212, 191, 0.15);
}

.credit-pack-badge {
  align-self: flex-start;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  margin-bottom: 12px;
}

.credit-pack-badge.best {
  background: #2dd4bf;
  color: #0f172a;
}

.credit-pack-amount {
  font-size: 20px;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 4px;
}

.credit-pack-price {
  font-size: 24px;
  font-weight: 800;
  color: #2dd4bf;
  margin-bottom: 2px;
}

.credit-pack-unit {
  font-size: 11px;
  color: #94a3b8;
  margin-bottom: 16px;
}

.credit-pack-perks {
  list-style: none;
  padding: 0;
  margin: 0 0 20px 0;
  flex: 1;
}

.credit-pack-perks li {
  font-size: 12px;
  color: #cbd5e1;
  margin-bottom: 6px;
  line-height: 1.4;
}

.btn-buy-package {
  width: 100%;
  padding: 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-buy-package:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn-buy-package.best {
  background: #2dd4bf;
  color: #0f172a;
  border-color: #2dd4bf;
}

.btn-buy-package.best:hover {
  background: #14b8a6;
  box-shadow: 0 0 15px rgba(45, 212, 191, 0.4);
}

.payment-secure-badge {
  text-align: center;
  font-size: 11.5px;
  color: #94a3b8;
  padding: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

/* ==========================================================================
   COOKIE CONSENT BANNER
   ========================================================================== */
.cookie-consent-banner {
  position: fixed;
  bottom: 20px;
  left: 24px;
  right: 24px;
  max-width: 900px;
  margin: 0 auto;
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 18px;
  padding: 14px 20px;
  z-index: 99999;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.7);
}

.cookie-consent-content {
  display: flex;
  align-items: center;
  gap: 16px;
}

@media (max-width: 640px) {
  .cookie-consent-content {
    flex-direction: column;
    align-items: flex-start;
  }
}

.cookie-icon {
  font-size: 24px;
  flex-shrink: 0;
}

.cookie-text {
  font-size: 12px;
  color: #cbd5e1;
  line-height: 1.45;
  flex: 1;
}

.cookie-text a {
  color: #2dd4bf;
  text-decoration: underline;
}

.cookie-buttons {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.btn-cookie-accept {
  background: #2dd4bf;
  color: #0f172a;
  border: none;
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-cookie-accept:hover {
  background: #14b8a6;
}

.btn-cookie-essential {
  background: rgba(255, 255, 255, 0.08);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-cookie-essential:hover {
  background: rgba(255, 255, 255, 0.14);
}

/* QRIS Popup Modal Styles */
.qris-pulse-dot {
  display: inline-block;
  animation: qrisPulse 1.8s infinite ease-in-out;
}

@keyframes qrisPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.6; }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ==========================================================================
   INPAINT / INBRUSH STUDIO PRO - EXPANSIVE DESKTOP & RESPONSIVE MOBILE
   ========================================================================== */

/* Expansive Desktop Inbrush Modal (Matching mockup inbrush_desktop_web_feature) */
.settings-modal-card.inpaint-modal-card {
  width: min(88vw, 1100px) !important;
  max-width: 1200px !important;
  height: min(86vh, 850px) !important;
  max-height: 90vh !important;
  background: rgba(13, 17, 27, 0.96) !important;
  backdrop-filter: blur(28px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(28px) saturate(180%) !important;
  border: 1px solid rgba(56, 189, 248, 0.35) !important;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.85),
              0 0 45px rgba(56, 189, 248, 0.18),
              inset 0 1px 0 rgba(255, 255, 255, 0.1) !important;
  display: flex !important;
  flex-direction: column !important;
  border-radius: 20px !important;
  overflow: hidden !important;
  padding: 0 !important;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.inpaint-modal-card .modal-header {
  padding: 16px 24px;
  background: rgba(15, 23, 42, 0.8);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.badge-desktop-size {
  display: inline-block;
  padding: 2px 8px;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: linear-gradient(135deg, #0ea5e9, #06b6d4);
  color: #ffffff;
  border-radius: 999px;
  margin-left: 8px;
  vertical-align: middle;
}

.inpaint-canvas-container {
  position: relative;
  flex: 1;
  min-height: 340px;
  background: #07090e;
  background-image: 
    linear-gradient(45deg, #0f172a 25%, transparent 25%), 
    linear-gradient(-45deg, #0f172a 25%, transparent 25%), 
    linear-gradient(45deg, transparent 75%, #0f172a 75%), 
    linear-gradient(-45deg, transparent 75%, #0f172a 75%);
  background-size: 24px 24px;
  background-position: 0 0, 0 12px, 12px -12px, -12px 0px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  user-select: none;
  cursor: crosshair;
}

.inpaint-canvas-container canvas {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 96%;
  max-height: 96%;
  object-fit: contain;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.6);
  border-radius: 8px;
}

#inpaintDrawCanvas {
  opacity: 0.85;
}

.inpaint-toolbar {
  padding: 14px 22px;
  background: rgba(15, 23, 42, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.inpaint-tools-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.inpaint-mode-toggles {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.4);
  padding: 4px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.btn-inpaint-tool {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: transparent;
  color: #94a3b8;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-inpaint-tool:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #f8fafc;
}

.btn-inpaint-tool.active {
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.25), rgba(6, 182, 212, 0.2));
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.45);
  box-shadow: 0 0 14px rgba(14, 165, 233, 0.2);
}

.btn-inpaint-tool.active.unmask {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(217, 119, 6, 0.2));
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.45);
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.2);
}

.tool-addon-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.tool-addon-badge.unlocked {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.4);
}

.inpaint-color-palette {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.color-swatch {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid rgba(0, 0, 0, 0.5);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.color-swatch:hover {
  transform: scale(1.15);
}

.color-swatch.active {
  transform: scale(1.25);
  box-shadow: 0 0 0 2px #38bdf8, 0 0 12px rgba(56, 189, 248, 0.5);
}

.brush-size-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #94a3b8;
  font-size: 0.82rem;
  font-weight: 600;
}

.brush-size-wrap input[type="range"] {
  width: 120px;
  accent-color: #38bdf8;
  cursor: pointer;
}

#brushSizeVal {
  min-width: 38px;
  color: #38bdf8;
  font-weight: 700;
}

.inpaint-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Mobile responsive for Inpaint Modal */
@media (max-width: 768px) {
  .settings-modal-card.inpaint-modal-card {
    width: 95vw !important;
    max-width: 480px !important;
    height: 90vh !important;
    border-radius: 16px !important;
  }
  
  .inpaint-toolbar {
    padding: 10px 14px;
    gap: 10px;
    justify-content: center;
  }
  
  .inpaint-mode-toggles {
    width: 100%;
    justify-content: space-around;
  }

  .btn-inpaint-tool {
    padding: 6px 10px;
    font-size: 0.75rem;
  }

  .brush-size-wrap {
    width: 100%;
    justify-content: space-between;
  }
  
  .brush-size-wrap input[type="range"] {
    flex: 1;
    margin: 0 8px;
  }
  
  .inpaint-actions {
    width: 100%;
    display: flex;
    gap: 8px;
  }
  
  .inpaint-actions button {
    flex: 1;
    padding: 10px 0;
  }
}

/* ==========================================================================
   INBRUSH RIGHT-SIDE PANEL (Desktop View with Green Bilah)
   ========================================================================== */

.inbrush-side-panel {
  position: fixed;
  top: 76px;
  right: 20px;
  width: 320px;
  max-height: calc(100vh - 100px);
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-left: 5px solid #10b981 !important; /* Bilah berwarna hijau */
  border-radius: 16px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.6),
              0 0 25px rgba(16, 185, 129, 0.15);
  padding: 18px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: slideInRightPanel 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideInRightPanel {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.inbrush-side-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 10px;
}

.inbrush-side-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.inbrush-bilah-green {
  display: inline-block;
  width: 4px;
  height: 24px;
  background: #10b981;
  border-radius: 2px;
  box-shadow: 0 0 10px #10b981;
}

.inbrush-icon {
  font-size: 1.3rem;
}

.inbrush-side-title h4 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.2;
}

.inbrush-status-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  color: #10b981;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.inbrush-side-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1rem;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: all 0.2s;
}

.inbrush-side-close:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.inbrush-side-preview-wrap {
  position: relative;
  width: 100%;
  height: 180px;
  border-radius: 12px;
  overflow: hidden;
  background: #090d16;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.inbrush-side-preview-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.inbrush-side-preview-wrap:hover img {
  transform: scale(1.04);
}

.inbrush-side-badge {
  position: absolute;
  bottom: 8px;
  left: 8px;
  padding: 3px 8px;
  font-size: 0.65rem;
  font-weight: 700;
  color: #ffffff;
  background: rgba(16, 185, 129, 0.85);
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.inbrush-side-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: rgba(0, 0, 0, 0.25);
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.inbrush-meta-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
}

.inbrush-meta-item .meta-label {
  color: #94a3b8;
}

.inbrush-meta-item .meta-val {
  color: #e2e8f0;
  font-weight: 600;
}

.inbrush-meta-item .meta-val.highlight-green {
  color: #10b981;
  font-weight: 700;
}

.inbrush-side-actions {
  display: flex;
  gap: 8px;
}

.btn-inbrush-action {
  flex: 1;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-inbrush-action.edit {
  background: rgba(14, 165, 233, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.btn-inbrush-action.edit:hover {
  background: rgba(14, 165, 233, 0.35);
  color: #ffffff;
}

.btn-inbrush-action.clear {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-inbrush-action.clear:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #ffffff;
}

/* Hide inbrush side panel on small mobile devices to avoid overlap */
@media (max-width: 992px) {
  .inbrush-side-panel {
    display: none !important;
  }
}

/* ==========================================================================
   ANCHOR MASK READY BUTTON STYLING (Matching web_view_mobile_anchor_after_inbrush)
   ========================================================================== */

.ref-action-btn.mask-ready,
#btnAnchorInpaint.mask-ready,
.inpaint-mask-ready-badge {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(5, 150, 105, 0.25)) !important;
  color: #34d399 !important;
  border: 1px solid #10b981 !important;
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.35),
              inset 0 0 8px rgba(16, 185, 129, 0.15) !important;
  font-weight: 700 !important;
  animation: pulseGreenGlow 2.5s infinite ease-in-out;
}

@keyframes pulseGreenGlow {
  0%, 100% {
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.35);
  }
  50% {
    box-shadow: 0 0 25px rgba(16, 185, 129, 0.65);
  }
}

/* ==========================================================================
   FEATURE PURCHASE & ADD-ON MODAL
   ========================================================================== */

.feature-purchase-card {
  width: min(92vw, 440px) !important;
  background: rgba(15, 23, 42, 0.98) !important;
  backdrop-filter: blur(28px) saturate(180%) !important;
  border: 1px solid rgba(245, 158, 11, 0.45) !important;
  box-shadow: 0 25px 55px rgba(0, 0, 0, 0.8), 0 0 35px rgba(245, 158, 11, 0.2) !important;
  border-radius: 20px !important;
  overflow: hidden !important;
  padding: 0 !important;
}

.feature-purchase-header {
  padding: 20px 24px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(217, 119, 6, 0.05));
  border-bottom: 1px solid rgba(245, 158, 11, 0.2);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.feature-purchase-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.feature-purchase-title .feat-icon {
  font-size: 1.8rem;
}

.feature-purchase-title h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 800;
  color: #f8fafc;
}

.feature-purchase-title p {
  margin: 2px 0 0 0;
  font-size: 0.78rem;
  color: #fbbf24;
}

.feature-purchase-body {
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.feature-highlights {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.highlight-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.82rem;
  color: #e2e8f0;
}

.highlight-item .icon {
  color: #10b981;
  font-weight: 800;
}

.feature-pricing-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.feature-price-wrap {
  display: flex;
  flex-direction: column;
}

.feature-price-wrap .price-label {
  font-size: 0.72rem;
  color: #94a3b8;
  text-transform: uppercase;
}

.feature-price-wrap .price-amount {
  font-size: 1.4rem;
  font-weight: 800;
  color: #38bdf8;
}

.feature-pricing-box .badge-lifetime {
  padding: 3px 8px;
  font-size: 0.68rem;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: 999px;
}

.btn-buy-feature {
  width: 100%;
  padding: 13px 20px;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 700;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #0f172a;
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.35);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-buy-feature:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(245, 158, 11, 0.5);
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
}

.btn-simulate-feature {
  width: 100%;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-simulate-feature:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #f8fafc;
}

/* ==========================================================================
   GENUINE GOOGLE SSO CHOOSER MODAL
   ========================================================================== */

.google-chooser-card {
  width: min(92vw, 420px) !important;
  background: #ffffff !important;
  color: #1f2937 !important;
  border-radius: 18px !important;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7) !important;
  overflow: hidden !important;
  padding: 0 !important;
  border: none !important;
}

.google-chooser-header {
  padding: 24px 28px 16px;
  text-align: center;
  position: relative;
}

.google-chooser-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: transparent;
  border: none;
  font-size: 1.1rem;
  color: #6b7280;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 50%;
}

.google-chooser-close:hover {
  background: #f3f4f6;
  color: #111827;
}

.google-official-logo {
  width: 52px;
  height: 52px;
  margin: 0 auto 12px;
}

.google-chooser-header h3 {
  margin: 0 0 6px 0;
  font-size: 1.3rem;
  font-weight: 600;
  color: #1f2937;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.google-chooser-header p {
  margin: 0;
  font-size: 0.85rem;
  color: #5f6368;
}

.google-account-list {
  display: flex;
  flex-direction: column;
  padding: 8px 16px 20px;
}

.google-account-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s ease;
  border: 1px solid transparent;
}

.google-account-item:hover {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.google-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  color: #ffffff;
  flex-shrink: 0;
}

.google-avatar.avatar-g {
  background: #ea4335;
}

.google-avatar.avatar-p {
  background: #1a73e8;
}

.google-avatar.avatar-add {
  background: #e8eaed;
  color: #5f6368;
}

.google-account-details {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.google-acc-name {
  font-size: 0.92rem;
  font-weight: 600;
  color: #202124;
}

.google-acc-email {
  font-size: 0.78rem;
  color: #5f6368;
}

.google-chooser-footer {
  padding: 14px 24px;
  background: #f8fafc;
  border-top: 1px solid #e5e7eb;
  font-size: 0.75rem;
  color: #6b7280;
  text-align: center;
}

.google-security-notice {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.google-security-notice a {
  color: #1a73e8;
  text-decoration: none;
}

/* ==========================================================================
   VERSIONING BADGES & FLOATING PROMPT VERSION PILL (Format: {Version}.{Build}.{BugFixed})
   ========================================================================== */
.floating-prompt-version {
  position: absolute;
  top: -24px;
  right: 14px;
  z-index: 15;
  display: flex;
  align-items: center;
  pointer-events: auto;
  user-select: none;
  animation: fadeInDown 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.fpv-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  background: rgba(14, 26, 43, 0.88);
  border: 1px solid rgba(45, 212, 191, 0.35);
  border-radius: 12px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35), 0 0 10px rgba(45, 212, 191, 0.12);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-family: var(--font-mono, 'JetBrains Mono', 'Fira Code', monospace);
  font-size: 11px;
  letter-spacing: 0.3px;
  color: #e2e8f0;
  cursor: default;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.fpv-pill:hover {
  border-color: rgba(45, 212, 191, 0.7);
  background: rgba(14, 26, 43, 0.96);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45), 0 0 16px rgba(45, 212, 191, 0.25);
  transform: translateY(-1.5px);
}

.fpv-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2dd4bf;
  box-shadow: 0 0 8px #2dd4bf;
  animation: pulseDot 2s infinite ease-in-out;
}

.fpv-tag {
  font-weight: 700;
  color: #2dd4bf;
}

.fpv-divider {
  color: rgba(255, 255, 255, 0.25);
  font-size: 9px;
}

.fpv-meta {
  color: #94a3b8;
  font-size: 10px;
  font-weight: 500;
}

@keyframes pulseDot {
  0%, 100% {
    transform: scale(1);
    opacity: 0.85;
    box-shadow: 0 0 6px #2dd4bf;
  }
  50% {
    transform: scale(1.25);
    opacity: 1;
    box-shadow: 0 0 12px #2dd4bf, 0 0 18px rgba(45, 212, 191, 0.4);
  }
}

/* Auth Modal Version Pill & Footer */
.auth-version-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  padding: 3px 12px;
  background: rgba(45, 212, 191, 0.1);
  border: 1px solid rgba(45, 212, 191, 0.35);
  border-radius: 14px;
  font-family: var(--font-mono, monospace);
  font-size: 11px;
  box-shadow: 0 0 12px rgba(45, 212, 191, 0.12);
}

.auth-version-pill .v-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2dd4bf;
  box-shadow: 0 0 6px #2dd4bf;
}

.auth-version-pill .v-tag {
  font-weight: 700;
  color: #2dd4bf;
  letter-spacing: 0.4px;
}

.auth-version-pill .v-sub {
  color: rgba(255, 255, 255, 0.6);
  font-size: 10px;
}

.auth-gate-version-footer {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
  font-size: 11px;
  color: #94a3b8;
  font-family: var(--font-mono, monospace);
  letter-spacing: 0.2px;
}

.auth-gate-version-footer strong.text-teal {
  color: #2dd4bf;
  font-weight: 700;
}



