/* ==========================================================================
   ImageResizer Pro (img2go Clone with Enhanced Client-Side Capabilities)
   Typography: Preserved Poppins (Headings) + Inter (UI/Body)
   Theme: Modern Indigo & Slate with Dark / Light Mode & Enhanced Responsiveness
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Poppins:wght@500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* Exact Typography preserved from img2go brand specification */
  --font-heading: "Poppins", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-ui: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-sans: "Inter", ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Font weights */
  --fw-normal: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;
  --fw-extrabold: 800;

  /* Color Palette - Modern Indigo Slate */
  --primary-50: #eef2ff;
  --primary-100: #e0e7ff;
  --primary-200: #c7d2fe;
  --primary-300: #a5b4fc;
  --primary-400: #818cf8;
  --primary-500: #6366f1;
  --primary-600: #4f46e5;
  --primary-700: #4338ca;
  --primary-800: #3730a3;
  --primary-900: #312e81;

  --accent-cyan: #06b6d4;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-rose: #f43f5e;

  /* Light Theme (Default) */
  --bg-page: #f8fafc;
  --bg-card: #ffffff;
  --bg-card-subtle: #f1f5f9;
  --bg-input: #ffffff;
  --border-color: #e2e8f0;
  --border-focus: #6366f1;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --dropzone-bg: #f8fafc;
  --dropzone-border: #cbd5e1;
  --slider-track: #e2e8f0;
}

[data-theme="dark"] {
  --bg-page: #0b0f19;
  --bg-card: #111827;
  --bg-card-subtle: #1e293b;
  --bg-input: #1f2937;
  --border-color: #2e384d;
  --border-focus: #818cf8;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.3);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.35), 0 4px 6px -4px rgb(0 0 0 / 0.35);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.4), 0 8px 10px -6px rgb(0 0 0 / 0.4);
  --dropzone-bg: #131c2e;
  --dropzone-border: #334155;
  --slider-track: #334155;
}

/* Base Resets */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-ui);
  background-color: var(--bg-page);
  color: var(--text-main);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  transition: background-color 0.25s ease, color 0.25s ease;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  letter-spacing: -0.025em;
  font-weight: var(--fw-bold);
  color: var(--text-main);
}

p, span, label, input, button, select, textarea {
  font-family: var(--font-ui);
}

code, kbd, samp, pre, .font-mono {
  font-family: var(--font-mono);
}

a {
  color: var(--primary-600);
  text-decoration: none;
  transition: color 0.15s ease;
}
[data-theme="dark"] a {
  color: var(--primary-400);
}
a:hover {
  text-decoration: underline;
}

/* Container */
.container {
  width: 100%;
  max-width: 1240px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}
@media (min-width: 640px) {
  .container {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

/* Header & Nav */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.25s ease, border-color 0.25s ease;
}
[data-theme="dark"] .site-header {
  background-color: rgba(17, 24, 39, 0.92);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4.25rem;
  gap: 1rem;
}

.logo-brand {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
  flex-shrink: 0;
}
.logo-img {
  width: 2.375rem;
  height: 2.375rem;
  border-radius: 0.5rem;
  object-fit: contain;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}
.brand-text {
  display: flex;
  flex-direction: column;
}
.brand-title {
  font-size: 1.125rem;
  font-weight: var(--fw-bold);
  line-height: 1.2;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
@media (min-width: 640px) {
  .brand-title {
    font-size: 1.25rem;
  }
}
.brand-badge {
  font-size: 0.65rem;
  font-weight: var(--fw-semibold);
  background: linear-gradient(135deg, var(--primary-500), var(--accent-cyan));
  color: #fff;
  padding: 0.12rem 0.4rem;
  border-radius: 0.375rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.brand-subtitle {
  font-size: 0.6875rem;
  color: var(--text-muted);
}
@media (min-width: 640px) {
  .brand-subtitle {
    font-size: 0.75rem;
  }
}

/* Important Pages Nav Links */
.nav-links {
  display: none;
  align-items: center;
  gap: 0.85rem;
}
@media (min-width: 840px) {
  .nav-links {
    display: flex;
  }
}
.nav-link {
  font-size: 0.875rem;
  font-weight: var(--fw-medium);
  color: var(--text-muted);
  text-decoration: none;
  padding: 0.35rem 0.6rem;
  border-radius: 0.45rem;
  transition: all 0.15s ease;
  cursor: pointer;
  background: transparent;
  border: none;
  font-family: inherit;
}
.nav-link:hover {
  color: var(--text-main);
  text-decoration: none;
  background-color: var(--bg-card-subtle);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
@media (min-width: 640px) {
  .header-actions {
    gap: 0.75rem;
  }
}

.security-pill {
  display: none;
  align-items: center;
  gap: 0.375rem;
  background-color: rgba(16, 185, 129, 0.1);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.25);
  padding: 0.35rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: var(--fw-semibold);
  white-space: nowrap;
}
@media (min-width: 640px) {
  .security-pill {
    display: inline-flex;
  }
}
[data-theme="dark"] .security-pill {
  background-color: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.3);
}

.theme-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
  color: var(--text-main);
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
}
.theme-toggle-btn:hover {
  background-color: var(--bg-card-subtle);
}

/* Mobile Hamburger Menu Button */
.mobile-menu-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
  color: var(--text-main);
  cursor: pointer;
}
@media (min-width: 840px) {
  .mobile-menu-btn {
    display: none;
  }
}

/* Mobile Menu Dropdown */
.mobile-nav-drawer {
  display: none;
  flex-direction: column;
  padding: 1rem 1.25rem;
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  gap: 0.5rem;
}
.mobile-nav-drawer.open {
  display: flex;
}
.mobile-nav-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.9375rem;
  font-weight: var(--fw-medium);
  color: var(--text-main);
  background: transparent;
  border: none;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  transition: background-color 0.15s;
}
.mobile-nav-link:hover {
  background-color: var(--bg-card-subtle);
}

/* Hero Section */
.hero-section {
  padding: 2rem 0 1.5rem;
  background: radial-gradient(circle at 50% 0%, rgba(99, 102, 241, 0.08) 0%, transparent 70%);
}
@media (min-width: 640px) {
  .hero-section {
    padding: 3rem 0 2rem;
  }
}
.hero-header {
  text-align: center;
  max-width: 48rem;
  margin: 0 auto 1.75rem;
}
.hero-title {
  font-size: clamp(1.85rem, 5vw, 2.75rem);
  line-height: 1.2;
  margin-bottom: 0.75rem;
  background: linear-gradient(135deg, var(--text-main) 60%, var(--primary-600));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
[data-theme="dark"] .hero-title {
  background: linear-gradient(135deg, #ffffff 65%, var(--primary-400));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-desc {
  font-size: clamp(0.9375rem, 2.5vw, 1.0625rem);
  color: var(--text-muted);
  line-height: 1.5;
  padding: 0 0.5rem;
}

/* Privacy Ribbon */
.privacy-ribbon {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem 1.25rem;
  flex-wrap: wrap;
  margin-top: 1rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.privacy-item {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.privacy-item svg {
  color: var(--accent-emerald);
  flex-shrink: 0;
}

/* App Workspace Card */
.app-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 1.25rem;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  margin-bottom: 3.5rem;
  transition: border-color 0.25s ease, background-color 0.25s ease;
}

/* Dropzone */
.dropzone-container {
  padding: 2.5rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  background-color: var(--dropzone-bg);
  border: 2px dashed var(--dropzone-border);
  border-radius: 1rem;
  margin: 1rem;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.15s ease;
  position: relative;
}
@media (min-width: 640px) {
  .dropzone-container {
    padding: 3.5rem 1.5rem;
    margin: 1.25rem;
  }
}
.dropzone-container:hover, .dropzone-container.drag-over {
  border-color: var(--primary-500);
  background-color: rgba(99, 102, 241, 0.04);
  transform: translateY(-2px);
}
.dropzone-art {
  width: 4.75rem;
  height: 4.75rem;
  margin-bottom: 1rem;
  object-fit: contain;
  filter: drop-shadow(0 4px 12px rgba(99, 102, 241, 0.2));
}
@media (min-width: 640px) {
  .dropzone-art {
    width: 5.5rem;
    height: 5.5rem;
    margin-bottom: 1.25rem;
  }
}
.dropzone-title {
  font-size: clamp(1.125rem, 3vw, 1.35rem);
  font-weight: var(--fw-bold);
  margin-bottom: 0.35rem;
  color: var(--text-main);
}
.dropzone-sub {
  font-size: clamp(0.8125rem, 2vw, 0.9375rem);
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}
.btn-select-file {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
  color: #fff;
  font-weight: var(--fw-semibold);
  font-size: clamp(0.9375rem, 2.5vw, 1rem);
  padding: 0.75rem 1.75rem;
  border-radius: 0.625rem;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn-select-file:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.45);
}
.dropzone-footer {
  margin-top: 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}
.sample-btn {
  background: none;
  border: 1px solid var(--border-color);
  color: var(--primary-600);
  padding: 0.4rem 0.85rem;
  border-radius: 0.5rem;
  font-size: 0.8125rem;
  font-weight: var(--fw-medium);
  cursor: pointer;
  transition: all 0.15s;
}
[data-theme="dark"] .sample-btn {
  color: var(--primary-400);
}
.sample-btn:hover {
  background-color: var(--bg-card-subtle);
  border-color: var(--primary-400);
}
.formats-hint {
  font-size: 0.75rem;
  color: var(--text-subtle);
}

/* Editor Interface */
.editor-workspace {
  display: none;
  flex-direction: column;
}
.editor-workspace.active {
  display: flex;
}

/* Top Toolbar */
.editor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-color);
  background-color: var(--bg-card);
  flex-wrap: wrap;
  gap: 0.75rem;
}
@media (min-width: 640px) {
  .editor-toolbar {
    padding: 1rem 1.5rem;
  }
}
.active-file-info {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}
.file-thumb-mini {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.45rem;
  object-fit: cover;
  border: 1px solid var(--border-color);
  flex-shrink: 0;
}
.file-name-dim {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.file-name-text {
  font-weight: var(--fw-semibold);
  font-size: 0.875rem;
  color: var(--text-main);
  max-width: 170px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (min-width: 480px) {
  .file-name-text {
    max-width: 240px;
    font-size: 0.9375rem;
  }
}
.file-orig-dim {
  font-size: 0.6875rem;
  color: var(--text-muted);
}
@media (min-width: 480px) {
  .file-orig-dim {
    font-size: 0.75rem;
  }
}
.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border-color);
  background-color: var(--bg-card);
  color: var(--text-main);
  font-size: 0.8125rem;
  font-weight: var(--fw-medium);
  cursor: pointer;
  transition: all 0.15s;
}
.btn-secondary:hover {
  background-color: var(--bg-card-subtle);
}

/* Editor Grid: Settings (Left) & Preview (Right) */
.editor-grid {
  display: grid;
  grid-template-columns: 1fr;
}
@media (min-width: 1024px) {
  .editor-grid {
    grid-template-columns: 460px 1fr;
  }
}

/* Settings Column */
.settings-column {
  padding: 1.25rem 1rem;
  border-bottom: 1px solid var(--border-color);
  background-color: var(--bg-card);
}
@media (min-width: 640px) {
  .settings-column {
    padding: 1.5rem;
  }
}
@media (min-width: 1024px) {
  .settings-column {
    border-bottom: none;
    border-right: 1px solid var(--border-color);
    max-height: calc(100vh - 12rem);
    overflow-y: auto;
  }
}

/* Settings Section */
.settings-group {
  margin-bottom: 1.5rem;
}
.group-title {
  font-size: 0.8125rem;
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Mode Navigation Tabs - Fully Responsive Horizontal Scroll */
.mode-tabs {
  display: flex;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  background-color: var(--bg-card-subtle);
  padding: 0.3rem;
  border-radius: 0.625rem;
  margin-bottom: 1.25rem;
  gap: 0.25rem;
}
.mode-tabs::-webkit-scrollbar {
  display: none;
}
.mode-tab-btn {
  flex: 1 0 auto;
  border: none;
  background: transparent;
  padding: 0.55rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: var(--fw-semibold);
  color: var(--text-muted);
  border-radius: 0.45rem;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.mode-tab-btn:hover {
  color: var(--text-main);
}
.mode-tab-btn.active {
  background-color: var(--bg-card);
  color: var(--primary-600);
  box-shadow: var(--shadow-sm);
}
[data-theme="dark"] .mode-tab-btn.active {
  color: var(--primary-300);
}

/* Tab Panels */
.tab-panel {
  display: none;
}
.tab-panel.active {
  display: block;
}

/* Form Controls */
.input-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.input-field-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}
.input-label {
  font-size: 0.8125rem;
  font-weight: var(--fw-medium);
  color: var(--text-muted);
}
.input-box {
  width: 100%;
  padding: 0.55rem 0.65rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border-color);
  background-color: var(--bg-input);
  color: var(--text-main);
  font-size: 0.9375rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input-box:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.aspect-lock-btn {
  margin-top: 1.25rem;
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  border: 1px solid var(--border-color);
  background-color: var(--bg-card-subtle);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  flex-shrink: 0;
}
.aspect-lock-btn.locked {
  background-color: rgba(99, 102, 241, 0.12);
  color: var(--primary-600);
  border-color: var(--primary-400);
}
[data-theme="dark"] .aspect-lock-btn.locked {
  color: var(--primary-300);
}

/* Unit selector pills */
.unit-pills, .ratio-pills, .percentage-pills {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.pill-btn {
  padding: 0.35rem 0.65rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  font-weight: var(--fw-medium);
  border: 1px solid var(--border-color);
  background-color: var(--bg-card-subtle);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}
.pill-btn:hover {
  color: var(--text-main);
  border-color: var(--text-muted);
}
.pill-btn.active {
  background-color: var(--primary-600);
  color: #fff;
  border-color: var(--primary-600);
}

/* Percentage Slider */
.slider-container {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.8125rem;
  color: var(--text-muted);
}
.range-slider {
  width: 100%;
  accent-color: var(--primary-600);
  height: 0.375rem;
  background-color: var(--slider-track);
  border-radius: 0.25rem;
  cursor: pointer;
}

/* Fit Mode Cards - Responsive Grid */
.fit-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(95px, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.fit-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 0.25rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border-color);
  background-color: var(--bg-card-subtle);
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}
.fit-card:hover {
  border-color: var(--primary-400);
}
.fit-card.active {
  background-color: rgba(99, 102, 241, 0.08);
  border-color: var(--primary-600);
  color: var(--primary-600);
}
[data-theme="dark"] .fit-card.active {
  color: var(--primary-300);
}
.fit-title {
  font-size: 0.75rem;
  font-weight: var(--fw-semibold);
}

/* Focal Point Alignment (for crop) */
.focal-picker {
  display: none;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.25rem;
  max-width: 120px;
  margin: 0.5rem 0;
}
.focal-picker.active {
  display: grid;
}
.focal-btn {
  aspect-ratio: 1;
  background-color: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: 0.25rem;
  cursor: pointer;
  transition: all 0.15s;
}
.focal-btn.active {
  background-color: var(--primary-600);
  border-color: var(--primary-600);
}

/* Format & Quality Settings */
.format-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(65px, 1fr));
  gap: 0.35rem;
  margin-bottom: 0.75rem;
}
.format-btn {
  padding: 0.5rem 0.25rem;
  text-align: center;
  border-radius: 0.375rem;
  border: 1px solid var(--border-color);
  background-color: var(--bg-card-subtle);
  font-size: 0.75rem;
  font-weight: var(--fw-bold);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}
.format-btn:hover {
  color: var(--text-main);
}
.format-btn.active {
  background-color: var(--primary-600);
  color: #fff;
  border-color: var(--primary-600);
}

/* Transform & Filter Pills */
.tool-btn-group {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.tool-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.4rem 0.65rem;
  border-radius: 0.375rem;
  font-size: 0.75rem;
  font-weight: var(--fw-medium);
  border: 1px solid var(--border-color);
  background-color: var(--bg-card-subtle);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s;
}
.tool-action-btn:hover {
  background-color: var(--border-color);
}
.tool-action-btn.active {
  background-color: rgba(99, 102, 241, 0.15);
  border-color: var(--primary-600);
  color: var(--primary-600);
}
[data-theme="dark"] .tool-action-btn.active {
  color: var(--primary-300);
}

/* Switch / Checkbox Row */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.5rem;
  cursor: pointer;
  gap: 0.75rem;
}
.toggle-label {
  font-size: 0.8125rem;
  color: var(--text-main);
}
.switch {
  position: relative;
  display: inline-block;
  width: 2.25rem;
  height: 1.25rem;
  flex-shrink: 0;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider-toggle {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--slider-track);
  border-radius: 9999px;
  transition: 0.2s;
}
.slider-toggle:before {
  position: absolute;
  content: "";
  height: 0.95rem;
  width: 0.95rem;
  left: 0.15rem;
  bottom: 0.15rem;
  background-color: white;
  border-radius: 50%;
  transition: 0.2s;
}
input:checked + .slider-toggle {
  background-color: var(--primary-600);
}
input:checked + .slider-toggle:before {
  transform: translateX(1rem);
}

/* Preview Column (Right) */
.preview-column {
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-page);
  justify-content: space-between;
  min-height: 420px;
}
@media (min-width: 640px) {
  .preview-column {
    padding: 1.5rem;
    min-height: 480px;
  }
}

/* Preview Stage Container */
.stage-wrap {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 280px;
  max-height: 520px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: 
    repeating-conic-gradient(#00000008 0% 25%, transparent 0% 50%) 
    50% / 20px 20px;
  border-radius: 0.75rem;
  border: 1px solid var(--border-color);
  overflow: hidden;
  margin-bottom: 1rem;
}
[data-theme="dark"] .stage-wrap {
  background: 
    repeating-conic-gradient(#ffffff08 0% 25%, transparent 0% 50%) 
    50% / 20px 20px;
}

/* Split Compare Slider Component */
.split-viewer {
  position: relative;
  width: 100%;
  height: 100%;
  max-height: 520px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  user-select: none;
  touch-action: pan-y;
}
.split-image-container {
  position: relative;
  max-width: 100%;
  max-height: 100%;
  display: inline-block;
  box-shadow: var(--shadow-lg);
  border-radius: 0.5rem;
  overflow: hidden;
}
.split-after-img {
  display: block;
  max-width: 100%;
  max-height: 480px;
  object-fit: contain;
}
.split-before-wrap {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 50%;
  overflow: hidden;
  border-right: 2px solid #fff;
  box-shadow: 2px 0 8px rgba(0,0,0,0.3);
}
.split-before-img {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: auto;
  max-width: none;
  object-fit: contain;
}
.split-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background-color: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-700);
  cursor: ew-resize;
  z-index: 10;
  pointer-events: none;
}
.split-badge {
  position: absolute;
  bottom: 0.75rem;
  font-size: 0.6875rem;
  font-weight: var(--fw-bold);
  padding: 0.2rem 0.5rem;
  border-radius: 0.25rem;
  background-color: rgba(0,0,0,0.65);
  color: #fff;
  z-index: 5;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  backdrop-filter: blur(4px);
}
.split-badge.badge-left {
  left: 0.75rem;
}
.split-badge.badge-right {
  right: 0.75rem;
}

/* Preview Stats Bar - Fully Responsive */
.preview-stats-bar {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  padding: 0.75rem;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 0.625rem;
  margin-bottom: 1rem;
}
@media (min-width: 640px) {
  .preview-stats-bar {
    grid-template-columns: repeat(5, 1fr);
    padding: 0.75rem 1rem;
  }
}
.stat-pill {
  display: flex;
  flex-direction: column;
}
.stat-name {
  font-size: 0.6875rem;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: var(--fw-semibold);
}
.stat-value {
  font-size: 0.875rem;
  font-weight: var(--fw-bold);
  font-family: var(--font-mono);
  color: var(--text-main);
  white-space: nowrap;
}
@media (min-width: 640px) {
  .stat-value {
    font-size: 0.9375rem;
  }
}
.stat-value.diff-smaller {
  color: var(--accent-emerald);
}
.stat-value.diff-larger {
  color: var(--accent-amber);
}

/* Action Buttons Bar */
.preview-actions-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.btn-primary-download {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
  color: #fff;
  font-weight: var(--fw-bold);
  font-size: 1rem;
  padding: 0.85rem 1.25rem;
  border-radius: 0.625rem;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
  transition: transform 0.15s, box-shadow 0.15s;
}
@media (min-width: 640px) {
  .btn-primary-download {
    font-size: 1.0625rem;
    padding: 0.85rem 1.5rem;
  }
}
.btn-primary-download:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.45);
}

/* Batch Queue Drawer */
.batch-queue-section {
  border-top: 1px solid var(--border-color);
  padding: 1rem;
  background-color: var(--bg-card-subtle);
}
@media (min-width: 640px) {
  .batch-queue-section {
    padding: 1.25rem 1.5rem;
  }
}
.batch-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.batch-title {
  font-size: 0.9375rem;
  font-weight: var(--fw-bold);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.batch-count-badge {
  background-color: var(--primary-600);
  color: white;
  font-size: 0.6875rem;
  padding: 0.15rem 0.45rem;
  border-radius: 9999px;
  font-weight: var(--fw-bold);
}
.batch-list {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scrollbar-width: thin;
}
.batch-item-card {
  min-width: 130px;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  cursor: pointer;
  position: relative;
  transition: border-color 0.15s;
  flex-shrink: 0;
}
.batch-item-card.active {
  border-color: var(--primary-600);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3);
}
.batch-item-thumb {
  width: 100%;
  height: 70px;
  object-fit: cover;
  border-radius: 0.375rem;
}
.batch-item-name {
  font-size: 0.75rem;
  font-weight: var(--fw-semibold);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.batch-item-dim {
  font-size: 0.6875rem;
  color: var(--text-muted);
}
.btn-batch-download-zip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, var(--accent-emerald), #059669);
  color: #fff;
  font-size: 0.8125rem;
  font-weight: var(--fw-bold);
  padding: 0.5rem 0.85rem;
  border-radius: 0.5rem;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
  transition: transform 0.15s;
}
@media (min-width: 640px) {
  .btn-batch-download-zip {
    font-size: 0.875rem;
    padding: 0.55rem 1rem;
  }
}
.btn-batch-download-zip:hover {
  transform: translateY(-1px);
}

/* Feature Sections */
.features-section {
  padding: 2.5rem 0;
}
@media (min-width: 640px) {
  .features-section {
    padding: 3.5rem 0;
  }
}
.section-header {
  text-align: center;
  max-width: 44rem;
  margin: 0 auto 2rem;
  padding: 0 0.5rem;
}
@media (min-width: 640px) {
  .section-header {
    margin-bottom: 2.5rem;
  }
}
.section-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--primary-600);
  background-color: rgba(99, 102, 241, 0.1);
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  margin-bottom: 0.5rem;
}
[data-theme="dark"] .section-badge {
  color: var(--primary-300);
}
.section-title {
  font-size: clamp(1.5rem, 4vw, 1.875rem);
  line-height: 1.25;
  margin-bottom: 0.75rem;
}
.section-desc {
  font-size: clamp(0.875rem, 2vw, 1rem);
  color: var(--text-muted);
}

/* 5 Ways Grid */
.cards-grid-5 {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}
@media (min-width: 640px) {
  .cards-grid-5 {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
}
@media (min-width: 1024px) {
  .cards-grid-5 {
    grid-template-columns: repeat(3, 1fr);
  }
}
.feature-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
}
@media (min-width: 640px) {
  .feature-card {
    padding: 1.5rem;
  }
}
.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-300);
}
.feature-card-icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.65rem;
  background-color: rgba(99, 102, 241, 0.1);
  color: var(--primary-600);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.85rem;
}
[data-theme="dark"] .feature-card-icon {
  color: var(--primary-400);
}
.feature-card-title {
  font-size: 1.125rem;
  margin-bottom: 0.4rem;
}
.feature-card-text {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Showcase Cards (DPI & Batch Processing) */
.showcase-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 1.25rem;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  margin-bottom: 2.5rem;
  display: grid;
  grid-template-columns: 1fr;
}
@media (min-width: 840px) {
  .showcase-card {
    grid-template-columns: 1.1fr 1fr;
  }
  .showcase-card.reverse {
    grid-template-columns: 1fr 1.1fr;
  }
}
.showcase-image-wrap {
  position: relative;
  overflow: hidden;
  background-color: var(--bg-card-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 240px;
}
.showcase-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.showcase-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
@media (min-width: 640px) {
  .showcase-content {
    padding: 2.25rem;
  }
}
.showcase-tag {
  font-size: 0.75rem;
  font-weight: var(--fw-bold);
  color: var(--primary-600);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}
[data-theme="dark"] .showcase-tag {
  color: var(--primary-300);
}
.showcase-title {
  font-size: clamp(1.25rem, 3vw, 1.5rem);
  margin-bottom: 0.65rem;
  line-height: 1.3;
}
.showcase-text {
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 1.125rem;
}
.showcase-bullets {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-bottom: 1.125rem;
}
.showcase-bullet-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-main);
}
.showcase-bullet-item svg {
  color: var(--accent-emerald);
  flex-shrink: 0;
  margin-top: 0.15rem;
}

/* Aspect Ratio Handling Demo Cards */
.aspect-demo-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 1rem;
  margin-bottom: 2.5rem;
}
@media (min-width: 520px) {
  .aspect-demo-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 768px) {
  .aspect-demo-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (min-width: 1024px) {
  .aspect-demo-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}
.aspect-demo-box {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  padding: 1rem;
  text-align: center;
}
.demo-preview-frame {
  aspect-ratio: 16 / 9;
  background-color: #000;
  border-radius: 0.5rem;
  overflow: hidden;
  margin-bottom: 0.75rem;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}
.demo-preview-frame img {
  width: 100%;
  height: 100%;
}
.demo-preview-frame.stretch img {
  object-fit: fill;
}
.demo-preview-frame.crop img {
  object-fit: cover;
}
.demo-preview-frame.white-bars {
  background-color: #fff;
  border: 1px solid var(--border-color);
}
.demo-preview-frame.white-bars img {
  object-fit: contain;
}
.demo-preview-frame.black-bars {
  background-color: #000;
}
.demo-preview-frame.black-bars img {
  object-fit: contain;
}
.demo-preview-frame.blur-bars {
  background-size: cover;
  background-position: center;
}
.demo-preview-frame.blur-bars img {
  object-fit: contain;
  position: relative;
  z-index: 2;
}
.demo-title {
  font-size: 0.875rem;
  font-weight: var(--fw-bold);
  margin-bottom: 0.25rem;
}
.demo-caption {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Social Media Presets Grid */
.social-presets-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}
@media (min-width: 640px) {
  .social-presets-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1024px) {
  .social-presets-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
.social-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  padding: 1.25rem;
}
.social-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.social-header h3 {
  font-size: 1.0625rem;
}
.preset-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.preset-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8125rem;
  padding: 0.25rem 0;
  border-bottom: 1px dashed var(--border-color);
}
.preset-name {
  color: var(--text-muted);
}
.preset-val {
  font-family: var(--font-mono);
  font-weight: var(--fw-semibold);
  color: var(--text-main);
}

/* How to Resize Steps */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}
@media (min-width: 768px) {
  .steps-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
.step-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  padding: 1.5rem;
  position: relative;
}
.step-number {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  font-size: 2.25rem;
  font-weight: var(--fw-extrabold);
  font-family: var(--font-heading);
  color: var(--border-color);
  line-height: 1;
}
.step-title {
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
}
.step-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* FAQ Accordion */
.faq-wrap {
  max-width: 48rem;
  margin: 0 auto 2.5rem;
}
.faq-item {
  border-bottom: 1px solid var(--border-color);
}
.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.125rem 0;
  background: none;
  border: none;
  text-align: left;
  font-size: clamp(0.9375rem, 2.5vw, 1.0625rem);
  font-weight: var(--fw-semibold);
  font-family: var(--font-heading);
  color: var(--text-main);
  cursor: pointer;
  gap: 1rem;
}
.faq-icon {
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
.faq-item.active .faq-icon {
  transform: rotate(180deg);
}
.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease-out;
  color: var(--text-muted);
  font-size: 0.9375rem;
  line-height: 1.6;
}
.faq-item.active .faq-answer {
  max-height: 300px;
  padding-bottom: 1.125rem;
}

/* ==========================================================================
   Security & Privacy Guarantee Banner (Specially Enhanced for Dark Mode)
   ========================================================================== */
.security-banner {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.08), rgba(99, 102, 241, 0.08));
  background-color: var(--bg-card);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 1.25rem;
  padding: 1.5rem;
  margin-bottom: 3.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.06);
}
@media (min-width: 768px) {
  .security-banner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 2.25rem;
  }
}
.security-banner-info {
  max-width: 40rem;
}
.security-banner-title {
  font-size: clamp(1.125rem, 2.5vw, 1.35rem);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: #0f172a;
}
.security-banner-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Explicit Dark Mode Overrides for "Guaranteed 100% Client-Side Security & Privacy" */
[data-theme="dark"] .security-banner {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.12), rgba(99, 102, 241, 0.15));
  background-color: #111827;
  border: 1px solid rgba(52, 211, 153, 0.4);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.6), 0 0 25px rgba(16, 185, 129, 0.12);
}
[data-theme="dark"] .security-banner-title {
  color: #ffffff !important;
  font-weight: var(--fw-bold);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}
[data-theme="dark"] .security-banner-desc {
  color: #e2e8f0 !important;
}
[data-theme="dark"] .security-banner-info svg {
  color: #34d399 !important;
  filter: drop-shadow(0 0 8px rgba(52, 211, 153, 0.4));
}
[data-theme="dark"] .security-banner .security-pill {
  background-color: rgba(16, 185, 129, 0.2);
  color: #6ee7b7;
  border-color: rgba(52, 211, 153, 0.45);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.15);
}

/* Footer */
.site-footer {
  margin-top: auto;
  background-color: var(--bg-card);
  border-top: 1px solid var(--border-color);
  padding: 2.5rem 0 2rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
  margin-bottom: 2rem;
}
@media (min-width: 640px) {
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1024px) {
  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr 1fr;
  }
}
.footer-brand-title {
  font-size: 1.125rem;
  font-weight: var(--fw-bold);
  color: var(--text-main);
  margin-bottom: 0.5rem;
}
.footer-text {
  font-size: 0.8125rem;
  line-height: 1.6;
}
.footer-heading {
  font-size: 0.875rem;
  font-weight: var(--fw-bold);
  color: var(--text-main);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.footer-links button.footer-link-btn {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: color 0.15s;
}
.footer-links button.footer-link-btn:hover {
  color: var(--primary-600);
}
[data-theme="dark"] .footer-links button.footer-link-btn:hover {
  color: var(--primary-300);
}
.footer-bottom {
  border-top: 1px solid var(--border-color);
  padding-top: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.8125rem;
}

/* ==========================================================================
   Modals for Disclaimer, Privacy Policy, About Us, Contact Us
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.modal-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}
.modal-dialog {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 1.25rem;
  width: 100%;
  max-width: 600px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
  transform: scale(0.95);
  transition: transform 0.2s ease;
  overflow: hidden;
}
.modal-backdrop.open .modal-dialog {
  transform: scale(1);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
}
.modal-title {
  font-size: 1.25rem;
  font-weight: var(--fw-bold);
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.modal-close-btn {
  background: none;
  border: none;
  width: 2rem;
  height: 2rem;
  border-radius: 0.375rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
}
.modal-close-btn:hover {
  background-color: var(--bg-card-subtle);
  color: var(--text-main);
}
.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--text-muted);
}
.modal-body p {
  margin-bottom: 1rem;
}
.modal-body strong {
  color: var(--text-main);
}
.modal-body ul {
  margin-bottom: 1rem;
  padding-left: 1.25rem;
}
.modal-body li {
  margin-bottom: 0.35rem;
}

/* Contact Specific UI */
.contact-box {
  background-color: var(--bg-card-subtle);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1rem 0;
}
.contact-email-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  padding: 0.6rem 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.9375rem;
  color: var(--primary-600);
}
[data-theme="dark"] .contact-email-row {
  color: var(--primary-300);
}
.btn-copy-email {
  background: none;
  border: 1px solid var(--border-color);
  border-radius: 0.375rem;
  padding: 0.3rem 0.65rem;
  font-size: 0.75rem;
  font-weight: var(--fw-semibold);
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s;
}
.btn-copy-email:hover {
  background-color: var(--primary-600);
  color: #fff;
  border-color: var(--primary-600);
}

/* Notification Toast */
.toast-notice {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background-color: var(--bg-card);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-xl);
  padding: 0.75rem 1.25rem;
  border-radius: 0.625rem;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 0.875rem;
  font-weight: var(--fw-medium);
  z-index: 100;
  transform: translateY(120%);
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.toast-notice.show {
  transform: translateY(0);
  opacity: 1;
}

/* Print calculation badge helper */
.print-size-calc {
  font-size: 0.75rem;
  color: var(--primary-600);
  background-color: rgba(99, 102, 241, 0.08);
  padding: 0.35rem 0.6rem;
  border-radius: 0.375rem;
  margin-top: 0.35rem;
  display: inline-block;
  font-family: var(--font-mono);
}
[data-theme="dark"] .print-size-calc {
  color: var(--primary-300);
}

/* SEO content pages */
.content-page { padding: 3rem 0 5rem; }
.content-shell { max-width: 1020px; margin: 0 auto; }
.breadcrumbs { font-size: .82rem; color: var(--text-muted); margin-bottom: 1.25rem; }
.breadcrumbs a { color: var(--primary-600); font-weight: 600; }
.article-header { max-width: 780px; margin-bottom: 2rem; }
.article-kicker { color: var(--primary-600); font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; }
.article-title { font-size: clamp(2rem, 5vw, 3.65rem); line-height: 1.08; margin: .55rem 0 1rem; }
.article-meta { color: var(--text-muted); font-size: .9rem; }
.featured-visual { display: block; width: 100%; max-height: 500px; object-fit: cover; border-radius: 1.25rem; border: 1px solid var(--border-color); box-shadow: var(--shadow-lg); margin: 0 0 2.5rem; }
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 2.5rem; align-items: start; }
.article-body { max-width: 720px; font-size: 1.05rem; line-height: 1.78; }
.article-body .lede { font-size: 1.2rem; color: var(--text-muted); line-height: 1.65; margin-bottom: 2rem; }
.article-body h2 { font-size: 1.55rem; margin: 2.3rem 0 .65rem; }
.article-body p { margin-bottom: 1rem; }
.article-body code { background: var(--bg-card-subtle); border: 1px solid var(--border-color); border-radius: .25rem; padding: .1rem .3rem; font-size: .9em; }
.article-aside { position: sticky; top: 6rem; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 1rem; padding: 1.2rem; box-shadow: var(--shadow-sm); }
.article-aside h3 { font-size: .9rem; margin-bottom: .7rem; }
.article-aside a { display: block; padding: .45rem 0; color: var(--text-muted); font-size: .88rem; }
.article-aside a:hover { color: var(--primary-600); }
.faq-section { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border-color); }
.faq-section h2 { margin-top: 0; }
.related-section { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--border-color); }
.related-grid, .article-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.article-card { background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 1rem; overflow: hidden; box-shadow: var(--shadow-sm); transition: transform .18s ease, box-shadow .18s ease; }
.article-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.article-card img { width: 100%; aspect-ratio: 1.9; object-fit: cover; display: block; }
.article-card-content { padding: 1rem; }
.article-card h3 { font-size: 1rem; line-height: 1.3; margin-bottom: .45rem; }
.article-card p { color: var(--text-muted); font-size: .86rem; line-height: 1.55; }
.article-card .read-more { display: inline-block; margin-top: .7rem; font-weight: 700; font-size: .85rem; }
.blog-hero { padding: 3rem 0 2rem; background: radial-gradient(circle at 80% 0%, rgba(99,102,241,.12), transparent 60%); }
.blog-hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); margin-bottom: .7rem; }
.blog-hero p { max-width: 680px; color: var(--text-muted); line-height: 1.6; }
.legal-page { max-width: 780px; }
.legal-page h1 { font-size: clamp(2rem, 5vw, 3rem); margin-bottom: .75rem; }
.legal-page h2 { font-size: 1.35rem; margin: 2rem 0 .6rem; }
.legal-page p, .legal-page li { color: var(--text-muted); line-height: 1.75; margin-bottom: .75rem; }
.legal-page ul { padding-left: 1.25rem; }
@media (max-width: 800px) { .article-layout { grid-template-columns: 1fr; } .article-aside { position: static; order: -1; } .related-grid, .article-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .content-page { padding-top: 2rem; } .related-grid, .article-grid { grid-template-columns: 1fr; } .article-body { font-size: 1rem; } .featured-visual { border-radius: .85rem; } }

.content-page{padding:3rem 0 5rem}.content-shell{max-width:1020px;margin:auto}.breadcrumbs{font-size:.82rem;color:var(--text-muted);margin-bottom:1.25rem}.breadcrumbs a{font-weight:600}.article-header{max-width:780px;margin-bottom:2rem}.article-kicker{color:var(--primary-600);font-size:.8rem;font-weight:700;text-transform:uppercase;letter-spacing:.09em}.article-title{font-size:clamp(2rem,5vw,3.65rem);line-height:1.08;margin:.55rem 0 1rem}.article-meta{color:var(--text-muted);font-size:.9rem}.featured-visual{display:block;width:100%;border-radius:1.25rem;border:1px solid var(--border-color);box-shadow:var(--shadow-lg);margin-bottom:2.5rem}.article-layout{display:grid;grid-template-columns:minmax(0,1fr) 260px;gap:2.5rem}.article-body{max-width:720px;font-size:1.05rem;line-height:1.78}.article-body .lede{font-size:1.2rem;color:var(--text-muted);line-height:1.65;margin-bottom:2rem}.article-body h2{font-size:1.55rem;margin:2.3rem 0 .65rem}.article-body p{margin-bottom:1rem}.article-body code{background:var(--bg-card-subtle);border:1px solid var(--border-color);border-radius:.25rem;padding:.1rem .3rem}.article-aside{position:sticky;top:6rem;background:var(--bg-card);border:1px solid var(--border-color);border-radius:1rem;padding:1.2rem;box-shadow:var(--shadow-sm)}.article-aside h3{font-size:.9rem;margin-bottom:.7rem}.article-aside a{display:block;padding:.45rem 0;color:var(--text-muted);font-size:.88rem}.faq-section,.related-section{margin-top:2.5rem;padding-top:1.5rem;border-top:1px solid var(--border-color)}.faq-section h2{margin-top:0}.related-grid,.article-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1rem}.article-card{background:var(--bg-card);border:1px solid var(--border-color);border-radius:1rem;overflow:hidden;box-shadow:var(--shadow-sm);transition:.18s}.article-card:hover{transform:translateY(-3px);box-shadow:var(--shadow-md)}.article-card img{width:100%;aspect-ratio:1.9;object-fit:cover;display:block}.article-card-content{padding:1rem}.article-card h3{font-size:1rem;line-height:1.3;margin-bottom:.45rem}.article-card p{color:var(--text-muted);font-size:.86rem;line-height:1.55}.read-more{display:inline-block;margin-top:.7rem;font-weight:700;font-size:.85rem}.blog-hero{padding:3rem 0 2rem;background:radial-gradient(circle at 80% 0%,rgba(99,102,241,.12),transparent 60%)}.blog-hero h1{font-size:clamp(2rem,5vw,3.2rem);margin-bottom:.7rem}.blog-hero p{max-width:680px;color:var(--text-muted);line-height:1.6}.legal-page{max-width:780px}.legal-page h1{font-size:clamp(2rem,5vw,3rem);margin-bottom:.75rem}.legal-page h2{font-size:1.35rem;margin:2rem 0 .6rem}.legal-page p,.legal-page li{color:var(--text-muted);line-height:1.75;margin-bottom:.75rem}.legal-page ul{padding-left:1.25rem}@media(max-width:800px){.article-layout{grid-template-columns:1fr}.article-aside{position:static;order:-1}.related-grid,.article-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:520px){.related-grid,.article-grid{grid-template-columns:1fr}.article-body{font-size:1rem}}

/* Article thumbnails use a consistent 16:9 presentation across the homepage and Blog. */
.article-card img { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; display: block; }

/* Final article-card layout: wide 16:9 thumbnails and consistent navigation-safe grids. */
.article-grid, .related-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  align-items: stretch;
}
.article-card { min-width: 0; height: 100%; }
.article-card > a { display: flex; flex-direction: column; height: 100%; }
.article-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  min-height: 0;
  object-fit: cover;
  display: block;
  flex: 0 0 auto;
}
.article-card-content { flex: 1 1 auto; }
@media (max-width: 900px) {
  .article-grid, .related-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .article-grid, .related-grid { grid-template-columns: 1fr; gap: 1rem; }
}
