/* ============================================================
   Lumina Image Studio - Modern 100% Client-Side Image Suite
   ============================================================ */

:root {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --border-color: rgba(0, 0, 0, 0.08);
  --border-focus: #4f46e5;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --accent-primary: #6366f1;
  --accent-hover: #4f46e5;
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #d946ef 100%);
  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.06);
  --shadow-xl: 0 16px 24px -4px rgba(0, 0, 0, 0.08);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.15);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --header-height: 64px;
  --sidebar-width: 330px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
}

[data-theme="light"] {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --border-color: rgba(0, 0, 0, 0.08);
  --border-focus: #4f46e5;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.06);
  --shadow-xl: 0 16px 24px -4px rgba(0, 0, 0, 0.08);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.15);
}

[data-theme="dark"] {
  --bg-primary: #0b0f19;
  --bg-secondary: #111827;
  --bg-tertiary: #1f2937;
  --bg-card: rgba(17, 24, 39, 0.75);
  --bg-card-hover: rgba(31, 41, 55, 0.95);
  --border-color: rgba(255, 255, 255, 0.1);
  --border-focus: #6366f1;
  --text-primary: #f9fafb;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.2), 0 2px 4px -1px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.4), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
  --shadow-glow: 0 0 25px rgba(99, 102, 241, 0.35);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

/* Anti-Copy Protection */
body {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

input, textarea, select, [contenteditable="true"], .policy-card, .faq-answer {
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
  user-select: text;
}

html, body {
  width: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* Header */
.app-header {
  height: var(--header-height);
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
}

.brand-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--accent-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: var(--shadow-glow);
}

.brand-title {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--text-primary) 30%, var(--accent-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.header-center {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin: 0 1rem;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  list-style: none;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  transition: color 0.15s ease;
  white-space: nowrap;
}

.nav-link:hover, .nav-link.active {
  color: var(--accent-primary);
}

.search-command-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-lg);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.search-command-btn:hover {
  border-color: var(--accent-primary);
  color: var(--text-primary);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}

.kbd-shortcut {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: var(--bg-tertiary);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-family: var(--font-mono);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.privacy-pill {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-emerald);
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 0.35rem 0.75rem;
  border-radius: 9999px;
}

.privacy-pill svg {
  width: 14px;
  height: 14px;
}

.icon-btn {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.icon-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border-color: var(--border-focus);
}

/* Hero Section */
.hero-section {
  padding: 2.75rem 1.5rem 2rem 1.5rem;
  text-align: center;
  max-width: 880px;
  margin: 0 auto;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.8rem;
  border-radius: 9999px;
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent-primary);
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 1rem;
  border: 1px solid rgba(99, 102, 241, 0.25);
}

.hero-title {
  font-size: 2.6rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 0.75rem;
  background: linear-gradient(135deg, var(--text-primary) 30%, var(--accent-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.5;
  max-width: 650px;
  margin: 0 auto 1.75rem auto;
}

/* Modern Glowing Hero Dropzone */
.hero-dropzone-wrapper {
  max-width: 720px;
  margin: 0 auto 2rem auto;
}

.hero-dropzone {
  background: var(--bg-card);
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-xl);
  padding: 2.5rem 1.5rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
  box-shadow: var(--shadow-xl);
  backdrop-filter: blur(12px);
  position: relative;
}

.hero-dropzone:hover,
.hero-dropzone.drag-active {
  border-color: var(--accent-primary);
  background: var(--bg-card-hover);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

.dropzone-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(99, 102, 241, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem auto;
  color: var(--accent-primary);
}

.quick-format-pills {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 1.25rem;
  flex-wrap: wrap;
}

.q-pill {
  font-size: 0.75rem;
  font-weight: 500;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.3rem 0.65rem;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.q-pill:hover {
  border-color: var(--accent-primary);
  color: var(--text-primary);
  background: rgba(99, 102, 241, 0.1);
}

/* ============================================================
   Converter Sections & Grid (Fixed No-Overflow Layout)
   ============================================================ */

.section-container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto 3.5rem auto;
  padding: 0 1.25rem;
}

.section-title-wrap {
  text-align: center;
  margin-bottom: 1.75rem;
}

.section-main-title {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 0.35rem;
  letter-spacing: -0.02em;
}

.section-main-sub {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.category-filter-chips {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}

.cat-filter-chip {
  padding: 0.45rem 0.9rem;
  border-radius: 9999px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.cat-filter-chip:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.cat-filter-chip.active {
  background: var(--accent-primary);
  color: #ffffff;
  border-color: var(--accent-primary);
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.35);
}

/* Responsive 4-Column Grid with Safe Minmax */
.converters-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.9rem;
  width: 100%;
}

.converter-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 0.85rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-sm);
  position: relative;
  min-width: 0; /* Prevents flex children from overflowing */
}

.converter-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

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

.converter-card-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.converter-card-desc {
  font-size: 0.73rem;
  color: var(--text-secondary);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.converter-card-arrow {
  color: var(--text-muted);
  font-size: 0.85rem;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.converter-card:hover .converter-card-arrow {
  color: var(--accent-primary);
  transform: translateX(3px);
}

/* Format Badges (Matching reference colors) */
.fmt-badge {
  width: 42px;
  height: 42px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.02em;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.badge-png { background: #2563eb; } /* Blue */
.badge-heic { background: #d97706; } /* Gold/Amber */
.badge-jpg { background: #0d9488; } /* Teal */
.badge-jpg-red { background: #dc2626; } /* Red */
.badge-pdf { background: #e11d48; } /* Red/Rose */
.badge-webp { background: #0284c7; } /* Sky Blue */
.badge-webp-purple { background: #6366f1; } /* Indigo */
.badge-heic-green { background: #16a34a; } /* Green */
.badge-avif { background: #9333ea; } /* Purple */
.badge-tiff { background: #c026d3; } /* Magenta */
.badge-bmp { background: #e11d48; } /* Rose */
.badge-gif { background: #ea580c; } /* Orange */
.badge-ocr { background: #059669; } /* Emerald */
.badge-img { background: #be123c; } /* Maroon */
.badge-svg { background: #f97316; } /* Orange/Coral for SVG */
.badge-doc { background: #2563eb; } /* Blue for DOC/DOCX */

/* FAQ Section Accordions */
.faq-container {
  max-width: 780px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.faq-question {
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
}

.faq-answer {
  padding: 0 1.25rem 1rem 1.25rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.55;
  display: none;
}

.faq-item.open .faq-answer {
  display: block;
}

.faq-item.open .faq-chevron {
  transform: rotate(180deg);
}

.faq-chevron {
  transition: transform 0.2s ease;
  font-size: 0.75rem;
}

/* Studio Workspace Modal / Overlay */
.studio-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(16px);
  z-index: 90;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.studio-modal-backdrop.open {
  display: flex;
}

.studio-container {
  width: 95vw;
  max-width: 1280px;
  height: 90vh;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
}

.studio-header {
  height: 58px;
  padding: 0 1.25rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  gap: 1rem;
}

#studio-current-filename {
  max-width: 200px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-block;
  vertical-align: middle;
}

.tool-btn {
  white-space: nowrap;
  flex-shrink: 0;
}

.studio-body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Canvas Viewport */
.canvas-viewport {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 1.5rem;
  background: #090d16;
}

.canvas-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  max-height: 100%;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border-color);
  background: #111827;
}

#main-canvas {
  display: block;
  max-width: 100%;
  max-height: calc(90vh - 140px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

/* Split Compare Slider */
.split-compare-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.split-slider-line {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #ffffff;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.6);
  pointer-events: auto;
  cursor: ew-resize;
  z-index: 20;
}

.split-slider-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #ffffff;
  color: #111827;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.split-label-before,
.split-label-after {
  position: absolute;
  top: 12px;
  padding: 4px 8px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.75);
  color: white;
  pointer-events: none;
}
.split-label-before { left: 12px; }
.split-label-after { right: 12px; }

/* Cropper Overlay */
.crop-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 15;
}

.crop-box {
  position: absolute;
  border: 2px solid var(--accent-cyan);
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55);
  cursor: move;
}

.crop-handle {
  position: absolute;
  width: 10px;
  height: 10px;
  background: var(--accent-cyan);
  border: 1px solid #ffffff;
  border-radius: 2px;
}
.crop-handle.tl { top: -5px; left: -5px; }
.crop-handle.tr { top: -5px; right: -5px; }
.crop-handle.bl { bottom: -5px; left: -5px; }
.crop-handle.br { bottom: -5px; right: -5px; }

/* Right Inspector Dock */
.inspector-sidebar {
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.inspector-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.inspector-title {
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.inspector-body {
  flex: 1;
  padding: 1.25rem;
  overflow-y: auto;
}

.inspector-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border-color);
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

/* Form Controls & Buttons */
.control-group {
  margin-bottom: 1.15rem;
}

.control-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}

.control-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.control-value {
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--accent-primary);
  font-weight: 600;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--bg-tertiary);
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent-primary);
  cursor: pointer;
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.6);
  border: 2px solid #ffffff;
}

.select-input,
.text-input,
.number-input {
  width: 100%;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  outline: none;
}

.select-input:focus,
.text-input:focus,
.number-input:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}

.btn-primary {
  background: var(--accent-gradient);
  color: white;
  border: none;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
  transition: all 0.2s ease;
}

.btn-primary:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.45);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--accent-primary);
}

.tool-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.tool-btn:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.tool-btn.active {
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-primary);
  border-color: var(--accent-primary);
}

.preset-chip {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.4rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.preset-chip:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.preset-chip.active {
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent-primary);
  border-color: var(--accent-primary);
  font-weight: 600;
}

/* Footer */
.app-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 3rem 1.5rem 2rem 1.5rem;
  margin-top: auto;
}

.footer-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
}

.footer-col-title {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.15s ease;
}

.footer-links a:hover {
  color: var(--accent-primary);
}

.footer-bottom {
  max-width: 1200px;
  margin: 2.5rem auto 0 auto;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Modals & Toasts */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 10vh;
}

.modal-backdrop.open { display: flex; }

.command-modal, .batch-modal {
  width: 90%;
  max-width: 600px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}

.command-search-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
}

.command-search-input {
  flex: 1;
  background: transparent;
  border: none;
  font-size: 1.1rem;
  color: var(--text-primary);
  outline: none;
}

.command-list {
  max-height: 380px;
  overflow-y: auto;
  padding: 0.5rem;
}

.command-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  cursor: pointer;
}

.command-item:hover { background: var(--bg-tertiary); }

.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
}

.toast.success { border-left: 4px solid var(--accent-emerald); }
.toast.error { border-left: 4px solid var(--accent-rose); }
.toast.info { border-left: 4px solid var(--accent-primary); }

/* ============================================================
   RESPONSIVE BREAKPOINTS (Guarantees Perfect Grid Fitting)
   ============================================================ */

@media (max-width: 1200px) {
  .converters-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .converters-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 600px) {
  .converters-grid {
    grid-template-columns: 1fr;
  }
  .hero-title {
    font-size: 2rem;
  }
  .footer-grid {
    grid-template-columns: 1fr;
  }
  .studio-body {
    flex-direction: column;
  }
@media (max-width: 768px) {
  .inpage-workspace-container > div {
    grid-template-columns: 1fr !important;
  }
}

