/* ==========================================================================
   PDFMaster - PDF Page Numbering Tool Stylesheet
   Clean & Minimal · Strict Brand Palette (#e8372a) · Low-RAM Architecture
   ========================================================================== */

/* ===== DESIGN TOKENS ===== */
:root {
  --accent: #e8372a;
  --accent-dark: #c42d21;
  --accent-light: rgba(232, 55, 42, 0.08);
  --accent-glow: rgba(232, 55, 42, 0.25);

  --success-green: #10b981;
  --success-green-dark: #059669;
  --success-bg: rgba(16, 185, 129, 0.1);

  --font-heading: "Sora", sans-serif;
  --font-body: "DM Sans", sans-serif;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 4px rgba(0, 0, 0, 0.06);
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.12);
  --transition: 0.2s ease;
  --max-w: 1240px;
  --nav-h: 68px;
}

[data-theme="light"] {
  --bg: #f8f7f5;
  --surface: #ffffff;
  --surface-2: #f2f1ef;
  --surface-3: #eae9e6;
  --border: #e4e2de;
  --border-focus: #c8c5be;
  --text: #1a1917;
  --text-2: #4a4845;
  --text-3: #7a7875;
  --nav-bg: rgba(248, 247, 245, 0.94);
  --card-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  --card-hover-shadow: 0 8px 24px rgba(0, 0, 0, 0.09);
  --modal-overlay: rgba(15, 15, 15, 0.65);
  --badge-bg: #f1f0ee;
  --thumb-bg: #ffffff;
}

[data-theme="dark"] {
  --bg: #111110;
  --surface: #1c1b1a;
  --surface-2: #252422;
  --surface-3: #2e2c2a;
  --border: #333230;
  --border-focus: #4a4845;
  --text: #f0ede8;
  --text-2: #b5b0a8;
  --text-3: #7a7875;
  --nav-bg: rgba(17, 17, 16, 0.94);
  --card-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
  --card-hover-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  --modal-overlay: rgba(0, 0, 0, 0.82);
  --badge-bg: #272523;
  --thumb-bg: #181716;
}

/* ===== RESET & BASE ===== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  transition:
    background var(--transition),
    color var(--transition);
  overflow-x: hidden;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
  font-family: var(--font-body);
  border: none;
  background: none;
}

ol,
ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

/* ===== NAVBAR ===== */
.site-header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--nav-h);
  background: var(--nav-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
  transition:
    background var(--transition),
    border-color var(--transition);
}

.site-header nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-h);
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.nav-logo img {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  object-fit: contain;
}

.logo-text {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--text);
  letter-spacing: -0.02em;
}

.logo-text span {
  color: var(--accent);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Header Buttons */
.theme-toggle,
.recovery-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  transition: all var(--transition);
  position: relative;
}

.theme-toggle:hover,
.recovery-btn:hover {
  background: var(--accent-light);
  color: var(--accent);
  border-color: rgba(232, 55, 42, 0.25);
}

.theme-toggle svg,
.recovery-btn svg {
  width: 18px;
  height: 18px;
}

.recovery-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 10px;
  height: 10px;
  background: var(--accent);
  border: 2px solid var(--surface);
  border-radius: 50%;
  animation: pulse-accent 2s infinite;
}

@keyframes pulse-accent {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(232, 55, 42, 0.7);
  }
  70% {
    transform: scale(1.1);
    box-shadow: 0 0 0 6px rgba(232, 55, 42, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(232, 55, 42, 0);
  }
}

.hamburger-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  padding: 8px;
}

.h-bar {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all var(--transition);
}

/* ===== MOBILE SIDE MENU ===== */
.side-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--modal-overlay);
  z-index: 1100;
  backdrop-filter: blur(4px);
}

.side-overlay.open {
  display: block;
}

.side-menu {
  position: fixed;
  top: 0;
  right: 0;
  width: 280px;
  height: 100%;
  background: var(--surface);
  z-index: 1200;
  padding: 24px;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  overflow-y: auto;
}

.side-menu.open {
  transform: translateX(0);
}

.side-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.side-menu-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.1rem;
}

.side-nav {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.side-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.95rem;
  color: var(--text-2);
  font-weight: 500;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
}

.side-nav a:hover {
  background: var(--accent-light);
  color: var(--accent);
}

.side-divider {
  height: 1px;
  background: var(--border);
  margin: 8px 0;
}

/* ===== BREADCRUMB ===== */
.breadcrumb {
  padding: 16px 0 0;
  font-size: 0.82rem;
  color: var(--text-3);
}

.breadcrumb__list {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.breadcrumb__item a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.breadcrumb__sep {
  opacity: 0.5;
}

/* ===== HERO SECTION ===== */
.hero {
  padding: 44px 0 36px;
  text-align: center;
}

.hero__inner {
  max-width: 820px;
  margin: 0 auto;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-light);
  border: 1px solid rgba(232, 55, 42, 0.18);
  color: var(--accent);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
  margin-bottom: 20px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero__title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4.5vw, 3.1rem);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
  color: var(--text);
}

.hero__title .accent {
  color: var(--accent);
  background: linear-gradient(135deg, var(--accent) 0%, #ff6b4a 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero__sub {
  font-size: clamp(0.98rem, 1.8vw, 1.12rem);
  color: var(--text-2);
  margin-bottom: 24px;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

.hero__badges {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

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

.pill svg {
  color: var(--accent);
}

/* ===== TOOL MAIN SECTION ===== */
.tool-section {
  padding-bottom: 60px;
}

/* Upload Dropzone */
.upload-zone {
  border: 2px dashed var(--border);
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 56px 28px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  box-shadow: var(--shadow-sm);
  max-width: 760px;
  margin: 0 auto;
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--accent);
  background: var(--accent-light);
  box-shadow: 0 0 0 6px var(--accent-glow);
  transform: translateY(-2px);
}

.upload-zone__icon {
  width: 68px;
  height: 68px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: var(--accent-light);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(232, 55, 42, 0.18);
  transition: transform var(--transition);
}

.upload-zone:hover .upload-zone__icon {
  transform: scale(1.08) rotate(4deg);
}

.upload-zone__title {
  font-family: var(--font-heading);
  font-size: 1.45rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.upload-zone__sub {
  color: var(--text-3);
  font-size: 0.92rem;
  margin-bottom: 22px;
}

.upload-zone__formats {
  margin-top: 18px;
  font-size: 0.78rem;
  color: var(--text-3);
}

#fileInput {
  display: none;
}

/* Buttons */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--accent);
  color: #ffffff;
  padding: 12px 28px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.95rem;
  transition: all var(--transition);
  box-shadow: 0 4px 14px rgba(232, 55, 42, 0.3);
}

.btn-primary:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(232, 55, 42, 0.45);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 15px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.84rem;
  transition: all var(--transition);
}

.btn-secondary:hover {
  background: var(--surface-2);
  border-color: var(--border-focus);
}

.btn-xs {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  font-size: 0.78rem;
  font-weight: 600;
  transition: all var(--transition);
}

.btn-xs:hover {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border-focus);
}

.btn-xs.active {
  background: var(--accent-light);
  color: var(--accent);
  border-color: var(--accent);
  font-weight: 700;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  transition: all var(--transition);
}

.btn-icon:hover:not(:disabled) {
  background: var(--accent-light);
  color: var(--accent);
  border-color: rgba(232, 55, 42, 0.25);
}

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

/* ===== WORKSPACE LAYOUT ===== */
.workspace {
  display: none;
}

.workspace.active {
  display: block;
}

/* File Info Bar */
.file-info-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 20px;
  margin-bottom: 22px;
  flex-wrap: wrap;
  gap: 14px;
}

.file-info-bar__left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.file-info-bar__icon {
  width: 42px;
  height: 42px;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.file-info-bar__name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.96rem;
  max-width: 320px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-info-bar__size {
  font-size: 0.8rem;
  color: var(--text-3);
}

.badge-ram {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--success-bg);
  color: var(--success-green);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.file-info-bar__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Workspace 2-Column Split: Document Preview (Left) + Configuration Sidebar (Right) */
.workspace-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 28px;
  align-items: start;
}

@media (max-width: 992px) {
  .workspace-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

/* ===== CONFIGURATION PANEL (RIGHT SIDEBAR) ===== */
.config-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  box-shadow: var(--shadow-sm);
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: var(--border-focus) transparent;
}

@media (min-width: 993px) {
  .config-panel {
    position: sticky;
    top: calc(var(--nav-h) + 16px);
    max-height: calc(100vh - var(--nav-h) - 32px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

.config-panel::-webkit-scrollbar {
  width: 6px;
}

.config-panel::-webkit-scrollbar-track {
  background: transparent;
}

.config-panel::-webkit-scrollbar-thumb {
  background: var(--border-focus);
  border-radius: var(--radius-full);
}

.config-panel::-webkit-scrollbar-thumb:hover {
  background: var(--text-3);
}

.config-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 18px;
}

.config-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.config-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text);
  letter-spacing: -0.01em;
}

.config-title svg {
  color: var(--accent);
}

/* 3x3 Position Selector Grid */
.position-picker {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

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

.pos-btn {
  aspect-ratio: 1.4;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 6px;
  color: var(--text-2);
  transition: all var(--transition);
  position: relative;
}

.pos-btn:hover {
  border-color: var(--accent);
  background: var(--surface-3);
  color: var(--text);
}

.pos-btn.active {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 700;
  box-shadow: 0 0 0 2px var(--accent-glow);
}

.pos-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  transition: all var(--transition);
}

.pos-btn:hover .pos-dot {
  background: var(--accent);
}

.pos-btn.active .pos-dot {
  background: var(--accent);
  transform: scale(1.25);
  box-shadow: 0 0 6px var(--accent-glow);
}

.pos-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Facing Pages Toggle */
.facing-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
  padding: 4px 2px;
}

.toggle-label {
  font-size: 0.8rem;
  color: var(--text-2);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Switch UI */
.switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 22px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider-switch {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: var(--border);
  transition: 0.3s;
  border-radius: 22px;
}

.slider-switch:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

input:checked + .slider-switch {
  background-color: var(--accent);
}

input:checked + .slider-switch:before {
  transform: translateX(16px);
}

/* Format & Style Inputs */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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

.form-select,
.form-input {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.85rem;
  transition: all var(--transition);
}

.form-select:focus,
.form-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Format Chips */
.format-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.chip-btn {
  padding: 4px 10px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 0.74rem;
  color: var(--text-2);
  font-weight: 500;
  transition: all var(--transition);
}

.chip-btn:hover {
  background: var(--surface-3);
  color: var(--text);
  border-color: var(--border-focus);
}

.chip-btn.active {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 700;
}

/* Two-column Input Row */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

/* Color Presets & Picker */
.color-picker-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.color-swatch {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--border);
  cursor: pointer;
  transition: transform var(--transition);
}

.color-swatch:hover {
  transform: scale(1.15);
}

.color-swatch.active {
  border-color: var(--accent);
  box-shadow:
    0 0 0 2px var(--surface),
    0 0 0 4px var(--accent);
}

.custom-color-input {
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  background: transparent;
}

/* Pill Background Control */
.pill-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0;
}

.pill-toggle-row .toggle-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  letter-spacing: -0.01em;
}

.pill-toggle-row .toggle-label svg {
  color: var(--accent);
}

.pill-color-picker-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-top: 8px;
  animation: fadeInDown 0.2s ease;
}

.pill-color-swatch {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid var(--border);
  cursor: pointer;
  transition: transform var(--transition);
}

.pill-color-swatch:hover {
  transform: scale(1.15);
}

.pill-color-swatch.active {
  border-color: var(--accent);
  box-shadow:
    0 0 0 2px var(--surface),
    0 0 0 4px var(--accent);
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Range & Slider Controls */
.slider-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.slider-group input[type="range"] {
  flex: 1;
  accent-color: var(--accent);
  height: 6px;
  border-radius: 3px;
  background: var(--border);
  cursor: pointer;
}

.slider-val-box {
  width: 48px;
  height: 30px;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
}

/* Scope Selector Chips */
.scope-chips {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

.scope-btn {
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 0.76rem;
  color: var(--text-2);
  font-weight: 600;
  text-align: center;
  transition: all var(--transition);
}

.scope-btn:hover {
  background: var(--surface-2);
  color: var(--text);
}

.scope-btn.active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
  box-shadow: 0 2px 8px var(--accent-glow);
}

/* ===== PAGES VIEW & PREVIEW (LEFT COLUMN) ===== */
.pages-view-wrapper {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

/* Single Page Preview Navigation Toolbar */
.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 16px;
  flex-wrap: wrap;
  gap: 12px;
}

.preview-nav-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.preview-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  transition: all var(--transition);
}

.preview-nav-btn:hover:not(:disabled) {
  background: var(--accent-light);
  color: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-glow);
}

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

.preview-page-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-2);
}

.preview-page-input {
  width: 52px;
  height: 32px;
  text-align: center;
  font-weight: 700;
  font-size: 0.88rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  transition: all var(--transition);
}

.preview-page-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.preview-page-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-toggle-include {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: var(--radius-full);
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--accent-light);
  border: 1px solid rgba(232, 55, 42, 0.35);
  color: var(--accent);
}

.btn-toggle-include:hover {
  background: rgba(232, 55, 42, 0.16);
  border-color: var(--accent);
}

.btn-toggle-include.is-excluded {
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-3);
}

.btn-toggle-include.is-excluded:hover {
  background: var(--surface-3);
  color: var(--text-2);
  border-color: var(--border-focus);
}

.toggle-icon {
  font-size: 0.95rem;
  line-height: 1;
}

/* Selection Summary Banner */
.summary-banner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.summary-text {
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.summary-badge-num {
  color: var(--accent);
  background: var(--accent-light);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.summary-badge-excl {
  color: var(--text-3);
  background: var(--surface-2);
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.preview-sample-box {
  font-size: 0.82rem;
  color: var(--text-3);
  display: flex;
  align-items: center;
  gap: 6px;
}

.preview-sample-box strong {
  color: var(--accent);
  font-family: var(--font-body);
}

/* Single Page Stage Container */
.single-page-stage-container {
  width: 100%;
  min-height: 520px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.single-page-stage {
  position: relative;
  max-width: 100%;
  margin: 0 auto;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.16);
  border-radius: 4px;
  background: #ffffff;
  line-height: 0;
  display: inline-block;
}

.single-page-canvas {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 4px;
}

/* Live Stamped Page Number Overlay on Single Page Preview */
.page-number-stamp-overlay {
  position: absolute;
  pointer-events: none;
  z-index: 10;
  white-space: nowrap;
  line-height: 1;
  font-family: Helvetica, Arial, sans-serif;
  font-weight: 500;
  transition: all 0.15s ease;
  user-select: none;
}

.page-number-stamp-overlay.has-pill-bg {
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(0, 0, 0, 0.14);
  line-height: 1.1;
}

[data-theme="dark"] .page-number-stamp-overlay.has-pill-bg {
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

/* Excluded Overlay for Single Page Preview */
.page-excluded-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(1.5px);
  -webkit-backdrop-filter: blur(1.5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 15;
  border-radius: 4px;
}

[data-theme="dark"] .page-excluded-overlay {
  background: rgba(15, 23, 42, 0.75);
}

.page-excluded-badge {
  background: #1e293b;
  color: #ffffff;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.single-page-loader {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  border-radius: 4px;
}

[data-theme="dark"] .single-page-loader {
  background: rgba(15, 23, 42, 0.6);
}

/* ===== BOTTOM ACTION BAR ===== */
.action-bar {
  position: sticky;
  bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  width: fit-content;
  max-width: min(90%, 640px);
  margin: 20px auto 0;
  box-sizing: border-box;
  text-align: center;
  padding: 8px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
  z-index: 100;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

[data-theme="dark"] .action-bar {
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
}

.action-bar__info {
  font-size: 0.84rem;
  color: var(--text-2);
  font-weight: 500;
  text-align: center;
}

.action-bar__btns {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-number-main {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #ffffff;
  padding: 12px 26px;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 0.95rem;
  transition: all var(--transition);
  box-shadow: 0 4px 16px var(--accent-glow);
}

.btn-number-main:hover:not(:disabled) {
  background: var(--accent-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(232, 55, 42, 0.45);
}

.btn-number-main:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-number-main.btn-block {
  width: 100%;
  justify-content: center;
  padding: 13px 20px;
  font-size: 0.96rem;
}

/* ===== SUCCESS RESULTS CARD ===== */
.results-card {
  display: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 24px;
  text-align: center;
  max-width: 640px;
  margin: 30px auto 0;
  box-shadow: var(--shadow);
}

.results-card.active {
  display: block;
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.results-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--success-bg);
  color: var(--success-green);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
}

.results-title {
  font-family: var(--font-heading);
  font-size: 1.55rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.results-sub {
  color: var(--text-2);
  font-size: 0.94rem;
  margin-bottom: 24px;
}

.results-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 24px;
  margin-bottom: 28px;
}

.results-stat-val {
  font-size: 1.15rem;
  font-weight: 700;
  display: block;
}

.results-stat-divider {
  width: 1px;
  height: 36px;
  background: var(--border);
}

.results-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ===== LOADING PROGRESS MODAL ===== */
.loading-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--modal-overlay);
  backdrop-filter: blur(6px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.loading-modal-overlay.active {
  display: flex;
}

.loading-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 30px;
  width: 100%;
  max-width: 440px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: scaleIn 0.25s ease;
}

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

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--surface-3);
  border-top-color: var(--accent);
  border-radius: 50%;
  margin: 0 auto 18px;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-modal__title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.loading-modal__sub {
  font-size: 0.85rem;
  color: var(--text-3);
  margin-bottom: 20px;
}

.loading-bar-track {
  width: 100%;
  height: 8px;
  background: var(--surface-3);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 12px;
}

.loading-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), #ff6b4a);
  border-radius: 4px;
  transition: width 0.2s ease;
}

.loading-modal__status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-2);
}

.loading-mode-tag {
  display: inline-block;
  margin-top: 14px;
  font-size: 0.72rem;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 600;
}

/* ===== HIGH RESOLUTION PAGE INSPECTOR MODAL ===== */
.inspect-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--modal-overlay);
  backdrop-filter: blur(8px);
  z-index: 2100;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.inspect-modal-overlay.active {
  display: flex;
}

.inspect-modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  animation: scaleIn 0.25s ease;
}

.inspect-modal__head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.inspect-modal__title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
}

.inspect-modal__body {
  padding: 20px;
  overflow-y: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  min-height: 400px;
  position: relative;
}

.inspect-page-box {
  position: relative;
  max-width: 100%;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  border-radius: 4px;
  background: #ffffff;
  overflow: hidden;
}

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

.inspect-modal__foot {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.close-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  transition: all var(--transition);
}

.close-btn:hover {
  background: var(--surface-3);
  color: var(--text);
}

/* ===== TOAST NOTIFICATIONS ===== */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 18px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  color: var(--text);
  z-index: 3000;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 380px;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.toast-success {
  border-left: 4px solid var(--success-green);
}

.toast.toast-error {
  border-left: 4px solid var(--accent);
}

.toast.toast-info {
  border-left: 4px solid var(--accent);
}

.toast.toast-warning {
  border-left: 4px solid #f59e0b;
}

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

.section__header {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 48px;
}

.section__tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent-light);
  border: 1px solid rgba(232, 55, 42, 0.18);
  color: var(--accent);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.section__title {
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 3.2vw, 2.35rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
  line-height: 1.25;
}

.section__sub {
  font-size: 1rem;
  color: var(--text-2);
  line-height: 1.6;
}

/* What is it 2-Col Grid */
.what-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 40px;
  align-items: center;
}

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

.what-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  font-size: 0.98rem;
  color: var(--text-2);
  line-height: 1.7;
}

.what-body strong {
  color: var(--text);
}

.what-visual {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  box-shadow: var(--shadow-sm);
}

.what-visual__demo-pages {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.demo-sheet {
  width: 78px;
  height: 104px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 8px 6px;
  gap: 4px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.demo-line {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
}

.demo-stamp {
  position: absolute;
  bottom: 6px;
  right: 6px;
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--surface);
  padding: 1px 4px;
  border-radius: 2px;
  border: 0.5px solid rgba(232, 55, 42, 0.25);
}

/* Features Grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all var(--transition);
}

.feature-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: var(--card-hover-shadow);
}

.feature-card__icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: var(--accent-light);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(232, 55, 42, 0.18);
}

.feature-card h3 {
  font-family: var(--font-heading);
  font-size: 1.12rem;
  font-weight: 700;
}

.feature-card p {
  font-size: 0.88rem;
  color: var(--text-2);
  line-height: 1.6;
}

/* How to Use Steps */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}

.step-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
}

.step-number {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1rem;
}

.step-card h3 {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
}

.step-card p {
  font-size: 0.86rem;
  color: var(--text-2);
  line-height: 1.6;
}

/* Use Cases Section */
.use-cases-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.use-case-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.use-case-card h4 {
  font-family: var(--font-heading);
  font-size: 0.98rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
}

.use-case-card p {
  font-size: 0.85rem;
  color: var(--text-2);
  line-height: 1.55;
}

/* Comparison Table */
.comparison-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
}

.comparison-table th,
.comparison-table td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.comparison-table th {
  background: var(--surface-2);
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--text);
  font-size: 0.86rem;
}

.comparison-table th.highlight-col {
  color: var(--text);
  font-family: var(--font-heading);
  font-weight: 800;
  letter-spacing: -0.01em;
}

.comparison-table th.highlight-col span {
  color: var(--accent);
}

.comparison-table tr:last-child td {
  border-bottom: none;
}

.comparison-table .feature-name {
  font-weight: 600;
}

.table-check {
  color: var(--success-green);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
}

.table-cross {
  color: var(--accent);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Architecture Deep Dive */
.arch-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px 30px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.arch-points {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.arch-point {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.arch-point h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}

.arch-point p {
  font-size: 0.85rem;
  color: var(--text-2);
  line-height: 1.6;
}

/* FAQ Accordion */
.faq-list {
  max-width: 840px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--transition);
}

.faq-item:hover {
  border-color: var(--accent);
}

.faq-question {
  width: 100%;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-heading);
  font-size: 0.98rem;
  font-weight: 700;
  text-align: left;
  color: var(--text);
  gap: 16px;
}

.faq-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s ease;
  color: var(--text-3);
  flex-shrink: 0;
}

.faq-item.open .faq-icon {
  transform: rotate(180deg);
  color: var(--accent);
}

.faq-answer {
  display: none;
  padding: 0 22px 20px;
  font-size: 0.9rem;
  color: var(--text-2);
  line-height: 1.7;
}

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

/* Related Tools Grid */
.tools-grid-mini {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.tool-card-mini {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: all var(--transition);
}

.tool-card-mini:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.tool-card-mini__icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--accent-light);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid rgba(232, 55, 42, 0.18);
}

.tool-card-mini h4 {
  font-family: var(--font-heading);
  font-size: 0.88rem;
  font-weight: 700;
  margin-bottom: 2px;
}

.tool-card-mini p {
  font-size: 0.74rem;
  color: var(--text-3);
}

/* ===== FOOTER ===== */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 56px 0 32px;
}

.footer__grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 48px;
}

@media (max-width: 768px) {
  .footer__grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

.footer__brand p {
  font-size: 0.88rem;
  color: var(--text-3);
  margin-top: 12px;
  max-width: 280px;
}

.footer__socials {
  display: flex;
  gap: 12px;
  margin-top: 18px;
}

.footer__social-link {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  transition: all var(--transition);
}

.footer__social-link:hover {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border-focus);
}

.footer__col h4 {
  font-family: var(--font-heading);
  font-size: 0.92rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text);
}

.footer__col ul {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer__col a {
  font-size: 0.84rem;
  color: var(--text-3);
  transition: color var(--transition);
}

.footer__col a:hover {
  color: var(--accent);
}

.footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--border);
  padding-top: 24px;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.82rem;
  color: var(--text-3);
}

.footer__badges {
  display: flex;
  gap: 10px;
}

.footer__badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-2);
}

/* Back to Top */
.back-top {
  position: fixed;
  bottom: 24px;
  left: 24px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  transition: all var(--transition);
  opacity: 0;
  visibility: hidden;
  z-index: 1000;
}

.back-top.show {
  opacity: 1;
  visibility: visible;
}

.back-top:hover {
  background: var(--surface-2);
  color: var(--text);
  transform: translateY(-2px);
}

/* Responsive Overrides */
@media (max-width: 640px) {
  .hero {
    padding: 32px 0 24px;
  }
  .upload-zone {
    padding: 36px 18px;
  }
  .preview-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .preview-nav-group {
    justify-content: center;
  }
  .preview-page-actions {
    justify-content: center;
  }
  .btn-toggle-include {
    width: 100%;
    justify-content: center;
  }
  .hamburger-btn {
    display: flex;
  }
  .nav-right a.theme-toggle {
    display: none;
  }
  .action-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .btn-number-main {
    width: 100%;
    justify-content: center;
  }
}
