:root {
  /* Modern SaaS Brand & Accent */
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: rgba(79, 70, 229, 0.08);
  --primary-glow: rgba(79, 70, 229, 0.15);
  --secondary: #0ea5e9;

  /* Sophisticated Light Neutrals */
  --bg-color: #f8fafc;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-dim: #94a3b8;

  /* Clean SaaS Card & Surface */
  --card-bg: rgba(255, 255, 255, 0.88);
  --card-border: rgba(226, 232, 240, 0.85);
  --card-shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.04), 0 16px 32px -8px rgba(15, 23, 42, 0.06), 0 0 0 1px rgba(226, 232, 240, 0.4);

  /* Inner Preview Panel */
  --preview-bg: rgba(248, 250, 252, 0.7);
  --preview-border: rgba(226, 232, 240, 0.9);

  /* Inputs & Form Elements */
  --input-bg: #ffffff;
  --input-border: #cbd5e1;
  --input-border-hover: #94a3b8;
  --input-focus: #4f46e5;
  --input-focus-ring: rgba(79, 70, 229, 0.15);

  /* Radii & Typography */
  --radius-sm: 0.375rem;
  --radius-md: 0.625rem;
  --radius-lg: 0.875rem;
  --radius-xl: 1.25rem;
  --font-family: 'Outfit', system-ui, -apple-system, sans-serif;
}

[data-theme="dark"] {
  /* Modern SaaS Dark Brand */
  --primary: #6366f1;
  --primary-hover: #818cf8;
  --primary-light: rgba(99, 102, 241, 0.12);
  --primary-glow: rgba(99, 102, 241, 0.25);
  --secondary: #38bdf8;

  /* Sophisticated Dark Neutrals */
  --bg-color: #0b0f19;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  /* Clean SaaS Dark Card & Surface */
  --card-bg: rgba(17, 24, 39, 0.82);
  --card-border: rgba(255, 255, 255, 0.09);
  --card-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.25), 0 20px 35px -10px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);

  /* Inner Preview Panel */
  --preview-bg: rgba(15, 23, 42, 0.65);
  --preview-border: rgba(255, 255, 255, 0.07);

  /* Inputs & Form Elements */
  --input-bg: rgba(15, 23, 42, 0.85);
  --input-border: #334155;
  --input-border-hover: #475569;
  --input-focus: #818cf8;
  --input-focus-ring: rgba(99, 102, 241, 0.25);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  transition: background-color 0.25s ease, color 0.25s ease;
}

/* =========================================================
   Modern SaaS Background (Simple & Unique Dot Matrix + Vignette)
   ========================================================= */
.saas-background {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background-color: var(--bg-color);
}

.saas-grid {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 1px 1px, rgba(100, 116, 139, 0.22) 1px, transparent 0);
  background-size: 24px 24px;
  mask-image: radial-gradient(ellipse 80% 65% at 50% 20%, #000 40%, transparent 95%);
  -webkit-mask-image: radial-gradient(ellipse 80% 65% at 50% 20%, #000 40%, transparent 95%);
}

.saas-glow {
  position: absolute;
  top: -140px;
  left: 50%;
  transform: translateX(-50%);
  width: min(840px, 100vw);
  height: 440px;
  background: radial-gradient(ellipse at center, rgba(79, 70, 229, 0.08) 0%, rgba(79, 70, 229, 0) 70%);
  pointer-events: none;
}

[data-theme="dark"] .saas-grid {
  background-image: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.08) 1px, transparent 0);
  mask-image: radial-gradient(ellipse 80% 65% at 50% 20%, #000 45%, transparent 95%);
  -webkit-mask-image: radial-gradient(ellipse 80% 65% at 50% 20%, #000 45%, transparent 95%);
}

[data-theme="dark"] .saas-glow {
  background: radial-gradient(ellipse at center, rgba(99, 102, 241, 0.15) 0%, rgba(99, 102, 241, 0) 70%);
}

/* Fallback for legacy class if present */
.background-blobs {
  display: none !important;
}

/* =========================================================
   Navbar
   ========================================================= */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  max-width: 1120px;
  margin: 0 auto;
  width: 100%;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--text-main);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.logo svg {
  color: var(--primary);
}

.icon-btn {
  background: var(--input-bg);
  border: 1px solid var(--card-border);
  color: var(--text-main);
  cursor: pointer;
  padding: 0.5rem;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
  display: grid;
  place-items: center;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.icon-btn:hover {
  border-color: var(--input-border-hover);
  color: var(--primary);
  transform: translateY(-1px);
}

.sun-icon {
  display: none;
}

.moon-icon {
  display: block;
}

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

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

/* =========================================================
   Navbar Action Controls & Buy Me a Coffee Button
   ========================================================= */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.bmc-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: #FFDD00;
  color: #000000;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0 0.875rem;
  height: 38px;
  border-radius: var(--radius-md);
  text-decoration: none;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.bmc-nav-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(255, 221, 0, 0.4);
  color: #000000;
}

.bmc-cup-icon {
  flex-shrink: 0;
}

[data-theme="dark"] .bmc-nav-btn {
  background: #FFDD00;
  color: #000000;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(255, 221, 0, 0.25);
}

[data-theme="dark"] .bmc-nav-btn:hover {
  box-shadow: 0 4px 16px rgba(255, 221, 0, 0.45);
}

/* =========================================================
   Main Content & Hero
   ========================================================= */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem 1rem 3rem;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
}

.hero {
  text-align: center;
  margin-bottom: 2.25rem;
  max-width: 620px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  background: var(--primary-light);
  border: 1px solid rgba(79, 70, 229, 0.15);
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--primary);
  margin-bottom: 1rem;
  letter-spacing: 0.01em;
}

[data-theme="dark"] .hero-badge {
  border-color: rgba(99, 102, 241, 0.25);
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--primary);
  box-shadow: 0 0 6px var(--primary);
}

.hero h1 {
  font-size: clamp(2.125rem, 4.5vw, 3.25rem);
  line-height: 1.15;
  margin-bottom: 0.875rem;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.accent-text,
.gradient-text {
  color: var(--primary);
  background: none;
  -webkit-text-fill-color: initial;
}

.hero p {
  color: var(--text-muted);
  font-size: 1.0625rem;
  line-height: 1.55;
  max-width: 520px;
}

/* =========================================================
   Glass Card (SaaS Elevated Container)
   ========================================================= */
.glass-card {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.88fr);
  gap: 2.25rem;
  align-items: start;
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--card-shadow);
  padding: 2.25rem;
  width: 100%;
  max-width: 1020px;
}

/* =========================================================
   Controls Panel
   ========================================================= */
.controls-panel {
  display: flex;
  flex-direction: column;
  gap: 1.375rem;
  min-width: 0; /* Prevents flex children from causing overflow */
}

/* Tabs */
.tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}

.tab-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 0.5rem;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  user-select: none;
  width: 100%;
}

.tab-btn:hover {
  color: var(--text-main);
  background: rgba(100, 116, 139, 0.08);
}

.tab-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 6px var(--primary-glow);
}

.tab-btn.active svg {
  stroke: #ffffff;
}

/* Tab Content */
.tab-content {
  display: none !important;
  animation: fadeIn 0.25s ease;
}

.tab-content.active {
  display: block !important;
}

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

/* Form Grid */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.full-width {
  grid-column: span 2;
}

.checkbox-group {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  flex-direction: row;
  cursor: pointer;
  padding-top: 0.25rem;
}

.checkbox-group input[type="checkbox"] {
  width: 1.125rem;
  height: 1.125rem;
  accent-color: var(--primary);
  cursor: pointer;
  padding: 0;
}

.checkbox-group label {
  cursor: pointer;
  font-size: 0.9375rem;
  color: var(--text-main);
  font-weight: 400;
}

/* Input Fields & Groups */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.input-group label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

.input-wrapper,
.select-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.input-icon,
.select-arrow {
  position: absolute;
  color: var(--text-dim);
  pointer-events: none;
  transition: color 0.15s ease;
}

.input-icon {
  left: 0.875rem;
}

.select-arrow {
  right: 0.875rem;
}

input:focus ~ .input-icon,
select:focus ~ .select-arrow {
  color: var(--primary);
}

input,
select,
textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.9375rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
  outline: none;
  min-height: 44px; /* Accessible touch target */
}

input {
  padding: 0.75rem 1rem;
}

.input-wrapper input {
  padding-left: 2.75rem; /* Room for icon */
}

select {
  padding-left: 0.875rem;
  padding-right: 2.5rem;
  appearance: none;
  cursor: pointer;
}

textarea {
  resize: vertical;
  min-height: 80px;
  line-height: 1.5;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-dim);
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--input-border-hover);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--input-focus);
  box-shadow: 0 0 0 3px var(--input-focus-ring);
}

.options-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

.color-picker-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.625rem;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-md);
  padding: 0.35rem 0.65rem;
  min-height: 44px;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.color-picker-wrapper:hover {
  border-color: var(--input-border-hover);
}

.color-picker-wrapper:focus-within {
  border-color: var(--input-focus);
  box-shadow: 0 0 0 3px var(--input-focus-ring);
}

.color-picker-wrapper input[type="color"] {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  background: transparent;
  flex-shrink: 0;
}

.color-picker-wrapper input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

.color-picker-wrapper input[type="color"]::-webkit-color-swatch {
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}

.color-picker-wrapper input[type="color"]::-moz-color-swatch {
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 50%;
}

.color-hex-label {
  font-size: 0.875rem;
  font-weight: 500;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  color: var(--text-main);
  letter-spacing: 0.02em;
  user-select: none;
}

/* =========================================================
   Curated Color Palettes Presets
   ========================================================= */
.palette-input-group {
  grid-column: 1 / -1;
}

.palette-presets {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
}

.palette-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.45rem 0.6rem;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.palette-chip:hover {
  border-color: var(--primary);
  background: var(--bg-hover);
  transform: translateY(-1px);
}

.palette-chip.active {
  border-color: var(--primary);
  background: rgba(79, 70, 229, 0.08);
  color: var(--primary);
  box-shadow: 0 0 0 2px var(--input-focus-ring);
  font-weight: 600;
}

.palette-swatch {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}

@media (max-width: 640px) {
  .palette-presets {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.375rem;
  }
}

/* =========================================================
   Center Logo / Icon Upload Dropzone
   ========================================================= */
.logo-input-group {
  grid-column: 1 / -1;
}

.logo-label-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.logo-rec-badge {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--primary);
  background: rgba(79, 70, 229, 0.08);
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  letter-spacing: 0.02em;
}

[data-theme="dark"] .logo-rec-badge {
  color: var(--primary);
  background: rgba(129, 140, 248, 0.12);
}

.logo-dropzone {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 48px;
  background: var(--input-bg);
  border: 1.5px dashed var(--input-border);
  border-radius: var(--radius-md);
  padding: 0.45rem 0.85rem;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
  user-select: none;
}

.logo-dropzone:hover {
  border-color: var(--input-border-hover);
  background: rgba(255, 255, 255, 0.95);
}

[data-theme="dark"] .logo-dropzone:hover {
  background: rgba(30, 41, 59, 0.7);
}

.logo-dropzone:focus-visible {
  border-color: var(--input-focus);
  box-shadow: 0 0 0 3px var(--input-focus-ring);
}

.logo-dropzone.drag-over {
  border-color: var(--primary);
  border-style: solid;
  background: rgba(79, 70, 229, 0.07);
  box-shadow: 0 0 0 3px var(--input-focus-ring);
}

.logo-file-input {
  display: none;
}

.logo-dropzone-empty {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
}

.logo-dropzone-icon {
  color: var(--primary);
  flex-shrink: 0;
}

.logo-dropzone-text {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.logo-dropzone-text strong {
  color: var(--text-main);
  font-weight: 600;
}

.logo-dropzone-filled {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
}

.logo-thumb {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: 4px;
  background: #ffffff;
  border: 1px solid var(--border-subtle);
  padding: 2px;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.logo-meta {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.logo-name {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.logo-status {
  font-size: 0.6875rem;
  color: var(--success);
  font-weight: 500;
}

.logo-remove-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.logo-remove-btn:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

.logo-remove-btn:focus-visible {
  outline: 2px solid #ef4444;
  outline-offset: 1px;
}

/* Quick Logo Presets List */
.logo-presets-container {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

.logo-presets-title {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
}

.logo-presets-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.logo-preset-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.55rem;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.logo-preset-btn svg {
  flex-shrink: 0;
}

.logo-preset-btn:hover {
  border-color: var(--primary);
  background: var(--bg-hover);
  transform: translateY(-1px);
}

.logo-preset-btn.active {
  border-color: var(--primary);
  background: rgba(79, 70, 229, 0.08);
  color: var(--primary);
  box-shadow: 0 0 0 2px var(--input-focus-ring);
  font-weight: 600;
}

.hidden {
  display: none !important;
}

/* =========================================================
   Actions & Buttons
   ========================================================= */
.actions {
  display: grid;
  grid-template-columns: 1.25fr 1fr 1fr auto;
  gap: 0.625rem;
  margin-top: 0.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9375rem;
  cursor: pointer;
  transition: all 0.15s ease;
  border: 1px solid transparent;
  font-family: inherit;
  white-space: nowrap;
  min-height: 44px; /* Accessible touch target */
}

.btn-primary {
  grid-column: 1 / -1;
  width: 100%;
  background: var(--primary);
  color: #ffffff;
  padding: 0.875rem 1.25rem;
  box-shadow: 0 2px 8px var(--primary-glow);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px var(--primary-glow);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  color: var(--text-main);
  min-width: 0;
}

.btn-secondary:hover:not(:disabled) {
  border-color: var(--input-border-hover);
  background: rgba(100, 116, 139, 0.05);
  transform: translateY(-1px);
}

.btn-secondary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

/* =========================================================
   Download Cluster & Format Selection Dropdown
   ========================================================= */
.download-cluster {
  grid-column: 1;
  display: inline-flex;
  align-items: stretch;
  width: 100%;
  min-width: 0;
  border-radius: var(--radius-md);
}

.download-cluster .download-btn {
  flex: 1;
  min-width: 0;
  padding: 0.75rem 0.85rem;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-right: none;
  overflow: hidden;
}

.download-cluster .download-btn span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.format-select-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-left: 1px solid rgba(0, 0, 0, 0.1);
  border-top-right-radius: var(--radius-md);
  border-bottom-right-radius: var(--radius-md);
  transition: all 0.15s ease;
}

[data-theme="dark"] .format-select-wrapper {
  border-left-color: rgba(255, 255, 255, 0.12);
}

.format-select-wrapper:hover {
  border-color: var(--input-border-hover);
  background: rgba(100, 116, 139, 0.05);
}

.format-select-wrapper:focus-within {
  border-color: var(--input-focus);
  box-shadow: 0 0 0 3px var(--input-focus-ring);
  z-index: 1;
}

.format-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background: transparent;
  border: none;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0 1.5rem 0 0.65rem;
  height: 100%;
  min-height: 44px;
  cursor: pointer;
  outline: none;
}

.format-select option {
  background: var(--card-bg);
  color: var(--text-main);
  font-weight: 600;
}

.format-chevron {
  position: absolute;
  right: 0.45rem;
  pointer-events: none;
  color: var(--text-muted);
  transition: transform 0.15s ease;
}

.format-select-wrapper:hover .format-chevron {
  color: var(--text-main);
}

#copyBtn {
  grid-column: 2;
  width: 100%;
  min-width: 0;
}

#printBtn {
  grid-column: 3;
  width: 100%;
  min-width: 0;
}

.btn-ghost {
  grid-column: 4;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  color: var(--text-muted);
  padding: 0.75rem;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
}

.btn.btn-copied {
  border-color: #10b981;
  color: #059669;
  background: rgba(16, 185, 129, 0.08);
}

[data-theme="dark"] .btn.btn-copied {
  border-color: #34d399;
  color: #34d399;
  background: rgba(52, 211, 153, 0.12);
}

.btn-ghost:hover {
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.05);
}

/* Status Bar */
.statusbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  text-align: center;
  padding-top: 0.25rem;
}

.status-indicator {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #22c55e;
  flex-shrink: 0;
}

/* =========================================================
   Preview Panel (Zero Overflow, Crisp Presentation)
   ========================================================= */
.preview-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--preview-bg);
  border: 1px dashed var(--preview-border);
  border-radius: var(--radius-lg);
  min-height: 330px;
  padding: 1.75rem 1.25rem;
  position: relative;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.preview-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--preview-border);
}

.preview-title {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.preview-badge {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  background: rgba(100, 116, 139, 0.1);
  color: var(--text-muted);
}

.preview-badge.ready {
  background: rgba(34, 197, 94, 0.12);
  color: #16a34a;
}

[data-theme="dark"] .preview-badge.ready {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
}

.qr-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.qr-box {
  background: #ffffff;
  padding: 1rem;
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
  max-width: 100%;
  box-sizing: border-box;
  display: none;
  overflow: hidden;
}

.qr-box:not(:empty) {
  display: flex;
  align-items: center;
  justify-content: center;
  animation: popIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* CRITICAL: Ensure generated QR canvas or img NEVER overflows container */
#qrcode canvas,
#qrcode img {
  max-width: 100% !important;
  height: auto !important;
  object-fit: contain;
  display: block;
  margin: 0 auto;
  border-radius: 4px;
}

.qr-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.875rem;
  color: var(--text-muted);
  text-align: center;
  padding: 1.5rem 1rem;
}

.qr-placeholder p {
  font-size: 0.875rem;
  color: var(--text-dim);
}

.qr-box:not(:empty) + .qr-placeholder {
  display: none;
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: scale(0.88);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* =========================================================
   Preview Loading Overlay & Spinner
   ========================================================= */
.preview-loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.875rem;
  z-index: 10;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.2s ease;
  border-radius: inherit;
}

[data-theme="dark"] .preview-loading-overlay {
  background: rgba(15, 23, 42, 0.85);
}

.preview-loading-overlay.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.spinner {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2.5px solid rgba(79, 70, 229, 0.16);
  border-top-color: var(--primary);
  animation: spin 0.75s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

[data-theme="dark"] .spinner {
  border: 2.5px solid rgba(129, 140, 248, 0.18);
  border-top-color: var(--primary);
}

.loading-text {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

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

/* =========================================================
   OpenDevv Support Card (Buy Me a Coffee & Payment QR)
   ========================================================= */
.support-card {
  width: 100%;
  max-width: 760px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  padding: 1.75rem 2rem;
  text-align: left;
  margin-bottom: 2rem;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.support-card:hover {
  border-color: rgba(79, 70, 229, 0.25);
  box-shadow: var(--shadow-md);
}

[data-theme="dark"] .support-card:hover {
  border-color: rgba(129, 140, 248, 0.3);
}

.support-card-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2.25rem;
}

.support-text-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

.support-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: #e11d48;
  background: rgba(225, 29, 72, 0.08);
  border-radius: var(--radius-full);
  padding: 0.25rem 0.75rem;
  width: fit-content;
  letter-spacing: 0.02em;
}

[data-theme="dark"] .support-pill {
  color: #fb7185;
  background: rgba(251, 113, 133, 0.12);
}

.support-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
  letter-spacing: -0.01em;
}

.support-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0;
}

.support-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.375rem;
}

.bmc-main-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #FFDD00;
  color: #000000;
  font-weight: 700;
  font-size: 0.9375rem;
  padding: 0.7rem 1.35rem;
  border-radius: var(--radius-lg);
  text-decoration: none;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  width: fit-content;
}

.bmc-main-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 221, 0, 0.45);
  color: #000000;
}

.support-qr-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.support-qr-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  text-align: center;
}

.support-qr-frame {
  background: #ffffff;
  padding: 0.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 140px;
  height: 140px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.support-qr-frame:hover {
  transform: scale(1.03);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.support-qr-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  border-radius: var(--radius-sm);
}

.support-qr-caption {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

@media (max-width: 640px) {
  .support-card {
    padding: 1.5rem 1.25rem;
    margin-bottom: 1.5rem;
  }

  .support-card-body {
    flex-direction: column;
    text-align: center;
    gap: 1.5rem;
  }

  .support-text-col {
    align-items: center;
  }

  .support-actions {
    justify-content: center;
    width: 100%;
  }

  .bmc-main-btn {
    width: 100%;
    justify-content: center;
  }
}

/* =========================================================
   Footer
   ========================================================= */
.footer {
  padding: 2.5rem 1.5rem 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  align-items: center;
  margin-top: auto;
}

.footer a {
  color: var(--text-main);
  text-decoration: none;
  transition: color 0.15s;
}

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

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

.footer-links a {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

/* =========================================================
   Tablet Responsive Architecture (641px - 959px)
   ========================================================= */
@media (max-width: 959px) {
  .glass-card {
    grid-template-columns: 1fr;
    gap: 1.875rem;
    padding: 1.75rem;
    max-width: 640px;
  }

  .preview-panel {
    order: 2; /* Naturally stacks below controls */
    min-height: 280px;
    padding: 1.5rem 1.25rem;
  }

  .hero h1 {
    font-size: 2.5rem;
  }
}

/* =========================================================
   Mobile Responsive Architecture (<= 640px)
   ========================================================= */
@media (max-width: 640px) {
  .main-content {
    padding: 1rem 0.75rem 2rem;
  }

  .navbar {
    padding: 1rem 0.875rem;
  }

  .hero {
    margin-bottom: 1.75rem;
  }

  .hero-badge {
    font-size: 0.75rem;
    padding: 0.3rem 0.75rem;
  }

  .hero h1 {
    font-size: 1.875rem;
    line-height: 1.2;
    margin-bottom: 0.625rem;
  }

  .hero p {
    font-size: 0.9375rem;
  }

  /* Card padding and border radius on small screens */
  .glass-card {
    padding: 1.25rem 1rem;
    border-radius: 1rem;
    gap: 1.375rem;
  }

  /* Form grids become single column */
  .form-grid {
    grid-template-columns: 1fr;
    gap: 0.875rem;
  }

  .full-width {
    grid-column: span 1;
  }

  /* Options row remains an organized 2x2 grid on standard mobile */
  .options-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  /* Actions reorganization on mobile: Primary button full width, download cluster, copy, print, & clear */
  .actions {
    display: grid;
    grid-template-columns: 1fr 1fr auto;
    gap: 0.625rem;
  }

  .btn-primary {
    grid-column: 1 / -1;
    width: 100%;
    padding: 0.875rem 1.25rem;
  }

  .download-cluster {
    grid-column: 1 / -1;
    width: 100%;
  }

  .download-cluster .download-btn {
    padding: 0.875rem 0.5rem;
    font-size: 0.8125rem;
  }

  .download-cluster .format-select {
    padding: 0 1.25rem 0 0.45rem;
    font-size: 0.75rem;
  }

  #copyBtn {
    grid-column: 1;
    width: 100%;
    padding: 0.875rem 0.75rem;
    font-size: 0.875rem;
  }

  #printBtn {
    grid-column: 2;
    width: 100%;
    padding: 0.875rem 0.75rem;
    font-size: 0.875rem;
  }

  .btn-ghost {
    grid-column: 3;
    width: 44px;
    height: 44px;
  }

  .tabs {
    grid-template-columns: repeat(4, 1fr);
    gap: 0.3rem;
    margin-bottom: 0.5rem;
  }

  .tab-btn {
    padding: 0.5rem 0.35rem;
    font-size: 0.8125rem;
    gap: 0.3rem;
  }

  /* Preview panel adjustments on mobile */
  .preview-panel {
    min-height: 240px;
    padding: 1.25rem 0.75rem;
    border-radius: var(--radius-md);
  }

  .qr-box {
    padding: 0.75rem;
  }

  .footer-links {
    gap: 1rem;
  }

  /* SEO content on mobile */
  .seo-content {
    margin-top: 2.75rem;
    gap: 3rem;
  }

  .section-title {
    font-size: 1.5rem;
  }

  .section-sub {
    font-size: 0.9375rem;
  }

  .seo-card {
    padding: 1.25rem 1.125rem;
  }

  .step-card {
    padding: 1.5rem 1.25rem;
  }

  .faq-summary {
    padding: 1rem 1.25rem;
    font-size: 0.95rem;
  }

  .faq-answer {
    padding: 0 1.25rem 1.125rem;
    font-size: 0.875rem;
  }
}

/* Mobile adjustments (<= 480px) */
@media (max-width: 480px) {
  .tabs {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.35rem;
  }

  .tab-btn {
    padding: 0.55rem 0.5rem;
    font-size: 0.8125rem;
  }
}

/* Extra small mobile adjustments (<= 380px) */
@media (max-width: 380px) {
  .glass-card {
    padding: 1rem 0.75rem;
  }

  .btn {
    font-size: 0.875rem;
  }

  .tab-btn {
    padding: 0.45rem 0.65rem;
    font-size: 0.75rem;
  }

  .options-row {
    grid-template-columns: 1fr;
    gap: 0.625rem;
  }

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

  .btn-primary,
  .download-cluster,
  #copyBtn,
  #printBtn,
  .btn-ghost {
    grid-column: 1 / -1;
    width: 100%;
  }
}

/* =========================================================
   SEO & Informational Architecture Sections
   ========================================================= */
.seo-content {
  margin-top: 4rem;
  display: flex;
  flex-direction: column;
  gap: 4.5rem;
  width: 100%;
}

.seo-section {
  width: 100%;
}

.section-header {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 2.25rem;
}

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.25rem 0.85rem;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  letter-spacing: 0.02em;
}

.section-title {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.25;
  margin-bottom: 0.75rem;
}

.section-sub {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Feature Benefits Grid */
.seo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.25rem;
}

.seo-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  padding: 1.75rem 1.5rem;
  box-shadow: var(--card-shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.seo-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
}

.seo-card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  background: var(--primary-light);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.seo-card h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.35;
}

.seo-card p {
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* 3-Step Process */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

.step-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  padding: 2rem 1.75rem;
  box-shadow: var(--card-shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.9375rem;
  margin-bottom: 0.5rem;
}

.step-card h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-main);
}

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

/* Use Cases Grid */
.usecases-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.usecase-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  padding: 1.85rem 1.6rem;
  box-shadow: var(--card-shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.usecase-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
}

.usecase-badge {
  align-self: flex-start;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--primary);
  background: var(--primary-light);
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
}

.usecase-card h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-main);
  line-height: 1.35;
}

.usecase-card p {
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.6;
  flex-grow: 1;
}

.usecase-btn {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-light);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 0.5rem;
}

.usecase-btn:hover {
  background: var(--primary);
  color: #ffffff;
  transform: translateX(2px);
}

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

.faq-item {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.faq-item[open] {
  border-color: var(--primary);
}

.faq-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  user-select: none;
  list-style: none;
}

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

.faq-chevron {
  color: var(--text-muted);
  transition: transform 0.25s ease, color 0.2s ease;
  flex-shrink: 0;
  margin-left: 1rem;
}

.faq-item[open] .faq-chevron {
  transform: rotate(180deg);
  color: var(--primary);
}

.faq-answer {
  padding: 0 1.5rem 1.35rem;
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.65;
}

/* =========================================================
   SEO Article, Breadcrumbs, Hub Navigation & Footer Links
   ========================================================= */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.breadcrumbs a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s ease;
}

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

.breadcrumbs span {
  color: var(--text-dim);
}

.breadcrumbs .current {
  color: var(--text-main);
  font-weight: 500;
}

.nav-links-menu {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links-menu a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  transition: color 0.15s ease;
}

.nav-links-menu a:hover,
.nav-links-menu a.active {
  color: var(--primary);
}

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

.article-content {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  box-shadow: var(--card-shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  margin-top: 2rem;
  line-height: 1.7;
  color: var(--text-muted);
}

.article-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.article-content h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-main);
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
}

.article-content p {
  margin-bottom: 1.15rem;
  font-size: 0.95rem;
}

.article-content ul,
.article-content ol {
  margin: 0 0 1.25rem 1.5rem;
  padding: 0;
}

.article-content li {
  margin-bottom: 0.4rem;
}

.article-content code {
  background: var(--input-bg);
  padding: 0.15rem 0.4rem;
  border-radius: var(--radius-sm);
  font-size: 0.85em;
  border: 1px solid var(--border-subtle);
}

.seo-table-container {
  overflow-x: auto;
  margin: 1.5rem 0;
}

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

.seo-table th,
.seo-table td {
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-subtle);
}

.seo-table th {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

.seo-table tr:hover {
  background: var(--bg-hover);
}

.hub-nav-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-subtle);
}

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

.hub-link-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
  text-decoration: none;
  transition: all 0.2s ease;
}

.hub-link-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.hub-link-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.hub-link-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

/* =========================================================
   Print Styles (Exclusive Centered QR Code Printout)
   ========================================================= */
@media print {
  @page {
    margin: 0;
    size: auto;
  }

  /* Pure clean paper white background */
  html, body {
    background: #ffffff !important;
    color: #000000 !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 100% !important;
    overflow: hidden !important;
    box-shadow: none !important;
  }

  /* Completely eliminate all UI chrome, controls, background decorations, and headers */
  .bg-dots,
  .bg-gradient-glow,
  .navbar,
  .hero,
  .controls-panel,
  .footer,
  .support-card,
  .bmc-nav-btn,
  .preview-header,
  .preview-loading-overlay,
  .qr-placeholder,
  .print-meta,
  .seo-content {
    display: none !important;
  }

  /* Collapse parent wrappers so they don't add borders, shadows, or offsets */
  .main-content,
  .glass-card,
  .preview-panel,
  .qr-area {
    display: contents !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  /* Center the QR code box directly in the middle of the printed page */
  .qr-box {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: #ffffff !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    z-index: 999999 !important;
  }

  /* High fidelity print scaling for strictly ONE QR code.
     Note: QRCode.js generates BOTH a <canvas> and an <img> fallback in the DOM.
     We explicitly render only the canvas and hide the duplicate image. */
  .qr-box canvas {
    display: block !important;
    margin: auto !important;
    max-width: 70vmin !important;
    max-height: 70vmin !important;
    width: auto !important;
    height: auto !important;
    box-shadow: none !important;
    border: none !important;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  /* Hide the duplicate fallback <img> element generated by QRCode.js */
  .qr-box img {
    display: none !important;
  }

  /* Fallback: if for any reason no canvas exists, display the img */
  .qr-box:not(:has(canvas)) img,
  .qr-box > img:only-child {
    display: block !important;
    margin: auto !important;
    max-width: 70vmin !important;
    max-height: 70vmin !important;
    width: auto !important;
    height: auto !important;
    box-shadow: none !important;
    border: none !important;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: pixelated;
    image-rendering: crisp-edges;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }
}
