/**
 * SMARTDOCIFY - ALL-IN-ONE PDF CONVERTER & MERGER STYLESHEET
 * Token-driven responsive design system with full Light & Dark theme parity.
 */

:root {
  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Foundation Tokens - Light Theme */
  --bg-base: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-alt: #f1f5f9;
  --bg-card: #ffffff;
  --bg-input: #ffffff;

  --border-subtle: #e2e8f0;
  --border-medium: #cbd5e1;
  --border-hover: #94a3b8;
  --border-color: #e2e8f0;

  --text-main: #0f172a;
  --text-muted: #475569;
  --text-light: #94a3b8;

  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: rgba(37, 99, 235, 0.08);
  --primary-glow: rgba(37, 99, 235, 0.25);

  --secondary: #7c3aed;
  --secondary-hover: #6d28d9;
  --secondary-light: rgba(124, 58, 237, 0.08);

  --success: #10b981;
  --success-hover: #059669;
  --success-light: rgba(16, 185, 129, 0.1);

  --warning: #f59e0b;
  --warning-light: rgba(245, 158, 11, 0.12);

  --danger: #ef4444;
  --danger-hover: #dc2626;
  --danger-light: rgba(239, 68, 68, 0.1);

  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.06), 0 1px 2px 0 rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
}

[data-theme="dark"] {
  --bg-base: #0f172a;
  --bg-surface: #1e293b;
  --bg-surface-alt: #172338;
  --bg-card: #1e293b;
  --bg-input: #0f172a;

  --border-subtle: #2d3b55;
  --border-medium: #3b4c6b;
  --border-hover: #506690;
  --border-color: #2d3b55;

  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-light: #64748b;

  --primary: #3b82f6;
  --primary-hover: #60a5fa;
  --primary-light: rgba(59, 130, 246, 0.15);
  --primary-glow: rgba(59, 130, 246, 0.35);

  --secondary: #8b5cf6;
  --secondary-hover: #a78bfa;
  --secondary-light: rgba(139, 92, 246, 0.15);

  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.35);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 10px 20px -3px rgba(0, 0, 0, 0.55);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.6);
}

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

html {
  font-family: var(--font-family);
  background-color: var(--bg-base);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-base);
  color: var(--text-main);
  overflow-x: hidden;
}

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

/* ==========================================================================
   HEADER & NAVIGATION
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  backdrop-filter: blur(8px);
  transition: background-color var(--transition-normal);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.logo-icon-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
}

.logo-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.logo-text {
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.desktop-nav {
  display: flex;
  align-items: center;
}

.nav-list {
  display: flex;
  list-style: none;
  gap: 1.5rem;
}

.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color var(--transition-fast);
}

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

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

.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-alt);
  color: var(--text-main);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.action-btn:hover {
  background: var(--border-subtle);
}

.action-btn svg {
  width: 1.15rem;
  height: 1.15rem;
}

.icon-sun { display: none; }
.icon-moon { display: block; }
[data-theme="dark"] .icon-sun { display: block; }
[data-theme="dark"] .icon-moon { display: none; }

.menu-toggle { display: none; }

@media (max-width: 768px) {
  .desktop-nav { display: none; }
  .menu-toggle { display: inline-flex; }
}

/* Mobile Nav Drawer */
.mobile-nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.mobile-nav-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.mobile-nav-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 280px;
  background: var(--bg-surface);
  z-index: 201;
  transform: translateX(100%);
  transition: transform var(--transition-normal);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
}

.mobile-nav-drawer.open {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.drawer-nav-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.drawer-nav-list .nav-link {
  font-size: 1.05rem;
  display: block;
  padding: 0.5rem 0;
}

/* ==========================================================================
   BREADCRUMBS
   ========================================================================== */
.breadcrumbs-bar {
  padding: 0.85rem 0;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  font-size: 0.875rem;
}

.breadcrumbs-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
}

.breadcrumb-item a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.breadcrumb-item a:hover {
  color: var(--primary);
}

.breadcrumb-separator {
  color: var(--text-light);
  user-select: none;
}

.breadcrumb-current {
  color: var(--text-main);
  font-weight: 600;
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */
.hero-section {
  padding: 2.5rem 0 1.5rem;
  text-align: center;
}

.hero-badge-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.825rem;
  font-weight: 600;
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid rgba(37, 99, 235, 0.15);
}

.hero-title {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-main);
  margin-bottom: 0.75rem;
  line-height: 1.2;
}

@media (min-width: 768px) {
  .hero-title {
    font-size: 2.75rem;
  }
}

.hero-subtitle {
  max-width: 680px;
  margin: 0 auto;
  font-size: 1.05rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Supported Formats Pills */
.formats-strip {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1.5rem auto 0;
  max-width: 820px;
}

.format-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  box-shadow: var(--shadow-sm);
}

.format-pill.active {
  background: var(--primary-light);
  border-color: rgba(37, 99, 235, 0.25);
  color: var(--primary);
}

.format-pill.info-pill {
  background: var(--warning-light);
  border-color: rgba(245, 158, 11, 0.25);
  color: #b45309;
  cursor: pointer;
}

[data-theme="dark"] .format-pill.info-pill {
  color: #fbbf24;
}

/* ==========================================================================
   TOOL WORKSPACE
   ========================================================================== */
.tool-section {
  padding: 1.5rem 0 3rem;
}

.workspace-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  padding: 1.75rem;
  transition: all var(--transition-normal);
}

@media (max-width: 640px) {
  .workspace-card {
    padding: 1.25rem;
    border-radius: var(--radius-lg);
  }
}

/* Upload Dropzone */
.dropzone {
  border: 2px dashed var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 3rem 1.5rem;
  text-align: center;
  background: var(--bg-surface-alt);
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
}

.dropzone:hover, .dropzone.drag-active {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 4px var(--primary-glow);
}

.dropzone-icon-wrap {
  width: 4rem;
  height: 4rem;
  margin: 0 auto 1.25rem;
  border-radius: var(--radius-full);
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform var(--transition-fast);
}

.dropzone:hover .dropzone-icon-wrap {
  transform: scale(1.08);
}

.dropzone-icon-wrap svg {
  width: 2rem;
  height: 2rem;
}

.dropzone-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.dropzone-desc {
  font-size: 0.925rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

.btn-browse {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-md);
  background: var(--primary);
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.25);
  transition: all var(--transition-fast);
}

.btn-browse:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.dropzone-meta {
  margin-top: 1.25rem;
  font-size: 0.8rem;
  color: var(--text-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.dropzone-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

/* Workspace Layout (Active State) */
.workspace-active {
  display: none;
}

.workspace-active.visible {
  display: block;
}

.workspace-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding-bottom: 1.25rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.stats-badges {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-full);
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-subtle);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

.header-action-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

/* Mode Switcher Tabs */
.mode-switcher {
  display: flex;
  align-items: center;
  background: var(--bg-surface-alt);
  padding: 0.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  margin-bottom: 1.5rem;
  width: 100%;
}

.mode-tab {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
}

.mode-tab.active {
  background: var(--bg-surface);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.mode-tab svg {
  width: 1.15rem;
  height: 1.15rem;
}

/* Reorder / Drag Notice */
.reorder-hint {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  background: var(--bg-surface-alt);
  padding: 0.65rem 1rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
  border: 1px solid var(--border-subtle);
}

.reorder-hint svg {
  width: 1.15rem;
  height: 1.15rem;
  color: var(--primary);
  flex-shrink: 0;
}

/* File Cards List */
.file-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
}

.file-card {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.9rem 1.15rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-fast);
  position: relative;
  user-select: none;
}

.file-card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
}

.file-card.dragging {
  opacity: 0.45;
  border-color: var(--primary);
  transform: scale(0.99);
}

.file-card.drag-over {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 2px var(--primary-glow);
}

.card-drag-handle {
  color: var(--text-light);
  cursor: grab;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast);
}

.card-drag-handle:active {
  cursor: grabbing;
}

.card-drag-handle:hover {
  color: var(--text-main);
}

.card-drag-handle svg {
  width: 1.25rem;
  height: 1.25rem;
}

.card-index {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  width: 1.5rem;
  text-align: center;
  flex-shrink: 0;
}

.card-thumb {
  width: 3.25rem;
  height: 3.25rem;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  position: relative;
}

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

.card-thumb canvas {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.card-thumb svg {
  width: 1.6rem;
  height: 1.6rem;
  color: var(--primary);
}

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

.card-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.2rem;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.card-tag {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
}

.card-status {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.status-ready { color: var(--text-muted); }
.status-converting { color: var(--primary); }
.status-done { color: var(--success); }
.status-error { color: var(--danger); }

/* Card Actions */
.card-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.btn-card-action {
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--bg-surface-alt);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-card-action:hover:not(:disabled) {
  background: var(--border-subtle);
  color: var(--text-main);
}

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

.btn-card-action.btn-card-delete:hover {
  background: var(--danger-light);
  border-color: rgba(239, 68, 68, 0.2);
  color: var(--danger);
}

.btn-card-download {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  background: var(--success);
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-card-download:hover {
  background: var(--success-hover);
}

@media (max-width: 640px) {
  .file-card {
    padding: 0.75rem 0.85rem;
    gap: 0.65rem;
  }
  .card-thumb {
    width: 2.75rem;
    height: 2.75rem;
  }
  .card-actions {
    gap: 0.25rem;
  }
}

/* ==========================================================================
   SETTINGS ACCORDION PANEL
   ========================================================================== */
.settings-panel {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--bg-surface-alt);
  margin-bottom: 1.75rem;
  overflow: hidden;
}

.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  cursor: pointer;
  background: transparent;
  border: none;
  width: 100%;
  font-family: inherit;
  text-align: left;
}

.settings-title-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.975rem;
  font-weight: 700;
  color: var(--text-main);
}

.settings-title-group svg {
  width: 1.2rem;
  height: 1.2rem;
  color: var(--primary);
}

.settings-toggle-icon {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--text-muted);
  transition: transform var(--transition-normal);
}

.settings-panel.open .settings-toggle-icon {
  transform: rotate(180deg);
}

.settings-body {
  display: none;
  padding: 1.25rem;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-card);
}

.settings-panel.open .settings-body {
  display: block;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
}

.setting-item {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.setting-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.setting-hint {
  font-size: 0.75rem;
  color: var(--text-light);
  font-weight: normal;
}

.setting-select {
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: all var(--transition-fast);
}

.setting-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* ==========================================================================
   CONVERSION TRIGGER & PROGRESS BAR
   ========================================================================== */
.convert-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}

.filename-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 260px;
}

.filename-input-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.filename-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.925rem;
  outline: none;
  transition: all var(--transition-fast);
}

.filename-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.btn-primary-convert {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 0.85rem 2rem;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #ffffff;
  font-size: 1.05rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
  transition: all var(--transition-fast);
}

.btn-primary-convert:hover:not(:disabled) {
  opacity: 0.95;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.45);
}

.btn-primary-convert:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-primary-convert svg {
  width: 1.35rem;
  height: 1.35rem;
}

/* Progress Block */
.progress-container {
  display: none;
  margin-top: 1.5rem;
  padding: 1.25rem;
  background: var(--bg-surface-alt);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.progress-container.visible {
  display: block;
}

.progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.progress-track {
  width: 100%;
  height: 8px;
  background: var(--border-subtle);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-bar-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: var(--radius-full);
  transition: width 0.25s ease;
}

.progress-stage-text {
  margin-top: 0.5rem;
  font-size: 0.825rem;
  color: var(--text-muted);
}

/* ==========================================================================
   SUCCESS CARD (MERGE & DOWNLOAD)
   ========================================================================== */
.success-card {
  display: none;
  margin-top: 2rem;
  padding: 2rem;
  background: var(--bg-surface);
  border: 2px solid var(--success);
  border-radius: var(--radius-xl);
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.success-card.visible {
  display: block;
}

.success-icon-wrap {
  width: 4rem;
  height: 4rem;
  margin: 0 auto 1rem;
  border-radius: var(--radius-full);
  background: var(--success-light);
  color: var(--success);
  display: flex;
  align-items: center;
  justify-content: center;
}

.success-icon-wrap svg {
  width: 2.25rem;
  height: 2.25rem;
}

.success-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.success-meta-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.success-actions-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn-success-download {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 2rem;
  border-radius: var(--radius-md);
  background: var(--success);
  color: #ffffff;
  font-size: 1.05rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
  transition: all var(--transition-fast);
}

.btn-success-download:hover {
  background: var(--success-hover);
  transform: translateY(-1px);
}

.btn-secondary-action {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.5rem;
  border-radius: var(--radius-md);
  background: var(--bg-surface-alt);
  color: var(--text-main);
  font-size: 0.95rem;
  font-weight: 600;
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-secondary-action:hover {
  background: var(--border-subtle);
}

/* Separate Mode Download Strip */
.separate-results-strip {
  display: none;
  margin-top: 1.5rem;
  padding: 1.5rem;
  background: var(--bg-surface-alt);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
}

.separate-results-strip.visible {
  display: block;
}

.separate-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn-zip-download {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  background: var(--primary);
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-zip-download:hover {
  background: var(--primary-hover);
}

/* ==========================================================================
   MODAL / PREVIEW DIALOG
   ========================================================================== */
.preview-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  z-index: 300;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.preview-modal-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.preview-modal-box {
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border-subtle);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 80%;
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 340px;
  background: var(--bg-surface-alt);
}

.preview-canvas-wrap {
  box-shadow: var(--shadow-lg);
  border-radius: 4px;
  background: #ffffff;
  max-width: 100%;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-canvas-wrap img {
  max-width: 100%;
  max-height: 65vh;
  object-fit: contain;
  display: block;
}

.preview-canvas-wrap canvas {
  max-width: 100%;
  height: auto;
  display: block;
}

.preview-text-content {
  background: var(--bg-card);
  padding: 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  width: 100%;
  max-height: 55vh;
  overflow: auto;
  font-family: monospace;
  font-size: 0.85rem;
  white-space: pre-wrap;
  line-height: 1.5;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}

.modal-page-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Office Notice Modal / Alert */
.alert-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
  line-height: 1.5;
}

.alert-warning {
  background: var(--warning-light);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #92400e;
}

[data-theme="dark"] .alert-warning {
  color: #fcd34d;
}

.alert-warning svg {
  width: 1.35rem;
  height: 1.35rem;
  color: #f59e0b;
  flex-shrink: 0;
  margin-top: 0.15rem;
}

/* ==========================================================================
   SUPPORTING SEO & CONTENT SECTIONS
   ========================================================================== */
.seo-section {
  padding: 3rem 0;
  border-top: 1px solid var(--border-subtle);
}

.section-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.75rem;
  text-align: center;
}

.section-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  text-align: center;
  max-width: 720px;
  margin: 0 auto 2.5rem;
}

/* How-to Steps Grid */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

.step-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  position: relative;
  transition: all var(--transition-fast);
}

.step-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-hover);
}

.step-number {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: var(--radius-full);
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.step-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.5rem;
}

.step-desc {
  font-size: 0.925rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* Article / Editorial Content */
.editorial-article {
  max-width: 860px;
  margin: 0 auto 3rem;
  line-height: 1.75;
  color: var(--text-main);
}

.editorial-article h2 {
  font-size: 1.45rem;
  font-weight: 800;
  margin: 2rem 0 0.75rem;
  color: var(--text-main);
}

.editorial-article h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 1.5rem 0 0.5rem;
  color: var(--text-main);
}

.editorial-article p {
  margin-bottom: 1.25rem;
  color: var(--text-muted);
  font-size: 1rem;
}

.editorial-article ul, .editorial-article ol {
  margin: 0 0 1.25rem 1.5rem;
  color: var(--text-muted);
}

.editorial-article li {
  margin-bottom: 0.5rem;
}

/* FAQ Accordion */
.faq-accordion {
  max-width: 860px;
  margin: 0 auto 3rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.faq-item {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  overflow: hidden;
  transition: all var(--transition-fast);
}

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem;
  background: transparent;
  border: none;
  width: 100%;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  text-align: left;
}

.faq-question svg {
  width: 1.25rem;
  height: 1.25rem;
  color: var(--text-muted);
  transition: transform var(--transition-normal);
  flex-shrink: 0;
}

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

.faq-answer {
  display: none;
  padding: 0 1.25rem 1.25rem;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
}

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

/* Related Tools Grid */
.related-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  max-width: 1100px;
  margin: 0 auto;
}

.related-tool-card {
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  text-decoration: none;
  transition: all var(--transition-fast);
}

.related-tool-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.related-tool-icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--radius-md);
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.related-tool-icon svg {
  width: 1.5rem;
  height: 1.5rem;
}

.related-tool-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.related-tool-desc {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1rem;
  flex: 1;
}

.related-tool-link {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

/* ==========================================================================
   SITE FOOTER
   ========================================================================== */
.site-footer {
  margin-top: auto;
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  padding: 3rem 0 1.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(4, 1fr);
  gap: 2rem;
  margin-bottom: 2.5rem;
}

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

@media (max-width: 576px) {
  .footer-grid {
    grid-template-columns: 1fr;
  }
}

.footer-heading {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 1rem;
  letter-spacing: -0.01em;
}

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

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color var(--transition-fast);
}

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

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.85rem;
  color: var(--text-muted);
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-bottom-links {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.footer-bottom-links a {
  color: var(--text-muted);
  text-decoration: none;
}

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