/* ============================================================================
   allconvertpdf.com (PDF Convert) — Final Production Design System
   Brand Palette: Deep Navy (#04102E) & Electric Royal Blue (#0057FF)
   iLovePDF 3-Stage Workflow × Pro Minimalist UI × High-Structure SEO Silos
   ============================================================================ */

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

:root {
  /* Official PDF Convert Brand Colors (Extracted from Logo) */
  --brand-navy: #04102E;
  --brand-blue: #0057FF;
  --brand-blue-hover: #0045CC;
  --brand-blue-soft: rgba(0, 87, 255, 0.08);
  --brand-blue-glow: rgba(0, 87, 255, 0.28);

  /* Semantic Tool Category Accents */
  --c-organize: #0057FF;    /* Electric Blue (Merge, Split, Remove, Extract, Organize) */
  --c-optimize: #10B981;    /* Emerald Green (Compress, Repair, OCR) */
  --c-word: #2563EB;        /* Word Blue */
  --c-ppt: #F97316;         /* PowerPoint Orange */
  --c-excel: #16A34A;       /* Excel Green */
  --c-jpg: #EAB308;         /* JPG Gold */
  --c-edit: #7C3AED;        /* Edit Purple (Rotate, Page Numbers, Watermark, Edit) */
  --c-security: #04102E;    /* Deep Navy (Sign, Unlock, Protect) */

  /* Pro Minimalist Light Surfaces */
  --bg-body: #F8FAFC;
  --bg-canvas: #F1F5F9;
  --bg-surface: #FFFFFF;
  --bg-subtle: #F1F5F9;
  --bg-hover: #F8FAFC;

  --text-primary: #04102E;
  --text-secondary: #475569;
  --text-muted: #64748B;

  --border-hairline: #E2E8F0;
  --border-strong: #CBD5E1;

  --radius-xs: 8px;
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-xl: 26px;

  --shadow-xs: 0 1px 2px rgba(4, 16, 46, 0.04);
  --shadow-sm: 0 4px 14px rgba(4, 16, 46, 0.05), 0 1px 2px rgba(4, 16, 46, 0.03);
  --shadow-md: 0 14px 30px -6px rgba(0, 87, 255, 0.10), 0 4px 10px rgba(4, 16, 46, 0.04);
  --shadow-lg: 0 24px 50px -12px rgba(4, 16, 46, 0.16);

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Plus Jakarta Sans', 'Inter', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --font-ar: 'Cairo', sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

body.dark-mode {
  --brand-navy: #F8FAFC;
  --bg-body: #060B19;
  --bg-canvas: #040812;
  --bg-surface: #0D1528;
  --bg-subtle: #162038;
  --bg-hover: #1B2744;

  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;

  --border-hairline: #1E293B;
  --border-strong: #334155;

  --shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 14px 32px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 28px 60px rgba(0, 0, 0, 0.7);
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font-sans);
  background-color: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.55;
  overflow-x: hidden;
  transition: background-color 0.2s ease, color 0.2s ease;
}
html[dir="rtl"] body { font-family: var(--font-ar), var(--font-sans); }
a { text-decoration: none; color: inherit; }
button, input, select, textarea { font-family: inherit; }
ul { list-style: none; }

.container {
  max-width: 1340px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ============================================================================
   1. ULTRA-MINIMALIST "PDF Convert" (allconvertpdf.com) HEADER & MEGA MENU
   ============================================================================ */
.ilove-navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  height: 60px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-hairline);
  display: flex;
  align-items: center;
}
body.dark-mode .ilove-navbar {
  background: rgba(11, 18, 33, 0.9);
}
.ilove-nav-inner {
  width: 100%;
  max-width: 1380px;
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.ilove-left {
  display: flex;
  align-items: center;
  gap: 36px;
  height: 100%;
}

/* Pure Minimalist Typographic Brand Wordmark (No Icon in Header) */
.brand-logo-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  user-select: none;
}
.brand-wordmark {
  font-family: var(--font-display);
  font-size: 1.32rem;
  font-weight: 800;
  letter-spacing: -0.035em;
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  line-height: 1;
}
.brand-wordmark .w-pdf {
  color: var(--text-primary);
}
.brand-wordmark .w-convert {
  color: var(--brand-blue);
}

.ilove-nav-links {
  display: flex;
  align-items: center;
  height: 100%;
  gap: 2px;
}
.ilove-nav-item {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
}
.ilove-nav-link {
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: var(--text-secondary);
  transition: color 0.15s ease, background 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}
.ilove-nav-link:hover, .ilove-nav-link.active {
  color: var(--text-primary);
  background: var(--bg-subtle);
}

/* Mega Menu Dropdown (All 25 Tools in 6 Minimalist Columns) */
.mega-dropdown {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  width: calc(100% - 48px);
  max-width: 1220px;
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 26px 30px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s var(--ease), visibility 0.16s;
  z-index: 1100;
}
.ilove-nav-item:hover .mega-dropdown,
.mega-dropdown:hover {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.mega-grid-6 {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 22px;
}
.mega-col-title {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-hairline);
}
.mega-tool-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 0.81rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: background 0.14s ease, color 0.14s ease;
}
.mega-tool-link:hover {
  background: var(--bg-subtle);
  color: var(--brand-blue);
}
.mega-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.mega-tool-ico {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: #FFFFFF;
  flex-shrink: 0;
}

.ilove-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cmd-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 11px;
  border-radius: 6px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-hairline);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.cmd-pill:hover { border-color: var(--border-strong); color: var(--text-primary); }
.cmd-pill kbd {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--text-muted);
}

.nav-util-btn {
  height: 34px;
  padding: 0 11px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid var(--border-hairline);
  color: var(--text-secondary);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.nav-util-btn:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
  background: var(--bg-subtle);
}

/* ============================================================================
   2. HERO & 22-TOOL MINIMALIST GRID
   ============================================================================ */
.ilove-hero {
  padding: 54px 0 28px;
  text-align: center;
}
.hero-domain-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px;
  border-radius: 50px;
  background: var(--brand-blue-soft);
  color: var(--brand-blue);
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 16px;
  border: 1px solid rgba(0, 87, 255, 0.18);
}
.ilove-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.2vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  color: var(--text-primary);
  max-width: 860px;
  margin: 0 auto 14px;
  line-height: 1.12;
}
.ilove-hero h1 span.blue {
  color: var(--brand-blue);
}
.ilove-hero p {
  font-size: 1.06rem;
  color: var(--text-secondary);
  max-width: 720px;
  margin: 0 auto 28px;
}

/* Filter Bar */
.ilove-filter-bar {
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}
.ilove-filter-btn {
  padding: 9px 18px;
  border-radius: 50px;
  border: 1px solid var(--border-hairline);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 0.83rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
}
.ilove-filter-btn:hover {
  border-color: var(--brand-blue);
  color: var(--brand-blue);
}
.ilove-filter-btn.active {
  background: var(--brand-blue);
  color: #FFFFFF;
  border-color: var(--brand-blue);
  box-shadow: 0 6px 16px var(--brand-blue-glow);
}

/* 22-Tool Grid */
.ilove-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(245px, 1fr));
  gap: 14px;
  padding-bottom: 56px;
}

.ilove-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 24px 22px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  position: relative;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), border-color 0.2s ease;
  cursor: pointer;
}
.ilove-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--card-accent, var(--brand-blue));
}

.ilove-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.ilove-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--card-accent, var(--brand-blue));
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  font-weight: 800;
  box-shadow: 0 6px 14px -3px var(--card-glow, rgba(0, 87, 255, 0.35));
  transition: transform 0.2s var(--ease);
}
.ilove-card:hover .ilove-icon {
  transform: scale(1.07);
}

.ilove-pill-badge {
  font-size: 0.65rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 5px;
  background: var(--bg-subtle);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.ilove-pill-badge.new {
  background: var(--brand-blue-soft);
  color: var(--brand-blue);
}

.ilove-card h3 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
  letter-spacing: -0.015em;
}
.ilove-card p {
  font-size: 0.81rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ============================================================================
   3. HIGH-STRUCTURE SEO SILOS & KEYWORD GAP HUB
   ============================================================================ */
.seo-silo-section {
  padding: 64px 0;
  border-top: 1px solid var(--border-hairline);
  background: var(--bg-surface);
}
.silo-grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}
.silo-box {
  background: var(--bg-body);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 22px;
}
.silo-box h3 {
  font-size: 0.96rem;
  font-weight: 800;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
}
.gap-links-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.gap-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 11px;
  border-radius: var(--radius-xs);
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  font-size: 0.81rem;
  font-weight: 600;
  color: var(--text-secondary);
  transition: all 0.15s ease;
}
.gap-link:hover {
  border-color: var(--brand-blue);
  color: var(--brand-blue);
  transform: translateX(3px);
}
.gap-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  color: #10B981;
  background: rgba(16, 185, 129, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
}

/* ============================================================================
   4. WORKSPACE STUDIO (3-STAGE ILOVEPDF FLOW)
   ============================================================================ */
.workspace-shell {
  min-height: calc(100vh - 66px);
  display: flex;
  flex-direction: column;
  background: var(--bg-canvas);
}

.stage-upload {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px 64px;
  text-align: center;
}
.stage-upload.dragover {
  background: var(--brand-blue-soft);
}
.stage-upload h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.8vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 10px;
}
.stage-upload .stage-sub {
  font-size: 1.08rem;
  color: var(--text-secondary);
  max-width: 650px;
  margin: 0 auto 32px;
}

.select-cta-wrap {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.btn-select-huge {
  min-width: 320px;
  height: 74px;
  padding: 0 42px;
  border-radius: 16px;
  background: var(--active-tool-color, var(--brand-blue));
  color: #FFFFFF;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 800;
  border: none;
  cursor: pointer;
  box-shadow: 0 14px 30px -6px rgba(0, 87, 255, 0.4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  transition: transform 0.18s var(--ease), filter 0.18s ease;
}
.btn-select-huge:hover {
  transform: translateY(-2px) scale(1.01);
  filter: brightness(1.06);
}
.source-side-btns { display: flex; flex-direction: column; gap: 8px; }
.source-mini-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--active-tool-color, var(--brand-blue));
  color: #FFFFFF;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

/* Stage 2 Workbench */
.stage-workbench {
  display: none;
  flex: 1;
  grid-template-columns: 1fr 350px;
  min-height: calc(100vh - 66px);
}
.stage-workbench.active { display: grid; }
.wb-canvas-area { padding: 28px 36px 100px; overflow-y: auto; }
.wb-top-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding: 10px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  flex-wrap: wrap;
  gap: 12px;
}
.fab-add-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 50px;
  background: var(--active-tool-color, var(--brand-blue));
  color: #FFFFFF;
  font-size: 0.82rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
}
.fab-badge {
  background: #04102E;
  color: #FFFFFF;
  font-size: 0.7rem;
  font-weight: 800;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.wb-thumbnails-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 20px;
}
.pdf-page-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  padding: 14px 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  box-shadow: var(--shadow-xs);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.pdf-page-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--active-tool-color, var(--brand-blue));
}
.pdf-page-card.deleted { opacity: 0.28; filter: grayscale(1); border-style: dashed; }
.page-card-actions {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 5px;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 5;
}
.pdf-page-card:hover .page-card-actions { opacity: 1; }
.page-act-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--border-hairline);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 0.78rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.page-act-btn:hover { background: var(--brand-blue); color: #FFFFFF; border-color: var(--brand-blue); }

.page-canvas-wrap {
  width: 100%;
  height: 195px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-subtle);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 10px;
  border: 1px solid var(--border-hairline);
}
.page-canvas-wrap canvas, .page-canvas-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.25s var(--ease);
}
.page-card-label { font-size: 0.76rem; font-weight: 600; color: var(--text-secondary); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page-num-pill { margin-top: 3px; font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-muted); }

/* Right Inspector */
.wb-inspector {
  background: var(--bg-surface);
  border-left: 1px solid var(--border-hairline);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: calc(100vh - 66px);
  position: sticky;
  top: 66px;
}
.inspector-header { padding: 22px 24px 18px; border-bottom: 1px solid var(--border-hairline); text-align: center; }
.inspector-header h2 { font-family: var(--font-display); font-size: 1.22rem; font-weight: 800; }
.inspector-body { padding: 20px 22px; overflow-y: auto; flex: 1; }

.ilove-opt-card {
  border: 1.5px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 10px;
  cursor: pointer;
  background: var(--bg-surface);
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.ilove-opt-card.selected {
  border-color: var(--active-tool-color, var(--brand-blue));
  background: var(--brand-blue-soft);
}
.opt-radio {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  margin-top: 2px;
  flex-shrink: 0;
}
.ilove-opt-card.selected .opt-radio {
  border-color: var(--active-tool-color, var(--brand-blue));
  background: var(--active-tool-color, var(--brand-blue));
  box-shadow: 0 0 0 3px var(--bg-surface) inset;
}
.opt-title { font-size: 0.88rem; font-weight: 700; margin-bottom: 2px; }
.opt-desc { font-size: 0.76rem; color: var(--text-muted); }

.inspector-footer { padding: 18px 22px; border-top: 1px solid var(--border-hairline); }
.btn-action-execute {
  width: 100%;
  height: 58px;
  border-radius: 12px;
  background: var(--active-tool-color, var(--brand-blue));
  color: #FFFFFF;
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 800;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 10px 24px -6px rgba(0, 87, 255, 0.42);
}

/* Stage 3 Result */
.stage-result { display: none; flex: 1; flex-direction: column; align-items: center; justify-content: center; padding: 56px 24px; text-align: center; }
.stage-result.active { display: flex; }
.savings-ring {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background: rgba(16, 185, 129, 0.12);
  border: 3px solid #10B981;
  color: #10B981;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  margin: 0 auto 18px;
}
.continue-to-card {
  max-width: 780px;
  width: 100%;
  margin-top: 40px;
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  box-shadow: var(--shadow-sm);
  text-align: left;
}
.continue-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 10px; margin-top: 14px; }
.continue-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-hairline);
  background: var(--bg-subtle);
  font-size: 0.81rem;
  font-weight: 700;
  cursor: pointer;
}
.continue-item:hover { border-color: var(--brand-blue); background: var(--bg-surface); }

/* Command Palette */
.cmd-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 16, 46, 0.55);
  backdrop-filter: blur(4px);
  z-index: 3000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 10vh;
}
.cmd-backdrop.open { display: flex; }
.cmd-modal {
  width: 100%;
  max-width: 580px;
  background: var(--bg-surface);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  margin: 0 16px;
}
.cmd-input-wrap { display: flex; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border-hairline); gap: 10px; }
.cmd-input { width: 100%; border: none; background: transparent; color: var(--text-primary); font-size: 0.95rem; font-weight: 600; outline: none; }
.cmd-list { max-height: 340px; overflow-y: auto; padding: 8px; }
.cmd-item { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-radius: var(--radius-xs); cursor: pointer; }
.cmd-item:hover { background: var(--bg-subtle); }

/* Footer */
.ilove-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-hairline);
  padding: 56px 0 28px;
  color: var(--text-secondary);
  font-size: 0.84rem;
}
.ilove-footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr; gap: 32px; margin-bottom: 40px; }
.ilove-footer h4 { color: var(--text-primary); font-size: 0.78rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 14px; }
.ilove-footer a { display: block; padding: 4px 0; color: var(--text-secondary); }
.ilove-footer a:hover { color: var(--brand-blue); }

.toast-wrap { position: fixed; bottom: 20px; right: 20px; z-index: 4000; display: flex; flex-direction: column; gap: 8px; }
.pro-toast { padding: 12px 18px; border-radius: var(--radius-sm); background: #04102E; color: #FFFFFF; font-size: 0.84rem; font-weight: 600; box-shadow: var(--shadow-md); display: flex; align-items: center; gap: 8px; }

/* ============================================================================
   5. MULTI-DEVICE ADAPTATION: TABLET, MOBILE & NATIVE APP SHELL
   ============================================================================ */

/* Touch devices always show page rotate/delete buttons without needing hover */
@media (hover: none), (pointer: coarse), (max-width: 1024px) {
  .page-card-actions {
    opacity: 1 !important;
  }
  .page-act-btn {
    width: 32px;
    height: 32px;
    font-size: 0.85rem;
    box-shadow: var(--shadow-xs);
  }
}

/* Minimalist Text Menu Button for Tablet & Mobile */
.mobile-menu-trigger {
  display: none;
  height: 34px;
  padding: 0 12px;
  border-radius: 6px;
  border: 1px solid var(--border-hairline);
  background: transparent;
  color: var(--text-secondary);
  align-items: center;
  justify-content: center;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}
.mobile-menu-trigger:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
  background: var(--bg-subtle);
}

/* Multi-Device Viewport Switcher Bar (for instant testing on any screen) */
.device-switcher-pill {
  display: inline-flex;
  align-items: center;
  background: var(--bg-subtle);
  border: 1px solid var(--border-hairline);
  border-radius: 50px;
  padding: 3px;
  gap: 2px;
}
.device-mode-btn {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.73rem;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 50px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}
.device-mode-btn.active {
  background: var(--brand-blue);
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(0, 87, 255, 0.3);
}

/* Simulated Viewport Frame when user clicks Mobile or Tablet preview on Desktop */
body.sim-mobile-view,
body.sim-tablet-view {
  background: #0B132B !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 0 60px;
}
body.sim-mobile-view > *:not(.cmd-backdrop):not(.mobile-drawer-backdrop):not(.sim-floating-bar):not(.toast-wrap) {
  width: 390px !important;
  max-width: 100vw !important;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.55);
}
body.sim-tablet-view > *:not(.cmd-backdrop):not(.mobile-drawer-backdrop):not(.sim-floating-bar):not(.toast-wrap) {
  width: 820px !important;
  max-width: 100vw !important;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.55);
}

/* Slide-Over Drawer for Mobile & Tablet */
.mobile-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(4, 16, 46, 0.6);
  backdrop-filter: blur(4px);
  z-index: 3500;
  display: none;
  justify-content: flex-end;
}
.mobile-drawer-backdrop.open {
  display: flex;
}
.mobile-drawer {
  width: 340px;
  max-width: 88vw;
  height: 100%;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-hairline);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: drawerSlideIn 0.22s var(--ease);
}
@keyframes drawerSlideIn {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}
.drawer-head {
  padding: 16px 18px;
  border-bottom: 1px solid var(--border-hairline);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.drawer-search-box {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-hairline);
}
.drawer-search-input {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border-strong);
  background: var(--bg-subtle);
  color: var(--text-primary);
  font-size: 0.86rem;
  font-weight: 600;
  outline: none;
}
.drawer-search-input:focus {
  border-color: var(--brand-blue);
}
.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 14px 16px 32px;
}
.drawer-cat-group {
  margin-bottom: 18px;
}
.drawer-cat-title {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border-hairline);
}
.drawer-tool-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.drawer-tool-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: var(--radius-xs);
  background: var(--bg-subtle);
  border: 1px solid transparent;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
}
.drawer-tool-item:hover,
.drawer-tool-item:active {
  border-color: var(--brand-blue);
  background: var(--brand-blue-soft);
}

/* Native Mobile Bottom Tab Bar */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(62px + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--bg-surface);
  border-top: 1px solid var(--border-hairline);
  box-shadow: 0 -6px 24px rgba(4, 16, 46, 0.08);
  z-index: 2500;
  grid-template-columns: repeat(5, 1fr);
}
.mob-tab-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 2px;
}
.mob-tab-link .mob-ico {
  font-size: 1.15rem;
  line-height: 1;
}
.mob-tab-link.active,
.mob-tab-link:hover {
  color: var(--brand-blue);
}

/* ---- TABLET BREAKPOINT (769px to 1100px) ---- */
@media (max-width: 1100px) {
  .mega-grid-6 {
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
  }
  .ilove-nav-link {
    padding: 0 9px;
    font-size: 0.78rem;
  }
  .cmd-pill span {
    display: none;
  }
  .ilove-tools-grid {
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 12px;
  }
  .stage-workbench.active {
    grid-template-columns: 1fr 310px;
  }
  .wb-canvas-area {
    padding: 20px 20px 90px;
  }
  .ilove-footer-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
  }
}

/* ---- PORTRAIT TABLET & LARGE PHONES (max-width: 900px) ---- */
@media (max-width: 900px) {
  .ilove-nav-links {
    display: none;
  }
  .mobile-menu-trigger {
    display: inline-flex;
  }
  .stage-workbench.active {
    grid-template-columns: 1fr;
  }
  .wb-inspector {
    height: auto;
    position: static;
    border-left: none;
    border-top: 2px solid var(--border-hairline);
    padding-bottom: 80px;
  }
  .inspector-footer {
    position: sticky;
    bottom: 62px;
    background: var(--bg-surface);
    z-index: 50;
    box-shadow: 0 -8px 20px rgba(4, 16, 46, 0.08);
  }
  .silo-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ---- SMARTPHONE MOBILE BREAKPOINT (max-width: 768px) ---- */
@media (max-width: 768px) {
  body {
    padding-bottom: 68px; /* Space for native bottom tab bar */
  }
  .mobile-bottom-nav {
    display: grid;
  }
  .ilove-navbar {
    height: 58px;
  }
  .ilove-nav-inner {
    padding: 0 14px;
  }
  .brand-logo-svg {
    width: 32px;
    height: 32px;
  }
  .brand-wordmark {
    font-size: 1.18rem;
  }
  .device-switcher-pill {
    display: none; /* Hide manual simulator bar on real mobile screens */
  }
  .ilove-hero {
    padding: 28px 14px 20px;
  }
  .ilove-hero h1 {
    font-size: 1.65rem;
    line-height: 1.2;
  }
  .ilove-hero p {
    font-size: 0.88rem;
    margin-bottom: 18px;
  }

  /* Horizontal Swipeable Category Bar on Mobile */
  .ilove-filter-bar {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    padding: 4px 4px 10px;
    margin: 0 -14px;
    padding-left: 14px;
    padding-right: 14px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .ilove-filter-bar::-webkit-scrollbar {
    display: none;
  }
  .ilove-filter-btn {
    flex-shrink: 0;
    padding: 8px 15px;
    font-size: 0.79rem;
  }

  /* 2-Column Compact Mobile App Grid (like iLovePDF Mobile) */
  .container {
    padding: 0 14px;
  }
  .ilove-tools-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding-bottom: 36px;
  }
  .ilove-card {
    padding: 16px 14px;
    min-height: 136px;
    border-radius: 12px;
  }
  .ilove-card-head {
    margin-bottom: 10px;
  }
  .ilove-icon {
    width: 38px;
    height: 38px;
    font-size: 1.1rem;
    border-radius: 9px;
  }
  .ilove-card h3 {
    font-size: 0.9rem;
    margin-bottom: 4px;
  }
  .ilove-card p {
    font-size: 0.74rem;
    line-height: 1.38;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  /* Silos & Footer on Mobile */
  .seo-silo-section {
    padding: 40px 0;
  }
  .silo-grid-4 {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .ilove-footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }
  .ilove-footer-grid > div:first-child {
    grid-column: 1 / -1;
  }

  /* Workspace Mobile Adaptation */
  .stage-upload {
    padding: 28px 16px 40px;
  }
  .stage-upload h1 {
    font-size: 1.65rem;
  }
  .stage-upload .stage-sub {
    font-size: 0.9rem;
    margin-bottom: 22px;
  }
  .select-cta-wrap {
    flex-direction: column;
    width: 100%;
    max-width: 340px;
  }
  .btn-select-huge {
    width: 100%;
    min-width: unset;
    height: 62px;
    font-size: 1.08rem;
    padding: 0 24px;
  }
  .source-side-btns {
    flex-direction: row;
    justify-content: center;
    margin-top: 4px;
  }
  .wb-thumbnails-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .page-canvas-wrap {
    height: 150px;
  }
  .continue-to-card {
    padding: 18px 16px;
  }
  .continue-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* ---- SMALL SMARTPHONE (max-width: 380px) ---- */
@media (max-width: 380px) {
  .ilove-tools-grid {
    grid-template-columns: 1fr;
  }
  .continue-grid {
    grid-template-columns: 1fr;
  }
}

/* Simulated Mode Overrides so Desktop users can preview Mobile/Tablet layout live */
body.sim-mobile-view .ilove-nav-links { display: none !important; }
body.sim-mobile-view .mobile-menu-trigger { display: inline-flex !important; }
body.sim-mobile-view .ilove-tools-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; }
body.sim-mobile-view .ilove-card { padding: 14px !important; min-height: 130px !important; }
body.sim-mobile-view .ilove-card h3 { font-size: 0.88rem !important; }
body.sim-mobile-view .ilove-card p { font-size: 0.72rem !important; }
body.sim-mobile-view .silo-grid-4 { grid-template-columns: 1fr !important; }
body.sim-mobile-view .ilove-footer-grid { grid-template-columns: 1fr 1fr !important; }
body.sim-mobile-view .stage-workbench.active { grid-template-columns: 1fr !important; }
body.sim-mobile-view .btn-select-huge { min-width: 260px !important; height: 60px !important; font-size: 1.05rem !important; }

body.sim-tablet-view .ilove-nav-links { display: none !important; }
body.sim-tablet-view .mobile-menu-trigger { display: inline-flex !important; }
body.sim-tablet-view .ilove-tools-grid { grid-template-columns: repeat(3, 1fr) !important; gap: 12px !important; }
body.sim-tablet-view .silo-grid-4 { grid-template-columns: repeat(2, 1fr) !important; }
body.sim-tablet-view .stage-workbench.active { grid-template-columns: 1fr 290px !important; }
