: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: #059669;
  --success-bg: #ecfdf5;
  --warning: #d97706;
  --warning-bg: #fffbeb;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.04);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", 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;
}

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

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

code,
pre {
  font-family: var(--font-mono);
}

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

/* Portal Header */
.site-header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
}

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

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

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

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

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

.header-hub-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
}

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

.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-size: 0.85rem;
  font-weight: 600;
  transition: all 0.15s ease;
}

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

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

.breadcrumb-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  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);
  text-decoration: underline;
}

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

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

/* Hero Section */
.hero-section {
  padding: 16px 0 22px;
}

.privacy-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--soft-accent);
  border: 1px solid var(--soft-accent-border);
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  margin-bottom: 10px;
}

.privacy-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
}

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

.hero-title code {
  font-size: 0.88em;
  background: var(--soft-accent);
  color: var(--primary);
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid var(--soft-accent-border);
}

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

/* 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 Tool Workspace */
.tool-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: 22px;
  align-items: start;
  margin-bottom: 26px;
}

@media (max-width: 980px) {
  .tool-workspace {
    grid-template-columns: 1fr;
  }
}

.panel-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.panel-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #fcfdff;
}

.panel-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-badge {
  font-size: 0.74rem;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--soft-accent);
  color: var(--primary);
}

.panel-body {
  padding: 20px;
}

/* Source Mode Tabs */
.source-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 20px;
}

@media (max-width: 560px) {
  .source-tabs {
    grid-template-columns: 1fr;
  }
}

.source-tab-btn {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: all 0.15s ease;
}

.source-tab-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.7);
}

.source-tab-btn.is-active {
  background: var(--card);
  color: var(--primary);
  border-color: var(--soft-accent-border);
  box-shadow: var(--shadow-sm);
}

.tab-pane {
  display: none;
}

.tab-pane.is-active {
  display: block;
}

/* Form Controls */
.control-section {
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

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

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

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

.form-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

@media (max-width: 560px) {
  .form-grid-2,
  .form-grid-3 {
    grid-template-columns: 1fr;
  }
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

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

.field-val {
  font-family: var(--font-mono);
  font-size: 0.77rem;
  color: var(--primary);
  font-weight: 600;
}

.text-input,
.select-input {
  width: 100%;
  padding: 9px 12px;
  font-size: 0.92rem;
  font-family: inherit;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.text-input:focus,
.select-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.16);
}

.monogram-input-big {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

/* Color Picker Field */
.color-picker-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
}

.color-swatch-input {
  width: 30px;
  height: 28px;
  border: none;
  padding: 0;
  background: none;
  cursor: pointer;
  flex-shrink: 0;
}

.color-hex-input {
  border: none;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text);
  width: 100%;
  min-width: 0;
  padding: 2px 0;
}

.color-hex-input:focus {
  outline: none;
}

/* Range Slider */
.range-input {
  width: 100%;
  accent-color: var(--primary);
  cursor: pointer;
  margin: 4px 0;
}

/* Preset Chips & Radius Pills */
.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.chip-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}

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

.chip-btn.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.swatch-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  border: 1px solid rgba(0, 0, 0, 0.12);
}

/* Emoji Grid */
.emoji-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
  gap: 6px;
  margin-top: 10px;
  max-height: 190px;
  overflow-y: auto;
  padding: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.emoji-pick-btn {
  appearance: none;
  border: 1px solid transparent;
  background: var(--card);
  border-radius: 6px;
  height: 38px;
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

.emoji-pick-btn:hover {
  transform: scale(1.08);
  border-color: var(--accent);
  background: var(--soft-accent);
}

.emoji-pick-btn.is-selected {
  border-color: var(--primary);
  background: var(--soft-accent);
  box-shadow: 0 0 0 2px rgba(67, 56, 202, 0.18);
}

/* Upload Dropzone */
.upload-dropzone {
  border: 2px dashed var(--border-strong);
  background: var(--bg);
  border-radius: var(--radius-md);
  padding: 22px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s ease;
}

.upload-dropzone:hover,
.upload-dropzone.is-dragover {
  border-color: var(--primary);
  background: var(--soft-accent);
}

.upload-icon-circle {
  width: 44px;
  height: 44px;
  margin: 0 auto 10px;
  border-radius: 50%;
  background: var(--soft-accent);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.upload-title {
  font-weight: 700;
  font-size: 0.94rem;
  color: var(--text);
  margin: 0 0 4px;
}

.upload-hint {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0 0 10px;
}

.upload-status-bar {
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--soft-accent);
  border: 1px solid var(--soft-accent-border);
  font-size: 0.8rem;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

/* Checkboxes */
.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  color: var(--text);
  cursor: pointer;
  margin-top: 6px;
}

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

.ico-sizes-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.size-pill-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.size-pill-label input {
  accent-color: var(--primary);
}

/* Right Preview Column */
.preview-stack {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Browser Tab Mockups */
.browser-mockup-box {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.browser-strip-light {
  background: #e2e8f0;
  padding: 8px 10px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.window-dots {
  display: flex;
  gap: 5px;
  padding-bottom: 8px;
}

.window-dots span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.dot-red { background: #f87171; }
.dot-amber { background: #fbbf24; }
.dot-green { background: #34d399; }

.browser-tab-light {
  background: #ffffff;
  border-radius: 8px 8px 0 0;
  padding: 7px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 190px;
  max-width: 250px;
  box-shadow: 0 -1px 3px rgba(15, 23, 42, 0.06);
}

.tab-favicon-slot {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tab-title-text {
  font-size: 0.78rem;
  font-weight: 600;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.tab-close-x {
  font-size: 0.78rem;
  color: #94a3b8;
}

.browser-urlbar-light {
  background: #ffffff;
  padding: 7px 12px;
  border-top: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
  color: #64748b;
}

.url-pill-light {
  background: #f1f5f9;
  border-radius: 999px;
  padding: 3px 12px;
  flex: 1;
  font-family: var(--font-mono);
  font-size: 0.73rem;
  color: #334155;
}

/* Dark Mode Browser Strip */
.browser-strip-dark {
  background: #0f172a;
  padding: 8px 10px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.browser-tab-dark {
  background: #1e293b;
  border-radius: 8px 8px 0 0;
  padding: 7px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 190px;
  max-width: 250px;
}

.browser-tab-dark .tab-title-text {
  color: #f1f5f9;
}

.browser-urlbar-dark {
  background: #1e293b;
  padding: 7px 12px;
  border-top: 1px solid #334155;
  display: flex;
  align-items: center;
  gap: 8px;
}

.url-pill-dark {
  background: #0f172a;
  border-radius: 999px;
  padding: 3px 12px;
  flex: 1;
  font-family: var(--font-mono);
  font-size: 0.73rem;
  color: #cbd5e1;
}

.mockup-caption {
  font-size: 0.73rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 5px;
  display: flex;
  justify-content: space-between;
}

/* Device & Search Mockups Grid */
.device-preview-grid {
  display: grid;
  grid-template-columns: 155px minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}

@media (max-width: 520px) {
  .device-preview-grid {
    grid-template-columns: 1fr;
  }
}

/* iOS Home Screen Mockup */
.ios-homescreen-card {
  background: radial-gradient(circle at 25% 20%, #312e81 0%, #1e1b4b 55%, #0f172a 100%);
  border-radius: var(--radius-md);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  border: 1px solid #312e81;
}

.ios-tag {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.68);
  margin-bottom: 10px;
  font-weight: 600;
}

.ios-icon-frame {
  width: 68px;
  height: 68px;
  border-radius: 15.2px; /* 22.37% iOS continuous squircle ratio */
  overflow: hidden;
  background: #000000; /* Authentic iOS behavior: alpha renders over black! */
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.38);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ios-icon-frame canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.ios-app-label {
  margin-top: 7px;
  font-size: 0.74rem;
  font-weight: 500;
  color: #ffffff;
  max-width: 110px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

/* SERP + Multi-size Strip Card */
.serp-and-sizes-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.serp-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.serp-header {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 4px;
}

.serp-icon-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.serp-icon-circle canvas {
  width: 18px;
  height: 18px;
}

.serp-site-meta {
  line-height: 1.25;
  min-width: 0;
}

.serp-site-name {
  font-size: 0.78rem;
  font-weight: 600;
  color: #202124;
}

.serp-site-url {
  font-size: 0.7rem;
  color: #4d5156;
}

.serp-blue-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: #1a0dab;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Pixel Inspection Strip */
.pixel-strip-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
}

.pixel-sizes-flex {
  display: flex;
  align-items: flex-end;
  justify-content: space-around;
  gap: 10px;
  padding-top: 4px;
}

.pixel-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.checkerboard {
  background-color: #ffffff;
  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: 8px 8px;
  background-position: 0 0, 0 4px, 4px -4px, -4px 0;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px;
}

.pixel-dim-tag {
  font-family: var(--font-mono);
  font-size: 0.69rem;
  color: var(--muted);
}

/* Export & Download Buttons */
.primary-export-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

@media (max-width: 560px) {
  .primary-export-row {
    grid-template-columns: 1fr;
  }
}

.btn-primary {
  appearance: none;
  border: 1px solid var(--primary);
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #ffffff;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 2px 8px rgba(67, 56, 202, 0.22);
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(67, 56, 202, 0.3);
}

.btn-secondary {
  appearance: none;
  border: 1px solid var(--soft-accent-border);
  background: var(--soft-accent);
  color: var(--primary);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s ease;
}

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

.asset-downloads-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

@media (max-width: 520px) {
  .asset-downloads-grid {
    grid-template-columns: 1fr;
  }
}

.asset-dl-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  padding: 9px 11px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  text-align: left;
  transition: all 0.14s ease;
}

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

.asset-dl-name {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
  display: block;
}

.asset-dl-meta {
  font-size: 0.71rem;
  color: var(--muted);
  display: block;
}

.asset-dl-arrow {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary);
  flex-shrink: 0;
}

/* Code Output Tabs (<head> Snippet / Inline SVG Data-URI / site.webmanifest) */
.code-tabs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.code-tab-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.code-tab-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  font-family: inherit;
  font-size: 0.77rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
}

.code-tab-btn.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.copy-code-btn {
  appearance: none;
  border: 1px solid var(--primary);
  background: var(--card);
  color: var(--primary);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.14s ease;
}

.copy-code-btn:hover,
.copy-code-btn.is-copied {
  background: var(--primary);
  color: #ffffff;
}

.code-output-pre {
  margin: 0;
  padding: 13px 14px;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: var(--radius-sm);
  font-size: 0.77rem;
  line-height: 1.55;
  overflow-x: auto;
  max-height: 230px;
  white-space: pre;
}

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

.partner-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.partner-title {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--text);
}

.ftc-note {
  margin: 0;
  font-size: 0.75rem;
  color: var(--subtle);
}

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

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

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

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

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

.affiliate-name {
  font-weight: 800;
  font-size: 0.98rem;
  color: var(--text);
}

.affiliate-badge {
  font-size: 0.71rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--soft-accent);
  color: var(--primary);
  white-space: nowrap;
}

.affiliate-desc {
  margin: 0 0 14px;
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.5;
}

.affiliate-desc code {
  background: var(--soft-accent);
  color: var(--primary);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 0.82em;
}

.affiliate-cta {
  display: inline-flex;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
}

.affiliate-cta:hover {
  color: var(--accent);
  text-decoration: underline;
}

/* Editorial Content & Benchmarks */
.editorial-section {
  margin: 30px 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 30px 32px;
  box-shadow: var(--shadow-sm);
}

@media (max-width: 640px) {
  .editorial-section {
    padding: 22px 18px;
  }
}

.editorial-section h2 {
  margin: 0 0 14px;
  font-size: 1.45rem;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--text);
}

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

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

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

.editorial-section li {
  margin-bottom: 7px;
  line-height: 1.65;
}

.editorial-section code {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 0.86em;
  color: var(--primary);
}

.formula-callout {
  margin: 18px 0;
  padding: 15px 18px;
  background: var(--soft-accent);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.92rem;
  color: var(--text);
}

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

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

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

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

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

/* FAQ Section */
.faq-section {
  margin: 30px 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  box-shadow: var(--shadow-sm);
}

@media (max-width: 640px) {
  .faq-section {
    padding: 22px 18px;
  }
}

.faq-section h2 {
  margin: 0 0 18px;
  font-size: 1.38rem;
  letter-spacing: -0.02em;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

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

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

.faq-chevron {
  font-size: 1.1rem;
  color: var(--primary);
  font-weight: 700;
  transition: transform 0.18s ease;
  flex-shrink: 0;
}

.faq-item.is-open .faq-chevron {
  transform: rotate(45deg);
}

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

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

/* Related Tools & Cross-Linking */
.related-section {
  margin: 30px 0 38px;
}

.related-section h2 {
  margin: 0 0 6px;
  font-size: 1.3rem;
  letter-spacing: -0.015em;
}

.related-sub {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 0.92rem;
}

.related-group-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin: 18px 0 10px;
}

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

.related-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  transition: all 0.15s ease;
}

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

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

.related-card-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 4px;
}

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

.related-card-desc {
  font-size: 0.79rem;
  color: var(--muted);
  line-height: 1.45;
}

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

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

.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);
}

.toast-banner {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #0f172a;
  color: #ffffff;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 90;
}

.toast-banner.is-shown {
  opacity: 1;
  transform: translateY(0);
}
