/* ==========================================================================
   Text Editor AI PRO - Glassmorphism Modern Design System & Canvas Studio
   ========================================================================== */

/* Local & System Font Bindings: Chanakya & Kruti Dev Indian Publishing Fonts */
@font-face {
  font-family: 'Chanakya';
  src: local('Chanakya'), local('Walkman-Chanakya-901'), local('Chanakya Regular');
}
@font-face {
  font-family: 'Chanakya Bold';
  src: local('Chanakya Bold'), local('Chanakya-Bold'), local('Walkman-Chanakya-902');
  font-weight: 700;
}
@font-face {
  font-family: 'Walkman-Chanakya';
  src: local('Walkman-Chanakya'), local('Walkman-Chanakya-901'), local('Chanakya');
}
@font-face {
  font-family: 'Kruti Dev 010';
  src: local('Kruti Dev 010'), local('KrutiDev010'), local('KDev010'), local('Kruti Dev');
}
@font-face {
  font-family: 'Kruti Dev 011';
  src: local('Kruti Dev 011'), local('KrutiDev011'), local('KDev011');
}
@font-face {
  font-family: 'Kruti Dev 020';
  src: local('Kruti Dev 020'), local('KrutiDev020'), local('KDev020');
}
@font-face {
  font-family: 'Kruti Dev 040';
  src: local('Kruti Dev 040'), local('KrutiDev040'), local('KDev040');
}
@font-face {
  font-family: 'Kruti Dev 055';
  src: local('Kruti Dev 055'), local('KrutiDev055'), local('KDev055');
}
@font-face {
  font-family: 'Kruti Dev 100';
  src: local('Kruti Dev 100'), local('KrutiDev100'), local('KDev100');
}
@font-face {
  font-family: 'Devlys 010';
  src: local('Devlys 010'), local('Devlys010'), local('DevLys 010');
}

/* Indian & Global Newspaper Font Bindings */
@font-face {
  font-family: 'Navbharat Times';
  src: local('Navbharat Times'), local('NavBharatTimes'), local('NBT'), local('Chanakya'), local('Mangal');
}
@font-face {
  font-family: 'Navbharat Times Bold';
  src: local('Navbharat Times Bold'), local('NBT-Bold'), local('Chanakya Bold');
  font-weight: 700;
}
@font-face {
  font-family: 'NBT Headline';
  src: local('NBT Headline'), local('Navbharat Times Headline'), local('Walkman-Chanakya-902');
  font-weight: 800;
}
@font-face {
  font-family: 'Dainik Jagran';
  src: local('Dainik Jagran'), local('Jagran'), local('Kruti Dev 010'), local('Mangal');
}
@font-face {
  font-family: 'Dainik Bhaskar';
  src: local('Dainik Bhaskar'), local('Bhaskar'), local('Chanakya'), local('Mangal');
}
@font-face {
  font-family: 'Amar Ujala';
  src: local('Amar Ujala'), local('AmarUjala'), local('Kruti Dev 010'), local('Mangal');
}
@font-face {
  font-family: 'Shree-Lipi 714';
  src: local('Shree-Lipi 714'), local('SHREE-DEV-0714'), local('Shree-Dev-0714');
}
@font-face {
  font-family: 'APS-DV-Prakash';
  src: local('APS-DV-Prakash'), local('APS-Prakash'), local('DV-Prakash');
}
@font-face {
  font-family: 'NYT Cheltenham';
  src: local('NYT Cheltenham'), local('Cheltenham'), local('Georgia');
}
@font-face {
  font-family: 'Times of India Headline';
  src: local('Times of India'), local('Times New Roman');
}
@font-face {
  font-family: 'The Hindu Editorial';
  src: local('The Hindu'), local('Merriweather'), local('Georgia');
}
@font-face {
  font-family: 'Chomsky (Masthead)';
  src: local('Chomsky'), local('Old English Text MT'), local('Cloister Black');
}

:root {
  /* Gemini-Inspired Classy Dark Palette */
  --bg-darkest: #131314;
  --bg-darker: #1e1e24;
  --bg-panel: #1e1e24;
  --bg-surface: #1e1e24;
  --bg-surface-hover: #2a2a32;
  --bg-input: #17171c;
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-light: rgba(255, 255, 255, 0.14);
  --border-focus: #8ab4f8;

  --accent-primary: #8ab4f8;
  --accent-primary-hover: #aecbfa;
  --accent-secondary: #c084fc;
  --accent-gradient: linear-gradient(135deg, #4285f4 0%, #9333ea 50%, #ec4899 100%);
  --gemini-gradient: linear-gradient(90deg, #4285f4, #9333ea, #ec4899, #60a5fa, #4285f4);
  --accent-glow-gradient: linear-gradient(135deg, rgba(66, 133, 244, 0.4), rgba(147, 51, 234, 0.4), rgba(236, 72, 153, 0.4));
  --accent-green: #34a853;
  --accent-danger: #ea4335;
  --accent-warning: #fbbc04;

  --text-primary: #e3e3e3;
  --text-secondary: #9aa0a6;
  --text-muted: #80868b;

  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 24px;
  --radius-full: 9999px;
  --radius-gemini: 24px;

  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 20px 50px rgba(0, 0, 0, 0.65);
  --shadow-glow: 0 0 25px rgba(66, 133, 244, 0.4);
  --shadow-glass: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 8px 32px rgba(0, 0, 0, 0.4);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --header-height: 60px;
  --toolbar-width: 68px;
  --inspector-width: 375px;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
}

html {
  overflow-x: hidden;
  overflow-y: auto;
  scroll-behavior: smooth;
  height: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-darkest);
  color: var(--text-primary);
  min-height: 100vh; min-height: 100dvh; height: 100dvh;
  width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  position: relative;
  scroll-behavior: smooth;
}

/* Universal Responsive Media, Embeds, & Vectors */
img, video, canvas:not(#mainCanvas), iframe, embed, object {
  max-width: 100%;
  height: auto;
}

svg {
  max-width: 100%;
}

/* ==========================================================================
   Ambient Aurora Mesh & Glassmorphism Atmosphere
   ========================================================================== */

.ambient-bg-image,
.ambient-glow,
.glow-1,
.glow-2,
.glow-3,
.glow-4,
.ambient-grid-overlay {
  display: none !important;
}

.aurora-bg-container,
.side-rays-container,
.particles-bg-container,
.galaxy-bg-container {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  pointer-events: none !important;
  z-index: 0 !important;
  overflow: hidden !important;
}

@keyframes auroraFloat1 {
  0% { transform: translate(0, 0) scale(1) rotate(0deg); }
  50% { transform: translate(70px, 45px) scale(1.15) rotate(45deg); }
  100% { transform: translate(-45px, 90px) scale(0.92) rotate(90deg); }
}

@keyframes auroraFloat2 {
  0% { transform: translate(0, 0) scale(1) rotate(0deg); }
  50% { transform: translate(-90px, -60px) scale(1.18) rotate(-60deg); }
  100% { transform: translate(50px, -80px) scale(0.94) rotate(-120deg); }
}

@keyframes auroraFloat3 {
  0% { transform: translate(0, 0) scale(0.95); opacity: 0.35; }
  50% { transform: translate(-60px, 70px) scale(1.22); opacity: 0.6; }
  100% { transform: translate(60px, -50px) scale(1); opacity: 0.35; }
}

input, textarea, select, button {
  font-family: inherit;
  color: inherit;
  outline: none;
}

input[type="text"], textarea, select {
  user-select: text;
}

/* ==========================================================================
   Header Styles (Frosted Glass)
   ========================================================================== */

.app-header {
  height: var(--header-height);
  background: rgba(10, 14, 25, 0.65);
  backdrop-filter: blur(24px) saturate(190%);
  -webkit-backdrop-filter: blur(24px) saturate(190%);
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 100;
  flex-shrink: 0;
  position: relative;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 20px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.logo-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.15rem;
  box-shadow: var(--shadow-glow);
}

.brand-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.badge-ai {
  font-size: 0.65rem;
  font-weight: 800;
  background: linear-gradient(135deg, #ec4899, #8b5cf6);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  color: white;
  letter-spacing: 0.05em;
}

.brand-subtitle {
  display: block;
  font-size: 0.7rem;
  color: var(--text-secondary);
  font-weight: 400;
}

.document-info {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(12px);
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.doc-name {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-primary);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dim-badge {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.header-center {
  display: flex;
  align-items: center;
}

.quick-tools {
  display: flex;
  align-items: center;
  background: rgba(14, 20, 35, 0.6);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 4px 8px;
  gap: 4px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.zoom-value {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 48px;
  text-align: center;
}

.divider-vertical {
  width: 1px;
  height: 20px;
  background: var(--border-color);
  margin: 0 4px;
}

.pdf-page-controls {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.pdf-page-badge {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  font-weight: 600;
  color: #c7d2fe;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.35);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.pdf-page-badge i {
  color: #ef4444;
}

.canvas-viewport.drag-active,
.empty-dropzone.drag-active {
  border: 2px dashed var(--accent-primary) !important;
  background: rgba(99, 102, 241, 0.08) !important;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ==========================================================================
   Buttons & Badges
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-primary {
  background: var(--accent-gradient);
  color: white;
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.btn-primary:hover {
  opacity: 0.95;
  transform: translateY(-1px);
  box-shadow: 0 6px 22px rgba(99, 102, 241, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.045);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 2px 8px rgba(0, 0, 0, 0.2);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 4px 14px rgba(0, 0, 0, 0.25);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.16);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  backdrop-filter: blur(10px);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.3);
  border-color: rgba(239, 68, 68, 0.5);
}

.btn-large {
  padding: 12px 24px;
  font-size: 0.95rem;
  border-radius: var(--radius-lg);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.75rem;
  border-radius: var(--radius-sm);
}

.icon-btn {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
  color: var(--text-secondary);
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s ease;
}

.icon-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.icon-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.toggle-btn {
  width: auto;
  padding: 0 12px;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 500;
}

.toggle-btn.active {
  background: var(--accent-gradient);
  color: white;
  box-shadow: 0 0 14px rgba(99, 102, 241, 0.4);
}

.badge-tag {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: rgba(99, 102, 241, 0.18);
  color: #c7d2fe;
  border: 1px solid rgba(99, 102, 241, 0.35);
  backdrop-filter: blur(8px);
}

/* ==========================================================================
   Main Application Layout
   ========================================================================== */

.app-main {
  flex: 1;
  display: flex;
  position: relative;
  min-height: calc(100vh - var(--header-height) - 32px);
  z-index: 2;
  overflow: visible;
}

/* Left Toolbar (Glass) */
.left-toolbar {
  width: var(--toolbar-width);
  background: rgba(10, 14, 26, 0.6);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border-right: 1px solid var(--border-color);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 10px 8px;
  z-index: 50;
  flex-shrink: 0;
  position: sticky;
  top: var(--header-height);
  max-height: calc(100vh - var(--header-height) - 32px);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
  align-self: flex-start;
}

.left-toolbar::-webkit-scrollbar {
  width: 3px;
}
.left-toolbar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 3px;
}

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

.tool-btn {
  width: 52px;
  height: 52px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}

.tool-btn i {
  font-size: 1.15rem;
}

.tool-label {
  font-size: 0.62rem;
  font-weight: 600;
}

.tool-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
  transform: translateY(-1px);
}

.tool-btn.active {
  background: rgba(99, 102, 241, 0.22);
  border-color: var(--accent-primary);
  color: #c7d2fe;
  box-shadow: 0 0 16px rgba(99, 102, 241, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.tool-btn.btn-tool-clear:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.35);
  color: #fca5a5;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.25);
}

.pulse-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 7px;
  height: 7px;
  background: #10b981;
  border-radius: 50%;
  animation: pulseGlow 1.8s infinite;
}

@keyframes pulseGlow {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; box-shadow: 0 0 8px #10b981; }
  100% { transform: scale(0.9); opacity: 0.7; }
}

.tool-btn.danger:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: var(--accent-danger);
  color: #fca5a5;
}

/* ==========================================================================
   Canvas Viewport
   ========================================================================== */

.canvas-viewport {
  flex: 1;
  background: transparent;
  position: relative;
  overflow-y: auto;
  overflow-x: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  z-index: 2;
  min-height: calc(100vh - var(--header-height) - 32px);
  padding: 24px 16px 48px 16px;
  scroll-behavior: smooth;
}

.empty-dropzone {
  max-width: 640px;
  width: 90%;
  margin: auto 0;
  padding: 30px 10px 70px 10px;
  text-align: center;
  z-index: 10;
}

/* Interactive Canvas Stage & Viewport Rendering */
.canvas-stage {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.7), 0 0 50px rgba(99, 102, 241, 0.15);
  border-radius: 4px;
  background-image: 
    linear-gradient(45deg, #1e293b 25%, transparent 25%), 
    linear-gradient(-45deg, #1e293b 25%, transparent 25%), 
    linear-gradient(45deg, transparent 75%, #1e293b 75%), 
    linear-gradient(-45deg, transparent 75%, #1e293b 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
  background-color: #0f172a;
  user-select: none;
  -webkit-user-select: none;
  z-index: 4;
}

#mainCanvas {
  display: block;
  width: 100%;
  height: 100%;
}

.canvas-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 30;
}

.canvas-overlay > * {
  pointer-events: auto;
}

/* Inpaint Selection Bounding Box */
.inpaint-selection-box {
  position: absolute;
  border: 2px dashed #38bdf8;
  background: rgba(56, 189, 248, 0.18);
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.4);
  pointer-events: none;
  border-radius: 4px;
}

/* Adobe Scan Style Document Crop Overlay */
.adobe-scan-mask {
  position: absolute;
  background: rgba(10, 15, 29, 0.65);
  pointer-events: none;
  z-index: 30;
}

.adobe-scan-crop-box {
  position: absolute;
  border: 2px solid #38bdf8;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6), 0 0 25px rgba(56, 189, 248, 0.5);
  cursor: move;
  pointer-events: auto;
  z-index: 35;
  background: rgba(56, 189, 248, 0.04);
}

.adobe-scan-grid-h1,
.adobe-scan-grid-h2,
.adobe-scan-grid-v1,
.adobe-scan-grid-v2 {
  position: absolute;
  pointer-events: none;
  border: none;
  opacity: 0.35;
}
.adobe-scan-grid-h1 { top: 33.33%; left: 0; right: 0; height: 1px; border-top: 1px dashed #ffffff; }
.adobe-scan-grid-h2 { top: 66.66%; left: 0; right: 0; height: 1px; border-top: 1px dashed #ffffff; }
.adobe-scan-grid-v1 { left: 33.33%; top: 0; bottom: 0; width: 1px; border-left: 1px dashed #ffffff; }
.adobe-scan-grid-v2 { left: 66.66%; top: 0; bottom: 0; width: 1px; border-left: 1px dashed #ffffff; }

/* 8-Way Adobe Scan Crop Handles */
.crop-handle {
  position: absolute;
  background: #ffffff;
  border: 2.5px solid #0284c7;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.7), 0 0 8px rgba(56, 189, 248, 0.6);
  z-index: 45;
  pointer-events: auto;
  touch-action: none;
  transition: transform 0.15s ease, background 0.15s ease;
}
.crop-handle:hover {
  transform: scale(1.3);
  background: #e0f2fe;
  border-color: #38bdf8;
}

/* Corner Handles: Disc handles */
.crop-handle.handle-nw { top: -8px; left: -8px; width: 16px; height: 16px; border-radius: 50%; cursor: nwse-resize; }
.crop-handle.handle-ne { top: -8px; right: -8px; width: 16px; height: 16px; border-radius: 50%; cursor: nesw-resize; }
.crop-handle.handle-sw { bottom: -8px; left: -8px; width: 16px; height: 16px; border-radius: 50%; cursor: nesw-resize; }
.crop-handle.handle-se { bottom: -8px; right: -8px; width: 16px; height: 16px; border-radius: 50%; cursor: nwse-resize; }

/* Edge Midpoint Side Handles: Pill handles */
.crop-handle.handle-n { top: -6px; left: calc(50% - 15px); width: 30px; height: 10px; border-radius: 6px; cursor: ns-resize; }
.crop-handle.handle-s { bottom: -6px; left: calc(50% - 15px); width: 30px; height: 10px; border-radius: 6px; cursor: ns-resize; }
.crop-handle.handle-w { top: calc(50% - 15px); left: -6px; width: 10px; height: 30px; border-radius: 6px; cursor: ew-resize; }
.crop-handle.handle-e { top: calc(50% - 15px); right: -6px; width: 10px; height: 30px; border-radius: 6px; cursor: ew-resize; }

/* Transform Gizmo & Handles */
.transform-box {
  position: absolute;
  border: 1.5px solid #818cf8;
  box-shadow: 0 0 14px rgba(99, 102, 241, 0.45);
  pointer-events: auto;
  cursor: move;
  z-index: 35;
}

.transform-handle {
  position: absolute;
  width: 12px;
  height: 12px;
  background: #ffffff;
  border: 2px solid #4f46e5;
  border-radius: 3px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.55);
  z-index: 40;
  pointer-events: auto;
  touch-action: none;
}

.transform-handle::after {
  content: '';
  position: absolute;
  top: -6px;
  left: -6px;
  right: -6px;
  bottom: -6px;
}

.transform-handle.handle-nw { top: -6px; left: -6px; cursor: nwse-resize; }
.transform-handle.handle-ne { top: -6px; right: -6px; cursor: nesw-resize; }
.transform-handle.handle-sw { bottom: -6px; left: -6px; cursor: nesw-resize; }
.transform-handle.handle-se { bottom: -6px; right: -6px; cursor: nwse-resize; }
.transform-handle.handle-n { top: -6px; left: calc(50% - 6px); cursor: ns-resize; }
.transform-handle.handle-s { bottom: -6px; left: calc(50% - 6px); cursor: ns-resize; }
.transform-handle.handle-w { top: calc(50% - 6px); left: -6px; cursor: ew-resize; }
.transform-handle.handle-e { top: calc(50% - 6px); right: -6px; cursor: ew-resize; }

.handle-rot-stem {
  position: absolute;
  top: -20px;
  left: calc(50% - 0.5px);
  width: 1px;
  height: 15px;
  background: #818cf8;
}

.handle-rot {
  position: absolute;
  top: -28px;
  left: calc(50% - 6px);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #6366f1;
  border: 2px solid #ffffff;
  cursor: grab;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

/* Before / After Split Slider Line & Knob */
.split-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #ffffff;
  z-index: 20;
  cursor: ew-resize;
  transform: translateX(-50%);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.6);
}

.split-knob {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #0f172a;
  border: 2px solid #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
}

/* Final welcome-surface overrides follow the editor's legacy modal rules. */
.tap-to-begin-overlay {
  justify-content: flex-start;
  cursor: default;
  user-select: auto;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.tap-to-begin-overlay.welcome-public-page { justify-content: flex-start !important; }
@media (max-width: 640px) {
  .tap-to-begin-overlay { padding: 0 18px 22px; }
}

.split-tag {
  position: absolute;
  top: 12px;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.split-tag.left-tag {
  right: 12px;
  background: rgba(0, 0, 0, 0.7);
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.split-tag.right-tag {
  left: 12px;
  background: rgba(99, 102, 241, 0.85);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
}

.dropzone-card {
  background: rgba(13, 18, 32, 0.58);
  border: 2px dashed rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-lg);
  padding: 52px 36px;
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45), 0 0 40px rgba(99, 102, 241, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.12);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.dropzone-card.drag-over {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.16);
  transform: scale(1.02);
  box-shadow: 0 0 40px rgba(99, 102, 241, 0.4);
}



.drop-icon-wrapper {
  width: 72px;
  height: 72px;
  background: var(--accent-gradient);
  border-radius: var(--radius-lg);
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: white;
  box-shadow: var(--shadow-glow);
}

.dropzone-card h2 {
  font-size: 1.45rem;
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.dropzone-card p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 28px;
}

.drop-actions-grid,
.drop-actions-single {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 26px;
}

.drop-action-btn-main {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 1rem;
  font-weight: 700;
  padding: 16px 36px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.35);
}

.drop-action-btn-main:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(99, 102, 241, 0.5);
}

.drop-action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.84rem;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.drop-action-btn:hover {
  transform: translateY(-2px);
}

/* Glowing Amber Vintage Car Button */
.btn-amber-glow {
  background: linear-gradient(135deg, #d97706 0%, #ea580c 50%, #b45309 100%);
  color: #ffffff;
  border: 1px solid rgba(251, 191, 36, 0.4);
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(217, 119, 6, 0.35), 0 0 16px rgba(234, 88, 12, 0.25);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-amber-glow:hover {
  background: linear-gradient(135deg, #f59e0b 0%, #ea580c 50%, #c2410c 100%);
  border-color: #fbbf24;
  box-shadow: 0 6px 24px rgba(245, 158, 11, 0.5), 0 0 20px rgba(234, 88, 12, 0.35);
  transform: translateY(-2px);
}

/* Header Put Image Dropdown */
.header-dropdown-wrap {
  position: relative;
}

.header-menu-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: 260px;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-md);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 30px rgba(99, 102, 241, 0.2);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 1000;
  animation: dropdownSlideIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.menu-dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: transparent;
  border: 1px solid transparent;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.18s ease;
  width: 100%;
  text-align: left;
  color: #f1f5f9;
}

.menu-dropdown-item i {
  font-size: 1rem;
  color: #818cf8;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

.menu-dropdown-item div {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.menu-dropdown-item strong {
  font-size: 0.78rem;
  font-weight: 700;
  color: #ffffff;
}

.menu-dropdown-item span {
  font-size: 0.65rem;
  color: #94a3b8;
}

.menu-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateX(2px);
}

.menu-dropdown-item.highlight-amber i {
  color: #fbbf24;
}

.menu-dropdown-item.highlight-amber:hover {
  background: rgba(217, 119, 6, 0.15);
  border-color: rgba(245, 158, 11, 0.3);
}

/* URL Preview Box */
.url-preview-box {
  margin-top: 12px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.4);
  max-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.url-preview-box img {
  max-width: 100%;
  max-height: 200px;
  object-fit: contain;
}

/* Vintage Car Year Badge in Gallery */
.sample-year-tag {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(217, 119, 6, 0.85);
  border: 1px solid rgba(251, 191, 36, 0.4);
  color: #fef3c7;
  font-size: 0.62rem;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  gap: 4px;
}

.feature-badges {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 18px;
  border-top: 1px solid var(--border-color);
}

.feat-pill {
  font-size: 0.72rem;
  font-weight: 500;
  background: var(--bg-surface);
  color: var(--text-secondary);
  padding: 4px 10px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--border-color);
}

.feat-pill i {
  color: var(--accent-green);
  font-size: 0.65rem;
}

/* Interactive Canvas Stage */
.canvas-stage {
  position: absolute;
  transform-origin: 0 0;
  box-shadow: var(--shadow-lg), 0 0 0 1px var(--border-color);
  user-select: none;
}

#mainCanvas {
  display: block;
  image-rendering: auto;
  background-color: #0b0c10;
}

.canvas-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Transform Gizmo / Selection Box */
.transform-box {
  position: absolute;
  border: 1.5px dashed var(--accent-primary);
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.25);
  pointer-events: all;
  cursor: move;
  background: transparent;
}

.transform-handle {
  position: absolute;
  width: 8px;
  height: 8px;
  background: var(--accent-primary);
  border: 1.5px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  pointer-events: all;
  transition: transform 0.1s ease;
}

.transform-handle:hover {
  transform: scale(1.3);
}

.handle-nw { top: -5px; left: -5px; cursor: nwse-resize; }
.handle-ne { top: -5px; right: -5px; cursor: nesw-resize; }
.handle-sw { bottom: -5px; left: -5px; cursor: nesw-resize; }
.handle-se { bottom: -5px; right: -5px; cursor: nwse-resize; }
.handle-n  { top: -5px; left: calc(50% - 4px); cursor: ns-resize; }
.handle-s  { bottom: -5px; left: calc(50% - 4px); cursor: ns-resize; }
.handle-w  { left: -5px; top: calc(50% - 4px); cursor: ew-resize; }
.handle-e  { right: -5px; top: calc(50% - 4px); cursor: ew-resize; }

.handle-rot {
  top: -22px;
  left: calc(50% - 5px);
  width: 10px;
  height: 10px;
  background: #ec4899;
  border: 1.5px solid white;
  border-radius: 50%;
  cursor: grab;
}

.handle-rot-stem {
  position: absolute;
  top: -16px;
  left: 50%;
  width: 1px;
  height: 16px;
  background: var(--accent-primary);
}

/* Inpaint Box Selector on canvas */
.inpaint-selection-box {
  position: absolute;
  border: 1.5px dashed var(--accent-secondary);
  background: rgba(6, 182, 212, 0.08);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.15);
  pointer-events: none;
}

/* Before / After Split Handle */
.split-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: white;
  box-shadow: 0 0 10px rgba(0,0,0,0.8);
  cursor: ew-resize;
  pointer-events: all;
  z-index: 60;
}

.split-knob {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: white;
  color: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  box-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.split-tag {
  position: absolute;
  top: 14px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.7);
  color: white;
  backdrop-filter: blur(4px);
  letter-spacing: 0.05em;
}

.left-tag { right: 14px; }
.right-tag { left: 14px; }

/* Eyedropper Loupe */
.eyedropper-loupe {
  position: absolute;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 3px solid white;
  box-shadow: 0 8px 30px rgba(0,0,0,0.7);
  overflow: hidden;
  pointer-events: none;
  z-index: 90;
  transform: translate(-50%, -50%);
  background: black;
}

#loupeCanvas {
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

.loupe-crosshair {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 10px;
  height: 10px;
  border: 1.5px solid white;
  box-shadow: 0 0 2px black;
  border-radius: 2px;
}

.loupe-info {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.85);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-size: 0.68rem;
  font-family: var(--font-mono);
  color: white;
}

/* Floating Toolbars */
.floating-toolbar {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(24, 29, 43, 0.92);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-lg);
  z-index: 70;
  font-size: 0.8rem;
}

.floating-toolbar label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
}

.float-title {
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.floating-tip {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(19, 23, 34, 0.9);
  border: 1px solid var(--border-color);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
  backdrop-filter: blur(8px);
  box-shadow: var(--shadow-sm);
  z-index: 40;
  transition: opacity 0.3s ease;
}

.floating-tip i {
  color: var(--accent-secondary);
}

/* ==========================================================================
   Right Inspector & Panels (Frosted Glass)
   ========================================================================== */

.right-inspector {
  width: var(--inspector-width);
  background: rgba(10, 14, 26, 0.62);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border-left: 1px solid var(--border-color);
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 95;
  flex-shrink: 0;
  position: sticky;
  top: var(--header-height);
  height: calc(100vh - var(--header-height));
  max-height: calc(100vh - var(--header-height));
  align-self: flex-start;
}

.inspector-tabs {
  display: flex;
  background: rgba(12, 17, 30, 0.55);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
}

.tab-btn {
  flex: 1;
  background: transparent;
  border: none;
  padding: 13px 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-bottom: 2px solid transparent;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.035);
}

.tab-btn.active {
  color: #c7d2fe;
  border-bottom-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.12);
  box-shadow: inset 0 -2px 10px rgba(99, 102, 241, 0.2);
}

.tab-pane {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 16px 90px 16px;
  display: none;
  flex-direction: column;
  gap: 14px;
}

.tab-pane.active {
  display: flex;
}

/* Scrollbar styling */
.tab-pane::-webkit-scrollbar,
.sample-gallery-grid::-webkit-scrollbar,
.text-style-presets-grid::-webkit-scrollbar,
.layer-list::-webkit-scrollbar {
  width: 5px;
}
.tab-pane::-webkit-scrollbar-track,
.sample-gallery-grid::-webkit-scrollbar-track,
.text-style-presets-grid::-webkit-scrollbar-track,
.layer-list::-webkit-scrollbar-track {
  background: transparent;
}
.tab-pane::-webkit-scrollbar-thumb,
.sample-gallery-grid::-webkit-scrollbar-thumb,
.text-style-presets-grid::-webkit-scrollbar-thumb,
.layer-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-full);
}
.tab-pane::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.28);
}

/* Panel Sections (Glass Cards) */
.panel-section {
  background: rgba(255, 255, 255, 0.028);
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 4px 20px rgba(0, 0, 0, 0.15);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.panel-section:hover {
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 6px 24px rgba(0, 0, 0, 0.2);
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-header h3 {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 7px;
  letter-spacing: -0.01em;
}

.section-header h3 i {
  color: var(--accent-primary);
}

.section-subtext {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* Form Controls */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-row {
  display: flex;
  gap: 10px;
}

.form-row.align-center {
  align-items: center;
}

.form-group.half {
  flex: 1;
}

.form-group.flex-1 {
  flex: 1;
}

textarea, input[type="text"], select {
  background: rgba(7, 10, 20, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 8px 11px;
  font-size: 0.8rem;
  backdrop-filter: blur(8px);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.35);
  transition: all 0.2s ease;
  width: 100%;
}

textarea:focus, input[type="text"]:focus, select:focus {
  border-color: var(--border-focus);
  background: rgba(9, 13, 26, 0.85);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25), inset 0 1px 3px rgba(0, 0, 0, 0.3);
}

textarea {
  resize: vertical;
  min-height: 60px;
  line-height: 1.4;
}

.font-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.font-count-badge {
  font-size: 0.65rem;
  font-weight: 600;
  color: #c7d2fe;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  letter-spacing: 0.02em;
}

.font-search-box {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 4px;
}

.font-search-box .search-icon {
  position: absolute;
  left: 10px;
  color: var(--text-muted);
  font-size: 0.75rem;
  pointer-events: none;
}

.font-search-input {
  padding-left: 30px !important;
  padding-right: 28px !important;
  font-size: 0.76rem !important;
  height: 34px;
  background: rgba(9, 13, 24, 0.75) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  transition: all 0.2s ease;
}

.font-search-input:focus {
  border-color: var(--accent-primary) !important;
  background: rgba(14, 19, 36, 0.95) !important;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25) !important;
}

.clear-search-btn {
  position: absolute;
  right: 6px;
  width: 20px;
  height: 20px;
  background: rgba(255, 255, 255, 0.08);
  border: none;
  border-radius: 50%;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.clear-search-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

.font-select-wrapper select {
  cursor: pointer;
}

.custom-font-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px dashed rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.custom-font-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border-color: var(--accent-primary);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.2);
}

/* Sliders (Glass Halo) */
.slider-control {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.slider-control.half {
  flex: 1;
}

.slider-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.slider-label span:last-child {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-primary);
  font-size: 0.7rem;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  outline: none;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.4);
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--accent-gradient);
  border: 1.5px solid #ffffff;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.6);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.25);
  box-shadow: 0 0 14px rgba(99, 102, 241, 0.85);
}

/* Style Button Groups */
.style-button-group {
  display: flex;
  align-items: center;
  background: rgba(7, 10, 20, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 3px;
  gap: 4px;
}

.style-toggle-btn {
  flex: 1;
  height: 28px;
  background: transparent;
  border: none;
  border-radius: 4px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.style-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}

.style-toggle-btn.active {
  background: var(--accent-gradient);
  color: white;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
}

/* Color Picker Box */
.color-picker-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(7, 10, 20, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}

input[type="color"] {
  -webkit-appearance: none;
  border: none;
  width: 26px;
  height: 26px;
  border-radius: 4px;
  cursor: pointer;
  background: transparent;
}

input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

input[type="color"]::-webkit-color-swatch {
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
}

.color-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.quick-action-row {
  display: flex;
  gap: 8px;
}

.quick-action-row .btn {
  flex: 1;
}

/* Edit Scope Segmented Control */
.scope-selection-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.03);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.scope-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
}

.segmented-control {
  display: flex;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 2px;
  gap: 2px;
}

.seg-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 4px 8px;
  font-size: 0.7rem;
  font-weight: 500;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}

.seg-btn:hover {
  color: var(--text-primary);
}

.seg-btn.active {
  background: var(--accent-primary);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(99, 102, 241, 0.3);
}

.batch-action-row {
  margin-top: 8px;
}

.full-width {
  width: 100%;
  justify-content: center;
}

/* Font Scope Actions & Sync Toggle */
.font-scope-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
}

.toggle-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.72rem;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.toggle-checkbox input[type="checkbox"] {
  accent-color: var(--accent-primary);
  cursor: pointer;
  width: 14px;
  height: 14px;
}

.toggle-checkbox:hover {
  color: var(--text-primary);
}

/* Presets */
.preset-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.preset-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 8px;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.preset-btn:hover {
  background: var(--bg-surface-hover);
  border-color: var(--accent-primary);
  transform: translateY(-1px);
}

/* Professional Typography Style Presets Grid */
.text-style-presets-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  max-height: 240px;
  overflow-y: auto;
  padding-right: 4px;
}

.text-style-preset-btn {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  text-align: left;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  color: var(--text-primary);
  position: relative;
  overflow: hidden;
}

.text-style-preset-btn i {
  font-size: 1rem;
  color: var(--accent-primary);
  flex-shrink: 0;
  width: 18px;
  text-align: center;
}

.text-style-preset-btn .preset-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.text-style-preset-btn .preset-name {
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-primary);
}

.text-style-preset-btn .preset-font {
  font-size: 0.65rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.text-style-preset-btn:hover {
  background: rgba(99, 102, 241, 0.1);
  border-color: var(--accent-primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.text-style-preset-btn.active {
  background: rgba(99, 102, 241, 0.18);
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 1px var(--accent-primary), 0 4px 12px rgba(99, 102, 241, 0.25);
}

.text-style-preset-btn.active .preset-name {
  color: #fff;
}

/* ==========================================================================
   Layers Panel
   ========================================================================== */

.layer-actions-top {
  display: flex;
  gap: 6px;
}

.icon-btn-sm {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.icon-btn-sm:hover {
  background: var(--bg-surface-hover);
  color: var(--text-primary);
  border-color: var(--border-light);
}

.layer-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 4px;
}

.layer-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.layer-item:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.14);
  transform: translateY(-1px);
}

.layer-item.active {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.16);
  box-shadow: 0 0 0 1px var(--accent-primary), 0 4px 12px rgba(99, 102, 241, 0.25);
}

.layer-info {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: hidden;
}

.layer-thumb {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  background: #000;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.layer-icon-placeholder {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  background: rgba(7, 10, 20, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-primary);
  font-size: 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.layer-name {
  font-size: 0.78rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 140px;
}

.layer-toggles {
  display: flex;
  align-items: center;
  gap: 4px;
}

.layer-toggle-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  width: 24px;
  height: 24px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.72rem;
  transition: all 0.15s ease;
}

.layer-toggle-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.08);
}

.layer-toggle-btn.active {
  color: var(--text-primary);
}

.layer-controls-bottom {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
  margin-top: 6px;
}

/* ==========================================================================
   Modals (Frosted Glass)
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh; height: 100dvh;
  background: rgba(4, 7, 14, 0.75);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}

.modal-window {
  background: rgba(13, 18, 32, 0.85);
  backdrop-filter: blur(32px) saturate(200%);
  -webkit-backdrop-filter: blur(32px) saturate(200%);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 520px;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.65), 0 0 50px rgba(99, 102, 241, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-window.large {
  max-width: 860px;
}

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

.modal-header h2 {
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-header h2 i {
  color: var(--accent-primary);
}

.btn-close-modal {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
  font-size: 1.1rem;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.btn-close-modal:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.2);
}

.modal-body {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 70vh;
  overflow-y: auto;
}

.modal-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.modal-footer {
  padding: 16px 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  background: rgba(255, 255, 255, 0.02);
}

/* Sample Gallery Grid */
.sample-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.sample-card {
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(12px);
}

.sample-card:hover {
  border-color: var(--accent-primary);
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35), 0 0 20px rgba(99, 102, 241, 0.25);
  background: rgba(255, 255, 255, 0.06);
}

.sample-img-wrap {
  width: 100%;
  height: 140px;
  background: #000;
  position: relative;
  overflow: hidden;
}

.sample-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sample-category {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  color: #a5b4fc;
}

.sample-info {
  padding: 10px 12px;
}

.sample-info h4 {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.sample-info p {
  font-size: 0.72rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Export Radio Cards */
.format-selector {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.radio-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.15s ease;
}

.radio-card input {
  display: none;
}

.radio-card:hover {
  border-color: var(--border-light);
}

.radio-card.active {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.12);
}

.radio-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
}

.radio-desc {
  font-size: 0.68rem;
  color: var(--text-secondary);
  line-height: 1.35;
}

.export-stat-box {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.78rem;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  color: var(--text-secondary);
}

.stat-item strong {
  color: var(--text-primary);
}

/* ==========================================================================
   Toasts
   ========================================================================== */

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
}

.toast {
  background: rgba(24, 29, 43, 0.95);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  color: var(--text-primary);
  font-size: 0.82rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(12px);
  animation: slideInRight 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.success i { color: var(--accent-green); }
.toast.info i { color: var(--accent-secondary); }
.toast.error i { color: var(--accent-danger); }

@keyframes slideInRight {
  from { transform: translateX(50px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ==========================================================================
   Mobile Drawer & Responsiveness Controls
   ========================================================================== */

.mobile-inspector-toggle-btn {
  display: none; /* hidden on desktop */
  position: absolute;
  bottom: 20px;
  right: 20px;
  background: var(--accent-gradient);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-full);
  padding: 10px 18px;
  font-size: 0.84rem;
  font-weight: 700;
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5), 0 0 15px rgba(168, 85, 247, 0.4);
  cursor: pointer;
  z-index: 80;
  align-items: center;
  gap: 8px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.mobile-inspector-toggle-btn:hover {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 8px 26px rgba(99, 102, 241, 0.65);
}

.mobile-drawer-header {
  display: none; /* hidden on desktop */
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: rgba(14, 19, 36, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
}

.drawer-drag-pill {
  position: absolute;
  top: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 36px;
  height: 4px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: var(--radius-full);
}

.drawer-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  color: #f1f5f9;
}

.drawer-header-title i {
  color: var(--accent-primary);
}

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

.btn-close-drawer:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
}

.inspector-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 7, 14, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 150;
  transition: opacity 0.3s ease;
}

/* ==========================================================================
   Comprehensive Multi-Device Responsive System & Breakpoint Tiers
   Breakpoints:
     1. Desktop (min-width: 1025px)
     2. Small Laptop (min-width: 769px and max-width: 1024px)
     3. Tablet (min-width: 577px and max-width: 768px)
     4. Mobile (max-width: 576px)
   ========================================================================== */

/* Universal Touch & Interactive Targets */
@media (pointer: coarse) {
  button,
  .icon-btn,
  .tool-btn,
  a.btn,
  .tab-btn,
  .mobile-nav-link {
    min-height: 44px;
    min-width: 44px;
  }
}

/* Mobile Hamburger Toggle Button (Hidden by default on Desktop) */
.btn-mobile-nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--text-primary);
  font-size: 1.1rem;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-left: 2px;
}

.btn-mobile-nav-toggle:hover,
.btn-mobile-nav-toggle:active {
  background: rgba(99, 102, 241, 0.25);
  border-color: rgba(99, 102, 241, 0.5);
  color: #8ab4f8;
}

/* Mobile Navigation Drawer & Backdrop */
.mobile-nav-backdrop {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh; height: 100dvh;
  background: rgba(3, 7, 18, 0.72);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  z-index: 9998;
  animation: navFadeIn 0.18s ease-out;
}

@keyframes navFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.mobile-nav-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(340px, 88vw);
  height: 100vh; height: 100dvh;
  background: #0e1424;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-left: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: -8px 0 35px rgba(0, 0, 0, 0.75);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  transform: translate3d(105%, 0, 0) !important;
  transition: transform 0.26s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.26s;
  will-change: transform;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  visibility: hidden;
  pointer-events: none;
}

.mobile-nav-drawer.drawer-open {
  transform: translate3d(0, 0, 0) !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

.mobile-nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.02);
}

.mobile-nav-header .logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mobile-nav-header .logo-icon {
  width: 32px;
  height: 32px;
  font-size: 1rem;
}

.mobile-nav-header .brand-title {
  font-size: 0.95rem;
}

.mobile-nav-content {
  padding: 20px 16px 44px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.mobile-nav-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 10px;
  padding-left: 4px;
}

.mobile-nav-tools-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.mobile-nav-tool-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 6px;
  min-height: 56px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: var(--text-primary);
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.mobile-nav-tool-btn i {
  font-size: 1.15rem;
  color: #8ab4f8;
}

.mobile-nav-tool-btn.primary {
  background: rgba(99, 102, 241, 0.2);
  border-color: rgba(99, 102, 241, 0.4);
}
.mobile-nav-tool-btn.primary i {
  color: #a5b4fc;
}

.mobile-nav-tool-btn.danger {
  background: rgba(239, 68, 68, 0.14);
  border-color: rgba(239, 68, 68, 0.3);
}
.mobile-nav-tool-btn.danger i {
  color: #f87171;
}

.mobile-nav-tool-btn:hover,
.mobile-nav-tool-btn:active {
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  min-height: 46px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.18s ease;
}

.mobile-nav-link i {
  font-size: 1rem;
  color: #8ab4f8;
  width: 20px;
  text-align: center;
}

.mobile-nav-link:hover,
.mobile-nav-link:active {
  color: #ffffff;
  background: rgba(99, 102, 241, 0.16);
  border-color: rgba(99, 102, 241, 0.35);
  transform: translateX(3px);
}

.mobile-nav-theme-btn {
  width: 100%;
  padding: 13px;
  min-height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
}

/* Light Theme overrides for Mobile Nav */
html[data-theme="light"] .mobile-nav-drawer,
body.light-theme .mobile-nav-drawer {
  background: rgba(248, 250, 252, 0.98) !important;
  border-left-color: rgba(0, 0, 0, 0.1) !important;
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.15) !important;
}

html[data-theme="light"] .mobile-nav-header,
body.light-theme .mobile-nav-header {
  border-bottom-color: rgba(0, 0, 0, 0.08) !important;
}

html[data-theme="light"] .mobile-nav-tool-btn,
body.light-theme .mobile-nav-tool-btn {
  background: rgba(0, 0, 0, 0.04) !important;
  border-color: rgba(0, 0, 0, 0.08) !important;
  color: #1e293b !important;
}

html[data-theme="light"] .mobile-nav-link,
body.light-theme .mobile-nav-link {
  background: rgba(0, 0, 0, 0.03) !important;
  border-color: rgba(0, 0, 0, 0.06) !important;
  color: #334155 !important;
}

html[data-theme="light"] .btn-mobile-nav-toggle,
body.light-theme .btn-mobile-nav-toggle {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.1);
  color: #1e293b;
}

/* --------------------------------------------------------------------------
   BREAKPOINT 1: Desktop (1025px and above)
   -------------------------------------------------------------------------- */
@media (min-width: 1025px) {
  :root {
    --toolbar-width: 68px;
    --inspector-width: 375px;
    --header-height: 60px;
  }

  .btn-mobile-nav-toggle {
    display: none !important;
  }

  .mobile-only-tool-btn {
    display: none !important;
  }

  .mobile-inspector-toggle-btn {
    display: none !important;
  }

  .mobile-drawer-header {
    display: none !important;
  }

  .app-header {
    height: var(--header-height);
    padding: 0 20px;
  }

  .left-toolbar {
    width: var(--toolbar-width);
    position: relative;
    border-right: 1px solid var(--border-color);
  }

  .right-inspector {
    width: var(--inspector-width);
    position: sticky;
    top: var(--header-height);
    height: calc(100vh - var(--header-height));
    max-height: calc(100vh - var(--header-height));
    transform: none !important;
    border-left: 1px solid var(--border-color);
    z-index: 95;
  }

  .canvas-viewport {
    width: calc(100vw - var(--toolbar-width) - var(--inspector-width));
    height: calc(100vh - var(--header-height) - 32px);
  }

  .app-persistent-footer {
    display: flex;
    left: var(--toolbar-width, 68px) !important;
    right: var(--inspector-width, 320px) !important;
    width: auto !important;
    z-index: 45 !important;
  }
}

/* --------------------------------------------------------------------------
   BREAKPOINT 2: Small Laptops (769px to 1024px)
   -------------------------------------------------------------------------- */
@media (min-width: 769px) and (max-width: 1024px) {
  :root {
    --toolbar-width: 58px;
    --inspector-width: 290px;
    --header-height: 56px;
  }

  .btn-mobile-nav-toggle {
    display: none !important;
  }

  .mobile-only-tool-btn {
    display: none !important;
  }

  .mobile-inspector-toggle-btn {
    display: none !important;
  }

  .mobile-drawer-header {
    display: none !important;
  }

  .app-header {
    height: var(--header-height);
    padding: 0 12px;
  }

  .brand-subtitle {
    display: none;
  }

  .quick-tools {
    gap: 3px;
    padding: 3px 6px;
  }

  .quick-tools .icon-btn {
    width: 32px;
    height: 32px;
  }

  .zoom-value {
    min-width: 38px;
    font-size: 0.72rem;
  }

  .left-toolbar {
    width: var(--toolbar-width);
    position: relative;
  }

  .tool-btn {
    width: 48px;
    height: 48px;
  }

  .tool-label {
    font-size: 0.6rem;
  }

  .right-inspector {
    width: var(--inspector-width);
    position: sticky;
    top: var(--header-height);
    height: calc(100vh - var(--header-height));
    max-height: calc(100vh - var(--header-height));
    transform: none !important;
    border-left: 1px solid var(--border-color);
    z-index: 95;
  }

  .canvas-viewport {
    width: calc(100vw - var(--toolbar-width) - var(--inspector-width));
    height: calc(100vh - var(--header-height) - 32px);
  }

  .empty-dropzone {
    max-width: min(580px, 92vw);
    width: 90%;
  }

  .dropzone-card {
    padding: 36px 24px;
  }

  .dropzone-card h2 {
    font-size: 1.3rem;
  }

  .app-persistent-footer {
    display: flex;
    left: var(--toolbar-width, 58px) !important;
    right: var(--inspector-width, 290px) !important;
    width: auto !important;
    z-index: 45 !important;
    padding: 0 12px !important;
    font-size: 11px !important;
  }
}

/* --------------------------------------------------------------------------
   BREAKPOINT 3: Tablet Devices (577px to 768px)
   -------------------------------------------------------------------------- */
@media (min-width: 577px) and (max-width: 768px) {
  :root {
    --header-height: 54px;
    --toolbar-height: 60px;
  }

  body {
    overflow: hidden;
  }

  .btn-mobile-nav-toggle {
    display: inline-flex !important;
  }

  .app-header {
    height: var(--header-height);
    padding: 0 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
  }

  .brand-subtitle {
    display: none;
  }

  .brand-title {
    font-size: 0.88rem;
  }

  .header-center {
    flex: 1;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    display: flex;
    justify-content: center;
  }

  .header-center::-webkit-scrollbar {
    display: none;
  }

  .quick-tools {
    flex-shrink: 0;
    gap: 3px;
    padding: 2px 6px;
  }

  .quick-tools .icon-btn {
    width: 32px;
    height: 32px;
  }

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

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

  #btnOpenExportModal {
    height: 34px !important;
    padding: 0 10px !important;
    font-size: 0.76rem !important;
    border-radius: 17px !important;
  }

  .app-main {
    flex-direction: column;
    height: calc(100vh - var(--header-height));
    position: relative;
  }

  /* Left Toolbar docked horizontally to bottom */
  .left-toolbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100vw;
    height: var(--toolbar-height);
    background: rgba(10, 14, 26, 0.96);
    backdrop-filter: blur(28px) saturate(200%);
    -webkit-backdrop-filter: blur(28px) saturate(200%);
    border-top: 1px solid var(--border-color);
    border-right: none;
    flex-direction: row;
    justify-content: flex-start;
    padding: 4px 10px;
    z-index: 100;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
  }

  .left-toolbar::-webkit-scrollbar {
    display: none;
  }

  .left-toolbar .tool-group {
    flex-direction: row;
    gap: 6px;
    width: max-content;
    align-items: center;
    padding: 0 16px 0 4px;
  }

  .tool-btn {
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    flex-shrink: 0;
    border-radius: 14px !important;
  }

  .mobile-only-tool-btn {
    display: flex !important;
  }

  .canvas-viewport {
    width: 100vw;
    height: calc(100vh - var(--header-height) - var(--toolbar-height));
    overflow: auto;
  }

  /* Right Inspector bottom sheet */
  .right-inspector {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100vw !important;
    height: 80vh !important;
    max-height: 85vh !important;
    background: #0b101e !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border-left: none !important;
    border-top: 1px solid rgba(255, 255, 255, 0.16) !important;
    border-radius: 22px 22px 0 0 !important;
    box-shadow: 0 -6px 28px rgba(0, 0, 0, 0.65) !important;
    z-index: 250 !important;
    transform: translate3d(0, 105%, 0) !important;
    transition: transform 0.2s cubic-bezier(0, 0, 0.2, 1) !important;
    will-change: transform;
    contain: paint;
  }

  .right-inspector.drawer-open {
    transform: translate3d(0, 0, 0) !important;
  }

  .mobile-drawer-header {
    display: flex;
  }

  .empty-dropzone {
    max-width: min(600px, 94vw);
    width: 92%;
    padding: 20px;
  }

  .dropzone-card {
    padding: 32px 20px;
  }

  .floating-toolbar {
    bottom: calc(var(--toolbar-height) + 12px) !important;
    width: calc(100vw - 24px) !important;
    max-width: calc(100vw - 24px) !important;
    left: 12px !important;
    transform: none !important;
    flex-wrap: wrap;
    padding: 8px 12px;
    z-index: 105 !important;
  }

  .modal-window {
    width: min(540px, 95vw) !important;
  }

  .mobile-inspector-toggle-btn {
    display: inline-flex !important;
    position: fixed !important;
    bottom: calc(var(--toolbar-height) + 12px) !important;
    right: 12px !important;
    z-index: 120 !important;
    min-height: 44px;
    border-radius: 22px;
  }

  .crop-floating-toolbar {
    bottom: calc(var(--toolbar-height, 58px) + 10px) !important;
    top: auto !important;
    left: 12px !important;
    right: 12px !important;
    width: auto !important;
    max-width: calc(100vw - 24px) !important;
    z-index: 115 !important;
    max-height: 48vh;
    overflow-y: auto;
  }

  .app-persistent-footer {
    display: none !important;
  }
}

/* --------------------------------------------------------------------------
   BREAKPOINT 4: Mobile Phones (576px and below, including 375px & 390px)
   -------------------------------------------------------------------------- */
@media (max-width: 576px) {
  :root {
    --header-height: 50px;
    --toolbar-height: 58px;
  }

  html, body {
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }

  body {
    overflow-y: hidden;
  }

  /* Compact Sleek Header with Zero Horizontal Overflow */
  .app-header {
    height: var(--header-height);
    padding: 0 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
  }

  .header-left {
    flex-shrink: 0;
    gap: 6px;
  }

  /* Remove circle icon next to Text Editor on mobile screens */
  .header-left .logo-icon {
    display: none !important;
  }

  .brand-title {
    font-size: clamp(0.76rem, 3.4vw, 0.88rem);
    white-space: nowrap;
  }

  .brand-subtitle {
    display: none !important;
  }

  .badge-ai {
    font-size: 0.52rem;
    padding: 1px 3px;
  }

  .badge-pro-text {
    display: none !important;
  }

  /* Center quick tools moved to Mobile Drawer on small screens to eliminate squeeze */
  .header-center {
    display: none !important;
  }

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

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

  #btnOpenExportModal {
    width: auto !important;
    height: 34px !important;
    min-width: unset !important;
    min-height: 34px !important;
    padding: 0 12px !important;
    border-radius: 8px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    font-size: 0.78rem !important;
    font-weight: 700 !important;
  }

  #btnOpenExportModal .btn-export-text {
    display: inline !important;
    font-size: 0.76rem !important;
  }

  .theme-toggle-btn {
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  #btnRefreshWorkspace {
    display: inline-flex !important;
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    border-radius: 50% !important;
    align-items: center !important;
    justify-content: center !important;
    touch-action: manipulation !important;
    cursor: pointer !important;
  }

  .btn-mobile-nav-toggle {
    display: inline-flex !important;
    width: 44px !important;
    height: 44px !important;
    min-width: 44px !important;
    min-height: 44px !important;
  }

  .app-main {
    flex-direction: column;
    height: calc(100vh - var(--header-height));
    position: relative;
    width: 100vw;
    max-width: 100vw;
    overflow-x: hidden;
  }

  /* Touch-scrollable bottom docked toolbar */
  .left-toolbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100vw;
    max-width: 100vw;
    height: var(--toolbar-height);
    background: rgba(10, 14, 26, 0.97);
    backdrop-filter: blur(28px) saturate(200%);
    -webkit-backdrop-filter: blur(28px) saturate(200%);
    border-top: 1px solid var(--border-color);
    border-right: none;
    flex-direction: row;
    justify-content: flex-start;
    padding: 3px 6px;
    z-index: 100;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x;
    box-sizing: border-box;
  }

  .left-toolbar::-webkit-scrollbar {
    display: none;
  }

  .left-toolbar .tool-group {
    flex-direction: row;
    gap: 4px;
    width: max-content;
    align-items: center;
    padding: 0 20px 0 4px;
  }

  .tool-btn {
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    flex-shrink: 0;
    gap: 2px;
    border-radius: 12px !important;
    padding: 2px;
  }

  .tool-btn i {
    font-size: 1.05rem;
  }

  .tool-label {
    font-size: 0.56rem;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.01em;
  }

  .left-toolbar .divider-horizontal {
    width: 1px !important;
    height: 24px !important;
    margin: 0 2px !important;
    background: rgba(255, 255, 255, 0.15) !important;
  }

  .mobile-only-tool-btn {
    display: flex !important;
  }

  /* Canvas viewport takes remaining height */
  .canvas-viewport {
    width: 100vw;
    max-width: 100vw;
    height: calc(100vh - var(--header-height) - var(--toolbar-height));
    padding: 8px;
    overflow: auto;
    box-sizing: border-box;
  }

  /* Fluid Empty State Dropzone */
  .empty-dropzone {
    width: 94vw !important;
    max-width: 94vw !important;
    padding: 12px !important;
    margin: 0 auto !important;
  }

  .dropzone-card {
    padding: 20px 14px !important;
    border-radius: 18px !important;
  }

  .drop-icon-wrapper {
    width: 56px !important;
    height: 56px !important;
    font-size: 1.5rem !important;
    margin-bottom: 14px !important;
  }

  .dropzone-card h2 {
    font-size: clamp(1.05rem, 4.2vw, 1.25rem) !important;
    margin-bottom: 8px !important;
  }

  .dropzone-card p {
    font-size: 0.78rem !important;
    margin-bottom: 18px !important;
    line-height: 1.5 !important;
  }

  .drop-action-btn-main {
    padding: 13px 14px !important;
    font-size: 0.85rem !important;
    width: 100% !important;
    min-height: 48px !important;
    border-radius: 14px !important;
  }

  .feature-badges {
    gap: 6px !important;
    padding-top: 14px !important;
  }

  .feat-pill {
    font-size: 0.68rem !important;
    padding: 4px 8px !important;
  }

  /* Right Inspector Sliding Bottom Sheet */
  .right-inspector {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    height: 84vh !important;
    max-height: 88vh !important;
    background: #0b101e !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border-left: none !important;
    border-top: 1px solid rgba(255, 255, 255, 0.16) !important;
    border-radius: 20px 20px 0 0 !important;
    box-shadow: 0 -6px 28px rgba(0, 0, 0, 0.7) !important;
    z-index: 250 !important;
    transform: translate3d(0, 105%, 0) !important;
    transition: transform 0.2s cubic-bezier(0, 0, 0.2, 1) !important;
    will-change: transform;
    contain: paint;
  }

  .right-inspector.drawer-open {
    transform: translate3d(0, 0, 0) !important;
  }

  .right-inspector .tab-pane {
    min-height: 0 !important;
    flex: 1 1 0% !important;
    padding: 12px 12px calc(env(safe-area-inset-bottom, 20px) + 95px) 12px !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-y !important;
    overscroll-behavior-y: contain !important;
    scroll-behavior: auto !important;
    will-change: scroll-position !important;
  }

  .mobile-drawer-header {
    display: flex;
  }

  .mobile-inspector-toggle-btn {
    display: inline-flex !important;
    position: fixed !important;
    bottom: calc(var(--toolbar-height) + 12px) !important;
    right: 12px !important;
    z-index: 120 !important;
    min-height: 44px;
    border-radius: 22px;
  }

  .form-row {
    flex-direction: column !important;
    gap: 8px !important;
  }

  .form-group.half,
  .slider-control.half {
    width: 100% !important;
  }

  .color-inline {
    justify-content: flex-start !important;
    gap: 10px !important;
  }

  /* Floating Toolbars on Mobile */
  .floating-toolbar {
    position: fixed !important;
    bottom: calc(var(--toolbar-height) + 10px) !important;
    left: 8px !important;
    right: 8px !important;
    width: auto !important;
    max-width: calc(100vw - 16px) !important;
    min-width: unset !important;
    transform: none !important;
    margin: 0 auto !important;
    flex-wrap: wrap !important;
    padding: 8px 10px !important;
    gap: 6px !important;
    font-size: 0.74rem !important;
    box-sizing: border-box !important;
    z-index: 105 !important;
    border-radius: 14px !important;
  }

  .crop-floating-toolbar {
    bottom: calc(var(--toolbar-height, 58px) + 8px) !important;
    top: auto !important;
    left: 8px !important;
    right: 8px !important;
    max-height: 48vh;
    overflow-y: auto;
    z-index: 115 !important;
  }

  .floating-tip {
    top: 6px;
    width: calc(100vw - 24px);
    font-size: 0.68rem;
    padding: 5px 8px;
  }

  .translation-floating-bar,
  .photoshop-gen-taskbar,
  .gen-taskbar {
    position: fixed !important;
    bottom: calc(var(--toolbar-height) + 10px) !important;
    left: 8px !important;
    right: 8px !important;
    width: auto !important;
    max-width: calc(100vw - 16px) !important;
    min-width: unset !important;
    transform: none !important;
    margin: 0 auto !important;
    padding: 10px 12px !important;
  }

  /* Modals as Responsive Bottom Sheets */
  .modal-overlay {
    padding: 0 !important;
    align-items: flex-end !important;
  }

  .modal-window {
    width: 100vw !important;
    max-width: 100vw !important;
    max-height: 88vh !important;
    border-radius: 20px 20px 0 0 !important;
    margin: 0 !important;
  }

  .modal-body {
    max-height: calc(88vh - 120px) !important;
    -webkit-overflow-scrolling: touch;
    padding: 14px !important;
  }

  .sample-gallery-grid,
  .format-selector,
  .adv-features-grid,
  .trans-studio-grid,
  .ocr-dual-grid {
    grid-template-columns: 1fr !important;
  }

  .app-persistent-footer {
    display: none !important;
  }

  /* Static Content Pages on Mobile */
  .static-page-container {
    padding: 24px 16px 80px 16px !important;
    max-width: 100vw !important;
  }

  .static-header h1 {
    font-size: 24px !important;
  }

  .grid-features {
    grid-template-columns: 1fr !important;
  }
}

/* ==========================================================================
   Mobile Hardware-Acceleration & GPU Optimization (Zero-Lag Engine)
   ========================================================================== */
@media (max-width: 768px) {
  /* Hide "PRO" word from upside in AI PRO on phone/tablet */
  .badge-pro-text {
    display: none !important;
  }

  /* Eliminate heavy blur overhead on mobile sliding drawers & layers to lock 60 FPS */
  .right-inspector,
  .right-inspector .panel-section,
  .right-inspector .inspector-tabs,
  .right-inspector .layer-item,
  .mobile-nav-drawer,
  .mobile-nav-backdrop,
  .inspector-backdrop {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    will-change: transform;
  }

  /* Zero-lag panel cards inside mobile inspector */
  .right-inspector .panel-section {
    box-shadow: none !important;
    transition: none !important;
    background: rgba(255, 255, 255, 0.04) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    contain: content;
  }

  .right-inspector .panel-section:hover,
  .right-inspector .panel-section:active {
    box-shadow: none !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
  }

  .right-inspector .inspector-tabs {
    background: #0f1526 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
  }

  /* Unify scroll container: eliminate trapped nested scroll inside layer-list */
  .layer-list {
    max-height: none !important;
    overflow: visible !important;
    overflow-y: visible !important;
    touch-action: pan-y !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    padding-right: 0 !important;
    user-select: none !important;
    -webkit-user-select: none !important;
  }

  .right-inspector .tab-pane {
    min-height: 0 !important;
    flex: 1 1 0% !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-y !important;
    scroll-behavior: auto !important;
    overscroll-behavior-y: contain !important;
    will-change: scroll-position !important;
  }

  /* Prevent sliders from fighting vertical scrolling on touch screens */
  .right-inspector input[type="range"] {
    touch-action: pan-x !important;
    height: 32px !important;
  }

  .right-inspector input[type="range"]::-webkit-slider-thumb {
    transition: none !important;
  }

  .right-inspector .slider-control {
    touch-action: pan-y !important;
  }

  .right-inspector .btn,
  .right-inspector .icon-btn-sm,
  .right-inspector .tab-btn,
  .right-inspector select,
  .layer-item,
  .layer-toggle-btn,
  .mobile-nav-tool-btn {
    touch-action: manipulation !important;
    -webkit-tap-highlight-color: transparent !important;
  }

  /* Mobile Layer items & action buttons instant tactile response */
  .layer-item {
    touch-action: pan-y !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    padding: 10px 12px !important;
    transform: none !important;
    transition: background 0.1s ease, border-color 0.1s ease !important;
  }

  .layer-item:active {
    transform: scale(0.98) !important;
    background: rgba(99, 102, 241, 0.15) !important;
  }

  .layer-toggle-btn {
    width: 34px !important;
    height: 34px !important;
    font-size: 0.85rem !important;
    touch-action: manipulation !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 6px !important;
  }

  .layer-toggle-btn:active {
    transform: scale(0.9) !important;
  }

  .layer-controls-bottom {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
    margin-top: 10px !important;
  }

  .layer-controls-bottom .btn {
    min-height: 42px !important;
    font-size: 0.82rem !important;
    padding: 8px 10px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    touch-action: manipulation !important;
    user-select: none !important;
    -webkit-tap-highlight-color: transparent !important;
  }

  .layer-controls-bottom .btn:active,
  .layer-actions-top button:active {
    transform: scale(0.96) !important;
    transition: transform 0.05s ease !important;
  }

  #layerDetailsPanel select {
    min-height: 42px !important;
    font-size: 0.85rem !important;
  }

  .app-header,
  .left-toolbar,
  .dropzone-card,
  .floating-toolbar,
  .modal-window,
  .modal-overlay,
  .photoshop-gen-taskbar,
  .translation-floating-bar {
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
  }

  /* Solid frosted surfaces prevent multi-layer GPU blending during touch actions */
  body.dark-theme .app-header,
  body.dark-theme .left-toolbar {
    background: rgba(13, 17, 28, 0.96) !important;
  }
  body.dark-theme .right-inspector {
    background: #0b101e !important;
  }
  body.dark-theme .mobile-nav-drawer {
    background: #0e1424 !important;
  }
  body.dark-theme .dropzone-card {
    background: rgba(14, 19, 34, 0.88) !important;
  }

  /* Light theme high-speed frosted surfaces */
  body.light-theme .app-header,
  body.light-theme .left-toolbar {
    background: rgba(255, 255, 255, 0.96) !important;
  }
  body.light-theme .right-inspector {
    background: #ffffff !important;
  }
  body.light-theme .mobile-nav-drawer {
    background: #ffffff !important;
  }
  body.light-theme .dropzone-card {
    background: rgba(255, 255, 255, 0.94) !important;
  }

  /* Simplify shadows to eliminate mobile GPU fill-rate throttling */
  .app-header,
  .left-toolbar,
  .right-inspector,
  .mobile-nav-drawer,
  .dropzone-card {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25) !important;
  }

  /* GPU composite layer isolation (Exclude sliding drawers that use translate X/Y) */
  .app-header,
  .left-toolbar,
  .canvas-viewport {
    transform: translateZ(0);
    will-change: auto;
  }

  /* Disable heavy ambient blur pulses and desktop status pills on mobile */
  .ambient-glow,
  .ambient-bg-image,
  .ghost-cursor-status-pill,
  .light-creative-status-pill,
  .light-mode-status-pill {
    display: none !important;
  }

  /* Cookie Consent Banner Mobile Responsiveness */
  .cookie-consent-banner {
    position: fixed !important;
    bottom: calc(var(--toolbar-height, 58px) + 12px) !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: calc(100vw - 20px) !important;
    max-width: calc(100vw - 20px) !important;
    padding: 12px 14px !important;
    z-index: 100000 !important;
    box-sizing: border-box !important;
  }

  .cookie-consent-content {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
  }

  .cookie-text p {
    font-size: 11.5px !important;
    line-height: 1.4 !important;
  }

  .cookie-actions {
    width: 100% !important;
    display: flex !important;
    gap: 6px !important;
    flex-wrap: wrap !important;
  }

  .cookie-actions button {
    flex: 1 1 auto !important;
    font-size: 0.76rem !important;
    padding: 6px 10px !important;
    text-align: center !important;
    justify-content: center !important;
  }
}

/* ==========================================================================
   Google Verification & Sign-In System (Frosted Glassmorphism)
   ========================================================================== */

.auth-modal-backdrop,
.google-auth-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh; height: 100dvh;
  background: rgba(3, 6, 15, 0.9);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: authFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 16px;
  overflow-y: auto;
}

@keyframes authFadeIn {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.auth-card,
.google-auth-card {
  background: rgba(14, 20, 38, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 20px;
  width: 100%;
  max-width: 500px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.8), 0 0 50px rgba(99, 102, 241, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  margin: auto;
}

.btn-auth-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text-muted);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.2s ease;
}

.btn-auth-close:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.4);
}

.auth-card-banner {
  padding: 28px 24px 20px;
  text-align: center;
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.16) 0%, rgba(168, 85, 247, 0.08) 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.auth-badge-verified {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(34, 197, 94, 0.16);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: #4ade80;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  box-shadow: 0 0 16px rgba(34, 197, 94, 0.25);
}

.auth-icon-cluster {
  position: relative;
  margin-bottom: 10px;
}

.auth-icon-circle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4), 0 0 25px rgba(99, 102, 241, 0.45);
}

.auth-icon-circle.email-icon {
  background: linear-gradient(135deg, #6366f1, #a855f7);
  color: #ffffff;
  font-size: 1.6rem;
}

.auth-icon-circle.google-g {
  background: rgba(255, 255, 255, 0.98);
}

.auth-sparkle {
  position: absolute;
  top: -4px;
  right: -6px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.7rem;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.5);
}

.auth-card-banner h2 {
  font-size: 1.25rem;
  font-weight: 800;
  margin-bottom: 6px;
  color: #ffffff;
}

.auth-subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.45;
  max-width: 440px;
}

.auth-card-body {
  padding: 20px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Quick Google Account Selection List */
.auth-selection-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auth-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: #a5b4fc;
  display: flex;
  align-items: center;
  gap: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.google-account-select-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.google-account-select-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.google-account-select-card:hover {
  background: rgba(66, 133, 244, 0.15);
  border-color: rgba(66, 133, 244, 0.6);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3), 0 0 16px rgba(66, 133, 244, 0.3);
}

.g-acc-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 0.92rem;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.g-acc-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.g-acc-name {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.g-acc-email {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.btn-select-acc-pill {
  background: rgba(66, 133, 244, 0.15);
  border: 1px solid rgba(66, 133, 244, 0.35);
  color: #60a5fa;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
}

.google-account-select-card:hover .btn-select-acc-pill {
  background: #4285f4;
  color: #ffffff;
  border-color: #4285f4;
  box-shadow: 0 2px 10px rgba(66, 133, 244, 0.4);
}

.or-divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  margin: 2px 0;
}

.or-divider::before,
.or-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.or-divider span {
  padding: 0 10px;
}

/* Direct Input Form */
.auth-input-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.g-input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.g-input-group label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.g-input-group input {
  width: 100%;
  background: rgba(9, 13, 24, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.84rem;
  color: var(--text-primary);
  outline: none;
  transition: all 0.2s ease;
}

.g-input-group input:focus {
  border-color: #4285f4;
  background: rgba(14, 20, 38, 0.98);
  box-shadow: 0 0 0 2px rgba(66, 133, 244, 0.35);
}

.btn-auth-submit,
.btn-google-verify-submit {
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: none;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
  margin-top: 4px;
}

.btn-auth-submit:hover,
.btn-google-verify-submit:hover {
  background: linear-gradient(135deg, #4f46e5 0%, #9333ea 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.55);
}

.btn-instant-pass {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #f1f5f9;
  font-weight: 600;
  font-size: 0.82rem;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  margin-top: 8px;
  transition: all 0.2s ease;
}

.btn-instant-pass:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: #6366f1;
  color: #818cf8;
  transform: translateY(-1px);
}

.otp-autofill-banner {
  background: rgba(99, 102, 241, 0.1);
  border: 1px dashed rgba(99, 102, 241, 0.35);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 0.78rem;
  color: #cbd5e1;
}

.btn-autofill-pill {
  background: linear-gradient(135deg, #6366f1, #a855f7);
  color: #ffffff;
  border: none;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 20px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
}

.btn-autofill-pill:hover {
  transform: scale(1.04);
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.4);
}

.btn-header-signin {
  font-size: 0.8rem;
  padding: 8px 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.security-verified-tag {
  font-size: 0.62rem;
  color: #818cf8;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  padding: 2px 7px;
  border-radius: var(--radius-full);
  margin-left: auto;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.field-security-feedback {
  font-size: 0.72rem;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  line-height: 1.4;
}

.field-security-feedback.error {
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}

/* Password Strength Meter */
.password-strength-container {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: 4px;
}

.strength-bar-track {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.strength-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: var(--radius-full);
  transition: width 0.25s ease, background 0.25s ease;
}

.strength-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.68rem;
  color: var(--text-muted);
}

.strength-label-row span:first-child {
  font-weight: 700;
}

/* OTP Email Verification Screen */
.otp-verification-screen {
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: authFadeIn 0.3s ease;
}

.btn-back-link {
  background: transparent;
  border: none;
  color: #a5b4fc;
  font-size: 0.74rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  align-self: flex-start;
  padding: 0;
  transition: color 0.15s ease;
}

.btn-back-link:hover {
  color: #ffffff;
}

.otp-banner-box {
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.otp-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent-gradient);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.4);
}

.otp-banner-box h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
}

.otp-banner-box p {
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

.highlight-email {
  color: #93c5fd;
  font-weight: 700;
}

.simulated-otp-notice {
  background: rgba(34, 197, 94, 0.14);
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: #86efac;
  font-size: 0.74rem;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.badge-auto-fill {
  font-size: 0.62rem;
  color: #4ade80;
  text-transform: uppercase;
  font-weight: 700;
}

.otp-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.otp-input-label {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: center;
}

.otp-input-row {
  display: flex;
  justify-content: center;
}

.otp-main-input {
  width: 220px !important;
  text-align: center;
  font-size: 1.5rem !important;
  font-weight: 800 !important;
  letter-spacing: 8px;
  padding: 10px 14px !important;
  font-family: var(--font-mono);
  background: rgba(9, 13, 24, 0.9) !important;
  border: 2px solid rgba(99, 102, 241, 0.5) !important;
  border-radius: var(--radius-md) !important;
  color: #ffffff !important;
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.25) !important;
  transition: all 0.2s ease;
}

.otp-main-input:focus {
  border-color: #6366f1 !important;
  box-shadow: 0 0 25px rgba(99, 102, 241, 0.45) !important;
}

@keyframes shakeError {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-9px); }
  40%, 80% { transform: translateX(9px); }
}

.otp-main-input.shake-error {
  animation: shakeError 0.45s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
  border-color: #ef4444 !important;
  box-shadow: 0 0 25px rgba(239, 68, 68, 0.55) !important;
}

.otp-inline-error {
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(239, 68, 68, 0.45);
  color: #fca5a5;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  animation: fadeIn 0.2s ease;
}

.otp-footer-meta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.btn-resend-link {
  background: transparent;
  border: none;
  color: #60a5fa;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  transition: color 0.15s ease;
}

.btn-resend-link:hover {
  color: #93c5fd;
}

.auth-mini-perks {
  display: flex;
  justify-content: space-around;
  gap: 8px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  flex-wrap: wrap;
}

.mini-perk-item {
  font-size: 0.68rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 5px;
}

.mini-perk-item i {
  color: #22c55e;
}

/* ==========================================================================
   Header User Profile Component
   ========================================================================== */

.btn-google-header {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-google-header:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(66, 133, 244, 0.5);
  box-shadow: 0 0 14px rgba(66, 133, 244, 0.3);
}

.user-profile-menu-wrap {
  position: relative;
}

/* Professional Header Profile Trigger Pill */
.user-profile-btn {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-full);
  padding: 4px 12px 4px 4px;
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.user-profile-btn:hover,
.user-profile-btn[aria-expanded="true"] {
  background: rgba(30, 41, 59, 0.88);
  border-color: rgba(129, 140, 248, 0.5);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.28), 0 0 16px rgba(99, 102, 241, 0.2);
  transform: translateY(-1px);
}

.avatar-ring-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-avatar-img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1.5px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  transition: transform 0.2s ease;
}

.user-profile-btn:hover .user-avatar-img {
  transform: scale(1.04);
}

.status-indicator-dot {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 9px;
  height: 9px;
  background: #22c55e;
  border: 2px solid #0f172a;
  border-radius: 50%;
  box-shadow: 0 0 8px #22c55e;
  animation: pulseStatus 2s infinite ease-in-out;
}

@keyframes pulseStatus {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.75; transform: scale(1.15); box-shadow: 0 0 12px #22c55e; }
}

.user-header-meta {
  display: flex;
  align-items: center;
  gap: 6px;
}

.user-name-text {
  font-size: 0.8rem;
  font-weight: 700;
  color: #f1f5f9;
  letter-spacing: -0.01em;
  max-width: 100px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pro-tier-pill {
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.2), rgba(245, 158, 11, 0.15));
  border: 1px solid rgba(234, 179, 8, 0.4);
  color: #fbbf24;
  font-size: 0.62rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 3px;
  letter-spacing: 0.04em;
  box-shadow: 0 0 10px rgba(234, 179, 8, 0.2);
}

.caret-icon {
  font-size: 0.62rem;
  color: var(--text-muted);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.user-profile-btn[aria-expanded="true"] .caret-icon {
  transform: rotate(180deg);
  color: #818cf8;
}

/* Executive Profile Dropdown Card */
.user-dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 285px;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.75), 0 0 35px rgba(99, 102, 241, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 1000;
  animation: dropdownSlideIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dropdownSlideIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.dropdown-header-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 2px 8px;
}

.dropdown-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.dropdown-avatar-lg {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(129, 140, 248, 0.5);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45), 0 0 14px rgba(99, 102, 241, 0.3);
}

.verified-ribbon-badge {
  position: absolute;
  bottom: -2px;
  right: -2px;
  background: #22c55e;
  color: #ffffff;
  font-size: 0.65rem;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #0f172a;
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
}

.dropdown-user-details {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}

.name-badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.user-fullname {
  font-size: 0.88rem;
  font-weight: 800;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.plan-tag-gold {
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.25), rgba(245, 158, 11, 0.18));
  border: 1px solid rgba(234, 179, 8, 0.5);
  color: #fbbf24;
  font-size: 0.58rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 3px;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.email-copy-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 2px 7px;
  cursor: pointer;
  transition: all 0.15s ease;
  width: fit-content;
  max-width: 100%;
}

.email-copy-row:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.35);
}

.user-email-text {
  font-size: 0.68rem;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.copy-icon {
  font-size: 0.65rem;
  color: #64748b;
  transition: color 0.15s ease;
}

.email-copy-row:hover .copy-icon {
  color: #818cf8;
}

/* Studio Status Micro Grid */
.dropdown-studio-badges {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 8px;
}

.studio-stat-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-label {
  font-size: 0.6rem;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 4px;
}

.stat-val {
  font-size: 0.68rem;
  font-weight: 700;
  color: #cbd5e1;
}

.stat-val.status-green {
  color: #4ade80;
}

.dropdown-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  margin: 2px 0;
}

/* Dropdown Action Items */
.dropdown-actions-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: 1px solid transparent;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  width: 100%;
  text-align: left;
}

.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
  transform: translateX(2px);
}

.item-icon-wrap {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: #818cf8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.dropdown-item:hover .item-icon-wrap {
  background: #6366f1;
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.4);
}

.item-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.item-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: #f1f5f9;
}

.item-desc {
  font-size: 0.65rem;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dropdown-item.danger {
  color: #f87171;
}

.dropdown-item.danger:hover {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.3);
  transform: translateX(2px);
}

.item-icon-wrap.danger-icon {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.25);
  color: #f87171;
}

.dropdown-item.danger:hover .item-icon-wrap.danger-icon {
  background: #ef4444;
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(239, 68, 68, 0.4);
}

.dropdown-section-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.62rem;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 6px 2px;
}

.dropdown-section-title i {
  font-size: 0.65rem;
  color: #818cf8;
}

.dropdown-item.highlight-amber {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.2);
}

.dropdown-item.highlight-amber:hover {
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(245, 158, 11, 0.4);
  transform: translateX(2px);
}

.item-icon-wrap.amber-icon {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.35);
  color: #fbbf24;
}

.dropdown-item.highlight-amber:hover .item-icon-wrap.amber-icon {
  background: #f59e0b;
  color: #ffffff;
  box-shadow: 0 2px 12px rgba(245, 158, 11, 0.5);
}

.btn-amber-glow {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.9), rgba(217, 119, 6, 0.95));
  color: #ffffff;
  border: 1px solid rgba(251, 191, 36, 0.6);
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.35);
}

.btn-amber-glow:hover {
  background: linear-gradient(135deg, rgba(251, 191, 36, 1), rgba(245, 158, 11, 1));
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
  transform: translateY(-2px);
}

/* Account Details Executive Modal */
.account-details-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh; height: 100dvh;
  background: rgba(3, 6, 15, 0.88);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10001;
  padding: 16px;
  animation: authFadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.account-details-card {
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 24px;
  width: 100%;
  max-width: 440px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.8), 0 0 50px rgba(99, 102, 241, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  padding: 28px 24px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.account-card-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.header-avatar-glow {
  position: relative;
  margin-bottom: 6px;
}

.details-avatar-img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 2.5px solid rgba(129, 140, 248, 0.6);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5), 0 0 30px rgba(99, 102, 241, 0.4);
}

.verified-dot-corner {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 20px;
  height: 20px;
  background: #22c55e;
  border: 3px solid #0f172a;
  border-radius: 50%;
  color: #ffffff;
  font-size: 0.65rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.6);
}

.account-card-header h3 {
  font-size: 1.2rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0;
}

.account-email-sub {
  font-size: 0.8rem;
  color: #94a3b8;
  margin: 0;
}

.tier-pill-gold {
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.2), rgba(245, 158, 11, 0.15));
  border: 1px solid rgba(234, 179, 8, 0.5);
  color: #fbbf24;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 4px;
  box-shadow: 0 0 14px rgba(234, 179, 8, 0.25);
}

.account-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 12px;
}

.meta-card {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.meta-label {
  font-size: 0.65rem;
  font-weight: 700;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 5px;
  text-transform: uppercase;
}

.meta-value {
  font-size: 0.78rem;
  color: #f1f5f9;
}

.meta-value.text-green { color: #4ade80; }
.meta-value.text-purple { color: #c084fc; }
.meta-value.text-mono { font-family: 'JetBrains Mono', monospace; font-size: 0.72rem; }

.account-card-footer {
  display: flex;
  justify-content: center;
}

/* Avatar Camera Overlay Badge */
.avatar-camera-overlay-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #6366f1;
  border: 1.5px solid #0f172a;
  color: #ffffff;
  font-size: 0.55rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
}

.avatar-camera-overlay-badge:hover {
  background: #818cf8;
  transform: scale(1.15);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.7);
}

/* Avatar & Profile Photo Modal */
.avatar-picker-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh; height: 100dvh;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 16px;
  animation: fadeIn 0.2s ease-out;
}

.avatar-picker-card {
  width: 100%;
  max-width: 440px;
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 0 0 40px rgba(99, 102, 241, 0.25);
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
}

.avatar-modal-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
}

.avatar-preview-halo {
  position: relative;
  width: 72px;
  height: 72px;
  margin-bottom: 4px;
}

.modal-preview-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #818cf8;
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.45);
}

.avatar-edit-tag {
  position: absolute;
  bottom: -4px;
  right: -4px;
  background: #10b981;
  color: #ffffff;
  font-size: 0.55rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  border: 1.5px solid #0f172a;
}

.avatar-modal-header h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: #ffffff;
}

.avatar-modal-desc {
  font-size: 0.78rem;
  color: #94a3b8;
  line-height: 1.4;
}

.avatar-modal-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.custom-photo-upload-box {
  background: rgba(99, 102, 241, 0.08);
  border: 1.5px dashed rgba(99, 102, 241, 0.4);
  border-radius: var(--radius-md);
  padding: 12px;
  transition: all 0.2s ease;
}

.custom-photo-upload-box:hover {
  background: rgba(99, 102, 241, 0.16);
  border-color: #818cf8;
}

.btn-custom-upload-label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.btn-custom-upload-label i {
  font-size: 1.4rem;
  color: #818cf8;
}

.upload-label-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.upload-label-text strong {
  font-size: 0.84rem;
  color: #f1f5f9;
}

.upload-label-text span {
  font-size: 0.68rem;
  color: #94a3b8;
}

.avatar-presets-heading {
  font-size: 0.62rem;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-align: center;
}

.avatar-presets-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.avatar-preset-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  padding: 10px 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.avatar-preset-btn:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.4);
  transform: translateY(-2px);
}

.preset-avatar-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
}

.preset-avatar-circle img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preset-name {
  font-size: 0.65rem;
  font-weight: 700;
  color: #cbd5e1;
  text-align: center;
  white-space: nowrap;
}

.avatar-modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* URL Preview Box in URL Loader Modal */
.url-preview-box {
  margin-top: 12px;
  max-height: 200px;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
}

.url-preview-box img {
  max-width: 100%;
  max-height: 200px;
  object-fit: contain;
}

/* ==========================================================================
   Full Screen Profile Photo Lightbox System
   ========================================================================== */

.profile-lightbox-backdrop {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh; height: 100dvh;
  background: rgba(4, 7, 18, 0.94);
  backdrop-filter: blur(32px) saturate(190%);
  -webkit-backdrop-filter: blur(32px) saturate(190%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100000;
  padding: 20px;
  animation: lightboxFadeIn 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.profile-lightbox-backdrop.lightbox-fade-out {
  opacity: 0;
  transform: scale(0.95);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

@keyframes lightboxFadeIn {
  from {
    opacity: 0;
    transform: scale(0.92);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.profile-lightbox-window {
  width: 100%;
  max-width: 480px;
  background: rgba(13, 19, 36, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 24px;
  padding: 30px 24px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.9), 0 0 60px rgba(99, 102, 241, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 18px;
  position: relative;
  user-select: none;
}

.lightbox-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
  color: #f1f5f9;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
}

.lightbox-close-btn:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
  color: #fca5a5;
  transform: rotate(90deg) scale(1.1);
}

.lightbox-top-banner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.lightbox-title-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #a5b4fc;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.lightbox-tip-sub {
  font-size: 0.68rem;
  color: #64748b;
}

.lightbox-photo-stage {
  padding: 10px 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-photo-halo {
  position: relative;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  padding: 5px;
  background: var(--accent-gradient);
  box-shadow: 0 0 35px rgba(99, 102, 241, 0.6), 0 0 70px rgba(168, 85, 247, 0.3);
  animation: haloPulse 3s infinite alternate ease-in-out;
}

@keyframes haloPulse {
  0% {
    box-shadow: 0 0 25px rgba(99, 102, 241, 0.5), 0 0 50px rgba(168, 85, 247, 0.25);
    transform: scale(1);
  }
  100% {
    box-shadow: 0 0 45px rgba(99, 102, 241, 0.8), 0 0 80px rgba(6, 182, 212, 0.45);
    transform: scale(1.02);
  }
}

.lightbox-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 3px solid #0f172a;
  background: #090d18;
  display: block;
}

.lightbox-verified-badge {
  position: absolute;
  bottom: 8px;
  right: 12px;
  width: 32px;
  height: 32px;
  background: #10b981;
  border: 3px solid #0f172a;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 1.1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

.lightbox-user-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.lightbox-user-name {
  font-size: 1.25rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.01em;
}

.lightbox-user-email {
  font-size: 0.82rem;
  color: #94a3b8;
}

.lightbox-badges-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.lightbox-badge-gold {
  background: linear-gradient(135deg, rgba(217, 119, 6, 0.2), rgba(245, 158, 11, 0.2));
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.lightbox-badge-green {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: #34d399;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.lightbox-actions-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-wrap: wrap;
}

.lightbox-btn {
  flex: 1;
  min-width: 120px;
  font-size: 0.8rem;
  padding: 10px 14px;
}

.user-avatar-img,
.dropdown-avatar-lg,
.details-avatar-img {
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
}

.user-avatar-img:hover,
.dropdown-avatar-lg:hover,
.details-avatar-img:hover {
  transform: scale(1.08);
  box-shadow: 0 0 14px rgba(99, 102, 241, 0.6);
}

/* ==========================================================================
   Anti-Screenshot & Security Content Protection Styles
   ========================================================================== */

/* Mobile Touch & Long-Press Image Callout Prevention (Disables mobile browser "Save/Share Image" sheets) */
canvas,
#mainCanvas,
.canvas-stage,
.canvas-viewport,
#viewportContainer,
.canvas-overlay,
.canvas-container img,
.canvas-stage img {
  -webkit-touch-callout: none !important;
  -webkit-user-select: none !important;
  user-select: none !important;
  -webkit-user-drag: none !important;
}

/* Privacy Blackout Shield during Window Blur / Snipping Tool / Mobile Hardware Snapshot */
.security-privacy-shield {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  background: rgba(4, 6, 14, 0.99);
  backdrop-filter: blur(50px);
  -webkit-backdrop-filter: blur(50px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.security-privacy-shield.active {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}

.security-privacy-shield.instant-active,
html.page-screenshot-blackout .security-privacy-shield,
body.page-screenshot-blackout .security-privacy-shield {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: all !important;
  transition: none !important;
  background: #000000 !important;
  z-index: 2147483647 !important;
}

/* Instant Backgrounding / Snapshot Blackout across iOS, Android, and Desktop */
html.page-screenshot-blackout,
body.page-screenshot-blackout {
  background: #000000 !important;
}

html.page-screenshot-blackout #canvasStage,
html.page-screenshot-blackout #mainCanvas,
html.page-screenshot-blackout canvas,
html.page-screenshot-blackout .canvas-container,
html.page-screenshot-blackout .canvas-viewport,
html.page-screenshot-blackout #viewportContainer,
html.page-screenshot-blackout .layer-panel,
html.page-screenshot-blackout .app-main,
body.page-screenshot-blackout #canvasStage,
body.page-screenshot-blackout #mainCanvas,
body.page-screenshot-blackout canvas,
body.page-screenshot-blackout .canvas-container,
body.page-screenshot-blackout .canvas-viewport,
body.page-screenshot-blackout #viewportContainer,
body.page-screenshot-blackout .layer-panel,
body.page-screenshot-blackout .app-main {
  filter: blur(100px) brightness(0) !important;
  -webkit-filter: blur(100px) brightness(0) !important;
  opacity: 0 !important;
  visibility: hidden !important;
  transition: none !important;
}

/* Dynamic Anti-Screenshot Visual DRM Watermark Overlay */
.security-drm-watermark-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 3;
  overflow: hidden;
  display: flex;
  flex-wrap: wrap;
  align-content: space-around;
  justify-content: space-around;
  gap: 24px;
  user-select: none;
  -webkit-user-select: none;
}

.security-drm-watermark-overlay::before {
  content: "";
  position: absolute;
  inset: -60%;
  width: 220%;
  height: 220%;
  background-image: repeating-linear-gradient(
    -35deg,
    rgba(255, 255, 255, 0.04) 0px,
    rgba(255, 255, 255, 0.04) 1.5px,
    transparent 1.5px,
    transparent 140px
  );
  transform: rotate(-10deg);
  pointer-events: none;
}

.security-drm-watermark-item {
  transform: rotate(-25deg);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.12);
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}

html[data-theme="light"] .security-drm-watermark-overlay::before,
body.light-theme .security-drm-watermark-overlay::before {
  background-image: repeating-linear-gradient(
    -35deg,
    rgba(0, 0, 0, 0.035) 0px,
    rgba(0, 0, 0, 0.035) 1.5px,
    transparent 1.5px,
    transparent 140px
  );
}

html[data-theme="light"] .security-drm-watermark-item,
body.light-theme .security-drm-watermark-item {
  color: rgba(0, 0, 0, 0.10);
}

.privacy-shield-content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  padding: 34px 24px 26px;
  border-radius: 22px;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(239, 68, 68, 0.4);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.9), 0 0 40px rgba(239, 68, 68, 0.2);
  max-width: 380px;
  width: 90%;
  pointer-events: auto;
}

.shield-close-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
  -webkit-tap-highlight-color: transparent;
}

.shield-close-btn:hover,
.shield-close-btn:active {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.5);
  color: #f87171;
  transform: scale(1.06);
}

.shield-lock-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(185, 28, 28, 0.4));
  border: 2px solid rgba(239, 68, 68, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: #f87171;
  animation: shieldPulse 2s infinite ease-in-out;
}

@keyframes shieldPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  50% { transform: scale(1.05); box-shadow: 0 0 0 14px rgba(239, 68, 68, 0); }
}

.privacy-shield-content h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #f8fafc;
  margin: 0;
}

.privacy-shield-content p {
  font-size: 0.85rem;
  color: #94a3b8;
  margin: 0;
  line-height: 1.4;
}

.btn-shield-resume {
  margin-top: 6px;
  width: 100%;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #ffffff;
  font-size: 0.92rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.4);
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn-shield-resume:hover,
.btn-shield-resume:active {
  background: linear-gradient(135deg, #4f46e5, #4338ca);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.5);
}

.shield-hint-text {
  font-size: 0.75rem !important;
  color: #64748b !important;
  margin-top: -4px !important;
}

/* Access Denied Security Violation Modal */
.access-denied-backdrop {
  z-index: 999999;
  background: rgba(5, 5, 10, 0.94);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
}

.access-denied-card {
  max-width: 480px;
  width: 90%;
  background: #0b0f19;
  border: 1px solid rgba(239, 68, 68, 0.4);
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.9), 0 0 50px rgba(239, 68, 68, 0.25);
  border-radius: 24px;
  overflow: hidden;
  padding: 0;
  animation: deniedPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

.security-denied-banner {
  position: relative;
  background: linear-gradient(180deg, rgba(220, 38, 38, 0.25) 0%, rgba(15, 23, 42, 0) 100%);
  padding: 32px 24px 16px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.denied-shield-ring {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: radial-gradient(circle, #dc2626 0%, #991b1b 100%);
  border: 3px solid rgba(254, 202, 202, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.2rem;
  color: #ffffff;
  box-shadow: 0 0 30px rgba(220, 38, 38, 0.6);
  z-index: 2;
  animation: deniedShake 0.6s ease;
}

@keyframes deniedShake {
  0%, 100% { transform: rotate(0deg); }
  20% { transform: rotate(-10deg); }
  40% { transform: rotate(10deg); }
  60% { transform: rotate(-6deg); }
  80% { transform: rotate(6deg); }
}

.access-denied-body {
  padding: 0 28px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.denied-badge-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #f87171;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 12px;
}

.access-denied-body h2 {
  font-size: 1.6rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 6px;
  letter-spacing: -0.02em;
}

.denied-reason-text {
  font-size: 0.9rem;
  color: #cbd5e1;
  margin: 0 0 16px;
  line-height: 1.4;
}

.security-alert-box {
  width: 100%;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
  margin-bottom: 14px;
}

.alert-line {
  font-size: 0.78rem;
  color: #94a3b8;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.35;
}

.alert-line i {
  color: #f87171;
  margin-top: 2px;
}

.unlock-guidance-text {
  font-size: 0.8rem;
  color: #64748b;
  margin: 0 0 18px;
}

.btn-denied-resume {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #94a3b8;
  padding: 12px 20px;
  border-radius: 12px;
  font-size: 0.92rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: not-allowed;
  transition: all 0.25s ease;
}

.btn-denied-resume.unlocked {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  border-color: #34d399;
  color: #ffffff;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-denied-resume.unlocked:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.5);
}

/* Universal Mobile & Desktop User Selection & Touch Callout Protection */
*, *::before, *::after {
  -webkit-touch-callout: none !important;
  -webkit-user-select: none !important;
  -khtml-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
  user-select: none !important;
}

input, textarea, [contenteditable="true"] {
  -webkit-user-select: text !important;
  -moz-user-select: text !important;
  -ms-user-select: text !important;
  user-select: text !important;
}

/* Dynamic Anti-Screenshot DRM Security Watermark Grid */
.security-drm-watermark-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh; height: 100dvh;
  z-index: 999990;
  pointer-events: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  grid-auto-rows: 130px;
  overflow: hidden;
  opacity: 0.14;
  user-select: none;
  -webkit-user-select: none;
}

.drm-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  transform: rotate(-22deg);
  pointer-events: none;
  font-family: var(--font-mono, monospace);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #f87171;
  text-shadow: 0 0 5px rgba(0,0,0,0.9);
  white-space: nowrap;
}

/* Canvas & Image Drag & Touch Callout Protection */
canvas, img, .canvas-area, .preview-container, .layer-item, .layer-item-thumb {
  -webkit-user-drag: none !important;
  -khtml-user-drag: none !important;
  -moz-user-drag: none !important;
  -o-user-drag: none !important;
  user-drag: none !important;
  -webkit-touch-callout: none !important;
}

/* Print Protection: Blank Page if Print is Triggered */
@media print {
  html, body {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    width: 0 !important;
    overflow: hidden !important;
    background: #000000 !important;
  }
}

/* Compulsory Field Badge */
.required-badge {
  font-size: 0.68rem;
  font-weight: 700;
  color: #f87171;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 2px 7px;
  border-radius: 6px;
  margin-left: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: inline-block;
  vertical-align: middle;
}

/* ==========================================================================
   WhatFont Inspector Card, Hover Badge & Sibling Font Cards
   ========================================================================== */

.whatfont-hover-badge {
  position: absolute;
  pointer-events: none;
  z-index: 90;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(168, 85, 247, 0.5);
  border-radius: var(--radius-md);
  padding: 6px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #f1f5f9;
  font-size: 0.8rem;
  font-weight: 600;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45), 0 0 16px rgba(168, 85, 247, 0.35);
  transform: translate(15px, 15px);
  transition: opacity 0.15s ease;
}

.whatfont-hover-badge i {
  color: #c084fc;
}

.whatfont-hover-hint {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 400;
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
}

.whatfont-card {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 380px;
  max-width: calc(100vw - 48px);
  max-height: calc(100vh - 120px);
  background: rgba(13, 18, 33, 0.82);
  backdrop-filter: blur(28px) saturate(200%);
  -webkit-backdrop-filter: blur(28px) saturate(200%);
  border: 1px solid rgba(168, 85, 247, 0.4);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 35px rgba(168, 85, 247, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.15);
  z-index: 120;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: whatfontFadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes whatfontFadeIn {
  from { opacity: 0; transform: translateY(-10px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

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

.whatfont-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 700;
  color: #e2e8f0;
}

.whatfont-title i {
  color: #c084fc;
}

.whatfont-close-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-size: 1rem;
  cursor: pointer;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.whatfont-close-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.whatfont-body {
  padding: 18px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: calc(100vh - 200px);
}

.whatfont-primary-box {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.12), rgba(99, 102, 241, 0.12));
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: var(--radius-md);
  padding: 14px;
}

.whatfont-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #c084fc;
  font-weight: 700;
  display: block;
  margin-bottom: 2px;
}

.whatfont-family-name {
  font-size: 1.45rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}

.whatfont-category-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
}

.whatfont-preview-text {
  margin-top: 10px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.whatfont-specs-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.whatfont-spec-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.whatfont-spec-card .spec-name {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}

.whatfont-spec-card .spec-val {
  font-size: 0.8rem;
  color: #f1f5f9;
  display: flex;
  align-items: center;
  gap: 6px;
}

.color-preview-chip {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  display: inline-block;
}

.whatfont-similar-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.whatfont-similar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 700;
  color: #cbd5e1;
}

.whatfont-similar-header i {
  color: var(--accent-primary);
}

.whatfont-similar-count {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 500;
}

.whatfont-similar-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 180px;
  overflow-y: auto;
  padding-right: 4px;
}

.whatfont-similar-card {
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: all 0.2s;
}

.whatfont-similar-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(168, 85, 247, 0.3);
}

.whatfont-similar-card.is-pairing {
  border-left: 3px solid #06b6d4;
}

.similar-font-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.similar-font-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: #ffffff;
}

.similar-font-tag {
  font-size: 0.62rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
}

.similar-font-tag.tag-pairing {
  background: rgba(6, 182, 212, 0.15);
  color: #67e8f9;
}

.similar-font-preview {
  font-size: 0.78rem;
  color: #94a3b8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.similar-font-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
}

.btn-apply-similar, .btn-copy-similar {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s;
}

.btn-apply-similar:hover {
  background: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
}

.btn-copy-similar:hover {
  background: rgba(255, 255, 255, 0.15);
  color: white;
}

.whatfont-actions-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 4px;
}

.whatfont-actions-bar .btn {
  flex: 1;
  min-width: 100px;
}

.whatfont-doc-scan-section {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.whatfont-scan-header {
  font-size: 0.78rem;
  font-weight: 700;
  color: #e2e8f0;
}

.whatfont-doc-scan-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 150px;
  overflow-y: auto;
}

.whatfont-doc-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.15s;
}

.whatfont-doc-item:hover {
  background: rgba(168, 85, 247, 0.15);
  border-color: rgba(168, 85, 247, 0.35);
}

/* ==========================================================================
   AdSense & Compliance Footer Navigation & Cookie Consent Banner
   ========================================================================== */
.dropzone-legal-footer {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--text-muted);
}

.legal-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: color 0.15s ease;
}

.legal-link:hover {
  color: var(--accent-blue);
  text-decoration: underline;
}

.legal-dot {
  color: rgba(255, 255, 255, 0.2);
  font-size: 10px;
}

.cookie-consent-banner {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 40px);
  max-width: 850px;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(99, 102, 241, 0.3);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 30px rgba(99, 102, 241, 0.15);
  border-radius: 14px;
  padding: 14px 20px;
  z-index: 99999;
  animation: slideUpConsent 0.3s ease-out;
}

@media (min-width: 769px) {
  .cookie-consent-banner {
    left: calc(var(--toolbar-width, 68px) + (100vw - var(--toolbar-width, 68px) - var(--inspector-width, 320px)) / 2) !important;
    transform: translateX(-50%) !important;
    max-width: min(720px, calc(100vw - var(--toolbar-width, 68px) - var(--inspector-width, 320px) - 30px)) !important;
    width: calc(100vw - var(--toolbar-width, 68px) - var(--inspector-width, 320px) - 30px) !important;
    bottom: 40px !important;
    z-index: 80 !important;
  }
}

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

.cookie-consent-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.cookie-icon {
  font-size: 22px;
  color: #f59e0b;
}

.cookie-text {
  flex: 1;
  min-width: 260px;
}

.cookie-text p {
  font-size: 12.5px;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
}

.cookie-text a {
  color: var(--accent-blue);
  text-decoration: underline;
}

.cookie-actions {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.cookie-preferences {
  flex-basis: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border-glass);
}

.cookie-preferences[hidden] { display: none; }
.cookie-preferences label { display: grid; grid-template-columns: auto 1fr; gap: 4px 9px; align-items: center; color: var(--text-primary); font-size: 13px; }
.cookie-preferences label span { grid-column: 2; color: var(--text-secondary); font-size: 11px; }
.cookie-preferences input { accent-color: var(--accent-blue); }
.cookie-preferences input:disabled { opacity: .7; }
.static-cookie-footer { padding: 18px 24px 32px; text-align: center; color: var(--text-secondary); font-size: 13px; }
.static-cookie-footer a, .static-cookie-footer button { color: var(--accent-blue); }
.static-cookie-footer button { border: 0; padding: 0; background: none; font: inherit; text-decoration: underline; cursor: pointer; }
@media (max-width: 600px) { .cookie-preferences { grid-template-columns: 1fr; } }

/* ==========================================================================
   Static Pages & Content Scrolling System (About, Privacy, Terms, Guides)
   ========================================================================== */
body.static-page-body,
body:has(.static-page-container) {
  height: auto !important;
  min-height: 100vh !important; min-height: 100dvh !important; height: 100dvh !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  display: block !important;
}

.static-page-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 24px 120px 24px;
  color: var(--text-primary);
  position: relative;
  z-index: 10;
  overflow: visible !important;
}

/* Custom Scrollbar for Smooth Reading */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(10, 14, 25, 0.8);
}

::-webkit-scrollbar-thumb {
  background: rgba(99, 102, 241, 0.4);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(99, 102, 241, 0.7);
}

/* ==========================================================================
   Persistent Bottom Legal & Information Bar
   ========================================================================== */
.app-persistent-footer {
  position: fixed;
  bottom: 0;
  left: var(--toolbar-width, 68px);
  right: var(--inspector-width, 320px);
  width: auto;
  height: 32px;
  background: rgba(10, 14, 25, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  z-index: 45;
  font-size: 11.5px;
  color: var(--text-muted);
  box-sizing: border-box;
}

.persistent-footer-left {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
}

.persistent-footer-links {
  display: flex;
  align-items: center;
  gap: 14px;
}

.persistent-footer-links a,
.persistent-footer-links button.footer-btn-link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  cursor: pointer;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.persistent-footer-links a:focus-visible,
.persistent-footer-links button.footer-btn-link:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
  border-radius: 4px;
}

.persistent-footer-links button.footer-btn-link:hover,
.persistent-footer-links a:hover {
  color: var(--accent-blue);
  text-decoration: underline;
}

.unused-old-footer-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.persistent-footer-links a:hover {
  color: var(--accent-blue);
  text-decoration: underline;
}

@media (max-width: 768px) {
  .app-persistent-footer {
    display: none !important;
  }
}

/* ==========================================================================
   Market-Leading Features UI Styling
   ========================================================================== */

/* 1. Translation Floating Bar (Down of Canvas) */
.translation-floating-bar {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(20px) saturate(190%);
  -webkit-backdrop-filter: blur(20px) saturate(190%);
  border: 1px solid rgba(6, 182, 212, 0.45);
  border-radius: var(--radius-lg, 14px);
  padding: 8px 16px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.55), 0 0 25px rgba(6, 182, 212, 0.25);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 70;
  animation: slideUpIn 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  font-size: 0.82rem;
}

.translation-floating-bar label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
}

.btn-close-float-bar {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #94a3b8;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 11px;
  margin-left: 4px;
  transition: all 0.2s ease;
}

.btn-close-float-bar:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.6);
  color: #f87171;
  transform: scale(1.08);
}

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

.translation-bar-content {
  display: flex;
  align-items: center;
  gap: 10px;
}

.translation-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #c7d2fe;
  display: flex;
  align-items: center;
  gap: 5px;
}

.translation-lang-select {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  border-radius: var(--radius-full, 9999px);
  padding: 4px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
}

/* 2. 4-Corner Perspective Warp Handles */
.perspective-handle {
  position: absolute;
  width: 16px;
  height: 16px;
  background: #6366f1;
  border: 2px solid #ffffff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.85);
  cursor: crosshair;
  z-index: 50;
  transition: transform 0.12s ease, background-color 0.12s ease;
}

.perspective-handle:hover,
.perspective-handle.active {
  transform: translate(-50%, -50%) scale(1.35);
  background: #ec4899;
}

/* 3. Signature & Stamp Studio Modal */
.signature-studio-canvas-container {
  background: repeating-conic-gradient(#1e2438 0% 25%, #151a2d 0% 50%) 50% / 20px 20px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md, 8px);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 240px;
  overflow: hidden;
  position: relative;
}

.signature-studio-preview {
  max-width: 100%;
  max-height: 260px;
  object-fit: contain;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.ink-color-picker-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ink-color-pill {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.2);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.ink-color-pill.active {
  transform: scale(1.2);
  border-color: #fff;
  box-shadow: 0 0 10px rgba(255,255,255,0.5);
}

/* 4. Batch Find & Replace Multi-page Modal */
.batch-scope-badge {
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: #a5b4fc;
  padding: 4px 10px;
  border-radius: var(--radius-full, 9999px);
  font-size: 0.72rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.batch-stats-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm, 6px);
  padding: 12px 14px;
  display: flex;
  justify-content: space-around;
  text-align: center;
}

.batch-stats-item .batch-stats-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-mono, monospace);
}

.batch-stats-item .batch-stats-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-top: 2px;
}

/* Header Quick Actions (Add Image & Clear) */
.btn-clear-danger {
  border-color: rgba(239, 68, 68, 0.3) !important;
  color: #fca5a5 !important;
}

.btn-clear-danger:hover {
  background: rgba(239, 68, 68, 0.18) !important;
  border-color: rgba(239, 68, 68, 0.6) !important;
  color: #ffffff !important;
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.35) !important;
}

.btn-text-xs {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--text-muted, #94a3b8);
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: var(--radius-sm, 6px);
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.btn-text-xs:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
}

.warp-toolbar-badge {
  position: absolute;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(99, 102, 241, 0.6);
  backdrop-filter: blur(8px);
  color: #e0e7ff;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-full, 9999px);
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  pointer-events: auto;
  z-index: 60;
  transform: translateY(-100%);
  margin-top: -6px;
}

.warp-pin-label {
  position: absolute;
  font-size: 0.65rem;
  font-weight: 700;
  color: #fff;
  pointer-events: none;
  text-shadow: 0 1px 3px rgba(0,0,0,0.8);
  transform: translate(12px, -8px);
}

/* =========================================================================
   AI Universal Translation Studio Modal & Real-Time Bi-Directional Translator
   ========================================================================= */

.trans-studio-lang-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.trans-studio-lang-card {
  flex: 1;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.2s ease;
}

.trans-studio-lang-card:focus-within {
  border-color: rgba(6, 182, 212, 0.6);
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.2);
}

.trans-card-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 6px;
}

.trans-card-inputs {
  display: flex;
  gap: 8px;
  align-items: center;
}

.trans-card-inputs .lang-search-input {
  width: 38%;
  padding: 6px 10px;
  font-size: 12px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #ffffff;
  outline: none;
  transition: border-color 0.2s;
}

.trans-card-inputs .lang-search-input:focus {
  border-color: #06b6d4;
}

.trans-select-stylish {
  flex: 1;
  padding: 6px 10px;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: 6px;
  background: rgba(2, 6, 23, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #f1f5f9;
  outline: none;
  cursor: pointer;
  transition: border-color 0.2s;
}

.trans-select-stylish:focus {
  border-color: #06b6d4;
}

.btn-swap-studio {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.2), rgba(99, 102, 241, 0.25));
  border: 1px solid rgba(6, 182, 212, 0.5);
  color: #22d3ee;
  padding: 9px 16px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.btn-swap-studio i {
  font-size: 15px;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.btn-swap-studio:hover {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.38), rgba(99, 102, 241, 0.45));
  border-color: #06b6d4;
  color: #ffffff;
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.45);
}

.btn-swap-studio:hover i {
  transform: rotate(180deg);
}

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

.trans-quick-suggestions {
  margin-bottom: 12px;
}

.trans-quick-title {
  font-size: 0.72rem;
  color: #94a3b8;
  font-weight: 600;
  display: block;
  margin-bottom: 6px;
}

.quick-lang-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.quick-lang-btn {
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  cursor: pointer;
  transition: all 0.2s ease;
}

.quick-lang-btn:hover {
  background: rgba(6, 182, 212, 0.25);
  border-color: rgba(6, 182, 212, 0.5);
  color: #ffffff;
  transform: translateY(-1px);
}

.trans-studio-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 12px;
}

@media (max-width: 680px) {
  .trans-studio-grid {
    grid-template-columns: 1fr;
  }
  .trans-studio-lang-bar {
    flex-direction: column;
  }
  .btn-swap-studio {
    flex-direction: row;
    width: 100%;
    padding: 7px;
  }
}

.trans-studio-card {
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.trans-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  font-weight: 600;
  color: #cbd5e1;
}

.trans-studio-textarea {
  width: 100%;
  min-height: 110px;
  max-height: 170px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(2, 6, 23, 0.85);
  color: #f8fafc;
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.5;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.trans-studio-textarea:focus {
  border-color: rgba(6, 182, 212, 0.6);
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.2);
}

.trans-target-output {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.08), rgba(99, 102, 241, 0.06));
  border-color: rgba(6, 182, 212, 0.35);
  color: #38bdf8;
  font-weight: 600;
}

.trans-badge {
  font-size: 0.65rem;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  font-weight: 600;
}

.trans-badge-success {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.trans-badge-loading {
  background: rgba(6, 182, 212, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(6, 182, 212, 0.35);
}

.trans-meta-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
}

.trans-meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.trans-meta-item .meta-label {
  font-size: 0.62rem;
  text-transform: uppercase;
  color: #64748b;
  font-weight: 700;
}

.trans-meta-item .meta-value {
  font-size: 0.78rem;
  font-weight: 600;
  color: #e2e8f0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.meta-color-preview {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  color: #e2e8f0;
  font-family: monospace;
}

.meta-color-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.3);
  display: inline-block;
  background: #ffffff;
}
  transition: all 0.2s;
  text-align: center;
}

.trans-action-btn strong {
  font-weight: 700;
}

.trans-action-btn i {
  font-size: 0.95rem;
}

.trans-secondary-row {
  display: flex;
  gap: 8px;
}

/* ==========================================================================
   Photoshop-Style Generative Fill Contextual Taskbar & Marching Ants
   ========================================================================== */

@keyframes marchingAnts {
  0% {
    stroke-dashoffset: 0;
  }
  100% {
    stroke-dashoffset: 16;
  }
}

.marching-ants-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
  z-index: 10;
}

.marching-ants-path {
  fill: rgba(99, 102, 241, 0.12);
  stroke: #ffffff;
  stroke-width: 1.5;
  stroke-dasharray: 6 6;
  animation: marchingAnts 0.6s linear infinite;
  filter: drop-shadow(0 0 1px #000000);
}

.marching-ants-box {
  position: absolute;
  border: 1.5px dashed #ffffff;
  background: rgba(99, 102, 241, 0.12);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6);
  pointer-events: none;
  z-index: 10;
}

/* Floating Photoshop Generative Fill Taskbar */
.photoshop-gen-taskbar {
  position: absolute;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(99, 102, 241, 0.25), 0 0 25px rgba(99, 102, 241, 0.2);
  min-width: min(420px, calc(100vw - 20px));
  max-width: min(580px, calc(100vw - 20px));
  transform: translate(-50%, 14px);
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.gen-taskbar-main {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gen-taskbar-drag-handle {
  color: var(--text-muted, #64748b);
  cursor: grab;
  font-size: 13px;
  display: flex;
  align-items: center;
}

.gen-taskbar-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, #6366f1, #a855f7);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 13px;
  box-shadow: 0 0 12px rgba(168, 85, 247, 0.4);
  flex-shrink: 0;
}

.gen-taskbar-modes {
  display: flex;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
  flex-shrink: 0;
}

.gen-mode-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary, #94a3b8);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s;
}

.gen-mode-btn:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.gen-mode-btn.active {
  color: #ffffff;
  background: rgba(99, 102, 241, 0.35);
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.3);
}

.gen-taskbar-divider {
  width: 1px;
  height: 22px;
  background: rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
}

.gen-taskbar-input-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.gen-taskbar-input {
  width: 100%;
  padding: 7px 28px 7px 10px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  color: #ffffff;
  font-size: 12px;
  font-family: inherit;
  outline: none;
  transition: all 0.2s;
}

.gen-taskbar-input:focus {
  border-color: #818cf8;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25);
  background: rgba(0, 0, 0, 0.65);
}

.gen-taskbar-input::placeholder {
  color: rgba(148, 163, 184, 0.7);
  font-style: italic;
}

.gen-clear-btn {
  position: absolute;
  right: 6px;
  background: transparent;
  border: none;
  color: var(--text-muted, #64748b);
  cursor: pointer;
  font-size: 12px;
  padding: 4px;
}

.gen-clear-btn:hover {
  color: #ffffff;
}

.btn-gen-fill-action {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  border: none;
  border-radius: 8px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
  transition: all 0.18s ease;
  flex-shrink: 0;
}

.btn-gen-fill-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
  filter: brightness(110%);
}

.btn-gen-fill-action:active {
  transform: translateY(0);
}

.btn-gen-cancel-action {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-secondary, #94a3b8);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.15s;
  flex-shrink: 0;
}

.btn-gen-cancel-action:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
}

/* Quick Prompt Suggestions Pills */
.gen-quick-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.gen-pill-label {
  font-size: 10.5px;
  color: var(--text-muted, #64748b);
  font-weight: 500;
}

.gen-pill {
  font-size: 10.5px;
  font-weight: 500;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 2px 8px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.gen-pill:hover {
  color: #ffffff;
  background: rgba(99, 102, 241, 0.25);
  border-color: rgba(99, 102, 241, 0.4);
}

/* ==========================================================================
   Header "Advanced Features" Top Button & Advanced AI Features Studio Suite Modal
   ========================================================================== */

.btn-header-advanced {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.18) 0%, rgba(168, 85, 247, 0.18) 50%, rgba(6, 182, 212, 0.18) 100%);
  border: 1px solid rgba(168, 85, 247, 0.45);
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: var(--radius-full, 9999px);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(99, 102, 241, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.btn-header-advanced i.fa-wand-magic-sparkles {
  color: #c084fc;
  font-size: 0.88rem;
  transition: transform 0.3s ease;
}

.btn-header-advanced:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.32) 0%, rgba(168, 85, 247, 0.32) 50%, rgba(6, 182, 212, 0.32) 100%);
  border-color: rgba(168, 85, 247, 0.8);
  box-shadow: 0 6px 25px rgba(168, 85, 247, 0.45), 0 0 20px rgba(6, 182, 212, 0.3);
  transform: translateY(-1px);
}

.btn-header-advanced:hover i.fa-wand-magic-sparkles {
  transform: rotate(15deg) scale(1.15);
}

.btn-header-advanced.pro-active {
  border-color: rgba(234, 179, 8, 0.6);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(234, 179, 8, 0.18) 100%);
}

.pro-tag-badge {
  background: rgba(99, 102, 241, 0.35);
  border: 1px solid rgba(168, 85, 247, 0.6);
  color: #e0e7ff;
  font-size: 0.62rem;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: var(--radius-full, 9999px);
  display: inline-flex;
  align-items: center;
  gap: 3px;
  letter-spacing: 0.04em;
}

.pro-tag-badge.active {
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.3), rgba(245, 158, 11, 0.25));
  border-color: rgba(234, 179, 8, 0.65);
  color: #fbbf24;
  box-shadow: 0 0 10px rgba(234, 179, 8, 0.3);
}

/* Advanced Features Modal */
.advanced-features-backdrop {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh; height: 100dvh;
  background: rgba(4, 7, 18, 0.88);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10002;
  padding: 20px;
  animation: authFadeIn 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.advanced-features-card {
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  background: rgba(13, 18, 36, 0.96);
  border: 1px solid rgba(168, 85, 247, 0.35);
  border-radius: 24px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.85), 0 0 60px rgba(99, 102, 241, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.18);
  padding: 28px 26px 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: relative;
  overflow-y: auto;
}

.adv-modal-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
}

.adv-header-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(168, 85, 247, 0.2));
  border: 1px solid rgba(168, 85, 247, 0.45);
  color: #c084fc;
  padding: 3px 12px;
  border-radius: var(--radius-full, 9999px);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.adv-modal-header h2 {
  font-size: 1.4rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: -0.01em;
  margin: 2px 0 0;
}

.adv-header-desc {
  font-size: 0.82rem;
  color: #94a3b8;
  max-width: 540px;
  line-height: 1.45;
  margin: 0;
}

.adv-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 14px;
  border-radius: var(--radius-full, 9999px);
  font-size: 0.74rem;
  font-weight: 700;
  margin-top: 4px;
}

.adv-status-pill.status-unlocked {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.45);
  color: #34d399;
}

.adv-status-pill.status-guest {
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}

.adv-features-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  max-height: 48vh;
  overflow-y: auto;
  padding-right: 4px;
}

@media (max-width: 640px) {
  .adv-features-grid {
    grid-template-columns: 1fr;
  }
}

/* Public welcome page: connected edit map */
.tap-to-begin-overlay {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-y: auto;
  padding: 0 clamp(20px, 5vw, 72px) 32px;
  background: #131314;
  color: #f8fafc;
  cursor: default;
  user-select: auto;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.welcome-nav {
  width: min(1200px, 100%);
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,.08);
}

.welcome-brand { display: inline-flex; align-items: center; gap: 10px; color: #f8fafc; text-decoration: none; font-weight: 700; letter-spacing: -.02em; font-size: 0.95rem; }
.welcome-brand b { color: #00e5ff; font-size: .76em; letter-spacing: .08em; }
.welcome-brand-mark { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid rgba(0,229,255,.4); border-radius: 8px; color: #00e5ff; font-size: 0.88rem; }
.welcome-start { min-height: 38px; padding: 0 14px; display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 7px; background: #00e5ff; color: #071116; font-size: 0.85rem; font-weight: 700; cursor: pointer; transition: background .18s ease, transform .18s ease; }
.welcome-start:hover { background: #78f1ff; transform: translateY(-1px); }
.welcome-start:focus-visible, .welcome-task:focus-visible, .welcome-marker:focus-visible, .welcome-brand:focus-visible { outline: 3px solid #a855f7; outline-offset: 4px; }
.welcome-content { width: min(1200px, 100%); margin: 0 auto; padding: clamp(20px, 3vh, 32px) 0 20px; }
.welcome-intro { max-width: 680px; margin-bottom: clamp(16px, 2.5vh, 26px); }
.welcome-intro h1 { margin: 0 0 12px; color: #f8fafc; font-size: clamp(1.85rem, 3.8vw, 3.4rem); line-height: 1.08; letter-spacing: -.035em; }
.welcome-intro h1 span { color: #00e5ff; }
.welcome-intro p { max-width: 54ch; margin: 0; color: #c4cbd6; font-size: clamp(0.9rem, 1.15vw, 1.02rem); line-height: 1.5; }
.welcome-map { position: relative; display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(250px, .85fr); align-items: center; gap: clamp(18px, 3.2vw, 48px); min-height: 0; }
.welcome-artwork { display: block; width: 100%; height: clamp(260px, 25vw, 340px); object-fit: cover; object-position: center; border-radius: 10px; }
.welcome-map-label { position: absolute; top: 12px; left: 12px; z-index: 2; padding: 5px 8px; border-radius: 4px; background: rgba(19,19,20,.88); color: #b3c5d1; font: 600 .62rem/1.2 'JetBrains Mono', monospace; letter-spacing: .04em; }
.welcome-connectors { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.welcome-connectors path { fill: none; stroke: rgba(0,229,255,.65); stroke-width: 2; stroke-dasharray: 5 7; vector-effect: non-scaling-stroke; }
.welcome-task-list { position: relative; z-index: 1; display: grid; gap: 7px; padding-left: 14px; }
.welcome-task { width: 100%; display: grid; grid-template-columns: 32px 1fr 16px; align-items: center; gap: 10px; padding: 12px 12px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: #dce4ed; text-align: left; cursor: pointer; transition: background .18s ease, border-color .18s ease; }
.welcome-task:hover, .welcome-task.is-active { border-color: rgba(0,229,255,.35); background: #1e1e24; }
.welcome-task-number { color: #00e5ff; font: 500 .7rem/1 'JetBrains Mono', monospace; }
.welcome-task b, .welcome-task small { display: block; }
.welcome-task b { margin-bottom: 3px; color: #f8fafc; font-size: 0.9rem; }
.welcome-task small { color: #aeb8c6; font-size: .74rem; line-height: 1.35; }
.welcome-task > i { color: #00e5ff; font-size: .72rem; opacity: 0; transition: opacity .18s ease; }
.welcome-task.is-active > i, .welcome-task:hover > i { opacity: 1; }
.welcome-task-detail { min-height: 2.8em; margin: 8px 12px 0 46px; color: #b5c0ce; font-size: .8rem; line-height: 1.45; }
.welcome-marker { position: absolute; z-index: 2; width: 30px; height: 30px; display: grid; place-items: center; border: 2px solid #131314; border-radius: 50%; background: #00e5ff; color: #071116; font: 700 .72rem 'JetBrains Mono', monospace; cursor: pointer; box-shadow: 0 0 0 1px #00e5ff; transition: transform .18s ease, background .18s ease; }
.welcome-marker:hover, .welcome-marker.is-active { transform: scale(1.15); background: #f8fafc; }
.welcome-marker[data-edit="replace"] { left: 37%; top: 48%; }
.welcome-marker.marker-translate { left: 50%; top: 30%; }
.welcome-marker.marker-erase { left: 61%; top: 65%; }
.welcome-proof { display: flex; flex-wrap: wrap; gap: 8px 20px; margin: 20px 0 0; color: #b8c4d2; font-size: .75rem; }
.welcome-proof span { display: inline-flex; align-items: center; gap: 6px; }
.welcome-proof i { color: #00e5ff; }

/* Interactive Live Preview Snippet Badge Overlay */
.welcome-live-snippet {
  position: absolute;
  top: 50%;
  left: 36%;
  transform: translate(-50%, -50%);
  z-index: 5;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1.5px solid rgba(0, 229, 255, 0.65);
  border-radius: 10px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.7), 0 0 20px rgba(0, 229, 255, 0.25);
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  min-width: 190px;
  max-width: 260px;
}

.welcome-snippet-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #00e5ff;
  text-transform: uppercase;
}

.welcome-snippet-text {
  font-size: 0.88rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #ffffff;
  transition: all 0.3s ease;
  white-space: nowrap;
}

/* Mode-specific styling states */
.welcome-live-snippet.mode-replace {
  border-color: rgba(0, 229, 255, 0.8);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.7), 0 0 25px rgba(0, 229, 255, 0.4);
}
.welcome-live-snippet.mode-replace .welcome-snippet-badge { color: #00e5ff; }
.welcome-live-snippet.mode-replace .welcome-snippet-text { color: #38bdf8; }

.welcome-live-snippet.mode-translate {
  top: 34%;
  left: 52%;
  border-color: rgba(168, 85, 247, 0.85);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.7), 0 0 25px rgba(168, 85, 247, 0.45);
}
.welcome-live-snippet.mode-translate .welcome-snippet-badge { color: #c084fc; }
.welcome-live-snippet.mode-translate .welcome-snippet-text { color: #e9d5ff; font-style: italic; }

.welcome-live-snippet.mode-erase {
  top: 66%;
  left: 60%;
  border-color: rgba(239, 68, 68, 0.8);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.7), 0 0 25px rgba(239, 68, 68, 0.35);
}
.welcome-live-snippet.mode-erase .welcome-snippet-badge { color: #f87171; }
.welcome-live-snippet.mode-erase .welcome-snippet-text {
  color: rgba(148, 163, 184, 0.4);
  text-decoration: line-through;
  filter: blur(1px);
  opacity: 0.45;
}

.welcome-live-snippet.is-animating {
  transform: translate(-50%, -50%) scale(1.05);
}

body.light-theme .welcome-live-snippet {
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15), 0 0 18px rgba(0, 229, 255, 0.2);
}
body.light-theme .welcome-live-snippet .welcome-snippet-text {
  color: #0f172a;
}
body.light-theme .tap-to-begin-overlay, html[data-theme="light"] .tap-to-begin-overlay { background: #f3f6f8; color: #17212b; }
body.light-theme .welcome-nav, html[data-theme="light"] .welcome-nav { border-color: rgba(23,33,43,.14); }
body.light-theme .welcome-brand, html[data-theme="light"] .welcome-intro h1 { color: #17212b; }
body.light-theme .welcome-intro p, html[data-theme="light"] .welcome-task-detail, html[data-theme="light"] .welcome-proof { color: #445465; }
body.light-theme .welcome-task b, html[data-theme="light"] .welcome-task b { color: #17212b; }
body.light-theme .welcome-task:hover, body.light-theme .welcome-task.is-active, html[data-theme="light"] .welcome-task:hover, html[data-theme="light"] .welcome-task.is-active { background: #fff; }
body.light-theme .welcome-marker, html[data-theme="light"] .welcome-marker { border-color: #f3f6f8; }
@media (max-width: 760px) {
  .tap-to-begin-overlay { padding: 0 18px 22px; }
  .welcome-nav { min-height: 70px; }
  .welcome-map { grid-template-columns: 1fr; gap: 18px; }
  .welcome-artwork { height: clamp(230px, 55vw, 370px); }
  .welcome-connectors { display: none; }
  .welcome-task-list { padding: 0; }
  .welcome-task { padding: 12px; }
  .welcome-task-detail { margin-left: 50px; }
  .welcome-marker { width: 31px; height: 31px; }
  .welcome-marker[data-edit="replace"] { left: 35%; top: 46%; }
  .welcome-marker.marker-translate { left: 52%; top: 26%; }
  .welcome-marker.marker-erase { left: 66%; top: 68%; }
  .welcome-proof { margin-top: 18px; }
}

.adv-feature-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 14px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  transition: all 0.22s ease;
}

.adv-feature-card:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(168, 85, 247, 0.35);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.adv-feature-icon-box {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.adv-feature-icon-box.icon-cyan {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.3), rgba(14, 165, 233, 0.2));
  border: 1px solid rgba(6, 182, 212, 0.5);
  color: #38bdf8;
}

.adv-feature-icon-box.icon-purple {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.3), rgba(99, 102, 241, 0.2));
  border: 1px solid rgba(168, 85, 247, 0.5);
  color: #c084fc;
}

.adv-feature-icon-box.icon-violet {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.3), rgba(168, 85, 247, 0.2));
  border: 1px solid rgba(139, 92, 246, 0.5);
  color: #a78bfa;
}

.adv-feature-icon-box.icon-amber {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.3), rgba(217, 119, 6, 0.2));
  border: 1px solid rgba(245, 158, 11, 0.5);
  color: #fbbf24;
}

.adv-feature-icon-box.icon-emerald {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.3), rgba(5, 150, 105, 0.2));
  border: 1px solid rgba(16, 185, 129, 0.5);
  color: #34d399;
}

.adv-feature-icon-box.icon-rose {
  background: linear-gradient(135deg, rgba(244, 63, 94, 0.3), rgba(225, 29, 72, 0.2));
  border: 1px solid rgba(244, 63, 94, 0.5);
  color: #fb7185;
}

.adv-feature-icon-box.icon-teal {
  background: linear-gradient(135deg, rgba(20, 184, 166, 0.3), rgba(13, 148, 136, 0.2));
  border: 1px solid rgba(20, 184, 166, 0.5);
  color: #2dd4bf;
}

.adv-feature-info {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
  min-width: 0;
}

.adv-feature-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.adv-feature-title-row strong {
  font-size: 0.85rem;
  font-weight: 700;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.adv-feature-chip {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-full, 9999px);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  flex-shrink: 0;
}

.adv-feature-info p {
  font-size: 0.74rem;
  color: #94a3b8;
  line-height: 1.38;
  margin: 0;
}

.btn-adv-launch {
  align-self: flex-start;
  margin-top: 4px;
  background: rgba(99, 102, 241, 0.14);
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: #c7d2fe;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-sm, 8px);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.18s ease;
}

.btn-adv-launch:hover {
  background: #6366f1;
  border-color: #818cf8;
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.45);
  transform: translateX(2px);
}

.adv-modal-footer {
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
}

.adv-guest-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  justify-content: center;
  flex-wrap: wrap;
}

.adv-verified-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

/* ==========================================================================
   React Bits & AeroShards GPU Wind Sculpture Styles
   ========================================================================== */
.aero-shards-hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.85;
}

.empty-dropzone {
  position: relative;
  overflow: hidden;
}

.dropzone-card {
  position: relative;
  z-index: 2;
}

@keyframes shine {
  0% {
    background-position: 100%;
  }
  100% {
    background-position: -100%;
  }
}

.shiny-text {
  font-weight: 700;
  letter-spacing: -0.01em;
}

.btn-header-blogs {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.15), rgba(139, 92, 246, 0.2));
  border: 1px solid rgba(236, 72, 153, 0.4);
  color: #f472b6;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-header-blogs:hover {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.3), rgba(139, 92, 246, 0.35));
  border-color: rgba(236, 72, 153, 0.7);
  color: #ffffff;
  box-shadow: 0 0 16px rgba(236, 72, 153, 0.35);
  transform: translateY(-1px);
}

/* ==========================================================================
   AI Slop Blogs & Engineering Articles Hub
   ========================================================================== */
.homepage-ai-blogs-section {
  width: 100%;
  max-width: 1280px;
  margin: 40px auto;
  padding: 0 24px;
}

.homepage-blogs-wrapper {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: 36px 32px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

.section-header-row {
  margin-bottom: 28px;
}

.section-pill {
  display: inline-flex;
  align-items: center;
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.3);
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 12px;
}

.section-heading {
  font-size: 28px;
  font-weight: 800;
  color: #f8fafc;
  margin: 0 0 8px 0;
  letter-spacing: -0.02em;
}

.section-subheading {
  font-size: 15px;
  color: #94a3b8;
  margin: 0;
  max-width: 680px;
  line-height: 1.5;
}

.ai-slop-blogs-container {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.ai-blogs-hero {
  text-align: center;
  margin-bottom: 8px;
}

.ai-blogs-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.3);
  padding: 6px 14px;
  border-radius: 9999px;
  margin-bottom: 12px;
}

.badge-pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #60a5fa;
  box-shadow: 0 0 8px #60a5fa;
  animation: pulse-glow 2s infinite ease-in-out;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.3); }
}

.ai-blogs-title {
  font-size: 32px;
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 10px 0;
  letter-spacing: -0.02em;
}

.ai-blogs-description {
  font-size: 15px;
  color: #94a3b8;
  max-width: 640px;
  margin: 0 auto 24px auto;
  line-height: 1.6;
}

.ai-blogs-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}

.search-box {
  position: relative;
  width: 100%;
  max-width: 540px;
}

.search-box .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: #64748b;
  pointer-events: none;
}

.blog-search-input {
  width: 100%;
  padding: 12px 38px 12px 40px;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  color: #f8fafc;
  font-size: 14px;
  transition: all 0.2s ease;
}

.blog-search-input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
  background: rgba(15, 23, 42, 1);
}

.search-clear-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  font-size: 13px;
  padding: 4px;
}

.category-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.category-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.category-pill:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #f8fafc;
  border-color: rgba(255, 255, 255, 0.25);
}

.category-pill.active {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  border-color: #818cf8;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
}

/* Blog Cards Grid */
.ai-blogs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 24px;
}

.blog-card {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.blog-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
}

.blog-card-inner {
  padding: 24px;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.blog-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.blog-category-tag {
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: #818cf8;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.blog-read-time {
  font-size: 12px;
  color: #94a3b8;
}

.blog-card-title {
  font-size: 18px;
  font-weight: 700;
  color: #f8fafc;
  margin: 0 0 8px 0;
  line-height: 1.35;
}

.blog-card-subtitle {
  font-size: 13.5px;
  color: #94a3b8;
  margin: 0 0 16px 0;
  line-height: 1.5;
  flex-grow: 1;
}

.blog-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}

.blog-tag {
  font-size: 11.5px;
  color: #64748b;
  background: rgba(255, 255, 255, 0.03);
  padding: 2px 8px;
  border-radius: 4px;
}

.blog-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.blog-author {
  display: flex;
  align-items: center;
  gap: 10px;
}

.author-img {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.author-details {
  display: flex;
  flex-direction: column;
}

.author-name {
  font-size: 12.5px;
  font-weight: 600;
  color: #e2e8f0;
}

.blog-date {
  font-size: 11px;
  color: #64748b;
}

.read-more-btn {
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.3);
  color: #818cf8;
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.read-more-btn:hover {
  background: #4f46e5;
  border-color: #6366f1;
  color: #ffffff;
}

.no-blogs-found {
  text-align: center;
  padding: 40px 20px;
  color: #94a3b8;
}

/* ==========================================================================
   React Modal Article Reader Styles
   ========================================================================== */
.react-blog-modal-overlay,
.article-reader-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 15, 29, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: modal-fade-in 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modal-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.react-blog-modal-window {
  width: 95%;
  max-width: 1200px;
  max-height: 90vh;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 32px;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.6);
}

.react-modal-close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #f8fafc;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
}

.react-modal-close-btn:hover {
  background: #ef4444;
  border-color: #f87171;
  color: #fff;
  transform: rotate(90deg);
}

.article-reader-modal {
  width: 95%;
  max-width: 860px;
  max-height: 88vh;
  background: #0f172a;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  padding: 36px 40px;
  overflow-y: auto;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
  animation: modal-scale-in 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modal-scale-in {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.reader-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.reader-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #94a3b8;
}

.reader-category {
  color: #818cf8;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.reader-dot {
  color: #475569;
}

.reader-close-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.reader-close-btn:hover {
  background: #ef4444;
  border-color: #f87171;
}

.reader-title {
  font-size: 28px;
  font-weight: 800;
  color: #ffffff;
  margin: 0 0 10px 0;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

.reader-subtitle {
  font-size: 16px;
  color: #94a3b8;
  margin: 0 0 20px 0;
  line-height: 1.5;
}

.reader-author-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  margin-bottom: 28px;
}

.reader-author-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #4f46e5;
}

.reader-author-name {
  font-size: 14px;
  font-weight: 700;
  color: #f8fafc;
}

.reader-author-role {
  font-size: 12px;
  color: #64748b;
}

.reader-actions {
  margin-left: auto;
}

.btn-try-studio {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  border: 1px solid #818cf8;
  color: #ffffff;
  font-weight: 600;
  font-size: 12.5px;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
}

.btn-try-studio:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.55);
}

.reader-content {
  font-size: 15px;
  line-height: 1.8;
  color: #cbd5e1;
  margin-bottom: 32px;
}

.reader-h3 {
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
  margin: 28px 0 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 8px;
}

.reader-h4 {
  font-size: 16.5px;
  font-weight: 600;
  color: #818cf8;
  margin: 20px 0 8px 0;
}

.reader-p {
  margin: 0 0 16px 0;
}

.reader-code-block {
  background: #090d16;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: #38bdf8;
  overflow-x: auto;
  margin: 18px 0;
  line-height: 1.5;
}

.reader-callout {
  background: rgba(99, 102, 241, 0.1);
  border-left: 4px solid #6366f1;
  border-radius: 0 8px 8px 0;
  padding: 12px 18px;
  margin: 18px 0;
  color: #e2e8f0;
  font-style: normal;
}

.reader-list {
  padding-left: 20px;
  margin: 0 0 18px 0;
}

.reader-list li {
  margin-bottom: 6px;
}

.reader-footer {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.reader-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.reader-tag {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #818cf8;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 6px;
}

.reader-footer-cta {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: flex-end;
}

@media (max-width: 768px) {
  .homepage-blogs-wrapper {
    padding: 24px 16px;
  }
  .ai-blogs-title {
    font-size: 24px;
  }
  .ai-blogs-grid {
    grid-template-columns: 1fr;
  }
  .article-reader-modal {
    padding: 20px 16px;
  }
  .reader-author-bar {
    flex-direction: column;
    align-items: flex-start;
  }
  .reader-actions {
    margin-left: 0;
    width: 100%;
  }
  .btn-try-studio {
    width: 100%;
  }
}

/* ==========================================================================
   Advanced Features & AI Blogs Left-Sidebar Buttons
   ========================================================================== */

.btn-tool-blogs-sidebar {
  border: 1px solid rgba(236, 72, 153, 0.4) !important;
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.15), rgba(139, 92, 246, 0.12)) !important;
  position: relative;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.btn-tool-blogs-sidebar:hover {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.32), rgba(139, 92, 246, 0.25)) !important;
  border-color: rgba(236, 72, 153, 0.8) !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 18px rgba(236, 72, 153, 0.45) !important;
}

.btn-tool-blogs-sidebar.active {
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.45), rgba(139, 92, 246, 0.4)) !important;
  border-color: #f472b6 !important;
  box-shadow: 0 0 20px rgba(236, 72, 153, 0.65) !important;
}

.btn-tool-adv-sidebar {
  border: 1px solid rgba(168, 85, 247, 0.45) !important;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.15), rgba(236, 72, 153, 0.1)) !important;
  position: relative;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.btn-tool-adv-sidebar:hover {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.3), rgba(236, 72, 153, 0.22)) !important;
  border-color: rgba(168, 85, 247, 0.75) !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 18px rgba(168, 85, 247, 0.45) !important;
}

.btn-tool-adv-sidebar.active {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.45), rgba(236, 72, 153, 0.38)) !important;
  border-color: #c084fc !important;
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.65) !important;
}

.adv-arrow-icon {
  font-size: 0.55rem;
  color: #c084fc;
  position: absolute;
  right: 5px;
  bottom: 5px;
  animation: bounceRight 1.5s infinite;
}

@keyframes bounceRight {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(2.5px); }
}

/* Header Quick Launch Button for Advanced Features */
.btn-header-adv {
  height: 32px;
  padding: 0 13px;
  font-size: 0.8rem;
  font-weight: 600;
  margin: 0 2px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(168, 85, 247, 0.16) !important;
  border: 1px solid rgba(168, 85, 247, 0.45) !important;
  color: #f1f5f9 !important;
  border-radius: 20px !important;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.btn-header-adv:hover {
  background: rgba(168, 85, 247, 0.32) !important;
  border-color: #c084fc !important;
  color: #ffffff !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(168, 85, 247, 0.35);
}

@media (max-width: 768px) {
  .btn-header-adv {
    display: none !important;
  }
}

/* Advanced Features Right-Side Canvas Slide Panel */
.adv-features-slide-panel {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 410px;
  max-width: calc(100vw - 32px);
  height: calc(100vh - var(--header-height, 58px) - 48px);
  max-height: 840px;
  background: rgba(13, 17, 34, 0.98);
  backdrop-filter: blur(28px) saturate(200%);
  -webkit-backdrop-filter: blur(28px) saturate(200%);
  border: 1px solid rgba(168, 85, 247, 0.45);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.8), 0 0 35px rgba(168, 85, 247, 0.28);
  z-index: 120;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slideInRight 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideInRight {
  from { transform: translateX(30px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

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

.adv-side-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.adv-side-title i {
  font-size: 1.35rem;
}

.adv-side-title h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
}

.adv-side-subtitle {
  font-size: 0.7rem;
  color: #94a3b8;
  display: block;
}

.adv-side-close-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.adv-side-close-btn:hover {
  background: rgba(239, 68, 68, 0.25);
  color: #fca5a5;
  transform: scale(1.08);
}

.adv-side-header {
  flex-shrink: 0;
}

.adv-side-body {
  padding: 14px;
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  overscroll-behavior-y: contain;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.adv-side-body::-webkit-scrollbar {
  width: 4px;
}

.adv-side-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 4px;
}

.adv-side-auth-banner {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.adv-auth-lock-card {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.14), rgba(239, 68, 68, 0.1));
  border: 1px solid rgba(245, 158, 11, 0.45);
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.adv-auth-lock-info {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.adv-auth-lock-info i {
  font-size: 1.1rem;
  color: #fbbf24;
  margin-top: 2px;
}

.adv-auth-lock-text strong {
  display: block;
  font-size: 0.85rem;
  color: #fbbf24;
  margin-bottom: 2px;
}

.adv-auth-lock-text span {
  font-size: 0.75rem;
  color: #cbd5e1;
  line-height: 1.35;
  display: block;
}

.adv-auth-verified-badge {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(6, 182, 212, 0.15));
  border: 1px solid rgba(16, 185, 129, 0.4);
  border-radius: 10px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: #34d399;
  font-weight: 600;
}

.adv-side-intro-card {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.14), rgba(168, 85, 247, 0.12));
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: 10px;
  padding: 10px 12px;
}

.adv-intro-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  color: #c084fc;
  background: rgba(168, 85, 247, 0.25);
  padding: 2px 8px;
  border-radius: 999px;
  margin-bottom: 4px;
}

.adv-side-intro-card p {
  font-size: 0.74rem;
  color: #cbd5e1;
  margin: 0;
  line-height: 1.4;
}

.adv-side-cards-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.adv-side-card {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.adv-side-card:hover {
  background: rgba(255, 255, 255, 0.065);
  border-color: rgba(168, 85, 247, 0.45);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.adv-card-icon-wrap {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  flex-shrink: 0;
}

.adv-card-content {
  flex: 1;
  min-width: 0;
}

.adv-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 4px;
}

.adv-card-header h4 {
  font-size: 0.82rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.adv-card-badge {
  font-size: 0.6rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

.adv-card-content p {
  font-size: 0.72rem;
  color: #94a3b8;
  line-height: 1.35;
  margin: 0 0 8px 0;
}

.btn-adv-side-launch {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #ffffff;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-adv-side-launch:hover {
  background: var(--accent-gradient);
  border-color: transparent;
  transform: translateY(-1px);
  box-shadow: 0 2px 12px rgba(99, 102, 241, 0.45);
}

/* ==========================================================================
   Bidirectional Translation Bar & Swap Controls
   ========================================================================== */

.translation-floating-bar {
  flex-wrap: wrap;
  gap: 12px;
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(6, 182, 212, 0.35);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5), 0 0 24px rgba(6, 182, 212, 0.2);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-lg);
  padding: 8px 16px;
  animation: slideUpFloat 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.trans-floating-fields {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.trans-field-label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.76rem;
  color: #cbd5e1;
}

.trans-select-inline {
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #ffffff;
  font-size: 0.74rem;
}

.btn-swap-langs {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #38bdf8;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.74rem;
  transition: all 0.25s ease;
  flex-shrink: 0;
}

.btn-swap-langs:hover {
  background: rgba(6, 182, 212, 0.3);
  border-color: #06b6d4;
  color: #ffffff;
  transform: rotate(180deg) scale(1.08);
}

.btn-close-float-bar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.75rem;
  transition: all 0.2s ease;
  margin-left: 4px;
}

.btn-close-float-bar:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: #ef4444;
  color: #fca5a5;
  transform: scale(1.08);
}

/* ==========================================================================
   Side-by-Side Dual Canvas Comparison Stage for Translation
   ========================================================================== */

.trans-compare-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  max-width: 96vw;
  width: 100%;
  margin: auto;
  padding: 10px;
  z-index: 10;
  animation: fadeInCompare 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes fadeInCompare {
  from { opacity: 0; transform: scale(0.97); }
  to { opacity: 1; transform: scale(1); }
}

.trans-compare-box {
  display: flex;
  flex-direction: column;
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  max-width: 46vw;
  flex: 1;
}

.trans-compare-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 0.76rem;
  font-weight: 700;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.trans-compare-tag.original-tag {
  background: rgba(100, 116, 139, 0.2);
  color: #94a3b8;
}

.trans-compare-tag.translated-tag {
  background: rgba(6, 182, 212, 0.15);
  color: #22d3ee;
  border-bottom-color: rgba(6, 182, 212, 0.25);
}

.trans-compare-canvas-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background-image: 
    linear-gradient(45deg, #1e293b 25%, transparent 25%), 
    linear-gradient(-45deg, #1e293b 25%, transparent 25%), 
    linear-gradient(45deg, transparent 75%, #1e293b 75%), 
    linear-gradient(-45deg, transparent 75%, #1e293b 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
  background-color: #0f172a;
  padding: 8px;
  overflow: auto;
  max-height: 72vh;
}

.trans-compare-canvas-wrap canvas {
  display: block;
  max-width: 100%;
  max-height: 68vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.trans-compare-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.trans-compare-arrow {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(6, 182, 212, 0.2);
  border: 1px solid rgba(6, 182, 212, 0.4);
  color: #22d3ee;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.35);
}

@media (max-width: 900px) {
  .trans-compare-stage {
    flex-direction: column;
    gap: 12px;
  }
  .trans-compare-box {
    max-width: 92vw;
  }
  .trans-compare-arrow {
    transform: rotate(90deg);
  }
}

/* ==========================================================================
   Responsive Styles for In-Place Photo & Document Translator Bar
   ========================================================================== */
.translation-floating-bar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  min-width: min(320px, calc(100vw - 16px));
  max-width: min(540px, calc(100vw - 16px));
  padding: 10px 14px;
  background: rgba(11, 16, 30, 0.96);
  border: 1px solid rgba(6, 182, 212, 0.35);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.75), 0 0 25px rgba(6, 182, 212, 0.15);
  border-radius: 12px;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  z-index: 1200;
}

.trans-bar-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.trans-bar-input-row {
  width: 100%;
}

.trans-bar-langs-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.trans-lang-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.trans-lang-lbl {
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
}

.trans-lang-pickers {
  display: flex;
  align-items: center;
  gap: 4px;
  width: 100%;
}

.trans-bar-actions-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-top: 2px;
}

.trans-bar-actions-row button {
  flex: 1;
  justify-content: center;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 700;
}

@media (max-width: 600px) {
  .app-header {
    padding: 6px 8px !important;
    gap: 4px !important;
  }
  .header-left .brand-subtitle {
    display: none !important;
  }
  .header-right {
    gap: 4px !important;
  }
  #btnHeaderAddImage, #btnHeaderClearCanvas, #btnOpenExportModal {
    padding: 5px 8px !important;
    font-size: 0.75rem !important;
  }
  .site-lang-btn {
    padding: 4px 6px !important;
    font-size: 0.72rem !important;
    gap: 4px !important;
  }
  .translation-floating-bar {
    position: fixed !important;
    bottom: calc(var(--toolbar-height, 58px) + 10px) !important;
    top: auto !important;
    left: 8px !important;
    right: 8px !important;
    width: auto !important;
    max-width: calc(100vw - 16px) !important;
    transform: none !important;
    padding: 10px 12px !important;
  }
  .trans-compare-stage {
    flex-direction: column !important;
    width: 100% !important;
    max-width: calc(100vw - 16px) !important;
    padding: 4px !important;
    gap: 10px !important;
  }
  .trans-compare-box {
    max-width: 100% !important;
    width: 100% !important;
  }
  .trans-compare-canvas-wrap {
    max-height: 38vh !important;
  }
}

/* Global Multi-Device Viewport & Floating Toolbar Responsiveness */
.floating-toolbar {
  max-width: 95vw;
  box-sizing: border-box;
}

@media (max-width: 1200px) {
  .floating-toolbar {
    flex-wrap: wrap;
    max-height: 48vh;
    overflow-y: auto;
    padding: 8px 12px;
  }
}

@media (max-width: 768px) {
  .adv-features-slide-panel {
    position: fixed;
    top: auto;
    bottom: var(--toolbar-height, 58px);
    left: 0;
    right: 0;
    width: 100vw;
    max-width: 100vw;
    height: 75vh;
    height: 75dvh;
    max-height: 75vh;
    max-height: 75dvh;
    border-radius: 18px 18px 0 0;
    border-left: none;
    border-right: none;
    z-index: 210;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    touch-action: pan-y;
  }

  .adv-side-cards-list {
    touch-action: pan-y;
    padding-bottom: 36px;
  }

  .btn-tool-adv-sidebar .adv-arrow-icon {
    display: none;
  }
}

/* ==========================================================================
   Google Translate Website Live UI Localization & Language Selector
   ========================================================================== */

/* 1. Complete Suppression of Google Translate Default Top Bar, Logos, Badges, Tooltips & Layout Shifting */
.goog-te-banner-frame,
.goog-te-banner-frame.skiptranslate,
iframe.goog-te-banner-frame,
iframe.skiptranslate,
#goog-gt-tt,
.goog-te-balloon-frame,
.goog-tooltip,
.goog-tooltip:hover,
.goog-logo-link,
.goog-te-gadget,
.goog-te-gadget-simple,
.goog-te-gadget-icon,
.goog-te-menu-value,
.goog-te-combo,
.goog-te-spinner-pos,
.goog-te-menu-frame,
[class*="VIpgJd"],
[id*="goog-gt-"],
.VIpgJd-ZVi9od-aZ2wEe-wOHMyf,
.VIpgJd-ZVi9od-aZ2wEe-wOHMyf-ti6hGc,
.VIpgJd-ZVi9od-l4eHX-hSRGPd,
.VIpgJd-ZVi9od-ORHb-OEVmcd {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
}

body {
  top: 0px !important;
  position: static !important;
}

.skiptranslate:not(.site-lang-dropdown):not(.site-lang-dropdown *) {
  display: none !important;
}

#google_translate_element {
  display: none !important;
}

/* 2. Header & Studio Language Selector Dropdown */
.site-lang-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.site-lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #f1f5f9;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.site-lang-btn:hover {
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(99, 102, 241, 0.45);
  color: #fff;
  box-shadow: 0 0 14px rgba(99, 102, 241, 0.25);
}

.site-lang-btn i.fa-globe {
  color: #38bdf8;
  font-size: 0.9rem;
}

.site-lang-btn i.fa-chevron-down {
  font-size: 0.65rem;
  opacity: 0.7;
  transition: transform 0.2s;
}

.site-lang-dropdown .site-lang-menu.active + .site-lang-btn i.fa-chevron-down,
.site-lang-dropdown:hover .site-lang-btn i.fa-chevron-down {
  transform: rotate(180deg);
}

.site-lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 260px;
  background: rgba(15, 23, 42, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(99, 102, 241, 0.2);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 10px;
  display: none;
  flex-direction: column;
  gap: 8px;
  z-index: 1000;
  animation: fadeInMenu 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.site-lang-menu.active {
  display: flex;
}

@keyframes fadeInMenu {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.site-lang-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.site-lang-search-wrap i {
  position: absolute;
  left: 10px;
  font-size: 0.75rem;
  color: #64748b;
}

.site-lang-search {
  width: 100%;
  padding: 7px 10px 7px 28px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  color: #fff;
  font-size: 0.78rem;
  outline: none;
  box-sizing: border-box;
}

.site-lang-search:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.25);
}

.btn-revert-site-lang {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 6px 10px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: 6px;
  color: #fca5a5;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-revert-site-lang:hover {
  background: rgba(239, 68, 68, 0.22);
  border-color: rgba(239, 68, 68, 0.45);
  color: #fff;
}

.site-lang-list {
  max-height: 240px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-right: 2px;
}

.site-lang-list::-webkit-scrollbar {
  width: 5px;
}
.site-lang-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 4px;
}

.site-lang-group-title {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #94a3b8;
  padding: 6px 8px 3px 8px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.site-lang-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 6px 10px;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: #cbd5e1;
  font-size: 0.78rem;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s;
}

.site-lang-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.site-lang-item.active {
  background: rgba(99, 102, 241, 0.25);
  color: #38bdf8;
  font-weight: 700;
}

.site-lang-native {
  font-size: 0.72rem;
  color: #64748b;
}

.site-lang-empty {
  padding: 16px;
  text-align: center;
  color: #64748b;
  font-size: 0.78rem;
}

/* 3. First-Visit Auto-Detect Banner */
.site-trans-detect-banner {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(56, 189, 248, 0.2);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 9999;
  animation: slideUpBanner 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 420px;
}

@keyframes slideUpBanner {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.site-trans-detect-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.site-trans-detect-info i {
  font-size: 1.2rem;
  color: #38bdf8;
}

.site-trans-detect-text {
  font-size: 0.8rem;
  color: #e2e8f0;
  line-height: 1.35;
}

.site-trans-detect-text strong {
  color: #38bdf8;
}

.site-trans-detect-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ==========================================================================
   Free OCR & AI Translation Studio Modal Styles
   ========================================================================== */
.modal-window.ocr-studio-window {
  max-width: 1040px;
  width: 95%;
  max-height: 92vh;
  border-radius: 20px;
  background: rgba(11, 17, 33, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.8), 0 0 60px rgba(56, 189, 248, 0.15);
  display: flex;
  flex-direction: column;
}

.ocr-studio-body {
  padding: 20px 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ocr-upload-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ocr-dropzone {
  border: 2px dashed rgba(56, 189, 248, 0.35);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.6);
  padding: 24px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.ocr-dropzone * {
  pointer-events: none;
}

.ocr-dropzone:hover,
.ocr-dropzone.drag-active {
  border-color: #38bdf8;
  background: rgba(56, 189, 248, 0.08);
  box-shadow: 0 0 25px rgba(56, 189, 248, 0.25);
  transform: translateY(-1px);
}

.ocr-drop-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(99, 102, 241, 0.2));
  border: 1px solid rgba(56, 189, 248, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #38bdf8;
  margin-bottom: 10px;
}

.ocr-dropzone h3 {
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 4px 0;
}

.ocr-dropzone p {
  font-size: 0.8rem;
  color: #94a3b8;
  margin: 0 0 12px 0;
}

.ocr-format-pills {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ocr-format-pills span {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
}

.ocr-file-info-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(56, 189, 248, 0.3);
  border-radius: 12px;
  padding: 10px 14px;
}

.ocr-file-info-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ocr-file-thumb {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.ocr-file-details h4 {
  font-size: 0.88rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 2px 0;
}

.ocr-file-details span {
  font-size: 0.74rem;
  color: #94a3b8;
}

/* Status & Progress Indicators */
.ocr-status-card {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 12px;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: fadeIn 0.2s ease;
}

.ocr-status-header {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #38bdf8;
  font-size: 0.85rem;
  font-weight: 600;
}

.ocr-status-header i.fa-spin {
  font-size: 1rem;
}

.ocr-progress-track {
  width: 100%;
  height: 6px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 4px;
  overflow: hidden;
}

.ocr-progress-fill {
  height: 100%;
  width: 10%;
  background: linear-gradient(90deg, #38bdf8, #818cf8, #a855f7);
  border-radius: 4px;
  transition: width 0.3s ease;
}

/* Dual-Grid Source & Translated Panels */
.ocr-dual-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 768px) {
  .ocr-dual-grid {
    grid-template-columns: 1fr;
  }
}

.ocr-card {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

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

.ocr-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  font-weight: 700;
  color: #f1f5f9;
}

.ocr-card-title i {
  color: #38bdf8;
}

.ocr-badge {
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
}

.ocr-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ocr-card-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.ocr-textarea {
  width: 100%;
  height: 220px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: #f1f5f9;
  font-family: 'Inter', 'Noto Sans', 'Noto Sans Devanagari', 'Noto Sans Gurmukhi', 'Noto Sans Bengali', 'Noto Sans Tamil', 'Noto Sans Telugu', 'Noto Sans Gujarati', 'Noto Sans Kannada', 'Noto Sans Malayalam', 'Noto Naskh Arabic', 'Noto Sans Arabic', 'Noto Sans SC', 'Noto Sans TC', 'Noto Sans JP', 'Noto Sans KR', 'Noto Sans Thai', 'Noto Sans Hebrew', system-ui, -apple-system, sans-serif;
  font-size: 0.86rem;
  line-height: 1.55;
  padding: 12px;
  resize: vertical;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.2s;
}

.ocr-textarea:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.2);
}

.ocr-card-footer {
  padding: 8px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.74rem;
  color: #64748b;
}

/* Translation Toolbar in Right Card */
.ocr-trans-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
  flex-wrap: wrap;
}

.ocr-lang-picker {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 180px;
}

.ocr-search-input {
  width: 75px;
  padding: 6px 8px;
  font-size: 0.74rem;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  outline: none;
}

.ocr-select {
  flex: 1;
  padding: 6px 10px;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #38bdf8;
  outline: none;
  cursor: pointer;
}

.ocr-trans-status-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  color: #c084fc;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.ocr-btn-action {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  padding: 5px 9px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}

.ocr-btn-action:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.ocr-btn-action.primary {
  background: linear-gradient(135deg, #0ea5e9, #6366f1);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 0 15px rgba(14, 165, 233, 0.3);
}

.ocr-btn-action.primary:hover {
  filter: brightness(1.1);
  box-shadow: 0 0 20px rgba(14, 165, 233, 0.45);
}

/* ==========================================================================
   Gemini-Inspired Modern Dark Theme, 24px Rounded Curves & Fluid AI Processing
   ========================================================================== */

/* 1. Global Dark Palette & Containers */
body,
.app-container,
.main-content,
.canvas-area,
#canvasWorkspace,
#canvasContainer {
  background-color: #131314 !important;
  color: #e3e3e3 !important;
}

/* React Bits Background System: Ghost Fibers & AeroShards Global Atmosphere */
#app-global-bg,
.app-global-bg {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important; height: 100dvh !important;
  pointer-events: none !important;
  z-index: 1 !important;
  overflow: hidden !important;
  mix-blend-mode: screen;
}

#aero-shards-bg-container,
.aero-shards-hero-bg {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  pointer-events: none !important;
  z-index: 0 !important;
  opacity: 0.55 !important;
  mix-blend-mode: screen !important;
}

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

/* Containers (#1e1e24 with subtle outlines) */
.app-header,
.header,
.toolbar,
.panel,
.inspector,
.modal-window,
.ocr-studio-window,
.ocr-card,
.ocr-file-info-bar,
.card,
.panel-card,
.tools-panel,
.site-lang-menu,
.dropdown-menu,
.site-lang-dropdown .site-lang-menu {
  background: #1e1e24 !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: #e3e3e3 !important;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45) !important;
}

/* 2. Universal 24px Border-Radius & Clean Outlines for All Buttons, Textareas & Dropzones */

/* All Buttons: 24px border radius with subtle clean outlines */
button,
.btn,
.btn-primary,
.btn-secondary,
.btn-action,
.tool-btn,
.ocr-btn-action,
.site-lang-btn,
.drop-action-btn-main,
.icon-btn,
.btn-close-modal,
.react-modal-close-btn,
.btn-large,
.btn-sm,
.btn-try-studio {
  border-radius: 24px !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

button:hover,
.btn:hover,
.ocr-btn-action:hover,
.tool-btn:hover {
  border-color: rgba(255, 255, 255, 0.22) !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3) !important;
}

/* Primary Action Buttons */
.btn-primary,
.ocr-btn-action.primary,
.drop-action-btn-main {
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 50%, #ec4899 100%) !important;
  border-color: rgba(255, 255, 255, 0.18) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.35) !important;
}

.btn-primary:hover,
.ocr-btn-action.primary:hover,
.drop-action-btn-main:hover {
  background: linear-gradient(135deg, #60a5fa 0%, #a855f7 50%, #f43f5e 100%) !important;
  box-shadow: 0 6px 26px rgba(168, 85, 247, 0.5) !important;
  transform: translateY(-1px);
}

/* All Textareas: 24px border radius, spacious padding, subtle outline */
textarea,
.ocr-textarea,
#ocrSourceText,
#ocrTranslatedText {
  border-radius: 24px !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  background: #17171c !important;
  color: #e3e3e3 !important;
  padding: 16px 20px !important;
  line-height: 1.6 !important;
  font-size: 0.9rem !important;
  transition: border-color 0.25s ease, box-shadow 0.25s ease !important;
  outline: none !important;
}

textarea:focus,
.ocr-textarea:focus {
  border-color: #8ab4f8 !important;
  box-shadow: 0 0 0 3px rgba(138, 180, 248, 0.2), 0 0 20px rgba(138, 180, 248, 0.15) !important;
}

/* All Drag-and-Drop Zones: 24px border radius with clean subtle dashed border */
.ocr-dropzone,
#ocrDropzone,
.dropzone,
.file-dropzone,
#editorDropzone,
.canvas-dropzone,
.drop-zone,
.welcome-dropzone {
  border-radius: 24px !important;
  border: 1.5px dashed rgba(255, 255, 255, 0.2) !important;
  background: #1e1e24 !important;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.ocr-dropzone:hover,
.ocr-dropzone.drag-active,
.dropzone:hover {
  border-color: #8ab4f8 !important;
  background: rgba(30, 30, 36, 0.85) !important;
  box-shadow: 0 0 25px rgba(138, 180, 248, 0.25) !important;
}

/* Inputs & Dropdowns */
input[type="text"],
input[type="search"],
select,
.ocr-select,
.ocr-search-input,
.site-lang-search {
  border-radius: 24px !important;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
  background: #17171c !important;
  color: #e3e3e3 !important;
  padding: 8px 16px !important;
  outline: none !important;
  transition: border-color 0.2s, box-shadow 0.2s !important;
}

input[type="text"]:focus,
select:focus,
.ocr-select:focus {
  border-color: #8ab4f8 !important;
  box-shadow: 0 0 0 2px rgba(138, 180, 248, 0.25) !important;
}

/* 3. Smooth Fluid Gradient Animation for Tesseract.js OCR & Translation */
@keyframes geminiFluidShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes geminiBorderPulse {
  0%, 100% {
    box-shadow: 0 0 16px rgba(66, 133, 244, 0.35), 0 0 32px rgba(168, 85, 247, 0.25);
  }
  50% {
    box-shadow: 0 0 26px rgba(236, 72, 153, 0.5), 0 0 45px rgba(168, 85, 247, 0.4);
  }
}

/* OCR Reading Loading Bar (Smooth Fluid Gradient: Soft Blue, Purple, Pink) */
.ocr-progress-track {
  width: 100% !important;
  height: 8px !important;
  background: rgba(255, 255, 255, 0.08) !important;
  border-radius: 24px !important;
  overflow: hidden !important;
  padding: 1px !important;
}

.ocr-progress-fill {
  height: 100% !important;
  border-radius: 24px !important;
  background: linear-gradient(90deg, #4285f4, #9333ea, #ec4899, #60a5fa, #4285f4) !important;
  background-size: 300% 300% !important;
  animation: geminiFluidShift 2.5s ease infinite !important;
  box-shadow: 0 0 16px rgba(168, 85, 247, 0.65), 0 0 8px rgba(236, 72, 153, 0.55) !important;
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

/* OCR Status Card with Animated Fluid Border */
.ocr-status-card {
  position: relative !important;
  background: #1e1e24 !important;
  border-radius: 24px !important;
  padding: 14px 20px !important;
  border: 1.5px solid transparent !important;
  background-clip: padding-box !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4) !important;
  color: #e3e3e3 !important;
}

.ocr-status-card::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 26px;
  background: linear-gradient(90deg, #4285f4, #9333ea, #ec4899, #60a5fa, #4285f4);
  background-size: 300% 300%;
  animation: geminiFluidShift 3s ease infinite, geminiBorderPulse 3s ease-in-out infinite;
  z-index: -1;
}

.ocr-status-header {
  color: #8ab4f8 !important;
  font-weight: 600 !important;
}

/* Fluid Border when OCR is reading file on dropzone */
.ocr-dropzone.ocr-processing {
  position: relative !important;
  background: #1e1e24 !important;
  border: 1.5px solid transparent !important;
  background-clip: padding-box !important;
}

.ocr-dropzone.ocr-processing::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 26px;
  background: linear-gradient(90deg, #4285f4, #9333ea, #ec4899, #60a5fa, #4285f4);
  background-size: 300% 300%;
  animation: geminiFluidShift 3s ease infinite, geminiBorderPulse 3s ease-in-out infinite;
  z-index: -1;
}

/* Translation Status Indicator with Fluid Animated Border */
.ocr-trans-status-inline {
  position: relative !important;
  background: #1e1e24 !important;
  border-radius: 24px !important;
  padding: 8px 18px !important;
  border: 1.5px solid transparent !important;
  background-clip: padding-box !important;
  color: #e3e3e3 !important;
  font-weight: 600 !important;
}

.ocr-trans-status-inline::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 26px;
  background: linear-gradient(90deg, #4285f4, #9333ea, #ec4899, #60a5fa, #4285f4);
  background-size: 300% 300%;
  animation: geminiFluidShift 3s ease infinite, geminiBorderPulse 3s ease-in-out infinite;
  z-index: -1;
}

/* Translating Textarea & Button Fluid Animation */
.ocr-textarea.is-translating {
  border-color: transparent !important;
  box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.4), 0 0 25px rgba(236, 72, 153, 0.35) !important;
  animation: geminiBorderPulse 2.5s ease-in-out infinite !important;
}

.ocr-btn-action.gemini-fluid-btn {
  background: linear-gradient(90deg, #4285f4, #9333ea, #ec4899, #60a5fa, #4285f4) !important;
  background-size: 300% 300% !important;
  animation: geminiFluidShift 2s ease infinite !important;
  border-color: transparent !important;
  color: #ffffff !important;
  box-shadow: 0 0 20px rgba(168, 85, 247, 0.5) !important;
}

/* ==========================================================================
   Profile Section Language Chooser
   ========================================================================== */
.profile-site-lang-box {
  width: 100%;
  position: relative;
}

.profile-site-lang-btn {
  width: 100%;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
  padding: 8px 12px !important;
  border-radius: 10px !important;
  color: #f1f5f9 !important;
  font-size: 0.8rem !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.profile-site-lang-btn:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  border-color: rgba(56, 189, 248, 0.45) !important;
}

.profile-site-lang-menu {
  position: static !important;
  width: 100% !important;
  margin-top: 6px !important;
  box-sizing: border-box !important;
  box-shadow: none !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  background: rgba(10, 15, 28, 0.95) !important;
  border-radius: 10px !important;
}

.profile-site-lang-menu.active {
  display: flex !important;
}

.profile-site-lang-menu .site-lang-list {
  max-height: 260px !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch !important;
  touch-action: pan-y !important;
}

/* Guest Profile Badge & Avatar */
.guest-profile-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.guest-avatar-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.15);
  border: 1.5px solid rgba(56, 189, 248, 0.4);
  color: #38bdf8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.guest-avatar-lg {
  background: rgba(56, 189, 248, 0.15);
  border: 2px solid rgba(56, 189, 248, 0.45);
  color: #38bdf8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.guest-tier-pill {
  font-size: 0.65rem;
  font-weight: 600;
  color: #94a3b8;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ==========================================================================
   In-Canvas Selectable OCR Text Layer & Floating Translation Overlay
   ========================================================================== */

.ocr-selectable-text-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 25;
  user-select: text;
  -webkit-user-select: text;
  font-family: 'Noto Sans', 'Segoe UI', Roboto, 'Noto Sans Devanagari', 'Noto Sans Arabic', 'Noto Sans SC', system-ui, sans-serif;
}

.ocr-word-span {
  position: absolute;
  display: inline-block;
  color: transparent;
  pointer-events: auto;
  user-select: text;
  -webkit-user-select: text;
  cursor: text;
  box-sizing: border-box;
  overflow: hidden;
  white-space: pre;
  font-family: inherit;
}

.ocr-word-span::selection {
  background: rgba(56, 189, 248, 0.42);
  color: transparent;
}

.ocr-word-span::-moz-selection {
  background: rgba(56, 189, 248, 0.42);
  color: transparent;
}

/* Floating "Translate" Trigger Button */
.ocr-floating-translate-btn {
  position: fixed;
  z-index: 99999;
  animation: ocrPopIn 0.16s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-floating-translate-act {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(19, 19, 24, 0.94);
  color: #f1f5f9;
  border: 1px solid rgba(56, 189, 248, 0.45);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5), 0 0 12px rgba(56, 189, 248, 0.25);
  padding: 7px 14px;
  border-radius: 24px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}

.btn-floating-translate-act i {
  color: #38bdf8;
  font-size: 0.95rem;
}

.btn-floating-translate-act:hover {
  transform: translateY(-2px);
  border-color: #38bdf8;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.6), 0 0 18px rgba(56, 189, 248, 0.4);
  background: rgba(26, 26, 34, 0.98);
}

/* Floating Translation Result Card */
.ocr-translation-popup-card {
  position: fixed;
  z-index: 99999;
  width: 340px;
  max-width: 90vw;
  background: rgba(20, 20, 26, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(56, 189, 248, 0.25);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: #e2e8f0;
  font-family: 'Noto Sans', 'Segoe UI', Roboto, system-ui, sans-serif;
  overflow: hidden;
  animation: ocrFadeScale 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.ocr-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  gap: 8px;
}

.ocr-popup-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #f1f5f9;
  white-space: nowrap;
}

.ocr-popup-lang-select {
  background: rgba(30, 30, 40, 0.9);
  color: #e2e8f0;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  padding: 4px 8px;
  font-size: 0.76rem;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  max-width: 140px;
}

.ocr-popup-lang-select:focus {
  border-color: #38bdf8;
}

.ocr-popup-close-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  transition: color 0.12s ease;
}

.ocr-popup-close-btn:hover {
  color: #f1f5f9;
}

.ocr-popup-body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ocr-popup-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #94a3b8;
  font-weight: 600;
}

.ocr-popup-source-text {
  margin: 4px 0 0;
  font-size: 0.82rem;
  color: #cbd5e1;
  background: rgba(0, 0, 0, 0.25);
  padding: 6px 10px;
  border-radius: 8px;
  max-height: 60px;
  overflow-y: auto;
  line-height: 1.4;
  word-break: break-word;
}

.ocr-popup-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.06);
}

.ocr-popup-target-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.ocr-popup-engine-badge {
  font-size: 0.65rem;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  padding: 2px 7px;
  border-radius: 10px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.ocr-popup-result-text {
  font-size: 0.92rem;
  font-weight: 500;
  color: #f8fafc;
  line-height: 1.45;
  background: rgba(14, 165, 233, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.2);
  padding: 8px 12px;
  border-radius: 10px;
  min-height: 38px;
  max-height: 120px;
  overflow-y: auto;
  word-break: break-word;
}

/* Fluid Gradient Loading Bar */
.ocr-popup-loading-bar {
  height: 3px;
  width: 100%;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 6px;
}

.ocr-fluid-gradient-bar {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #38bdf8, #818cf8, #c084fc, #f472b6, #38bdf8);
  background-size: 200% 100%;
  animation: ocrFluidStream 1.2s linear infinite;
}

.translating-shimmer {
  opacity: 0.7;
  font-style: italic;
}

.ocr-popup-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.02);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-ocr-popup-action {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  padding: 5px 12px;
  border-radius: 14px;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.14s ease;
}

.btn-ocr-popup-action:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.35);
  color: #f8fafc;
}

/* Canvas In-Stage Scanning Progress Bar */
.canvas-ocr-progress-bar {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(18, 18, 24, 0.88);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 20px;
  padding: 6px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 60;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.ocr-progress-fluid-stream {
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, #38bdf8, #818cf8, #c084fc, #f472b6);
  border-radius: 3px;
  transition: width 0.2s ease;
}

.ocr-progress-label {
  font-size: 0.74rem;
  color: #e2e8f0;
  font-weight: 500;
  white-space: nowrap;
}

.ocr-progress-label i {
  color: #38bdf8;
  margin-right: 4px;
}

@keyframes ocrPopIn {
  from { opacity: 0; transform: scale(0.9) translateY(4px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes ocrFadeScale {
  from { opacity: 0; transform: scale(0.96) translateY(-4px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes ocrFluidStream {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* ==========================================================================
   Comprehensive Light Mode Design System & Glassmorphic Palette
   ========================================================================== */

/* Header actions group & theme toggle button */
.header-actions-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), background 0.2s ease, border-color 0.2s ease;
}

.theme-toggle-btn:hover {
  transform: rotate(18deg) scale(1.08);
}

.theme-icon-sun {
  color: #fbbf24;
  font-size: 1rem;
}

.theme-icon-moon {
  color: #818cf8;
  font-size: 0.95rem;
}

.mobile-only-tool-btn {
  display: none;
}

/* Light Theme Variables */
html[data-theme="light"],
body.light-theme {
  --bg-darkest: #f4f6fa;
  --bg-darker: #ffffff;
  --bg-panel: #ffffff;
  --bg-surface: #ffffff;
  --bg-surface-hover: #f1f5f9;
  --bg-input: #f8fafc;

  --border-color: rgba(15, 23, 42, 0.09);
  --border-light: rgba(15, 23, 42, 0.14);
  --border-focus: #3b82f6;

  --accent-primary: #3b82f6;
  --accent-primary-hover: #2563eb;
  --accent-secondary: #8b5cf6;
  --accent-gradient: linear-gradient(135deg, #2563eb 0%, #7c3aed 50%, #db2777 100%);
  --gemini-gradient: linear-gradient(90deg, #2563eb, #7c3aed, #db2777, #3b82f6);
  --accent-glow-gradient: linear-gradient(135deg, rgba(37, 99, 235, 0.2), rgba(124, 58, 237, 0.2), rgba(219, 39, 119, 0.2));

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;

  --shadow-sm: 0 2px 10px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 10px 30px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 50px rgba(15, 23, 42, 0.12);
  --shadow-glass: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 8px 30px rgba(15, 23, 42, 0.06);
}

/* Light Theme Component Scoped Overrides */
html[data-theme="light"] body,
body.light-theme {
  background-color: transparent !important;
  color: #0f172a !important;
}

/* Light Theme Global Ambient Background Display (Exclusive Light Mode Creative Canvas) */
html[data-theme="light"] #app-global-bg,
html[data-theme="light"] .app-global-bg,
body.light-theme #app-global-bg,
body.light-theme .app-global-bg {
  position: fixed !important;
  inset: 0 !important;
  width: 100vw !important;
  height: 100vh !important; height: 100dvh !important;
  pointer-events: none !important;
  z-index: 1 !important;
  overflow: hidden !important;
  mix-blend-mode: normal !important;
  opacity: 1 !important;
  display: block !important;
  visibility: visible !important;
  background: transparent !important;
}

html[data-theme="light"] .app-main,
html[data-theme="light"] #canvasWorkspace,
html[data-theme="light"] #canvasContainer,
html[data-theme="light"] .canvas-area,
body.light-theme .app-main,
body.light-theme #canvasWorkspace,
body.light-theme #canvasContainer,
body.light-theme .canvas-area {
  background-color: transparent !important;
  background: transparent !important;
  background-image: none !important;
}

html[data-theme="light"] #aero-shards-bg-container,
body.light-theme #aero-shards-bg-container {
  display: none !important;
}

/* Light Theme Header */
html[data-theme="light"] .app-header,
body.light-theme .app-header {
  background: rgba(255, 255, 255, 0.9) !important;
  backdrop-filter: blur(24px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08) !important;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.9) !important;
  color: #0f172a !important;
}

html[data-theme="light"] .brand-title,
body.light-theme .brand-title {
  color: #0f172a !important;
}

/* Light Theme Quick Tools & Buttons */
html[data-theme="light"] .quick-tools,
body.light-theme .quick-tools {
  background: rgba(241, 245, 249, 0.85) !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.04) !important;
}

html[data-theme="light"] .icon-btn,
body.light-theme .icon-btn {
  background: rgba(255, 255, 255, 0.85) !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
  color: #334155 !important;
}

html[data-theme="light"] .icon-btn:hover,
body.light-theme .icon-btn:hover {
  background: #ffffff !important;
  color: #0f172a !important;
  border-color: rgba(15, 23, 42, 0.18) !important;
}

html[data-theme="light"] .zoom-value,
body.light-theme .zoom-value {
  color: #334155 !important;
  background: rgba(255, 255, 255, 0.7) !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
}

html[data-theme="light"] .divider-vertical,
body.light-theme .divider-vertical {
  background: rgba(15, 23, 42, 0.1) !important;
}

/* Light Theme Left Toolbar */
html[data-theme="light"] .left-toolbar,
body.light-theme .left-toolbar {
  background: rgba(255, 255, 255, 0.94) !important;
  backdrop-filter: blur(28px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(28px) saturate(180%) !important;
  border-right: 1px solid rgba(15, 23, 42, 0.08) !important;
  border-top-color: rgba(15, 23, 42, 0.08) !important;
  box-shadow: 4px 0 24px rgba(15, 23, 42, 0.05) !important;
}

html[data-theme="light"] .tool-btn,
body.light-theme .tool-btn {
  background: rgba(241, 245, 249, 0.75) !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
  color: #334155 !important;
}

html[data-theme="light"] .tool-btn:hover,
body.light-theme .tool-btn:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
  border-color: rgba(15, 23, 42, 0.16) !important;
}

html[data-theme="light"] .tool-btn.active,
body.light-theme .tool-btn.active {
  background: rgba(37, 99, 235, 0.12) !important;
  border-color: #3b82f6 !important;
  color: #1d4ed8 !important;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.2) !important;
}

/* Light Theme Right Inspector (Desktop only to prevent mobile fill-rate lag) */
@media (min-width: 769px) {
  html[data-theme="light"] .right-inspector,
  body.light-theme .right-inspector {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(28px) saturate(190%) !important;
    -webkit-backdrop-filter: blur(28px) saturate(190%) !important;
    border-left: 1px solid rgba(15, 23, 42, 0.08) !important;
    color: #0f172a !important;
    box-shadow: -4px 0 24px rgba(15, 23, 42, 0.05) !important;
  }
}

html[data-theme="light"] .inspector-tabs,
body.light-theme .inspector-tabs {
  background: rgba(241, 245, 249, 0.9) !important;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08) !important;
}

html[data-theme="light"] .tab-btn,
body.light-theme .tab-btn {
  color: #64748b !important;
}

html[data-theme="light"] .tab-btn:hover,
body.light-theme .tab-btn:hover {
  color: #0f172a !important;
}

html[data-theme="light"] .tab-btn.active,
body.light-theme .tab-btn.active {
  color: #1d4ed8 !important;
  border-bottom-color: #2563eb !important;
  background: rgba(37, 99, 235, 0.08) !important;
}

html[data-theme="light"] .panel-section,
body.light-theme .panel-section {
  border-bottom: 1px solid rgba(15, 23, 42, 0.06) !important;
}

html[data-theme="light"] .section-header h3,
body.light-theme .section-header h3 {
  color: #0f172a !important;
}

html[data-theme="light"] .form-group label,
body.light-theme .form-group label {
  color: #475569 !important;
}

html[data-theme="light"] textarea,
html[data-theme="light"] input[type="text"],
html[data-theme="light"] input[type="number"],
html[data-theme="light"] select,
body.light-theme textarea,
body.light-theme input[type="text"],
body.light-theme input[type="number"],
body.light-theme select {
  background: #ffffff !important;
  border: 1px solid rgba(15, 23, 42, 0.15) !important;
  color: #0f172a !important;
}

html[data-theme="light"] textarea:focus,
html[data-theme="light"] input:focus,
html[data-theme="light"] select:focus,
body.light-theme textarea:focus,
body.light-theme input:focus,
body.light-theme select:focus {
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15) !important;
}

html[data-theme="light"] .btn-secondary,
body.light-theme .btn-secondary {
  background: #f1f5f9 !important;
  border: 1px solid rgba(15, 23, 42, 0.12) !important;
  color: #334155 !important;
}

html[data-theme="light"] .btn-secondary:hover,
body.light-theme .btn-secondary:hover {
  background: #e2e8f0 !important;
  color: #0f172a !important;
  border-color: rgba(15, 23, 42, 0.2) !important;
}

/* Light Theme Canvas Viewport */
html[data-theme="light"] .canvas-viewport,
body.light-theme .canvas-viewport {
  background-color: transparent !important;
  background: transparent !important;
  background-image: none !important;
}

/* Light Theme Dropzone - Glassmorphic Aesthetic */
html[data-theme="light"] .dropzone-card,
body.light-theme .dropzone-card {
  background: rgba(255, 255, 255, 0.78) !important;
  backdrop-filter: blur(24px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(24px) saturate(180%) !important;
  border: 1.5px dashed rgba(99, 102, 241, 0.32) !important;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.95) !important;
}

html[data-theme="light"] .dropzone-card h2,
body.light-theme .dropzone-card h2 {
  color: #0f172a !important;
}

html[data-theme="light"] .dropzone-card p,
body.light-theme .dropzone-card p {
  color: #475569 !important;
}

html[data-theme="light"] .drop-icon-wrapper,
body.light-theme .drop-icon-wrapper {
  background: rgba(37, 99, 235, 0.08) !important;
  color: #2563eb !important;
}

/* Light Theme Floating Toolbars */
html[data-theme="light"] .floating-toolbar,
body.light-theme .floating-toolbar {
  background: rgba(255, 255, 255, 0.96) !important;
  border: 1px solid rgba(15, 23, 42, 0.12) !important;
  color: #0f172a !important;
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.12) !important;
}

html[data-theme="light"] .floating-toolbar label,
body.light-theme .floating-toolbar label {
  color: #334155 !important;
}

html[data-theme="light"] .floating-tip,
body.light-theme .floating-tip {
  background: rgba(255, 255, 255, 0.92) !important;
  color: #334155 !important;
  border: 1px solid rgba(15, 23, 42, 0.1) !important;
}

/* Light Theme Modals */
html[data-theme="light"] .modal-window,
body.light-theme .modal-window {
  background: rgba(255, 255, 255, 0.98) !important;
  border: 1px solid rgba(15, 23, 42, 0.12) !important;
  color: #0f172a !important;
  box-shadow: 0 25px 70px rgba(15, 23, 42, 0.18) !important;
}

html[data-theme="light"] .modal-header,
body.light-theme .modal-header {
  background: rgba(241, 245, 249, 0.6) !important;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08) !important;
  color: #0f172a !important;
}

html[data-theme="light"] .modal-header h2,
body.light-theme .modal-header h2 {
  color: #0f172a !important;
}

html[data-theme="light"] .modal-footer,
body.light-theme .modal-footer {
  background: rgba(241, 245, 249, 0.6) !important;
  border-top: 1px solid rgba(15, 23, 42, 0.08) !important;
}

html[data-theme="light"] .btn-close-modal,
body.light-theme .btn-close-modal {
  background: rgba(15, 23, 42, 0.06) !important;
  color: #475569 !important;
  border: 1px solid rgba(15, 23, 42, 0.1) !important;
}

html[data-theme="light"] .btn-close-modal:hover,
body.light-theme .btn-close-modal:hover {
  background: rgba(239, 68, 68, 0.1) !important;
  color: #dc2626 !important;
}

/* Light Theme Advanced AI Features Panel */
html[data-theme="light"] .adv-features-slide-panel,
body.light-theme .adv-features-slide-panel {
  background: rgba(255, 255, 255, 0.97) !important;
  border: 1px solid rgba(168, 85, 247, 0.3) !important;
  color: #0f172a !important;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.16) !important;
}

html[data-theme="light"] .adv-side-header,
body.light-theme .adv-side-header {
  background: rgba(241, 245, 249, 0.6) !important;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08) !important;
}

html[data-theme="light"] .adv-side-title h3,
body.light-theme .adv-side-title h3 {
  color: #0f172a !important;
}

html[data-theme="light"] .adv-side-intro-card,
body.light-theme .adv-side-intro-card {
  background: rgba(241, 245, 249, 0.7) !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
}

html[data-theme="light"] .adv-side-intro-card p,
body.light-theme .adv-side-intro-card p {
  color: #475569 !important;
}

html[data-theme="light"] .adv-side-card,
body.light-theme .adv-side-card {
  background: rgba(241, 245, 249, 0.75) !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
}

html[data-theme="light"] .adv-side-card:hover,
body.light-theme .adv-side-card:hover {
  background: #ffffff !important;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.08) !important;
}

html[data-theme="light"] .adv-side-card h4,
body.light-theme .adv-side-card h4 {
  color: #0f172a !important;
}

html[data-theme="light"] .adv-side-card p,
body.light-theme .adv-side-card p {
  color: #475569 !important;
}

html[data-theme="light"] .btn-adv-side-launch,
body.light-theme .btn-adv-side-launch {
  background: rgba(37, 99, 235, 0.08) !important;
  border: 1px solid rgba(37, 99, 235, 0.2) !important;
  color: #1d4ed8 !important;
}

html[data-theme="light"] .btn-adv-side-launch:hover,
body.light-theme .btn-adv-side-launch:hover {
  background: #2563eb !important;
  color: #ffffff !important;
}

/* Light Theme WhatFont Card */
html[data-theme="light"] .whatfont-card,
body.light-theme .whatfont-card {
  background: rgba(255, 255, 255, 0.98) !important;
  border: 1px solid rgba(15, 23, 42, 0.12) !important;
  color: #0f172a !important;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.16) !important;
}

html[data-theme="light"] .whatfont-primary-box,
body.light-theme .whatfont-primary-box {
  background: rgba(241, 245, 249, 0.7) !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
}

html[data-theme="light"] .whatfont-family-name,
body.light-theme .whatfont-family-name {
  color: #0f172a !important;
}

html[data-theme="light"] .whatfont-preview-text,
body.light-theme .whatfont-preview-text {
  color: #334155 !important;
}

html[data-theme="light"] .whatfont-spec-card,
body.light-theme .whatfont-spec-card {
  background: #ffffff !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
}

html[data-theme="light"] .whatfont-spec-card .spec-val,
body.light-theme .whatfont-spec-card .spec-val {
  color: #0f172a !important;
}

/* Light Theme Layer List Items */
html[data-theme="light"] .layer-item,
body.light-theme .layer-item {
  background: rgba(241, 245, 249, 0.75) !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
  color: #0f172a !important;
}

html[data-theme="light"] .layer-item:hover,
body.light-theme .layer-item:hover {
  background: #e2e8f0 !important;
}

html[data-theme="light"] .layer-item.active,
body.light-theme .layer-item.active {
  background: rgba(37, 99, 235, 0.1) !important;
  border-color: #3b82f6 !important;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.15) !important;
}

html[data-theme="light"] .layer-name,
body.light-theme .layer-name {
  color: #0f172a !important;
}

/* Light Theme Static Pages (About, Contact, Terms, Privacy) */
html[data-theme="light"] .static-page-container,
body.light-theme .static-page-container {
  color: #0f172a !important;
}

html[data-theme="light"] .static-header h1,
body.light-theme .static-header h1 {
  color: #0f172a !important;
}

html[data-theme="light"] .static-content h2,
body.light-theme .static-content h2 {
  color: #0f172a !important;
}

html[data-theme="light"] .static-content p,
html[data-theme="light"] .static-content li,
body.light-theme .static-content p,
body.light-theme .static-content li {
  color: #475569 !important;
}

html[data-theme="light"] .feature-box,
body.light-theme .feature-box {
  background: #ffffff !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.04) !important;
}

html[data-theme="light"] .feature-box h3,
body.light-theme .feature-box h3 {
  color: #0f172a !important;
}

html[data-theme="light"] .contact-card,
body.light-theme .contact-card {
  background: #ffffff !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
  color: #0f172a !important;
}

/* ==========================================================================
   Light Theme Persistent Bottom Footer Bar (About Us, Support, Links)
   ========================================================================== */
html[data-theme="light"] .app-persistent-footer,
body.light-theme .app-persistent-footer {
  background: rgba(255, 255, 255, 0.92) !important;
  backdrop-filter: blur(20px) saturate(180%) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
  border-top: 1px solid rgba(15, 23, 42, 0.1) !important;
  box-shadow: 0 -2px 14px rgba(15, 23, 42, 0.05) !important;
  color: #334155 !important;
}

html[data-theme="light"] .persistent-footer-left,
body.light-theme .persistent-footer-left {
  color: #0f172a !important;
  font-weight: 600 !important;
}

html[data-theme="light"] .persistent-footer-links a,
body.light-theme .persistent-footer-links a {
  color: #2563eb !important;
  font-weight: 600 !important;
  font-size: 12px !important;
  transition: color 0.15s ease, transform 0.15s ease !important;
}

html[data-theme="light"] .persistent-footer-links a:hover,
body.light-theme .persistent-footer-links a:hover {
  color: #1d4ed8 !important;
  text-decoration: underline !important;
  transform: translateY(-1px) !important;
}

html[data-theme="light"] .persistent-footer-links span,
body.light-theme .persistent-footer-links span {
  color: #94a3b8 !important;
}

/* ==========================================================================
   Comprehensive Light Theme Studio Tools, Buttons, Controls & Inputs
   ========================================================================== */

/* 1. Left Toolbar Buttons & Interactive States */
html[data-theme="light"] .left-toolbar,
body.light-theme .left-toolbar {
  background: rgba(255, 255, 255, 0.96) !important;
  border-right: 1px solid rgba(15, 23, 42, 0.1) !important;
  box-shadow: 4px 0 24px rgba(15, 23, 42, 0.06) !important;
}

html[data-theme="light"] .tool-btn,
body.light-theme .tool-btn {
  background: #f8fafc !important;
  border: 1px solid rgba(15, 23, 42, 0.12) !important;
  color: #0f172a !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04) !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

html[data-theme="light"] .tool-btn:hover,
body.light-theme .tool-btn:hover {
  background: #e2e8f0 !important;
  border-color: #2563eb !important;
  color: #0f172a !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15) !important;
}

html[data-theme="light"] .tool-btn.active,
body.light-theme .tool-btn.active {
  background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
  border-color: #1d4ed8 !important;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35) !important;
}

html[data-theme="light"] .tool-btn .tool-label,
body.light-theme .tool-btn .tool-label {
  color: #0f172a !important;
  font-weight: 600 !important;
}

html[data-theme="light"] .tool-btn.active *,
body.light-theme .tool-btn.active * {
  color: #ffffff !important;
}

html[data-theme="light"] .tool-btn:not(.active) i,
body.light-theme .tool-btn:not(.active) i {
  color: #2563eb !important;
}

/* Distinct high-contrast hues for specific tools in light mode */
html[data-theme="light"] .tool-btn:not(.active) i.fa-crop-simple,
body.light-theme .tool-btn:not(.active) i.fa-crop-simple,
html[data-theme="light"] .tool-btn:not(.active) #btnToolCrop i,
body.light-theme .tool-btn:not(.active) #btnToolCrop i {
  color: #0284c7 !important;
}

html[data-theme="light"] .tool-btn:not(.active) i.fa-paintbrush,
body.light-theme .tool-btn:not(.active) i.fa-paintbrush {
  color: #059669 !important;
}

html[data-theme="light"] .tool-btn:not(.active) i.fa-trash-can,
body.light-theme .tool-btn:not(.active) i.fa-trash-can,
html[data-theme="light"] .tool-btn:not(.active) #btnToolClearCanvas i,
body.light-theme .tool-btn:not(.active) #btnToolClearCanvas i {
  color: #dc2626 !important;
}

html[data-theme="light"] .tool-btn:not(.active) i.fa-wand-magic-sparkles,
body.light-theme .tool-btn:not(.active) i.fa-wand-magic-sparkles,
html[data-theme="light"] .tool-btn:not(.active) #btnToolAdvancedFeatures i,
body.light-theme .tool-btn:not(.active) #btnToolAdvancedFeatures i {
  color: #7c3aed !important;
}

html[data-theme="light"] .tool-btn:not(.active) i.fa-image,
body.light-theme .tool-btn:not(.active) i.fa-image {
  color: #0284c7 !important;
}

html[data-theme="light"] .tool-btn:not(.active) i.fa-square,
body.light-theme .tool-btn:not(.active) i.fa-square {
  color: #0d9488 !important;
}

html[data-theme="light"] .tool-btn:not(.active) i.fa-hand,
body.light-theme .tool-btn:not(.active) i.fa-hand {
  color: #d97706 !important;
}

html[data-theme="light"] .btn-tool-adv-sidebar .adv-arrow-icon,
body.light-theme .btn-tool-adv-sidebar .adv-arrow-icon {
  color: #7c3aed !important;
}

/* 2. Top Navigation Quick Tools & Header Buttons */
html[data-theme="light"] .quick-tools,
body.light-theme .quick-tools {
  background: rgba(255, 255, 255, 0.95) !important;
  border: 1px solid rgba(15, 23, 42, 0.12) !important;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.05) !important;
}

html[data-theme="light"] .quick-tools .icon-btn,
body.light-theme .quick-tools .icon-btn {
  background: #ffffff !important;
  border: 1px solid rgba(15, 23, 42, 0.14) !important;
  color: #0f172a !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04) !important;
}

html[data-theme="light"] .quick-tools .icon-btn i,
body.light-theme .quick-tools .icon-btn i {
  color: #0f172a !important;
}

html[data-theme="light"] .quick-tools .icon-btn:hover,
body.light-theme .quick-tools .icon-btn:hover {
  background: #f1f5f9 !important;
  border-color: #2563eb !important;
  color: #2563eb !important;
}

html[data-theme="light"] .quick-tools .icon-btn:hover i,
body.light-theme .quick-tools .icon-btn:hover i {
  color: #2563eb !important;
}

html[data-theme="light"] .quick-tools .icon-btn:disabled,
body.light-theme .quick-tools .icon-btn:disabled,
html[data-theme="light"] .quick-tools .icon-btn:disabled i,
body.light-theme .quick-tools .icon-btn:disabled i {
  color: #94a3b8 !important;
  opacity: 0.45 !important;
  background: #f8fafc !important;
  border-color: rgba(15, 23, 42, 0.06) !important;
}

html[data-theme="light"] .quick-tools .toggle-btn,
body.light-theme .quick-tools .toggle-btn {
  color: #0f172a !important;
}

html[data-theme="light"] .quick-tools .toggle-btn.active,
body.light-theme .quick-tools .toggle-btn.active {
  background: #dbeafe !important;
  border-color: #2563eb !important;
  color: #1d4ed8 !important;
}

html[data-theme="light"] .quick-tools .zoom-value,
body.light-theme .quick-tools .zoom-value {
  color: #0f172a !important;
  background: #f8fafc !important;
  border: 1px solid rgba(15, 23, 42, 0.12) !important;
  font-weight: 700 !important;
}

/* 3. Floating Inpaint Brush Options Bar in Light Mode */
html[data-theme="light"] #brushOptionsBar,
body.light-theme #brushOptionsBar {
  background: rgba(255, 255, 255, 0.98) !important;
  border: 1px solid rgba(15, 23, 42, 0.15) !important;
  color: #0f172a !important;
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.15) !important;
}

html[data-theme="light"] #brushOptionsBar .float-title,
body.light-theme #brushOptionsBar .float-title {
  color: #047857 !important;
  font-weight: 700 !important;
}

html[data-theme="light"] #brushOptionsBar label,
body.light-theme #brushOptionsBar label {
  color: #0f172a !important;
  font-weight: 600 !important;
}

html[data-theme="light"] #brushOptionsBar label span,
body.light-theme #brushOptionsBar label span {
  color: #0f172a !important;
  font-weight: 700 !important;
}

html[data-theme="light"] #brushOptionsBar select,
body.light-theme #brushOptionsBar select {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid rgba(15, 23, 42, 0.22) !important;
  font-weight: 500 !important;
}

html[data-theme="light"] #brushOptionsBar .btn-secondary,
body.light-theme #brushOptionsBar .btn-secondary {
  background: #f1f5f9 !important;
  color: #0f172a !important;
  border: 1px solid rgba(15, 23, 42, 0.16) !important;
  font-weight: 600 !important;
}

/* 4. Floating Crop Options Bar in Light Mode */
html[data-theme="light"] #cropOptionsBar,
body.light-theme #cropOptionsBar {
  background: rgba(255, 255, 255, 0.98) !important;
  border: 1px solid rgba(15, 23, 42, 0.16) !important;
  color: #0f172a !important;
  box-shadow: 0 16px 45px rgba(15, 23, 42, 0.16) !important;
}

html[data-theme="light"] #cropOptionsBar .float-title,
body.light-theme #cropOptionsBar .float-title {
  color: #0284c7 !important;
  font-weight: 700 !important;
}

html[data-theme="light"] #cropOptionsBar label,
body.light-theme #cropOptionsBar label {
  color: #0f172a !important;
  font-weight: 600 !important;
}

html[data-theme="light"] #cropOptionsBar select,
body.light-theme #cropOptionsBar select {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid rgba(15, 23, 42, 0.22) !important;
}

html[data-theme="light"] #cropOptionsBar .crop-sides-control-group,
body.light-theme #cropOptionsBar .crop-sides-control-group {
  background: #f1f5f9 !important;
  border: 1px solid rgba(15, 23, 42, 0.14) !important;
}

html[data-theme="light"] #cropOptionsBar .crop-sides-control-group span,
body.light-theme #cropOptionsBar .crop-sides-control-group span {
  color: #334155 !important;
  font-weight: 600 !important;
}

html[data-theme="light"] #cropOptionsBar .crop-side-item span,
body.light-theme #cropOptionsBar .crop-side-item span {
  color: #0284c7 !important;
  font-weight: 700 !important;
}

html[data-theme="light"] #cropOptionsBar input[type="number"],
body.light-theme #cropOptionsBar input[type="number"] {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid rgba(15, 23, 42, 0.25) !important;
  font-weight: 600 !important;
}

html[data-theme="light"] #cropOptionsBar div[style*="Result"],
body.light-theme #cropOptionsBar div[style*="Result"] {
  background: #f1f5f9 !important;
  color: #0f172a !important;
}

html[data-theme="light"] #cropOptionsBar .btn-secondary,
body.light-theme #cropOptionsBar .btn-secondary {
  background: #f1f5f9 !important;
  border: 1px solid rgba(15, 23, 42, 0.16) !important;
  color: #0f172a !important;
  font-weight: 600 !important;
}

/* 5. Watermark Floating Bar in Light Mode */
html[data-theme="light"] #watermarkOptionsBar,
body.light-theme #watermarkOptionsBar {
  background: rgba(255, 255, 255, 0.98) !important;
  border: 1px solid rgba(15, 23, 42, 0.16) !important;
  color: #0f172a !important;
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.15) !important;
}

html[data-theme="light"] #watermarkOptionsBar .float-title,
body.light-theme #watermarkOptionsBar .float-title {
  color: #047857 !important;
  font-weight: 700 !important;
}

html[data-theme="light"] #watermarkOptionsBar label,
body.light-theme #watermarkOptionsBar label {
  color: #0f172a !important;
  font-weight: 600 !important;
}

html[data-theme="light"] #watermarkOptionsBar select,
body.light-theme #watermarkOptionsBar select {
  background: #ffffff !important;
  color: #0f172a !important;
  border: 1px solid rgba(15, 23, 42, 0.2) !important;
}

html[data-theme="light"] #watermarkOptionsBar span,
body.light-theme #watermarkOptionsBar span {
  color: #334155 !important;
  font-weight: 500 !important;
}
  color: #1e293b !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04) !important;
}

html[data-theme="light"] .icon-btn:hover,
body.light-theme .icon-btn:hover {
  background: #f8fafc !important;
  border-color: #3b82f6 !important;
  color: #2563eb !important;
  transform: translateY(-1px) !important;
}

html[data-theme="light"] .toggle-btn.active,
body.light-theme .toggle-btn.active {
  background: #eff6ff !important;
  border-color: #3b82f6 !important;
  color: #1d4ed8 !important;
}

html[data-theme="light"] .zoom-value,
body.light-theme .zoom-value {
  color: #0f172a !important;
  background: #f8fafc !important;
  border: 1px solid rgba(15, 23, 42, 0.1) !important;
  font-weight: 600 !important;
}

/* Export Lossless Button */
html[data-theme="light"] #btnOpenExportModal,
body.light-theme #btnOpenExportModal {
  background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
  color: #ffffff !important;
  border: none !important;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.32) !important;
  font-weight: 600 !important;
}

html[data-theme="light"] #btnOpenExportModal:hover,
body.light-theme #btnOpenExportModal:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af) !important;
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.42) !important;
  transform: translateY(-1px) !important;
}

/* Theme Toggle Button in Light Mode */
html[data-theme="light"] .theme-toggle-btn,
body.light-theme .theme-toggle-btn {
  background: #ffffff !important;
  border: 1px solid rgba(15, 23, 42, 0.14) !important;
  color: #d97706 !important;
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.15) !important;
}

html[data-theme="light"] .theme-toggle-btn:hover,
body.light-theme .theme-toggle-btn:hover {
  background: #fef3c7 !important;
  border-color: #d97706 !important;
  color: #b45309 !important;
}

html[data-theme="light"] .theme-icon-sun {
  color: #d97706 !important;
}

html[data-theme="light"] .theme-icon-moon {
  color: #4f46e5 !important;
}

/* Primary Action Buttons */
html[data-theme="light"] .btn-primary,
body.light-theme .btn-primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
  color: #ffffff !important;
  border: none !important;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3) !important;
  font-weight: 600 !important;
}

html[data-theme="light"] .btn-primary:hover,
body.light-theme .btn-primary:hover {
  background: linear-gradient(135deg, #1d4ed8, #1e40af) !important;
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4) !important;
  transform: translateY(-1px) !important;
}

/* Secondary Action Buttons */
html[data-theme="light"] .btn-secondary,
body.light-theme .btn-secondary {
  background: #ffffff !important;
  border: 1px solid rgba(15, 23, 42, 0.14) !important;
  color: #1e293b !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04) !important;
  font-weight: 500 !important;
}

html[data-theme="light"] .btn-secondary:hover,
body.light-theme .btn-secondary:hover {
  background: #f8fafc !important;
  border-color: #3b82f6 !important;
  color: #2563eb !important;
}

/* Style Buttons in Inspector (Bold, Italic, Alignment) */
html[data-theme="light"] .style-toggle-btn,
body.light-theme .style-toggle-btn {
  background: #ffffff !important;
  border: 1px solid rgba(15, 23, 42, 0.12) !important;
  color: #334155 !important;
}

html[data-theme="light"] .style-toggle-btn:hover,
body.light-theme .style-toggle-btn:hover {
  background: #f1f5f9 !important;
  color: #0f172a !important;
}

html[data-theme="light"] .style-toggle-btn.active,
body.light-theme .style-toggle-btn.active {
  background: #2563eb !important;
  border-color: #2563eb !important;
  color: #ffffff !important;
}

/* Custom Font Upload Button */
html[data-theme="light"] .custom-font-btn,
body.light-theme .custom-font-btn {
  background: #ffffff !important;
  border: 1px solid rgba(15, 23, 42, 0.14) !important;
  color: #1e293b !important;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04) !important;
}

html[data-theme="light"] .custom-font-btn:hover,
body.light-theme .custom-font-btn:hover {
  background: #f8fafc !important;
  border-color: #3b82f6 !important;
  color: #2563eb !important;
}

/* Form Controls & Inputs */
html[data-theme="light"] .form-group label,
body.light-theme .form-group label {
  color: #1e293b !important;
  font-weight: 600 !important;
}

html[data-theme="light"] select,
html[data-theme="light"] input[type="text"],
html[data-theme="light"] input[type="number"],
html[data-theme="light"] textarea,
body.light-theme select,
body.light-theme input[type="text"],
body.light-theme input[type="number"],
body.light-theme textarea {
  background: #ffffff !important;
  border: 1px solid rgba(15, 23, 42, 0.16) !important;
  color: #0f172a !important;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04) !important;
}

html[data-theme="light"] select:focus,
html[data-theme="light"] input[type="text"]:focus,
html[data-theme="light"] input[type="number"]:focus,
html[data-theme="light"] textarea:focus,
body.light-theme select:focus,
body.light-theme input[type="text"]:focus,
body.light-theme input[type="number"]:focus,
body.light-theme textarea:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16) !important;
}

/* Slider Controls */
html[data-theme="light"] .slider-control .slider-label span,
body.light-theme .slider-control .slider-label span {
  color: #0f172a !important;
  font-weight: 600 !important;
}

html[data-theme="light"] .slider-control .slider-label span:last-child,
body.light-theme .slider-control .slider-label span:last-child {
  background: #eff6ff !important;
  color: #1d4ed8 !important;
  border: 1px solid #bfdbfe !important;
  padding: 1px 7px !important;
  border-radius: 6px !important;
  font-weight: 600 !important;
}

html[data-theme="light"] input[type="range"],
body.light-theme input[type="range"] {
  accent-color: #2563eb !important;
}

/* Mobile Inspector Toggle Button */
html[data-theme="light"] .mobile-inspector-toggle-btn,
body.light-theme .mobile-inspector-toggle-btn {
  background: #ffffff !important;
  border: 1px solid rgba(15, 23, 42, 0.14) !important;
  color: #1e293b !important;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08) !important;
}

html[data-theme="light"] .mobile-inspector-toggle-btn i,
body.light-theme .mobile-inspector-toggle-btn i {
  color: #2563eb !important;
}

/* Desktop default for mobile-only tool button */
.mobile-only-tool-btn {
  display: none;
}

/* ==========================================================================
   Step 1: Tap to Begin Landing Overlay with Galaxy Starfield Background
   ========================================================================== */
.tap-to-begin-overlay {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh; height: 100dvh;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 9, 19, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 20px;
  cursor: pointer;
  user-select: none;
}

.tap-to-begin-overlay.fade-out {
  opacity: 0;
  transform: scale(1.04);
  pointer-events: none;
}

.tap-card {
  position: relative;
  width: 100%;
  max-width: 520px;
  max-height: 94dvh;
  overflow-y: auto;
  scrollbar-width: none;
  background: rgba(19, 19, 24, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 28px;
  padding: 30px 24px;
  text-align: center;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.65), 0 0 45px rgba(96, 165, 250, 0.18);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  animation: tapCardPop 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.tap-card::-webkit-scrollbar {
  display: none;
}

.tap-preview-banner {
  width: 100%;
  max-width: 460px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.55), 0 0 25px rgba(99, 102, 241, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.16);
  margin: 2px 0 6px;
  background: #0b0f19;
  position: relative;
}

.tap-preview-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.tap-card:hover .tap-preview-img {
  transform: scale(1.02);
}

@keyframes tapCardPop {
  0% { opacity: 0; transform: scale(0.9) translateY(24px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.tap-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(96, 165, 250, 0.12);
  border: 1px solid rgba(96, 165, 250, 0.32);
  color: #60a5fa;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tap-icon-portal {
  position: relative;
  width: 90px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 8px 0;
}

.tap-icon-glow {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6, #ec4899);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 2rem;
  box-shadow: 0 0 30px rgba(139, 92, 246, 0.6);
  z-index: 2;
  animation: pulseGlow 3s infinite ease-in-out;
}

@keyframes pulseGlow {
  0%, 100% { transform: scale(1); box-shadow: 0 0 30px rgba(139, 92, 246, 0.6); }
  50% { transform: scale(1.06); box-shadow: 0 0 50px rgba(236, 72, 153, 0.85); }
}

.portal-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px dashed rgba(255, 255, 255, 0.25);
  animation: spinRing 14s linear infinite;
}

.ring-1 {
  width: 90px;
  height: 90px;
  border-top-color: #60a5fa;
  border-bottom-color: #c084fc;
}

.ring-2 {
  width: 108px;
  height: 108px;
  border-left-color: #f472b6;
  border-right-color: #38bdf8;
  animation-duration: 20s;
  animation-direction: reverse;
}

@keyframes spinRing {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.tap-title {
  font-size: 1.95rem;
  font-weight: 800;
  color: #ffffff;
  margin: 0;
  line-height: 1.25;
}

.tap-title .badge-ai {
  background: linear-gradient(135deg, #60a5fa 0%, #c084fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.tap-subtitle {
  font-size: 0.94rem;
  color: #9aa0a6;
  line-height: 1.5;
  margin: 0;
  max-width: 360px;
}

.btn-tap-start {
  width: 100%;
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 50%, #ec4899 100%);
  border: none;
  color: #ffffff;
  font-size: 1.05rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 10px 25px rgba(59, 130, 246, 0.45);
  transition: all 0.25s ease;
  margin-top: 8px;
}

.btn-tap-start:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 35px rgba(139, 92, 246, 0.6);
}

.btn-tap-start:active {
  transform: translateY(1px);
}

.tap-hint {
  font-size: 0.8rem;
  color: #80868b;
  margin-top: 4px;
}

/* Light Theme Support for Tap to Begin Overlay */
body.light-theme .tap-to-begin-overlay,
html[data-theme="light"] .tap-to-begin-overlay {
  background: rgba(241, 245, 249, 0.78);
}

body.light-theme .tap-card,
html[data-theme="light"] .tap-card {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(226, 232, 240, 0.9);
  box-shadow: 0 25px 60px rgba(15, 23, 42, 0.14), 0 0 40px rgba(59, 130, 246, 0.12);
}

body.light-theme .tap-title,
html[data-theme="light"] .tap-title {
  color: #0f172a;
}

body.light-theme .tap-subtitle,
html[data-theme="light"] .tap-subtitle {
  color: #475569;
}

body.light-theme .tap-hint,
html[data-theme="light"] .tap-hint {
  color: #64748b;
}

/* Mobile Phone Optimization for Tap to Begin Overlay & Touch Interactions */
@media (max-width: 640px) {
  .tap-to-begin-overlay {
    padding: 12px;
  }

  .tap-card {
    padding: 20px 16px;
    border-radius: 20px;
    gap: 10px;
    max-width: 95vw;
    max-height: 94dvh;
  }

  .tap-preview-banner {
    max-width: 100%;
    border-radius: 12px;
    margin: 2px 0 4px;
  }

  .tap-icon-portal {
    width: 72px;
    height: 72px;
    margin: 4px 0;
  }

  .tap-icon-glow {
    width: 58px;
    height: 58px;
    font-size: 1.55rem;
  }

  .ring-1 {
    width: 72px;
    height: 72px;
  }

  .ring-2 {
    width: 86px;
    height: 86px;
  }

  .tap-title {
    font-size: 1.5rem;
  }

  .tap-subtitle {
    font-size: 0.85rem;
    max-width: 290px;
  }

  .btn-tap-start {
    height: 48px;
    font-size: 1rem;
    border-radius: 14px;
    -webkit-tap-highlight-color: transparent;
  }

  .tap-hint {
    font-size: 0.75rem;
  }
}

/* ==========================================================================
   Smart In-Place Area Translator Studio HUD & Selection Box
   ========================================================================== */

.translate-selection-box {
  position: absolute;
  border: 2px dashed #60a5fa;
  background: rgba(96, 165, 250, 0.16);
  box-shadow: 0 0 18px rgba(96, 165, 250, 0.45);
  pointer-events: none;
  border-radius: 6px;
  animation: pulseTranslateBorder 2.4s ease-in-out infinite;
  z-index: 40;
}

@keyframes pulseTranslateBorder {
  0%, 100% {
    border-color: #60a5fa;
    box-shadow: 0 0 15px rgba(96, 165, 250, 0.4);
  }
  50% {
    border-color: #a855f7;
    box-shadow: 0 0 25px rgba(168, 85, 247, 0.55);
  }
}

.translate-box-badge {
  position: absolute;
  top: -28px;
  left: 0;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  gap: 5px;
  pointer-events: none;
}

html.studio-active #tapToBeginOverlay {
  display: none !important;
}

/* Floating Smart Area Translator HUD */
.area-translator-hud {
  position: absolute;
  width: 440px;
  max-width: calc(100vw - 32px);
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border: 1px solid rgba(96, 165, 250, 0.35);
  border-radius: 18px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 30px rgba(96, 165, 250, 0.25);
  z-index: 999;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: box-shadow 0.25s ease;
  font-family: inherit;
}

.light-theme .area-translator-hud {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(96, 165, 250, 0.45);
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.2), 0 0 25px rgba(96, 165, 250, 0.25);
  color: #0f172a;
}

.trans-hud-header {
  padding: 11px 16px;
  background: linear-gradient(90deg, rgba(37, 99, 235, 0.22), rgba(124, 58, 237, 0.18));
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: grab;
  user-select: none;
}

.trans-hud-header:active {
  cursor: grabbing;
}

.trans-hud-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  color: #ffffff;
}

.light-theme .trans-hud-title {
  color: #0f172a;
}

.trans-hud-icon {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 12px;
}

.trans-badge-source {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(96, 165, 250, 0.2);
  color: #60a5fa;
  border: 1px solid rgba(96, 165, 250, 0.35);
}

.trans-hud-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s ease;
}

.trans-hud-close:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

.trans-hud-body {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 75vh;
  overflow-y: auto;
}

.trans-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.trans-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  font-weight: 600;
  color: #94a3b8;
}

.light-theme .trans-block-header {
  color: #475569;
}

.trans-spinner {
  font-size: 11px;
  color: #60a5fa;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.trans-badge-success {
  font-size: 10.5px;
  color: #34d399;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.trans-textarea {
  width: 100%;
  padding: 9px 12px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9px;
  color: #f8fafc;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  line-height: 1.45;
  transition: border-color 0.2s ease;
  min-height: 48px;
}

.light-theme .trans-textarea {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #0f172a;
}

.trans-textarea:focus {
  outline: none;
  border-color: #60a5fa;
  box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.2);
}

.trans-target-textarea {
  border-color: rgba(96, 165, 250, 0.4);
  background: rgba(30, 41, 59, 0.5);
}

.light-theme .trans-target-textarea {
  background: rgba(240, 249, 255, 0.85);
  border-color: #93c5fd;
}

/* Language selector bar */
.trans-lang-bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.25);
  padding: 8px 10px;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.light-theme .trans-lang-bar {
  background: #f1f5f9;
  border-color: #e2e8f0;
}

.trans-lang-select-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.trans-lang-select-group label {
  font-size: 10px;
  color: #94a3b8;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.trans-select {
  background: rgba(15, 23, 42, 0.9);
  color: #f1f5f9;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 7px;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
}

.light-theme .trans-select {
  background: #ffffff;
  color: #0f172a;
  border-color: #cbd5e1;
}

.trans-select option {
  background: #0f172a;
  color: #f8fafc;
  padding: 6px 8px;
}

.light-theme .trans-select option {
  background: #ffffff;
  color: #0f172a;
}

.btn-trans-swap {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  align-self: center;
  transition: all 0.2s ease;
  margin-top: 14px;
}

.light-theme .btn-trans-swap {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #475569;
}

.btn-trans-swap:hover {
  background: rgba(96, 165, 250, 0.25);
  border-color: #60a5fa;
  color: #ffffff;
  transform: rotate(180deg);
}

.btn-trans-run {
  align-self: center;
  margin-top: 14px;
  height: 32px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 8px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  border: 1px solid rgba(96, 165, 250, 0.4);
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
  transition: all 0.2s ease;
}

.btn-trans-run:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.5);
}

/* Quick Language Pills */
.trans-quick-pills {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.trans-quick-pills .pill-label {
  font-size: 10.5px;
  color: #94a3b8;
  font-weight: 600;
  margin-right: 2px;
}

.trans-pill {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.16s ease;
}

.light-theme .trans-pill {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #475569;
}

.trans-pill:hover, .trans-pill.active {
  background: rgba(96, 165, 250, 0.25);
  border-color: #60a5fa;
  color: #60a5fa;
  transform: translateY(-1px);
}

/* Formatting settings */
.trans-format-settings {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.light-theme .trans-format-settings {
  background: #f8fafc;
  border-color: #e2e8f0;
}

.trans-format-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  flex-wrap: wrap;
}

.trans-checkbox-label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #cbd5e1;
  cursor: pointer;
  user-select: none;
}

.light-theme .trans-checkbox-label {
  color: #334155;
}

.trans-size-field {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #94a3b8;
}

.trans-num-input {
  width: 52px;
  padding: 3px 6px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  color: #ffffff;
  font-size: 12px;
  text-align: center;
}

.light-theme .trans-num-input {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #0f172a;
}

.trans-color-field {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #94a3b8;
}

.trans-color-input {
  width: 28px;
  height: 24px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
}

.light-theme .trans-color-input {
  border-color: #cbd5e1;
}

.trans-line-adjust-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 8px;
}

.trans-line-adjust-group label {
  color: #94a3b8;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
}

.trans-segmented-control {
  display: flex;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}

.light-theme .trans-segmented-control {
  background: #e2e8f0;
  border-color: #cbd5e1;
}

.trans-segmented-control .seg-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.trans-segmented-control .seg-btn.active {
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

/* Action buttons row */
.trans-actions-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.btn-replace-action {
  flex: 1;
  height: 36px;
  font-size: 12.5px;
  font-weight: 700;
  background: linear-gradient(135deg, #2563eb, #a855f7);
  border: 1px solid rgba(168, 85, 247, 0.45);
  color: #ffffff;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.4);
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-replace-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(124, 58, 237, 0.55);
}

.btn-layer-action {
  height: 36px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #f1f5f9;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.light-theme .btn-layer-action {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #1e293b;
}

.btn-layer-action:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.btn-icon-action {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #cbd5e1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s ease;
}

.btn-icon-action:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

/* Transliteration badge button */
.btn-trans-toggle-translit {
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(96, 165, 250, 0.4);
  color: #60a5fa;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.btn-trans-toggle-translit:hover {
  background: rgba(59, 130, 246, 0.28);
  border-color: #93c5fd;
  color: #ffffff;
}

.btn-trans-toggle-translit.active {
  background: linear-gradient(135deg, #10b981, #059669);
  border-color: #34d399;
  color: #ffffff;
}

.light-theme .btn-trans-toggle-translit {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #2563eb;
}

/* Compare action button */
.btn-compare-action {
  height: 36px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #f1f5f9;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.btn-compare-action:hover, .btn-compare-action.active {
  background: rgba(99, 102, 241, 0.25);
  border-color: #818cf8;
  color: #a5b4fc;
}

.light-theme .btn-compare-action {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #1e293b;
}

/* Compare Panel */
.trans-compare-box {
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 10px;
  padding: 10px 12px;
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.light-theme .trans-compare-box {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.trans-compare-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
  color: #a5b4fc;
}

.trans-compare-toggle-btns {
  display: flex;
  background: rgba(0, 0, 0, 0.35);
  border-radius: 6px;
  padding: 2px;
  gap: 2px;
}

.btn-compare-tab {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-compare-tab.active {
  background: #4f46e5;
  color: #ffffff;
}

.trans-compare-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.trans-compare-card {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 60px;
}

.light-theme .trans-compare-card {
  background: #ffffff;
  border-color: #e2e8f0;
}

.trans-compare-card .card-tag {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  color: #94a3b8;
  letter-spacing: 0.5px;
}

.trans-compare-card.original-card .card-tag {
  color: #f59e0b;
}

.trans-compare-card.translated-card .card-tag {
  color: #10b981;
}

.trans-compare-card .card-content {
  font-size: 12px;
  line-height: 1.4;
  color: #e2e8f0;
  word-break: break-word;
  max-height: 100px;
  overflow-y: auto;
}

.light-theme .trans-compare-card .card-content {
  color: #1e293b;
}

.trans-compare-card img.compare-img {
  max-width: 100%;
  max-height: 60px;
  object-fit: contain;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 4px;
}

.btn-canvas-preview-hold {
  width: 100%;
  height: 28px;
  font-size: 11px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.06);
  border: 1px dashed rgba(255, 255, 255, 0.2);
  color: #cbd5e1;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.btn-canvas-preview-hold:hover, .btn-canvas-preview-hold:active {
  background: rgba(99, 102, 241, 0.2);
  border-color: #818cf8;
  color: #ffffff;
}

@media (max-width: 576px) {
  .area-translator-hud {
    position: fixed;
    bottom: calc(env(safe-area-inset-bottom, 12px) + 68px);
    left: 12px !important;
    right: 12px !important;
    top: auto !important;
    width: auto;
    max-width: none;
    border-radius: 20px;
  }
  .trans-lang-bar {
    grid-template-columns: 1fr 1fr;
  }
  .btn-trans-swap {
    display: none;
  }
  .btn-trans-run {
    grid-column: span 2;
    width: 100%;
    justify-content: center;
  }
  .trans-actions-row {
    flex-direction: column;
  }
  .btn-replace-action, .btn-layer-action {
    width: 100%;
  }
}

.btn-canvas-preview-hold.holding {
  background: rgba(14, 165, 233, 0.3) !important;
  border-color: #38bdf8 !important;
  color: #38bdf8 !important;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.4) !important;
}

.trans-target-textarea {
  font-size: 15px !important;
  line-height: 1.6 !important;
  font-weight: 500 !important;
  min-height: 58px !important;
  padding: 10px 12px !important;
  color: #ffffff !important;
}

.light-theme .trans-target-textarea {
  color: #0f172a !important;
  background: #f0f9ff !important;
  font-weight: 600 !important;
}

/* Live Dual Canvas Side-by-Side Comparison (Right-hand side of original canvas) */
.trans-compare-orig-badge {
  position: absolute;
  top: -36px;
  left: 0;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #94a3b8;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  pointer-events: none;
  z-index: 6;
}

.trans-compare-side-stage {
  position: absolute;
  top: 0;
  left: calc(100% + 28px);
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.75), 0 0 45px rgba(56, 189, 248, 0.25);
  border-radius: 4px;
  background-image: 
    linear-gradient(45deg, #1e293b 25%, transparent 25%), 
    linear-gradient(-45deg, #1e293b 25%, transparent 25%), 
    linear-gradient(45deg, transparent 75%, #1e293b 75%), 
    linear-gradient(-45deg, transparent 75%, #1e293b 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
  background-color: #0f172a;
  border: 2px solid rgba(56, 189, 248, 0.55);
  user-select: none;
  z-index: 6;
}

.compare-side-header {
  position: absolute;
  top: -36px;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  pointer-events: auto;
}

.compare-side-pill {
  background: linear-gradient(135deg, #0284c7, #6366f1);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.45);
}

.compare-side-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-side-compare-apply {
  background: #10b981;
  color: #ffffff;
  border: none;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.2s ease;
  box-shadow: 0 3px 10px rgba(16, 185, 129, 0.35);
}

.btn-side-compare-apply:hover {
  background: #059669;
  transform: translateY(-1px);
}

.btn-side-compare-close {
  background: rgba(15, 23, 42, 0.9);
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.15);
  width: 24px;
  height: 24px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.btn-side-compare-close:hover {
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.45);
  transform: scale(1.05);
}

/* Quick Gizmo Delete Button (Crucial for 1-tap delete on phone/mobile) */
.gizmo-action-bar {
  position: absolute;
  top: -38px;
  right: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  pointer-events: auto;
  z-index: 50;
}

.gizmo-delete-btn {
  background: rgba(239, 68, 68, 0.95);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 7px;
  padding: 5px 10px;
  font-size: 11.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.5);
  transition: all 0.15s ease;
  user-select: none;
  touch-action: manipulation;
}

.gizmo-delete-btn:hover, .gizmo-delete-btn:active {
  background: #dc2626;
  transform: scale(1.06);
  box-shadow: 0 5px 16px rgba(220, 38, 38, 0.65);
}

/* Mobile Floating Layer Quick Action Bar (Phone bottom bar) */
.mobile-layer-bar {
  display: none;
}

@media (max-width: 768px) {
  .gizmo-delete-btn {
    padding: 7px 12px;
    font-size: 13px;
    min-height: 36px;
    border-radius: 8px;
  }

  .mobile-layer-bar {
    position: fixed;
    bottom: calc(env(safe-area-inset-bottom, 12px) + 68px);
    left: 14px;
    right: 14px;
    background: rgba(15, 23, 42, 0.94);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 14px;
    padding: 9px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6), 0 0 24px rgba(99, 102, 241, 0.25);
    z-index: 95;
    animation: slideUpFade 0.22s ease-out;
  }

  .mobile-layer-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #e2e8f0;
    font-size: 12.5px;
    font-weight: 600;
    max-width: 65%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-layer-info i {
    color: #818cf8;
    font-size: 14px;
  }

  .btn-mobile-layer-del {
    background: #ef4444;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 12.5px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.45);
    touch-action: manipulation;
  }

  .btn-mobile-layer-del:active {
    background: #dc2626;
    transform: scale(0.96);
  }
}

.btn-trans-delete {
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}


/* ==========================================================================
   Step 1: Tap to Begin OG Card Native Text Layout & Styles
   ========================================================================== */
.tap-og-card {
  max-width: 580px;
  background: radial-gradient(circle at 20% 20%, rgba(30, 27, 75, 0.95) 0%, rgba(11, 15, 25, 0.96) 60%, rgba(3, 7, 18, 0.98) 100%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 26px;
  padding: 30px 26px;
  box-shadow: 0 25px 65px rgba(0, 0, 0, 0.75), 0 0 50px rgba(99, 102, 241, 0.22);
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: left;
}

.tap-og-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

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

.tap-og-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #4f46e5, #9333ea);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 1.25rem;
  box-shadow: 0 8px 22px rgba(99, 102, 241, 0.45);
}

.tap-og-brand-text {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.3px;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tap-og-pro-badge {
  font-size: 0.72rem;
  font-weight: 800;
  background: linear-gradient(135deg, #06b6d4, #3b82f6);
  color: #ffffff;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.5px;
}

.tap-og-domain {
  font-size: 0.78rem;
  font-weight: 600;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 5px 12px;
  border-radius: 999px;
  letter-spacing: 0.2px;
}

.tap-og-hero {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tap-og-heading {
  font-size: clamp(1.45rem, 3.2vw, 2.05rem);
  font-weight: 800;
  line-height: 1.22;
  letter-spacing: -0.8px;
  margin: 0;
  background: linear-gradient(135deg, #ffffff 30%, #cbd5e1 75%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.tap-og-gradient-text {
  background: linear-gradient(135deg, #60a5fa 0%, #c084fc 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.tap-og-subtitle {
  font-size: 0.92rem;
  color: #94a3b8;
  line-height: 1.5;
  margin: 0;
}

.tap-og-features {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  width: 100%;
}

.tap-og-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  padding: 9px 12px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #f1f5f9;
}

.tap-og-pill-icon {
  font-size: 1.05rem;
}

/* Light Theme Support for OG Tap Card */
body.light-theme .tap-og-card,
html[data-theme="light"] .tap-og-card {
  background: radial-gradient(circle at 20% 20%, rgba(243, 244, 246, 0.98) 0%, rgba(255, 255, 255, 0.98) 60%, rgba(241, 245, 249, 0.98) 100%);
  border-color: rgba(203, 213, 225, 0.8);
  box-shadow: 0 25px 60px rgba(15, 23, 42, 0.12), 0 0 40px rgba(99, 102, 241, 0.15);
}

body.light-theme .tap-og-brand-text,
html[data-theme="light"] .tap-og-brand-text {
  color: #0f172a;
}

body.light-theme .tap-og-domain,
html[data-theme="light"] .tap-og-domain {
  color: #475569;
  background: rgba(15, 23, 42, 0.05);
  border-color: rgba(15, 23, 42, 0.1);
}

body.light-theme .tap-og-heading,
html[data-theme="light"] .tap-og-heading {
  background: linear-gradient(135deg, #0f172a 35%, #1e293b 75%, #334155 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

body.light-theme .tap-og-subtitle,
html[data-theme="light"] .tap-og-subtitle {
  color: #475569;
}

body.light-theme .tap-og-pill,
html[data-theme="light"] .tap-og-pill {
  background: rgba(15, 23, 42, 0.04);
  border-color: rgba(15, 23, 42, 0.1);
  color: #1e293b;
}

@media (max-width: 600px) {
  .tap-og-card {
    padding: 22px 18px;
    gap: 14px;
    max-width: 95vw;
    border-radius: 20px;
  }
  .tap-og-domain {
    display: none;
  }
  .tap-og-features {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .tap-og-pill {
    padding: 7px 10px;
    font-size: 0.76rem;
  }
}

/* ==========================================================================
   Before / After Split Compare HUD & Mobile Touch Improvements
   ========================================================================== */
.split-compare-hud {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 65;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 14px;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(99, 102, 241, 0.45);
  border-radius: 999px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(99, 102, 241, 0.25);
  pointer-events: auto;
  user-select: none;
}

.split-hud-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #ffffff;
}

.split-hud-badge i {
  color: #818cf8;
}

.split-hud-hint {
  font-size: 0.72rem;
  color: #94a3b8;
}

.btn-exit-split {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-exit-split:hover {
  background: rgba(239, 68, 68, 0.35);
  color: #ffffff;
}

.split-handle {
  touch-action: none;
}

.split-handle::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: -28px;
  right: -28px;
  width: 58px;
  cursor: ew-resize;
  touch-action: none;
}

.split-knob {
  width: 36px !important;
  height: 36px !important;
  touch-action: none;
  cursor: ew-resize;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.7), 0 0 14px rgba(99, 102, 241, 0.55);
}

/* Welcome page final layout rules follow legacy overlay styles. */
.tap-to-begin-overlay.welcome-public-page {
  align-items: center;
  justify-content: flex-start !important;
  overflow-y: auto;
  padding: 0 clamp(18px, 5vw, 72px) 32px;
  background: #131314;
  cursor: default;
  user-select: auto;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.welcome-image-stage { position: relative; min-width: 0; }
.welcome-image-stage .welcome-artwork { display: block; }
body.light-theme .tap-to-begin-overlay.welcome-public-page,
html[data-theme="light"] .tap-to-begin-overlay.welcome-public-page { background: #f3f6f8; }
body.light-theme .welcome-marker,
html[data-theme="light"] .welcome-marker { border-color: #f3f6f8; }

@media (max-width: 760px) {
  .tap-to-begin-overlay.welcome-public-page { padding: 0 18px 22px; }
  .welcome-map { grid-template-columns: minmax(0, 1fr); }
  .welcome-image-stage { width: 100%; }
  .welcome-connectors { display: none; }
  .welcome-marker { width: 36px; height: 36px; }
}

@media (max-width: 380px) {
  .welcome-nav { flex-wrap: wrap; gap: 10px; padding-block: 10px; }
  .welcome-brand { gap: 8px; font-size: .82rem; white-space: nowrap; }
  .welcome-brand-mark { width: 32px; height: 32px; }
  .welcome-start { flex: 1 1 100%; justify-content: center; gap: 7px; padding: 0 10px; font-size: .82rem; }
  .welcome-intro h1 { font-size: clamp(2rem, 8.8vw, 2.35rem); }
}

@media (min-width: 381px) and (max-width: 520px) {
  .welcome-nav { flex-wrap: wrap; gap: 10px; padding-block: 10px; }
  .welcome-start { flex: 1 1 100%; justify-content: center; }
}

@media (pointer: coarse) {
  .welcome-marker { width: 44px; height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  .tap-to-begin-overlay, .welcome-start, .welcome-task, .welcome-marker {
    animation: none !important;
    transition: none !important;
  }
}

/* ==========================================================================
   ILLOCA ARCHITECTURAL BLUEPRINT DESIGN SYSTEM (Welcome Page Only)
   Inspired by illoca.unseen.co: technical grids, coordinates, mono details,
   dual-stroke editorial typography & tactile split-square action buttons.
   ========================================================================== */

.tap-to-begin-overlay.illoca-style {
  position: fixed;
  inset: 0;
  z-index: 99999;
  background-color: #0d1117 !important;
  background-image: 
    radial-gradient(circle at 50% 10%, rgba(59, 96, 197, 0.12) 0%, transparent 60%),
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px) !important;
  background-size: 100% 100%, 32px 32px, 32px 32px !important;
  color: #f1f5f9;
  font-family: 'Space Grotesk', 'Inter', -apple-system, sans-serif;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start !important;
  padding: 0 clamp(16px, 4vw, 56px) 40px;
}

/* Technical Blueprint Coordinates & Indicators */
.illoca-coords {
  position: fixed;
  top: 36px;
  left: clamp(20px, 3.5vw, 48px);
  z-index: 100;
  font-family: 'Geist Mono', 'JetBrains Mono', monospace;
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  color: #718096;
  display: flex;
  flex-direction: column;
  gap: 3px;
  pointer-events: none;
}
.illoca-coords span { color: #3b82f6; font-weight: 700; margin-right: 4px; }

.illoca-contact {
  position: fixed;
  top: 36px;
  right: clamp(20px, 3.5vw, 48px);
  z-index: 100;
  pointer-events: none;
}
.illoca-contact-pill {
  font-family: 'Geist Mono', 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  padding: 4px 10px;
  background: rgba(30, 41, 59, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 999px;
  color: #94a3b8;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Floating Architectural Navigation Bar */
.illoca-nav {
  position: sticky;
  top: 20px;
  z-index: 90;
  width: min(840px, 100%);
  min-height: 58px;
  margin-top: 18px;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 8px;
  padding: 8px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45), 4px 4px 0 rgba(0, 0, 0, 0.3);
}

.illoca-nav-border {
  position: absolute;
  inset: -2px;
  pointer-events: none;
  opacity: 0.4;
}

.welcome-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #f8fafc;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.96rem;
  letter-spacing: -0.02em;
}
.welcome-brand-mark {
  width: 32px;
  height: 32px;
  background: #1e293b;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #38bdf8;
  font-size: 0.9rem;
}
.illoca-brand-tag {
  background: #3b82f6;
  color: #ffffff;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  margin-left: 4px;
}

.illoca-nav-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(30, 41, 59, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 999px;
  padding: 5px 14px;
  font-family: 'Geist Mono', 'JetBrains Mono', monospace;
  font-size: 0.73rem;
  letter-spacing: 0.04em;
  color: #cbd5e1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.illoca-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.8);
  animation: illocaPulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

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

.illoca-status-text {
  white-space: nowrap;
}

/* Illoca Tactile Swipe to Begin Slider Track */
.illoca-swipe-track {
  position: relative;
  width: 178px;
  height: 40px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 999px;
  padding: 3px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  cursor: grab;
  user-select: none;
  touch-action: none;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.25);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  overflow: hidden;
}

.illoca-swipe-track:focus-visible {
  outline: 2px solid #38bdf8;
  outline-offset: 2px;
}

.illoca-swipe-track.is-dragging {
  cursor: grabbing;
  border-color: #ea580c;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5), 0 0 14px rgba(234, 88, 12, 0.4);
}

.illoca-swipe-thumb {
  position: relative;
  z-index: 2;
  width: 34px;
  height: 34px;
  background: #ea580c;
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4), 0 0 10px rgba(234, 88, 12, 0.5);
  transition: background-color 0.2s ease, transform 0.05s linear;
  will-change: transform;
}

.illoca-swipe-thumb:hover {
  background: #f97316;
}

.illoca-swipe-text {
  position: absolute;
  left: 44px;
  right: 12px;
  text-align: center;
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  color: #94a3b8;
  letter-spacing: 0.02em;
  pointer-events: none;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: opacity 0.2s ease;
}

.illoca-swipe-text i {
  font-size: 0.7rem;
  color: #ea580c;
}

.illoca-swipe-hidden-trigger {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* Eyebrow Numbered Badge with SVG architectural dashed lines */
.illoca-eyebrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: clamp(24px, 4vh, 42px);
  margin-bottom: 12px;
}
.illoca-eyebrow-num {
  font-family: 'Geist Mono', 'JetBrains Mono', monospace;
  font-size: 0.78rem;
  font-weight: 800;
  color: #ea580c;
  background: rgba(234, 88, 12, 0.12);
  border: 1px solid rgba(234, 88, 12, 0.4);
  width: 22px;
  height: 22px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.illoca-eyebrow-text {
  font-family: 'Caveat', cursive, sans-serif;
  font-size: 1.35rem;
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.illoca-line-svg {
  width: 70px;
  height: 5px;
}

/* Illoca Editorial Headline with dual text stroke & annotations */
.illoca-intro {
  text-align: center;
  max-width: 900px;
  margin: 0 auto clamp(24px, 4vh, 38px);
}
.illoca-headline-wrapper {
  position: relative;
  display: inline-block;
  margin-bottom: 14px;
}
.illoca-title {
  margin: 0;
  font-family: 'Syne', 'Space Grotesk', sans-serif;
  font-size: clamp(2.4rem, 5.2vw, 4.4rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.04em;
  position: relative;
}
.illoca-title-bg {
  position: absolute;
  inset: 0;
  color: transparent;
  -webkit-text-stroke: 1.5px rgba(255, 255, 255, 0.18);
  pointer-events: none;
  user-select: none;
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.6));
}
.illoca-title-fill {
  position: relative;
  color: #ffffff;
}
.illoca-title-accent {
  background: linear-gradient(135deg, #f97316 0%, #38bdf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Handwritten Architect Annotations */
.illoca-handwritten-note {
  position: absolute;
  font-family: 'Caveat', cursive, sans-serif;
  font-size: 1.35rem;
  color: #ea580c;
  pointer-events: none;
  user-select: none;
}
.illoca-note-left {
  top: -12px;
  left: -90px;
  transform: rotate(-6deg);
}
.illoca-note-scribble {
  display: block;
  width: 100px;
  height: 12px;
  margin-top: -4px;
}
.illoca-note-right {
  bottom: -18px;
  right: -95px;
  transform: rotate(4deg);
  color: #718096;
  font-size: 1.15rem;
}
.illoca-note-right i {
  color: #38bdf8;
  margin-right: 4px;
}

.illoca-subtext {
  font-size: clamp(0.95rem, 1.25vw, 1.12rem);
  color: #94a3b8;
  max-width: 62ch;
  margin: 0 auto;
  line-height: 1.55;
  font-family: 'Inter', sans-serif;
}

/* Blueprint Stage Card with Corner Ticks */
.illoca-stage-grid {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.95fr);
  gap: clamp(24px, 3.5vw, 44px);
  width: min(1140px, 100%);
  margin: 0 auto;
  align-items: center;
}

.illoca-blueprint-card {
  position: relative;
  background: #0f172a;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 8px;
  padding: 10px;
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.4), 0 20px 40px rgba(0, 0, 0, 0.6);
}

/* Architectural Corner Crop Marks */
.illoca-corner {
  position: absolute;
  width: 12px;
  height: 12px;
  border-color: #38bdf8;
  border-style: solid;
  pointer-events: none;
  z-index: 10;
}
.illoca-corner.top-l { top: -2px; left: -2px; border-width: 2px 0 0 2px; }
.illoca-corner.top-r { top: -2px; right: -2px; border-width: 2px 2px 0 0; }
.illoca-corner.bot-l { bottom: -2px; left: -2px; border-width: 0 0 2px 2px; }
.illoca-corner.bot-r { bottom: -2px; right: -2px; border-width: 0 2px 2px 0; }

.illoca-badge-mono {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 10;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(56, 189, 248, 0.4);
  color: #38bdf8;
  font-family: 'Geist Mono', 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  padding: 4px 8px;
  border-radius: 4px;
}

.illoca-connectors path {
  stroke: rgba(56, 189, 248, 0.5) !important;
  stroke-dasharray: 4 6 !important;
  stroke-width: 2 !important;
}

/* Illoca Split Task Cards */
.illoca-task-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.illoca-task-item {
  width: 100%;
  display: flex !important;
  align-items: center !important;
  gap: 14px !important;
  padding: 12px 14px !important;
  background: rgba(15, 23, 42, 0.7) !important;
  border: 1px solid rgba(148, 163, 184, 0.2) !important;
  border-radius: 6px !important;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.25) !important;
}
.illoca-task-item:hover, .illoca-task-item.is-active {
  background: rgba(30, 41, 59, 0.95) !important;
  border-color: #38bdf8 !important;
  transform: translateX(4px) !important;
  box-shadow: 3px 3px 0 rgba(56, 189, 248, 0.3) !important;
}
.illoca-task-icon-box {
  width: 38px;
  height: 38px;
  background: #1e293b;
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: 0.95rem;
  flex-shrink: 0;
  transition: all 0.2s ease;
}
.illoca-task-item.is-active .illoca-task-icon-box,
.illoca-task-item:hover .illoca-task-icon-box {
  background: #ea580c;
  color: #ffffff;
  border-color: #ea580c;
}
.illoca-task-body {
  flex: 1;
  min-width: 0;
}
.illoca-task-body .welcome-task-number {
  font-family: 'Geist Mono', 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  color: #38bdf8;
  display: block;
  margin-bottom: 2px;
}
.illoca-task-body b {
  font-size: 0.92rem;
  color: #f8fafc;
  display: block;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.illoca-task-body small {
  font-size: 0.74rem;
  color: #94a3b8;
  display: block;
}
.illoca-task-arrow {
  color: #475569;
  font-size: 0.8rem;
  transition: all 0.2s ease;
}
.illoca-task-item.is-active .illoca-task-arrow,
.illoca-task-item:hover .illoca-task-arrow {
  color: #38bdf8;
  transform: translateX(2px);
}

.illoca-task-caption {
  font-family: 'Caveat', cursive, sans-serif;
  font-size: 1.15rem;
  color: #94a3b8;
  margin: 6px 0 0 10px;
  line-height: 1.35;
}

/* Proof Bar with Blueprint Stamp */
.illoca-footer-proof {
  width: min(1140px, 100%);
  margin: 32px auto 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px dashed rgba(148, 163, 184, 0.25);
  padding-top: 16px;
  font-family: 'Geist Mono', 'JetBrains Mono', monospace;
  font-size: 0.74rem;
  color: #94a3b8;
  flex-wrap: wrap;
  gap: 12px;
}
.illoca-footer-proof span i { color: #10b981; margin-right: 4px; }
.illoca-draft-stamp {
  border: 1px solid rgba(234, 88, 12, 0.4);
  color: #ea580c;
  padding: 2px 8px;
  border-radius: 3px;
  font-weight: 700;
  letter-spacing: 0.08em;
  background: rgba(234, 88, 12, 0.08);
}

/* Responsive Overrides */
@media (max-width: 1024px) {
  .illoca-coords, .illoca-contact { display: none; }
  .illoca-note-left, .illoca-note-right { display: none; }
}
@media (max-width: 768px) {
  .illoca-nav-center-tags { display: none; }
  .illoca-stage-grid { grid-template-columns: 1fr; }
  .illoca-connectors { display: none; }
  .illoca-nav { width: 100%; }
}

/* ==========================================================================
   ILLOCA ARCHITECTURAL DESIGN - STUDIO WORKSPACE & CANVAS
   ========================================================================== */

/* Blueprint Technical Grid Background across entire Workspace */
.app-main {
  background-color: #0b0f17 !important;
  background-image: 
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px) !important;
  background-size: 32px 32px, 32px 32px !important;
}

/* App Header Illoca Refinement */
.app-header {
  background: rgba(13, 17, 23, 0.9) !important;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4) !important;
}

/* Left Toolbar Blueprint Aesthetic */
.left-toolbar {
  background: rgba(13, 17, 23, 0.88) !important;
  border-right: 1px solid rgba(148, 163, 184, 0.2) !important;
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3) !important;
}
.left-toolbar .tool-btn {
  border-radius: 6px !important;
  border: 1px solid transparent !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
}
.left-toolbar .tool-btn:hover {
  background: rgba(30, 41, 59, 0.8) !important;
  border-color: rgba(148, 163, 184, 0.3) !important;
  color: #38bdf8 !important;
}
.left-toolbar .tool-btn.active {
  background: #1e293b !important;
  border-color: #38bdf8 !important;
  color: #ffffff !important;
  box-shadow: 2px 2px 0 rgba(56, 189, 248, 0.35) !important;
}

/* Studio Workspace Empty Card (Illoca Blueprint) */
.dropzone-card.illoca-workspace-card {
  position: relative;
  max-width: 680px;
  margin: 0 auto;
  background: #0f172a !important;
  border: 1px solid rgba(148, 163, 184, 0.28) !important;
  border-radius: 8px !important;
  padding: 44px 38px 36px !important;
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.4), 0 24px 60px rgba(0, 0, 0, 0.7) !important;
  text-align: center;
}

.illoca-workspace-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px dashed rgba(148, 163, 184, 0.25);
  padding-bottom: 12px;
  margin-bottom: 24px;
  font-family: 'Geist Mono', 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: #94a3b8;
}
.illoca-workspace-badge {
  color: #38bdf8;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.illoca-workspace-dims {
  color: #64748b;
}

.illoca-workspace-icon {
  width: 64px !important;
  height: 64px !important;
  background: #1e293b !important;
  border: 1px solid rgba(148, 163, 184, 0.3) !important;
  border-radius: 8px !important;
  color: #ea580c !important;
  font-size: 1.7rem !important;
  margin: 0 auto 18px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.3) !important;
}

.illoca-workspace-title {
  font-family: 'Syne', 'Space Grotesk', sans-serif !important;
  font-size: 1.6rem !important;
  font-weight: 800 !important;
  color: #f8fafc !important;
  letter-spacing: -0.03em !important;
  margin-bottom: 10px !important;
}

.illoca-workspace-desc {
  font-family: 'Inter', sans-serif !important;
  font-size: 0.92rem !important;
  color: #94a3b8 !important;
  line-height: 1.55 !important;
  max-width: 54ch;
  margin: 0 auto 26px !important;
}

/* Illoca Tactile Studio Upload Button */
.illoca-workspace-btn {
  display: inline-flex !important;
  align-items: center !important;
  padding: 4px 20px 4px 4px !important;
  background: #f8fafc !important;
  color: #0f172a !important;
  border: 1px solid #cbd5e1 !important;
  border-radius: 6px !important;
  font-family: 'Space Grotesk', 'Inter', sans-serif !important;
  font-weight: 700 !important;
  font-size: 0.9rem !important;
  gap: 12px !important;
  box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.3) !important;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease !important;
}
.illoca-workspace-btn:hover {
  transform: translate(-1px, -1px) !important;
  box-shadow: 3px 3px 0 rgba(59, 130, 246, 0.6) !important;
  background: #ffffff !important;
}
.illoca-workspace-btn .illoca-btn-square {
  width: 36px;
  height: 36px;
  background: #ea580c;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.illoca-workspace-badges {
  margin-top: 28px !important;
  padding-top: 18px !important;
  border-top: 1px dashed rgba(148, 163, 184, 0.25) !important;
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: center !important;
  gap: 8px 14px !important;
}
.illoca-workspace-badges .feat-pill {
  font-family: 'Geist Mono', 'JetBrains Mono', monospace !important;
  font-size: 0.72rem !important;
  background: rgba(30, 41, 59, 0.6) !important;
  border: 1px solid rgba(148, 163, 184, 0.2) !important;
  color: #cbd5e1 !important;
  padding: 4px 10px !important;
  border-radius: 4px !important;
}
.illoca-workspace-badges .feat-pill i {
  color: #10b981 !important;
  margin-right: 4px;
}

/* Canvas Viewport Frame in Illoca Style */
.canvas-stage {
  border: 1px solid rgba(148, 163, 184, 0.25) !important;
  box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.4), 0 20px 50px rgba(0, 0, 0, 0.7) !important;
  border-radius: 6px !important;
  position: relative !important;
}

