:root {
  --bg: #f8fafc;
  --card: #ffffff;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --primary: #4338ca;
  --primary-hover: #3730a3;
  --accent: #6366f1;
  --soft-accent: #eef2ff;
  --soft-accent-border: #c7d2fe;
  --text: #0f172a;
  --muted: #475569;
  --subtle: #64748b;
  --success-bg: #ecfdf5;
  --success-border: #a7f3d0;
  --success-text: #047857;
  --warn-bg: #fffbeb;
  --warn-border: #fde68a;
  --warn-text: #b45309;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 8px 24px -4px rgba(15, 23, 42, 0.06), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Inter, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

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

a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

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

.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Top Portal Header */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: saturate(180%) blur(8px);
  background-color: rgba(255, 255, 255, 0.94);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 62px;
  gap: 16px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.15rem;
  color: var(--text);
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand-link:hover {
  color: var(--primary);
  text-decoration: none;
}

.brand-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(67, 56, 202, 0.25);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 14px;
}

.header-hub-link {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
}

.header-hub-link:hover {
  color: var(--primary);
  text-decoration: none;
}

.all-tools-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--soft-accent);
  border: 1px solid var(--soft-accent-border);
  color: var(--primary);
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  transition: all 0.15s ease;
}

.all-tools-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  text-decoration: none;
}

/* Breadcrumb Bar */
.breadcrumb-bar {
  padding: 12px 0 4px;
  font-size: 0.85rem;
  color: var(--muted);
}

.breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.breadcrumb-list a {
  color: var(--muted);
  font-weight: 500;
}

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

.breadcrumb-sep {
  color: #94a3b8;
  user-select: none;
}

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

/* Hero Section */
.hero {
  padding: 18px 0 22px;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.trust-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--soft-accent);
  color: var(--primary);
  border: 1px solid var(--soft-accent-border);
}

.trust-pill.privacy {
  background: var(--success-bg);
  color: var(--success-text);
  border-color: var(--success-border);
}

.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(1.65rem, 3.2vw, 2.35rem);
  line-height: 1.2;
  letter-spacing: -0.025em;
  color: var(--text);
}

.hero-lead {
  margin: 0;
  max-width: 820px;
  font-size: 1.04rem;
  color: var(--muted);
  line-height: 1.55;
}

/* Optional Ad Slots */
.ad-slot {
  display: none;
  margin: 18px 0;
  padding: 14px;
  background: var(--card);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  text-align: center;
  color: var(--subtle);
  font-size: 0.8rem;
}

.ad-slot.is-visible {
  display: block;
}

/* Main Interactive Tool Card */
.tool-workspace {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 24px;
  margin-bottom: 28px;
}

/* Dropzone & Sample Bar */
.upload-bar {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 16px;
  margin-bottom: 22px;
}

.dropzone {
  border: 2px dashed var(--soft-accent-border);
  background: linear-gradient(180deg, #fafbff 0%, var(--soft-accent) 100%);
  border-radius: var(--radius-md);
  padding: 20px 18px;
  text-align: center;
  cursor: pointer;
  transition: all 0.18s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 124px;
  position: relative;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--primary);
  background: #e0e7ff;
  transform: translateY(-1px);
}

.dropzone:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.dropzone-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--card);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  box-shadow: var(--shadow-sm);
}

.dropzone-title {
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--text);
  margin-bottom: 3px;
}

.dropzone-sub {
  font-size: 0.82rem;
  color: var(--muted);
}

.file-input-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.sample-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
}

.sample-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sample-box-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.sample-active-name {
  font-size: 0.78rem;
  color: var(--primary);
  font-weight: 600;
  font-family: var(--font-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 190px;
}

.btn-sample-primary {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--soft-accent-border);
  background: var(--card);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: var(--shadow-sm);
}

.btn-sample-primary:hover {
  background: var(--soft-accent);
  border-color: var(--primary);
}

.sample-variants {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sample-chip {
  flex: 1 1 auto;
  padding: 5px 9px;
  font-size: 0.76rem;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
}

.sample-chip:hover {
  border-color: var(--accent);
  color: var(--primary);
}

.sample-chip.active {
  background: var(--soft-accent);
  border-color: var(--accent);
  color: var(--primary);
}

/* Controls Grid */
.controls-panel {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-bottom: 22px;
}

.controls-top-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.mode-tabs {
  display: inline-flex;
  background: #e2e8f0;
  padding: 4px;
  border-radius: 10px;
  gap: 4px;
}

.mode-tab {
  border: none;
  background: transparent;
  padding: 7px 14px;
  border-radius: 7px;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

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

.format-selector {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.control-inline-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
}

.format-pills {
  display: inline-flex;
  gap: 6px;
}

.format-pill {
  padding: 7px 13px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--card);
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.format-pill:hover {
  border-color: var(--accent);
  color: var(--primary);
}

.format-pill.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

/* Target KB Mode Controls */
.mode-pane {
  display: none;
}

.mode-pane.active {
  display: block;
}

.presets-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.preset-btn {
  padding: 8px 13px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--card);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.preset-btn:hover {
  border-color: var(--accent);
  color: var(--primary);
  background: var(--soft-accent);
}

.preset-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(67, 56, 202, 0.24);
}

.custom-kb-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.custom-kb-label {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--muted);
}

.input-with-unit {
  display: inline-flex;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input-with-unit:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.16);
}

.input-with-unit input {
  border: none;
  padding: 7px 10px;
  width: 86px;
  font-family: var(--font-mono);
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
  outline: none;
  background: transparent;
}

.input-unit-badge {
  padding: 7px 10px;
  background: #f1f5f9;
  border-left: 1px solid var(--border);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
}

/* Manual Quality Slider Mode */
.quality-slider-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.quality-slider-wrap {
  flex: 1 1 260px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.quality-slider-wrap input[type="range"] {
  width: 100%;
  accent-color: var(--primary);
  cursor: pointer;
}

.quality-scale-hints {
  display: flex;
  justify-content: space-between;
  font-size: 0.74rem;
  color: var(--subtle);
}

/* Options Bottom Row */
.controls-options-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}

.checkbox-label input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}

.secondary-options {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.mini-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
}

.mini-field select,
.mini-field input {
  padding: 5px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: var(--card);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}

.mini-field input {
  width: 82px;
  font-family: var(--font-mono);
}

/* Metrics & Status Verification Banner */
.results-banner {
  background: linear-gradient(135deg, #f8fafc 0%, var(--soft-accent) 100%);
  border: 1px solid var(--soft-accent-border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.metrics-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.metric-block {
  display: flex;
  flex-direction: column;
}

.metric-caption {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
  color: var(--muted);
}

.metric-value {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.25;
}

.metric-value.compressed {
  color: var(--primary);
}

.metric-sub {
  font-size: 0.78rem;
  color: var(--muted);
  font-family: var(--font-mono);
}

.metric-arrow {
  font-size: 1.35rem;
  color: var(--accent);
  font-weight: 700;
}

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

.saved-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--primary);
  color: #ffffff;
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 800;
  background: var(--success-bg);
  color: var(--success-text);
  border: 1px solid var(--success-border);
}

.status-pill.warn {
  background: var(--warn-bg);
  color: var(--warn-text);
  border-color: var(--warn-border);
}

.engine-telemetry {
  width: 100%;
  padding-top: 10px;
  border-top: 1px dashed var(--soft-accent-border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--muted);
  font-family: var(--font-mono);
}

.zoom-toggle-btn {
  border: 1px solid var(--border-strong);
  background: var(--card);
  color: var(--text);
  border-radius: 6px;
  padding: 3px 10px;
  font-family: var(--font-sans);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
}

.zoom-toggle-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* Side-by-Side Visual Preview */
.preview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.preview-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.preview-card.is-output {
  border-color: var(--soft-accent-border);
}

.preview-card-header {
  padding: 10px 14px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.preview-card-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
}

.preview-card-tag {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  background: #f1f5f9;
  color: var(--muted);
}

.preview-card.is-output .preview-card-tag {
  background: var(--soft-accent);
  color: var(--primary);
}

.preview-stage {
  height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  overflow: auto;
  /* Subtle checkerboard pattern for transparency inspection */
  background-color: #f1f5f9;
  background-image:
    linear-gradient(45deg, #e2e8f0 25%, transparent 25%),
    linear-gradient(-45deg, #e2e8f0 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e2e8f0 75%),
    linear-gradient(-45deg, transparent 75%, #e2e8f0 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0;
  position: relative;
}

.preview-stage img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.12);
  background: #ffffff;
}

.preview-stage.zoom-actual {
  align-items: flex-start;
  justify-content: flex-start;
}

.preview-stage.zoom-actual img {
  max-width: none;
  max-height: none;
}

.preview-card-footer {
  padding: 9px 14px;
  background: var(--card);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--muted);
  font-family: var(--font-mono);
}

/* Download & Action Bar */
.action-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.btn-download {
  flex: 1 1 280px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 24px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  color: #ffffff;
  font-size: 1rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(67, 56, 202, 0.32);
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.btn-download:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(67, 56, 202, 0.4);
}

.btn-download:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.secondary-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-secondary {
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--card);
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--soft-accent);
}

/* Partner / Affiliate Section */
.section-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-sm);
}

.section-header {
  margin-bottom: 18px;
}

.section-eyebrow {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary);
  margin-bottom: 4px;
}

.section-header h2 {
  margin: 0 0 6px;
  font-size: 1.4rem;
  letter-spacing: -0.02em;
  color: var(--text);
}

.section-header p {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
}

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

.affiliate-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

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

.affiliate-badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.73rem;
  font-weight: 700;
  background: var(--soft-accent);
  color: var(--primary);
  border: 1px solid var(--soft-accent-border);
  margin-bottom: 8px;
}

.affiliate-card h3 {
  margin: 0 0 6px;
  font-size: 1.06rem;
  color: var(--text);
}

.affiliate-card p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
  line-height: 1.5;
}

.affiliate-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 14px;
  border-radius: 8px;
  background: var(--card);
  border: 1px solid var(--soft-accent-border);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.86rem;
  text-decoration: none;
  transition: all 0.15s ease;
}

.affiliate-cta:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  text-decoration: none;
}

.ftc-disclosure {
  margin: 14px 0 0;
  font-size: 0.78rem;
  color: var(--subtle);
  line-height: 1.45;
}

/* Editorial Guide Styling */
.editorial-content h2 {
  font-size: 1.45rem;
  margin: 0 0 12px;
  letter-spacing: -0.02em;
  color: var(--text);
}

.editorial-content h3 {
  font-size: 1.14rem;
  margin: 24px 0 8px;
  color: var(--text);
}

.editorial-content p {
  margin: 0 0 14px;
  color: #334155;
  line-height: 1.7;
}

.editorial-content ul,
.editorial-content ol {
  margin: 0 0 16px;
  padding-left: 22px;
  color: #334155;
}

.editorial-content li {
  margin-bottom: 8px;
  line-height: 1.65;
}

.formula-box {
  background: var(--soft-accent);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 14px 18px;
  margin: 16px 0;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  color: var(--text);
  overflow-x: auto;
}

.benchmark-table-wrap {
  overflow-x: auto;
  margin: 18px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

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

.benchmark-table th {
  background: #f1f5f9;
  color: var(--text);
  font-weight: 700;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
}

.benchmark-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  color: #334155;
}

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

.benchmark-table code {
  font-family: var(--font-mono);
  background: var(--soft-accent);
  color: var(--primary);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.82rem;
}

/* FAQ Accordion */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.faq-question {
  width: 100%;
  background: var(--card);
  border: none;
  padding: 15px 18px;
  text-align: left;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: background-color 0.15s ease;
}

.faq-question:hover {
  background: #f8fafc;
  color: var(--primary);
}

.faq-chevron {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--soft-accent);
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 800;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.faq-item.open .faq-chevron {
  transform: rotate(180deg);
  background: var(--primary);
  color: #ffffff;
}

.faq-answer {
  display: none;
  padding: 0 18px 16px;
  background: var(--card);
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.65;
  border-top: 1px solid var(--border);
}

.faq-answer p {
  margin: 12px 0 0;
}

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

/* Cross-Linking Grid */
.crosslink-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

.crosslink-group h3 {
  margin: 0 0 12px;
  font-size: 1rem;
  color: var(--text);
}

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

.crosslink-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-weight: 600;
  font-size: 0.88rem;
  text-decoration: none;
  transition: all 0.15s ease;
}

.crosslink-list a:hover,
.crosslink-list a.is-current {
  border-color: var(--accent);
  background: var(--soft-accent);
  color: var(--primary);
}

.crosslink-tag {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--card);
  color: var(--muted);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

/* Footer */
.site-footer {
  margin-top: 40px;
  background: var(--card);
  border-top: 1px solid var(--border);
  padding: 32px 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.footer-brand strong {
  color: var(--text);
  font-size: 0.96rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.footer-links a {
  color: var(--muted);
  font-weight: 500;
}

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

/* Responsive Breakpoints */
@media (max-width: 900px) {
  .upload-bar {
    grid-template-columns: 1fr;
  }
  .affiliate-grid {
    grid-template-columns: 1fr;
  }
  .crosslink-columns {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .tool-workspace {
    padding: 16px;
  }
  .preview-grid {
    grid-template-columns: 1fr;
  }
  .preview-stage {
    height: 230px;
  }
  .custom-kb-group {
    margin-left: 0;
    width: 100%;
    justify-content: space-between;
  }
  .header-hub-link {
    display: none;
  }
}
