/* ==========================================================================
   UTMLinkCraft — Production Stylesheet
   Theme: Royal Blue (#2563eb) & Violet (#7c3aed) on Slate/White (#f8fafc)
   Zero external dependencies • Mobile-first responsive • Print-ready
   ========================================================================== */

:root {
  --bg-page: #f8fafc;
  --bg-surface: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-input: #ffffff;

  --text-heading: #0f172a;
  --text-main: #1e293b;
  --text-muted: #475569;
  --text-subtle: #64748b;

  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-soft: #eff6ff;
  --primary-border: #bfdbfe;

  --accent: #7c3aed;
  --accent-hover: #6d28d9;
  --accent-soft: #f5f3ff;
  --accent-border: #ddd6fe;

  --brand-gradient: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);

  --success: #059669;
  --success-soft: #ecfdf5;
  --success-border: #a7f3d0;

  --warning: #d97706;
  --warning-soft: #fffbeb;
  --warning-border: #fde68a;

  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --danger-border: #fecaca;

  --border-color: #e2e8f0;
  --border-strong: #cbd5e1;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  --radius-pill: 9999px;

  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 2px 6px -1px rgba(15, 23, 42, 0.06), 0 1px 3px -1px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 10px 25px -5px rgba(15, 23, 42, 0.07), 0 4px 10px -3px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 20px 35px -10px rgba(37, 99, 235, 0.12), 0 8px 16px -6px rgba(15, 23, 42, 0.06);

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;

  --container-max: 1200px;
}

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

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

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

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

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

img,
svg {
  vertical-align: middle;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 20px;
}

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

/* ==========================================================================
   SwiftKitHub Global Top Bar & Internal Linking Mesh
   ========================================================================== */
.skh-topbar {
  background: #0f172a;
  color: #cbd5e1;
  border-bottom: 1px solid #1e293b;
  font-size: 0.81rem;
  line-height: 1.4;
}

.skh-topbar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  padding-top: 8px;
  padding-bottom: 8px;
}

.skh-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  color: #94a3b8;
}

.skh-breadcrumb a {
  color: #cbd5e1;
  font-weight: 600;
  text-decoration: none;
}

.skh-breadcrumb a:hover {
  color: #93c5fd;
  text-decoration: underline;
}

.skh-breadcrumb span {
  color: #f8fafc;
  font-weight: 600;
}

.skh-all-tools {
  color: #93c5fd;
  font-weight: 700;
  white-space: nowrap;
  text-decoration: none;
}

.skh-all-tools:hover {
  color: #ffffff;
  text-decoration: underline;
}

.related-section {
  padding: 12px 0 48px;
}

.related-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 30px 32px;
  box-shadow: var(--shadow-sm);
}

.related-box-head {
  margin-bottom: 20px;
}

.related-box-head h2 {
  margin: 0 0 6px;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text-heading);
}

.related-box-head p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--text-muted);
}

.related-subhead {
  margin: 22px 0 12px;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-subtle);
}

.related-subhead:first-of-type {
  margin-top: 0;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
}

.related-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
  padding: 15px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: #fafbff;
  text-decoration: none;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.related-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
  background: var(--bg-surface);
}

.related-card-tag {
  display: inline-block;
  align-self: flex-start;
  font-size: 0.69rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  background: var(--primary-soft);
  color: var(--primary);
}

.related-card-tag.is-suite {
  background: var(--accent-soft);
  color: var(--accent);
}

.related-card-title {
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--text-heading);
  line-height: 1.35;
}

.related-card:hover .related-card-title {
  color: var(--primary);
}

.related-card-desc {
  font-size: 0.81rem;
  color: var(--text-muted);
  line-height: 1.48;
}

@media (max-width: 760px) {
  .related-box {
    padding: 22px 18px;
  }
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-color);
}

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

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

.brand-logo:hover {
  color: var(--text-heading);
}

.brand-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--brand-gradient);
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.25);
  flex-shrink: 0;
}

.brand-accent {
  background: var(--brand-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link {
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary);
  background-color: var(--primary-soft);
}

.nav-cta {
  margin-left: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  background: var(--brand-gradient);
  color: #ffffff !important;
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.24);
}

.nav-cta:hover {
  opacity: 0.94;
}

.mobile-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-heading);
  cursor: pointer;
}

/* ==========================================================================
   AdSense Slots (Hidden cleanly unless configured or previewed)
   ========================================================================== */
.ad-slot {
  display: none;
  margin: 18px auto;
  max-width: var(--container-max);
  text-align: center;
}

.ad-slot.is-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 92px;
  padding: 14px 20px;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-md);
  background: #f1f5f9;
  color: var(--text-subtle);
  font-size: 0.82rem;
}

.ad-slot.is-live {
  display: block;
  min-height: 90px;
  padding: 8px 0;
}

.ad-label {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-subtle);
  margin-bottom: 4px;
}

/* ==========================================================================
   Hero Section (Compact & Above-the-Fold Focused)
   ========================================================================== */
.hero-section {
  padding: 28px 0 20px;
  background: radial-gradient(circle at 15% 0%, rgba(37, 99, 235, 0.07) 0%, transparent 48%),
              radial-gradient(circle at 85% 10%, rgba(124, 58, 237, 0.07) 0%, transparent 48%);
}

.hero-header {
  max-width: 820px;
  margin: 0 auto 22px;
  text-align: center;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 13px;
  border-radius: var(--radius-pill);
  background: var(--primary-soft);
  border: 1px solid var(--primary-border);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin-bottom: 12px;
}

.hero-eyebrow .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.hero-title {
  margin: 0 0 10px;
  font-size: clamp(1.75rem, 3.4vw, 2.55rem);
  line-height: 1.18;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--text-heading);
}

.hero-subtitle {
  margin: 0 auto;
  max-width: 680px;
  font-size: 1.02rem;
  color: var(--text-muted);
}

/* ==========================================================================
   Core Interactive UTM Builder Card
   ========================================================================== */
.tool-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

/* Presets Bar */
.presets-bar {
  padding: 16px 22px;
  background: linear-gradient(to right, #f8fafc, #f5f3ff);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.presets-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-right: 4px;
}

.presets-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.preset-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  background: var(--bg-surface);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.83rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: var(--shadow-xs);
}

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

.preset-btn.active {
  background: var(--brand-gradient);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

/* Controls Toolbar: Mode Toggle + Smart Sanitizers */
.controls-toolbar {
  padding: 14px 22px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.mode-switch {
  display: inline-flex;
  background: var(--bg-subtle);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.mode-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.mode-btn.active {
  background: var(--bg-surface);
  color: var(--primary);
  box-shadow: var(--shadow-xs);
}

.sanitizers-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}

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

.toggle-input {
  appearance: none;
  -webkit-appearance: none;
  width: 36px;
  height: 20px;
  background: #cbd5e1;
  border-radius: var(--radius-pill);
  position: relative;
  cursor: pointer;
  transition: background-color 0.2s ease;
  flex-shrink: 0;
}

.toggle-input::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease;
}

.toggle-input:checked {
  background: var(--primary);
}

.toggle-input:checked::after {
  transform: translateX(16px);
}

.toggle-input:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.inline-select {
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: var(--bg-subtle);
  color: var(--text-heading);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

/* Workspace Two-Column Grid */
.builder-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.95fr;
  gap: 0;
}

.builder-inputs {
  padding: 24px 24px 26px;
  border-right: 1px solid var(--border-color);
}

.builder-output {
  padding: 24px;
  background: #fafbff;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Form Controls */
.field-group {
  margin-bottom: 16px;
}

.field-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.field-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.field-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-heading);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.param-code {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--bg-subtle);
  color: var(--accent);
}

.badge-req {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 2px 7px;
  border-radius: var(--radius-pill);
}

.badge-opt {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-subtle);
  background: var(--bg-subtle);
  padding: 2px 7px;
  border-radius: var(--radius-pill);
}

.text-input,
.textarea-input {
  width: 100%;
  padding: 10px 13px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg-input);
  color: var(--text-heading);
  font-family: inherit;
  font-size: 0.93rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.textarea-input {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.55;
  resize: vertical;
  min-height: 112px;
}

.text-input:focus,
.textarea-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.field-hint {
  margin-top: 4px;
  font-size: 0.78rem;
  color: var(--text-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.link-btn {
  border: none;
  background: none;
  padding: 0;
  color: var(--primary);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
}

.link-btn:hover {
  color: var(--accent);
}

.optional-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 14px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-subtle);
}

.optional-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

.form-footer-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin-top: 8px;
}

.form-footer-row .field-group {
  flex: 1;
  margin-bottom: 0;
}

/* ==========================================================================
   GA4 Default Channel Group Predictor Card
   ========================================================================== */
.ga4-card {
  padding: 16px 18px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--success-border);
  background: var(--success-soft);
  transition: all 0.2s ease;
}

.ga4-card.is-warning {
  border-color: var(--danger-border);
  background: var(--danger-soft);
}

.ga4-card.is-neutral {
  border-color: var(--warning-border);
  background: var(--warning-soft);
}

.ga4-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.ga4-card-label {
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.ga4-bucket-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.85rem;
  font-weight: 800;
  background: var(--success);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.25);
}

.ga4-card.is-warning .ga4-bucket-badge {
  background: var(--danger);
  box-shadow: 0 2px 6px rgba(220, 38, 38, 0.25);
}

.ga4-card.is-neutral .ga4-bucket-badge {
  background: var(--warning);
  box-shadow: 0 2px 6px rgba(217, 119, 6, 0.25);
}

.ga4-reason {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-main);
}

.ga4-fix-btn {
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--danger-border);
  background: #ffffff;
  color: var(--danger);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.ga4-fix-btn:hover {
  background: var(--danger);
  color: #ffffff;
}

/* ==========================================================================
   Generated URL Output Panel
   ========================================================================== */
.output-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

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

.output-title {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text-heading);
}

.output-stats {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-subtle);
  font-family: var(--font-mono);
}

.url-preview-box {
  padding: 13px 14px;
  border-radius: var(--radius-md);
  background: #0f172a;
  color: #f8fafc;
  font-family: var(--font-mono);
  font-size: 0.84rem;
  line-height: 1.6;
  word-break: break-all;
  min-height: 76px;
  border: 1px solid #1e293b;
  user-select: all;
}

.url-preview-box .hl-base {
  color: #e2e8f0;
}

.url-preview-box .hl-key {
  color: #93c5fd;
  font-weight: 600;
}

.url-preview-box .hl-val {
  color: #c4b5fd;
}

.url-preview-box .hl-hash {
  color: #6ee7b7;
}

.bulk-results-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 250px;
  overflow-y: auto;
  padding-right: 2px;
}

.bulk-result-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: #0f172a;
  color: #e2e8f0;
  font-family: var(--font-mono);
  font-size: 0.79rem;
  word-break: break-all;
}

.bulk-mini-copy {
  flex-shrink: 0;
  padding: 4px 9px;
  border-radius: 5px;
  border: 1px solid #334155;
  background: #1e293b;
  color: #f8fafc;
  font-family: var(--font-sans);
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
}

.bulk-mini-copy:hover {
  background: var(--primary);
  border-color: var(--primary);
}

.validation-alert {
  display: none;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  background: var(--warning-soft);
  border: 1px solid var(--warning-border);
  color: #92400e;
  font-size: 0.81rem;
  font-weight: 500;
}

.validation-alert.is-visible {
  display: block;
}

.sanitizer-notice {
  font-size: 0.77rem;
  color: var(--text-subtle);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Action Buttons */
.action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  text-decoration: none;
}

.btn-primary {
  flex: 1;
  min-width: 165px;
  background: var(--brand-gradient);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover {
  opacity: 0.95;
  transform: translateY(-1px);
  color: #ffffff;
}

.btn-primary.is-copied {
  background: var(--success);
  box-shadow: 0 4px 12px rgba(5, 150, 105, 0.28);
}

.btn-secondary {
  background: var(--bg-surface);
  border-color: var(--border-strong);
  color: var(--text-heading);
}

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

.btn-ghost {
  background: var(--bg-subtle);
  color: var(--text-muted);
  padding: 10px 13px;
}

.btn-ghost:hover {
  background: #e2e8f0;
  color: var(--text-heading);
}

.btn-sm {
  padding: 6px 11px;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
}

/* ==========================================================================
   Partner Affiliate Recommendations (High-Intent Placement)
   ========================================================================== */
.partners-section {
  padding: 28px 0 12px;
}

.section-head-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
}

.section-title-sm {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-heading);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.ftc-pill {
  font-size: 0.76rem;
  color: var(--text-subtle);
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
}

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

.affiliate-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  position: relative;
}

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

.affiliate-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.affiliate-name {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--text-heading);
}

.affiliate-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-border);
  white-space: nowrap;
}

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

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

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

/* ==========================================================================
   Campaign History Manager
   ========================================================================== */
.history-section {
  padding: 24px 0 16px;
}

.history-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.history-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.history-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.history-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-heading);
}

.count-pill {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  background: var(--primary-soft);
  color: var(--primary);
}

.history-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.history-search {
  flex: 1;
  min-width: 220px;
}

.history-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

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

.history-table th {
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.history-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

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

.history-table tr:hover td {
  background: #f8fafc;
}

.history-url-cell {
  max-width: 340px;
  font-family: var(--font-mono);
  font-size: 0.79rem;
  color: var(--text-heading);
  word-break: break-all;
}

.channel-mini-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 0.73rem;
  font-weight: 700;
  background: var(--success-soft);
  color: var(--success);
  border: 1px solid var(--success-border);
  white-space: nowrap;
}

.channel-mini-tag.is-unassigned {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: var(--danger-border);
}

.history-empty {
  padding: 32px 20px;
  text-align: center;
  color: var(--text-subtle);
  font-size: 0.92rem;
}

/* ==========================================================================
   SEO Guide & Content Sections
   ========================================================================== */
.content-section {
  padding: 40px 0 24px;
}

.prose-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 36px 40px;
  box-shadow: var(--shadow-sm);
}

.prose-card h2 {
  margin: 0 0 14px;
  font-size: 1.65rem;
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-heading);
}

.prose-card h3 {
  margin: 28px 0 10px;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-heading);
}

.prose-card p {
  margin: 0 0 15px;
  color: var(--text-main);
  line-height: 1.72;
}

.prose-card ul,
.prose-card ol {
  margin: 0 0 18px;
  padding-left: 22px;
}

.prose-card li {
  margin-bottom: 8px;
  line-height: 1.68;
}

.prose-card code {
  font-family: var(--font-mono);
  font-size: 0.86em;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--bg-subtle);
  color: var(--accent);
}

.formula-callout {
  margin: 18px 0 22px;
  padding: 16px 20px;
  border-left: 4px solid var(--primary);
  background: var(--primary-soft);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  color: var(--text-heading);
  overflow-x: auto;
}

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

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

.benchmark-table th {
  background: var(--bg-subtle);
  color: var(--text-heading);
  font-weight: 700;
  padding: 12px 15px;
  border-bottom: 1px solid var(--border-color);
}

.benchmark-table td {
  padding: 11px 15px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
}

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

/* ==========================================================================
   FAQ Accordion Section
   ========================================================================== */
.faq-section {
  padding: 24px 0 52px;
}

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

.section-header-center h2 {
  margin: 0 0 8px;
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--text-heading);
}

.section-header-center p {
  margin: 0;
  color: var(--text-muted);
}

.faq-list {
  max-width: 880px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.faq-item.is-open {
  border-color: var(--primary-border);
  box-shadow: var(--shadow-sm);
}

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

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

.faq-chevron {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: var(--text-subtle);
  transition: transform 0.2s ease, color 0.2s ease;
}

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

.faq-answer {
  display: none;
  padding: 0 22px 18px;
  color: var(--text-muted);
  font-size: 0.94rem;
  line-height: 1.68;
}

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

/* ==========================================================================
   Subpages (Privacy, Terms, About, Contact)
   ========================================================================== */
.page-main {
  padding: 42px 0 64px;
}

.legal-container {
  max-width: 840px;
  margin: 0 auto;
}

.page-badge {
  display: inline-block;
  padding: 4px 11px;
  border-radius: var(--radius-pill);
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 24px;
  margin-top: 22px;
}

.info-box {
  padding: 20px;
  border-radius: var(--radius-lg);
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background: #0f172a;
  color: #cbd5e1;
  padding: 44px 0 28px;
  margin-top: 24px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 28px;
  border-bottom: 1px solid #1e293b;
}

.footer-brand-name {
  color: #ffffff;
  font-size: 1.15rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.footer-desc {
  margin: 0 0 12px;
  font-size: 0.88rem;
  color: #94a3b8;
  max-width: 420px;
}

.footer-disclosure {
  margin: 0;
  font-size: 0.78rem;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid #1e293b;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  line-height: 1.5;
}

.footer-heading {
  margin: 0 0 12px;
  font-size: 0.83rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #ffffff;
}

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

.footer-links a {
  color: #cbd5e1;
  font-size: 0.88rem;
}

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

.footer-bottom {
  padding-top: 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.82rem;
  color: #94a3b8;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 980px) {
  .builder-grid {
    grid-template-columns: 1fr;
  }

  .builder-inputs {
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }

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

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

@media (max-width: 760px) {
  .mobile-menu-btn {
    display: inline-flex;
  }

  .main-nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    flex-direction: column;
    align-items: stretch;
    padding: 12px 20px 16px;
    gap: 4px;
  }

  .main-nav.is-open {
    display: flex;
  }

  .nav-cta {
    margin-left: 0;
    margin-top: 6px;
    text-align: center;
  }

  .field-row-2,
  .field-row-3,
  .contact-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .form-footer-row {
    flex-direction: column;
    align-items: stretch;
  }

  .prose-card {
    padding: 24px 20px;
  }

  .controls-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ==========================================================================
   Print Stylesheet (Clean Campaign Spec Export)
   ========================================================================== */
@media print {
  .skh-topbar,
  .site-header,
  .ad-slot,
  .presets-bar,
  .partners-section,
  .related-section,
  .faq-section,
  .site-footer,
  .action-buttons,
  .history-controls {
    display: none !important;
  }

  body {
    background: #ffffff;
    color: #000000;
  }

  .tool-card,
  .history-card,
  .prose-card {
    box-shadow: none;
    border: 1px solid #cbd5e1;
  }

  .url-preview-box {
    background: #f8fafc;
    color: #0f172a;
    border: 1px solid #cbd5e1;
  }
}
