:root {
  --bg-canvas: #F8FAFC;
  --surface-card: #FFFFFF;
  --surface-subtle: #F1F5F9;
  --text-primary: #0F172A;
  --text-secondary: #334155;
  --text-muted: #64748B;
  --border-hairline: #E2E8F0;
  --brand-primary: #2563EB;
  --brand-primary-hover: #1D4ED8;
  --action-emerald: #059669;
  --action-emerald-hover: #047857;
  --crop-alert: #DC2626;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --font-ui: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  overflow-x: hidden;
  width: 100%;
}

body {
  font-family: var(--font-ui);
  background-color: var(--bg-canvas);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  width: 100%;
}

/* NAVBAR */
#navbar {
  position: sticky;
  top: 0;
  height: 58px;
  background: var(--surface-card);
  border-bottom: 1px solid var(--border-hairline);
  box-shadow: var(--shadow-sm);
  z-index: 1000;
  display: flex;
  align-items: center;
}

.nav-inner {
  max-width: 1260px;
  width: 100%;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}

.brand-icon {
  width: 32px;
  height: 32px;
  background: var(--brand-primary);
  color: #FFFFFF;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: -0.5px;
  flex-shrink: 0;
}

.brand-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.trust-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ECFDF5;
  color: var(--action-emerald);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 9999px;
  border: 1px solid #A7F3D0;
  white-space: nowrap;
  flex-shrink: 0;
}

.trust-pill-icon {
  flex-shrink: 0;
  color: var(--action-emerald);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.nav-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  cursor: pointer;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.nav-link:hover {
  color: var(--brand-primary);
  background: #F1F5F9;
}

.nav-count-badge {
  background: #EFF6FF;
  color: var(--brand-primary);
  border: 1px solid #BFDBFE;
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 9999px;
  line-height: 1.2;
}

/* NAVBAR DROPDOWN */
.nav-dropdown {
  position: relative;
  display: inline-block;
}

.nav-dropdown-btn {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.nav-dropdown-btn:hover,
.nav-dropdown:hover .nav-dropdown-btn,
.nav-dropdown.is-open .nav-dropdown-btn {
  color: var(--brand-primary);
  background: #F1F5F9;
}

.dropdown-chevron {
  transition: transform 0.18s ease;
}

.nav-dropdown:hover .dropdown-chevron,
.nav-dropdown.is-open .dropdown-chevron {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 210px;
  background: #FFFFFF;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.12), 0 8px 10px -6px rgba(15, 23, 42, 0.06);
  padding: 6px;
  display: none;
  flex-direction: column;
  gap: 2px;
  z-index: 1050;
}

.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown.is-open .nav-dropdown-menu {
  display: flex;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
  white-space: nowrap;
}

.dropdown-item:hover {
  background: #F1F5F9;
  color: var(--brand-primary);
}

.dropdown-item svg {
  color: var(--brand-primary);
  flex-shrink: 0;
}

/* BOOKMARK BUTTON */
.nav-bookmark-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #EFF6FF;
  color: var(--brand-primary);
  border: 1px solid #BFDBFE;
  font-size: 11.5px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  font-family: inherit;
}

.nav-bookmark-pill:hover {
  background: var(--brand-primary);
  color: #FFFFFF;
  border-color: var(--brand-primary);
}

.nav-hamburger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-primary);
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease;
}

.nav-hamburger:hover {
  background: var(--surface-subtle);
}

/* MOBILE NAV DRAWER */
.mobile-nav-drawer {
  display: none;
  position: absolute;
  top: 58px;
  left: 0;
  right: 0;
  background: #FFFFFF;
  border-bottom: 1px solid var(--border-hairline);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15);
  padding: 14px 20px 20px;
  flex-direction: column;
  gap: 8px;
  z-index: 999;
}

.mobile-nav-drawer.is-open {
  display: flex;
}

.mobile-nav-link {
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: background 0.15s ease;
  cursor: pointer;
}

.mobile-nav-link:hover {
  background: #F1F5F9;
  color: var(--brand-primary);
}

.mobile-bookmark-btn {
  margin-top: 6px;
  width: 100%;
  justify-content: center;
  padding: 9px;
}

/* PROGRAMMATIC SEO QUICK-SWITCHER BAR */
#seoBar {
  background: var(--surface-subtle);
  border-bottom: 1px solid var(--border-hairline);
  padding: 8px 0;
  overflow-x: auto;
  white-space: nowrap;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  scrollbar-width: thin;
}

.seobar-inner {
  max-width: 1260px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-sizing: border-box;
}

.seobar-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.seo-pill {
  background: var(--surface-card);
  color: var(--text-secondary);
  border: 1px solid var(--border-hairline);
  padding: 5px 12px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.seo-pill:hover,
.seo-pill.active {
  background: var(--brand-primary);
  color: #FFFFFF;
  border-color: var(--brand-primary);
}

/* HERO HEADER */
#heroHeader {
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px 20px 14px;
  text-align: center;
}

#heroH1 {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.25;
}

#heroSub {
  font-size: 14.5px;
  color: var(--text-secondary);
  max-width: 860px;
  margin: 8px auto 0;
  line-height: 1.5;
}

/* ADS ARCHITECTURE (Coalition for Better Ads & Zero CLS) */
.ad-slot {
  background: var(--surface-subtle);
  border: 1px dashed var(--border-hairline);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  position: relative;
  overflow: hidden;
}

.ad-slot::before {
  content: "ADVERTISEMENT";
  font-size: 9px;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  position: absolute;
  top: 4px;
}

.ad-placeholder {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  opacity: 0.7;
}

.ad-slot-leaderboard {
  max-width: 728px;
  width: calc(100% - 32px);
  min-height: 90px;
  height: 90px;
  margin: 10px auto 16px;
  box-sizing: border-box;
}

.ad-slot-rect {
  width: 100%;
  max-width: 280px;
  min-height: 250px;
  height: 250px;
  margin: 14px auto;
  box-sizing: border-box;
}

.ad-slot-modal {
  width: 100%;
  max-width: 336px;
  min-height: 280px;
  height: 280px;
  margin: 16px auto;
  box-sizing: border-box;
}

/* WORKSPACE GRID */
.workspace-grid {
  max-width: 1220px;
  width: 100%;
  margin: 0 auto;
  padding: 0 16px 36px;
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: start;
  flex: 1;
  box-sizing: border-box;
}

.panel {
  background: var(--surface-card);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  min-width: 0; /* Prevents grid overflow */
  box-sizing: border-box;
}

/* AMAZON AFFILIATE LINK */
.affiliate-link {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  text-decoration: none;
  text-align: center;
  line-height: 1.4;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: rgba(241, 245, 249, 0.6);
  border: 1px dashed var(--border-hairline);
  transition: all 0.15s ease;
  margin-top: 6px;
}

.affiliate-link:hover {
  color: #D97706; /* Amber */
  border-color: #FCD34D;
  background: #FFFBEB;
}

/* SEO CARD & PSEO DIRECTORY */
.seo-card {
  background: var(--surface-card);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  margin-top: 24px;
  grid-column: 1 / -1;
  width: 100%;
  box-sizing: border-box;
}

.seo-card h2 {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.seo-card p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 14px;
  line-height: 1.5;
}

/* LEFT PANEL CONTROLS */
.panel-left {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

#dropzone {
  border: 2px dashed var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 18px 12px;
  text-align: center;
  cursor: pointer;
  background: var(--bg-canvas);
  transition: all 0.2s ease;
}

#dropzone:hover,
#dropzone.dragover {
  border-color: var(--brand-primary);
  background: rgba(37, 99, 235, 0.04);
}

.dropzone-icon {
  font-size: 26px;
  margin-bottom: 4px;
}

.dropzone-text {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.dropzone-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.btn-secondary-sm {
  width: 100%;
  padding: 7px 10px;
  background: var(--surface-subtle);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-secondary-sm:hover {
  background: #E2E8F0;
  color: var(--text-primary);
}

.field-label {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  margin-top: 4px;
}

#presetSelect {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  background: var(--surface-card);
  font-size: 12.5px;
  color: var(--text-primary);
  outline: none;
  cursor: pointer;
}

#presetSelect:focus {
  border-color: var(--brand-primary);
}

/* MARGIN SLIDERS */
.slider-group {
  background: var(--surface-subtle);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.slider-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.slider-label {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  width: 54px;
}

.slider-row input[type="range"] {
  flex: 1;
  accent-color: var(--brand-primary);
  height: 4px;
  cursor: pointer;
}

.slider-val {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  color: var(--brand-primary);
  width: 44px;
  text-align: right;
}

/* ORIENTATION */
#orientationGroup {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.orientation-options {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.orientation-option {
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  padding: 6px 2px;
  text-align: center;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  background: var(--surface-card);
  color: var(--text-secondary);
  user-select: none;
  transition: all 0.15s ease;
}

.orientation-option input {
  display: none;
}

.orientation-option.selected {
  background: var(--brand-primary);
  color: #FFFFFF;
  border-color: var(--brand-primary);
}

/* TOGGLES */
.toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
  cursor: pointer;
}

.toggle-row input[type="checkbox"] {
  accent-color: var(--brand-primary);
  width: 15px;
  height: 15px;
  cursor: pointer;
}

/* CENTER PANEL: MODERN BATCH TOOLBAR & STAGE */
.panel-center {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 580px;
}

.batch-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-hairline);
  flex-wrap: wrap;
}

.toolbar-stepper-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.stepper-nav-btn {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-subtle);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.stepper-nav-btn:hover:not(:disabled) {
  background: #E2E8F0;
  color: var(--text-primary);
  border-color: #CBD5E1;
}

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

.page-select-box {
  position: relative;
  display: flex;
  align-items: center;
  max-width: 240px;
  min-width: 140px;
  flex: 1;
}

#pageSelectDropdown {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  background: var(--surface-card);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  padding: 6px 28px 6px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  outline: none;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  transition: all 0.15s ease;
}

#pageSelectDropdown:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.dropdown-arrow-icon {
  position: absolute;
  right: 8px;
  pointer-events: none;
  color: var(--text-muted);
}

.batch-count-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  background: var(--surface-subtle);
  border: 1px solid var(--border-hairline);
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.batch-action-btn {
  padding: 6px 10px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-hairline);
  background: var(--surface-card);
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.batch-action-btn:hover {
  background: var(--surface-subtle);
  color: var(--text-primary);
  border-color: #CBD5E1;
}

.batch-action-clear {
  color: var(--crop-alert);
}

.batch-action-clear:hover {
  background: #FEE2E2;
  border-color: #FCA5A5;
}

.btn-with-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn-with-icon svg {
  flex-shrink: 0;
}

.dropzone-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
}

.stage-empty-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

/* STAGE CANVAS & CROP OVERLAY */
.canvas-stage {
  position: relative;
  background: var(--surface-subtle);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 480px;
  height: 520px;
  user-select: none;
  touch-action: none;
  cursor: crosshair;
}

#sourceCanvas {
  max-width: 100%;
  max-height: 100%;
  display: block;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  pointer-events: none; /* Let drag events land on stage & cropOverlay */
}

.stage-empty {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  pointer-events: none;
}

.stage-empty-icon {
  font-size: 36px;
  margin-bottom: 8px;
}

/* INTERACTIVE CROP BOX */
#cropOverlay {
  position: absolute;
  border: 2px dashed var(--crop-alert);
  box-shadow: 0 0 0 9999px rgba(15, 23, 42, 0.38);
  cursor: grab;
  z-index: 20;
  user-select: none;
  touch-action: none;
  background: rgba(37, 99, 235, 0.02);
}

#cropOverlay.is-dragging {
  cursor: grabbing;
}

.crop-handle {
  position: absolute;
  width: 12px;
  height: 12px;
  background: var(--crop-alert);
  border: 2px solid #FFFFFF;
  border-radius: 2px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  z-index: 21;
  touch-action: none;
  box-sizing: border-box;
}

/* Invisible generous hit target (30x30px) for effortless mouse/touch grabbing */
.crop-handle::before {
  content: '';
  position: absolute;
  top: -9px;
  left: -9px;
  right: -9px;
  bottom: -9px;
  cursor: inherit;
}

/* 4 Corner Handles */
.crop-handle[data-corner="tl"] {
  top: -6px;
  left: -6px;
  cursor: nwse-resize;
}

.crop-handle[data-corner="tr"] {
  top: -6px;
  right: -6px;
  cursor: nesw-resize;
}

.crop-handle[data-corner="bl"] {
  bottom: -6px;
  left: -6px;
  cursor: nesw-resize;
}

.crop-handle[data-corner="br"] {
  bottom: -6px;
  right: -6px;
  cursor: nwse-resize;
}

/* 4 Edge Midpoint Handles */
.crop-handle[data-corner="t"] {
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  cursor: ns-resize;
  width: 22px;
}

.crop-handle[data-corner="b"] {
  bottom: -6px;
  left: 50%;
  transform: translateX(-50%);
  cursor: ns-resize;
  width: 22px;
}

.crop-handle[data-corner="l"] {
  top: 50%;
  left: -6px;
  transform: translateY(-50%);
  cursor: ew-resize;
  height: 22px;
}

.crop-handle[data-corner="r"] {
  top: 50%;
  right: -6px;
  transform: translateY(-50%);
  cursor: ew-resize;
  height: 22px;
}

.crop-mask {
  display: none; /* Managed by shadow overlay on #cropOverlay */
}

/* RIGHT PANEL: PREVIEW & ACTION */
.panel-right {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.output-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.output-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  text-align: center;
}

#outputCanvas {
  width: 100%;
  max-width: 280px;
  aspect-ratio: 4 / 6;
  background: #FFFFFF;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  display: block;
}

.badge-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.badge {
  display: inline-flex;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  font-size: 10.5px;
  font-weight: 600;
}

.badge-mono {
  font-family: var(--font-mono);
  background: var(--surface-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border-hairline);
}

.badge-active {
  background: #ECFDF5;
  color: var(--action-emerald);
  border-color: #A7F3D0;
}

/* CTA BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px; /* Generous, noticeable gap between icon and text */
  width: 100%;
  padding: 13px 18px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  line-height: 1.3;
  box-sizing: border-box;
  text-align: center;
}

.btn:active {
  transform: scale(0.985);
}

.btn svg {
  flex-shrink: 0;
  display: inline-block;
  vertical-align: middle;
  margin-right: 2px;
}

.btn span {
  display: inline-block;
  line-height: 1.25;
}

.btn-print {
  background: var(--action-emerald);
  color: #FFFFFF;
  box-shadow: 0 2px 4px rgba(5, 150, 105, 0.2);
}

.btn-print:hover {
  background: var(--action-emerald-hover);
  box-shadow: 0 4px 8px rgba(5, 150, 105, 0.28);
}

.btn-download {
  background: var(--brand-primary);
  color: #FFFFFF;
  box-shadow: 0 2px 4px rgba(37, 99, 235, 0.2);
}

.btn-download:hover {
  background: var(--brand-primary-hover);
  box-shadow: 0 4px 8px rgba(37, 99, 235, 0.28);
}

/* HIDDEN THERMAL PRINT MOUNT */
#thermalPrintMount {
  display: none;
}

@media print {
  @page {
    size: 4in 6in;
    margin: 0;
  }

  body > *:not(#thermalPrintMount) {
    display: none !important;
  }

  #thermalPrintMount {
    display: block !important;
    width: 4in;
    margin: 0;
    padding: 0;
  }

  .print-page-img {
    width: 4in;
    height: 6in;
    page-break-after: always;
    break-after: page;
    display: block;
    object-fit: contain;
    margin: 0;
    padding: 0;
  }
}

/* MODAL SYSTEM */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(2px);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: var(--surface-card);
  border-radius: var(--radius-lg);
  max-width: 680px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 28px;
  position: relative;
  box-shadow: var(--shadow-lg);
}

.modal-sm {
  max-width: 460px;
  text-align: center;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 18px;
  font-size: 24px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.modal-body {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.modal-body h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 16px 0 6px;
}

.modal-body ul {
  padding-left: 20px;
  margin: 8px 0;
}

.modal-body a {
  color: var(--brand-primary);
  text-decoration: underline;
}

/* PROGRESS BAR IN MODAL */
.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--surface-subtle);
  border-radius: 9999px;
  overflow: hidden;
  margin: 16px 0;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--action-emerald);
  transition: width 0.3s ease;
}

/* CONTACT FORM */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
  text-align: left;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-row label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.form-row input,
.form-row textarea {
  padding: 8px 10px;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13px;
  outline: none;
}

.form-row input:focus,
.form-row textarea:focus {
  border-color: var(--brand-primary);
}

/* SEO SECTIONS BELOW THE FOLD */
.seo-section {
  padding: 56px 20px;
  background: var(--surface-card);
  border-top: 1px solid var(--border-hairline);
}

.seo-section-alt {
  background: var(--bg-canvas);
}

.seo-inner {
  max-width: 1080px;
  margin: 0 auto;
}

.seo-inner h2 {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 12px;
  text-align: center;
  letter-spacing: -0.02em;
}

.seo-section-desc {
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 24px;
  font-size: 14px;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
  background: var(--surface-card);
}

th, td {
  padding: 13px 18px;
  border-bottom: 1px solid var(--border-hairline);
}

th {
  background: var(--surface-subtle);
  font-weight: 700;
  color: var(--text-primary);
}

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

/* 3-STEP GRID */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 56px;
  margin-top: 24px;
}

.step-card {
  background: var(--surface-card);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  padding: 28px 22px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

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

.step-number {
  width: 38px;
  height: 38px;
  background: var(--brand-primary);
  color: #FFFFFF;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 14px;
  margin: 0 auto 14px;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

.step-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.step-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
}

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

details {
  background: var(--surface-card);
  border: 1px solid var(--border-hairline);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

details[open] {
  border-color: var(--brand-primary);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.08);
}

summary {
  padding: 16px 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  line-height: 1.4;
  user-select: none;
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: "+";
  font-size: 20px;
  font-weight: 600;
  color: var(--text-muted);
  margin-left: 14px;
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

details[open] summary::after {
  content: "−";
  color: var(--brand-primary);
}

.faq-answer {
  padding: 0 20px 20px;
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.65;
}

.faq-answer p + p {
  margin-top: 10px;
}

/* PSEO DIRECTORY & SEARCH BAR */
.pseo-search-panel {
  max-width: 960px;
  margin: 0 auto 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pseo-search-bar {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.pseo-search-icon {
  position: absolute;
  left: 14px;
  color: #64748B;
  pointer-events: none;
  display: flex;
  align-items: center;
}

.pseo-search-input {
  width: 100%;
  padding: 12px 42px 12px 42px;
  background: #FFFFFF;
  border: 1.5px solid #CBD5E1;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-family: inherit;
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  outline: none;
  box-sizing: border-box;
}

.pseo-search-input:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.pseo-search-clear {
  position: absolute;
  right: 12px;
  background: #E2E8F0;
  border: none;
  width: 22px;
  height: 22px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pseo-search-clear:hover {
  background: #CBD5E1;
  color: #0F172A;
}

.pseo-filter-chips {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.chips-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-right: 2px;
}

.filter-chip {
  background: #F1F5F9;
  color: var(--text-secondary);
  border: 1px solid #E2E8F0;
  padding: 4px 11px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.filter-chip:hover {
  background: #E2E8F0;
  color: var(--text-primary);
}

.filter-chip.active {
  background: var(--brand-primary);
  color: #FFFFFF;
  border-color: var(--brand-primary);
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.25);
}

.pseo-results-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--text-muted);
  padding: 0 2px;
}

.pseo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.pseo-link {
  font-size: 12.5px;
  color: var(--brand-primary);
  text-decoration: none;
  padding: 10px 14px;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: var(--radius-sm);
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  line-height: 1.35;
  box-sizing: border-box;
}

.pseo-link:hover {
  background: #FFFFFF;
  border-color: var(--brand-primary);
  box-shadow: 0 3px 8px rgba(37, 99, 235, 0.1);
  transform: translateY(-1px);
}

.pseo-courier {
  font-weight: 600;
  color: var(--text-primary);
}

.pseo-link:hover .pseo-courier {
  color: var(--brand-primary);
}

.pseo-arrow {
  color: #94A3B8;
  font-size: 13px;
  transition: transform 0.15s ease, color 0.15s ease;
  flex-shrink: 0;
}

.pseo-link:hover .pseo-arrow {
  color: var(--brand-primary);
  transform: translateX(3px);
}

.pseo-printer {
  color: var(--text-secondary);
  font-size: 12px;
  text-align: right;
  flex-shrink: 0;
}

.pseo-empty-state {
  text-align: center;
  padding: 36px 20px;
  background: #F8FAFC;
  border: 1px dashed #CBD5E1;
  border-radius: var(--radius-md);
  margin-top: 16px;
}

.pseo-empty-state p {
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 12px;
}

/* FOOTER */
#footer {
  background: #0B1120;
  color: #94A3B8;
  padding: 48px 20px 36px;
  margin-top: auto;
}

.footer-inner {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.footer-directory {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 32px;
}

.footer-col-title {
  color: #F8FAFC;
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer-col-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-col-list a {
  color: #94A3B8;
  font-size: 12.5px;
  text-decoration: none;
  transition: color 0.15s ease;
  line-height: 1.4;
}

.footer-col-list a:hover {
  color: #60A5FA;
  text-decoration: underline;
}

.footer-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.footer-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}

.footer-links a {
  color: #CBD5E1;
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s ease;
}

.footer-links a:hover {
  color: #FFFFFF;
}

.footer-copy {
  font-size: 12px;
}

.footer-disclaimer {
  font-size: 11px;
  color: #64748B;
  max-width: 760px;
  margin: 0 auto;
  line-height: 1.5;
}

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

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

/* MOBILE STICKY ACTION BAR */
#mobileActionBar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface-card);
  border-top: 1px solid var(--border-hairline);
  padding: 10px 16px;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.08);
  z-index: 1000;
  gap: 10px;
}

.btn-mobile {
  flex: 1;
  padding: 10px;
  font-size: 13px;
}

/* RESPONSIVE BREAKPOINTS */
@media (max-width: 1060px) {
  .workspace-grid {
    grid-template-columns: 300px minmax(0, 1fr);
  }

  .panel-right {
    grid-column: span 2;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-items: start;
  }

  .panel-right .output-section {
    grid-column: 1;
  }

  .panel-right #adSlotB {
    grid-column: 2;
    margin: 0 auto;
  }

  .panel-right .btn-print,
  .panel-right .btn-download,
  .panel-right .affiliate-link {
    grid-column: span 2;
  }
}

@media (max-width: 1180px) {
  .trust-pill-sub {
    display: none; /* Hide " • Zero Server Uploads" so it stays compact */
  }
}

@media (max-width: 980px) {
  .nav-links {
    display: none;
  }

  .nav-hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .trust-pill {
    padding: 3px 8px;
    font-size: 10.5px;
  }
}

@media (max-width: 720px) {
  .nav-inner {
    padding: 0 12px;
  }

  .nav-brand {
    gap: 8px;
  }

  .brand-name {
    font-size: 15px;
  }

  .trust-pill,
  .nav-bookmark-pill {
    display: none; /* Hide pills on small mobile to avoid navbar overflow */
  }

  .workspace-grid {
    grid-template-columns: 1fr;
    padding: 0 12px 70px; /* Space for sticky mobile action bar */
  }

  .panel-right {
    grid-column: span 1;
    display: flex;
    flex-direction: column;
  }

  .panel-right .btn-print,
  .panel-right .btn-download {
    display: none; /* Controlled by mobile sticky bar */
  }

  #mobileActionBar {
    display: flex;
  }

  .steps-grid {
    grid-template-columns: 1fr;
  }

  #heroTitle {
    font-size: 21px;
  }

  .ad-slot-leaderboard {
    min-height: 86px;
    height: auto;
  }

  .pseo-search-panel {
    gap: 10px;
  }

  .pseo-grid {
    grid-template-columns: 1fr;
  }
}

