/* ==========================================================================
   SellerMath Design System & Styling
   Clean, modern, high-conversion SaaS aesthetic for e-commerce tools
   ========================================================================== */

:root {
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Colors */
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  --border: #e2e8f0;
  --border-focus: #6366f1;

  /* Brand Accents */
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #eef2ff;

  /* Status / Money Colors */
  --profit: #10b981;
  --profit-dark: #047857;
  --profit-light: #ecfdf5;

  --fee: #f43f5e;
  --fee-light: #fff1f2;

  --cost: #f59e0b;
  --cost-light: #fffbeb;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.07);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.04);
  --radius-lg: 16px;
  --radius-md: 10px;
  --radius-sm: 6px;
}

/* Dark Mode Theme Tokens */
[data-theme="dark"] {
  --bg-main: #090d16;
  --bg-card: #111827;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-light: #64748b;
  --border: #1e293b;
  --border-focus: #818cf8;

  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: #1e1b4b;

  --profit: #10b981;
  --profit-dark: #34d399;
  --profit-light: #064e3b;

  --fee: #fb7185;
  --fee-light: #4c0519;

  --cost: #fbbf24;
  --cost-light: #451a03;

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.3);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5), 0 4px 6px -4px rgb(0 0 0 / 0.4);
}

[data-theme="dark"] .site-header {
  background: #111827;
  border-bottom-color: #1e293b;
}

[data-theme="dark"] .num-input,
[data-theme="dark"] .select-input {
  background: #0b0f19;
  color: #f8fafc;
  border-color: #1e293b;
}

[data-theme="dark"] .num-input:focus,
[data-theme="dark"] .select-input:focus {
  border-color: #818cf8;
}

[data-theme="dark"] .preset-btn {
  background: #111827;
  border-color: #1e293b;
  color: #94a3b8;
}

[data-theme="dark"] .preset-btn:hover {
  border-color: #818cf8;
  color: #c7d2fe;
}

[data-theme="dark"] .country-select-group {
  background: #0f172a;
  border-color: #1e293b;
}

[data-theme="dark"] .country-select {
  background: #111827;
  border-color: #1e293b;
  color: #f8fafc;
}

[data-theme="dark"] .header-row {
  background: #0f172a;
  color: #94a3b8;
}

[data-theme="dark"] .fee-sub-row {
  background: #111827;
  color: #94a3b8;
}

[data-theme="dark"] .calc-tip {
  background: #0f172a;
  color: #cbd5e1;
}

[data-theme="dark"] .prose-content {
  background: #111827;
  border-color: #1e293b;
}

[data-theme="dark"] .prose-content p,
[data-theme="dark"] .prose-content td,
[data-theme="dark"] .tips-list {
  color: #cbd5e1;
}

[data-theme="dark"] .styled-table th {
  background: #0f172a;
  color: #f8fafc;
  border-color: #1e293b;
}

[data-theme="dark"] .styled-table td {
  border-color: #1e293b;
}

[data-theme="dark"] .faq-item {
  border-color: #1e293b;
  background: #111827;
}

[data-theme="dark"] .faq-item summary {
  background: #0f172a;
  color: #f8fafc;
}

[data-theme="dark"] .faq-answer {
  background: #111827;
  border-color: #1e293b;
}

[data-theme="dark"] .ad-placeholder {
  background: #0f172a;
  border-color: #1e293b;
}

[data-theme="dark"] .ad-slot-mock {
  color: #94a3b8;
}

/* Reset & Basics */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

/* Header */
.site-header {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(8px);
}

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

.brand-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text-main);
  font-size: 1.25rem;
  font-weight: 700;
}

.logo-icon {
  font-size: 1.4rem;
}

.badge-tag {
  font-size: 0.72rem;
  background: var(--primary-light);
  color: var(--primary);
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
  margin-left: 6px;
}

.nav-links {
  display: flex;
  gap: 20px;
}

.nav-link {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s;
}

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

/* Hero Section */
.hero-section {
  text-align: center;
  padding: 48px 20px 32px;
}

.hero-badge {
  display: inline-block;
  background: #ecfdf5;
  color: var(--profit-dark);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 4px 14px;
  border-radius: 999px;
  margin-bottom: 16px;
  border: 1px solid #a7f3d0;
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}

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

/* Presets Bar */
.presets-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.presets-label {
  font-size: 0.88rem;
  color: var(--text-muted);
  font-weight: 600;
}

.preset-btn {
  background: #ffffff;
  border: 1px solid var(--border);
  padding: 6px 14px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

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

.preset-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 2px 4px rgb(79 70 229 / 0.3);
}

/* Calculator Grid */
.calculator-section {
  padding-bottom: 48px;
}

.calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}

.calc-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  padding: 28px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 14px;
}

.card-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
}

.card-header p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.live-pill {
  font-size: 0.75rem;
  background: var(--profit-light);
  color: var(--profit-dark);
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.live-pill::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--profit);
  border-radius: 50%;
}

/* Forms & Inputs */
.form-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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

.tooltip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-muted);
  font-size: 0.72rem;
  cursor: help;
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.currency-prefix {
  position: absolute;
  left: 14px;
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--text-light);
  font-weight: 600;
  pointer-events: none;
}

.num-input {
  width: 100%;
  padding: 10px 14px 10px 32px;
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 600;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: #ffffff;
  color: var(--text-main);
  transition: all 0.2s ease;
}

.num-input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgb(99 102 241 / 0.15);
}

.select-input {
  width: 100%;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: #ffffff;
  color: var(--text-main);
  cursor: pointer;
}

.select-input:focus {
  outline: none;
  border-color: var(--border-focus);
}

.divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 8px 0;
}

.divider::before, .divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px dashed var(--border);
}

.divider span {
  padding: 0 10px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-light);
  letter-spacing: 0.05em;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-main);
}

.checkbox-label input {
  width: 17px;
  height: 17px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* Results Display */
.profit-highlight {
  background: linear-gradient(135deg, #064e3b 0%, #065f46 100%);
  color: #ffffff;
  padding: 22px;
  border-radius: var(--radius-md);
  text-align: center;
  margin-bottom: 24px;
  box-shadow: 0 4px 12px rgb(6 78 59 / 0.25);
}

.profit-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #a7f3d0;
  font-weight: 700;
}

.profit-value {
  font-family: var(--font-mono);
  font-size: 2.6rem;
  font-weight: 700;
  margin: 4px 0 8px;
  letter-spacing: -0.02em;
}

.profit-sub {
  display: flex;
  justify-content: center;
  gap: 20px;
  font-size: 0.9rem;
  color: #d1fae5;
}

/* Distribution Bar */
.distribution-block {
  margin-bottom: 24px;
}

.bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.dist-bar {
  display: flex;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--border);
}

.segment {
  height: 100%;
  transition: width 0.3s ease;
}

.profit-seg { background: var(--profit); }
.cost-seg { background: var(--cost); }
.fee-seg { background: var(--fee); }

.legend {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.profit-dot { background: var(--profit); }
.cost-dot { background: var(--cost); }
.fee-dot { background: var(--fee); }

/* Itemized Table */
.itemized-list {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 20px;
}

.item-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 14px;
  font-size: 0.88rem;
  border-bottom: 1px solid var(--border);
}

.item-row:last-child {
  border-bottom: none;
}

.header-row {
  background: #f1f5f9;
  font-weight: 700;
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.fee-sub-row {
  color: var(--text-muted);
  font-size: 0.83rem;
  background: #fafafa;
}

.total-fees-row {
  background: var(--fee-light);
}

.total-costs-row {
  background: var(--cost-light);
}

.mono-val {
  font-family: var(--font-mono);
  font-weight: 600;
}

.fee-text { color: #e11d48; }
.cost-text { color: #d97706; }

.calc-tip {
  font-size: 0.84rem;
  color: #475569;
  background: #f8fafc;
  border-left: 3px solid var(--primary);
  padding: 10px 14px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

/* Ad Placeholder Container */
.ad-banner-wrapper {
  margin: 16px auto 48px;
}

.ad-placeholder {
  background: #ffffff;
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius-md);
  padding: 18px 24px;
  text-align: center;
  position: relative;
}

.ad-tag {
  position: absolute;
  top: -9px;
  left: 20px;
  background: #e2e8f0;
  color: #64748b;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 8px;
  border-radius: 4px;
  text-transform: uppercase;
}

.ad-slot-mock {
  font-size: 0.95rem;
  color: #334155;
}

/* Educational & Guide Prose Section */
.guide-section {
  padding-bottom: 64px;
}

.prose-content {
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: 40px;
  box-shadow: var(--shadow-sm);
}

.prose-content h2 {
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 32px 0 14px;
  letter-spacing: -0.02em;
}

.prose-content h2:first-child {
  margin-top: 0;
}

.prose-content h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 24px 0 10px;
}

.prose-content p {
  color: #334155;
  margin-bottom: 16px;
  font-size: 1rem;
}

/* Table */
.table-container {
  overflow-x: auto;
  margin: 20px 0;
}

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

.styled-table th {
  background: #f1f5f9;
  color: var(--text-main);
  padding: 12px 16px;
  border-bottom: 2px solid var(--border);
  font-weight: 700;
}

.styled-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: #334155;
}

.code-box {
  background: #0f172a;
  color: #38bdf8;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 0.88rem;
  overflow-x: auto;
  margin: 16px 0;
  line-height: 1.6;
}

.tips-list {
  margin: 16px 0 24px 24px;
  color: #334155;
}

.tips-list li {
  margin-bottom: 10px;
}

/* FAQ Accordion */
.faq-accordion {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}

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

.faq-item summary {
  padding: 14px 18px;
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--text-main);
  cursor: pointer;
  background: #f8fafc;
  list-style: none;
  position: relative;
}

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

.faq-item summary::after {
  content: "+";
  position: absolute;
  right: 18px;
  font-size: 1.2rem;
  color: var(--primary);
  font-weight: 700;
}

.faq-item[open] summary::after {
  content: "−";
}

.faq-answer {
  padding: 16px 18px;
  border-top: 1px solid var(--border);
  background: #ffffff;
}

.faq-answer p {
  margin-bottom: 0;
}

/* Footer */
.site-footer {
  background: #0f172a;
  color: #94a3b8;
  padding: 48px 0 24px;
  margin-top: 48px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 32px;
  border-bottom: 1px solid #1e293b;
  flex-wrap: wrap;
  gap: 24px;
}

.footer-brand .logo-text {
  color: #ffffff;
  font-size: 1.3rem;
}

.footer-desc {
  max-width: 380px;
  font-size: 0.88rem;
  margin-top: 8px;
  line-height: 1.5;
}

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

.footer-links a {
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}

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

.footer-bottom {
  padding-top: 24px;
  font-size: 0.8rem;
  color: #64748b;
  text-align: center;
}

/* Responsive */
@media (max-width: 860px) {
  .calc-grid {
    grid-template-columns: 1fr;
  }
  .hero-title {
    font-size: 2rem;
  }
  .prose-content {
    padding: 24px;
  }
}

/* ==========================================================================
   P0 & P2 Enhancements: Country Switcher, Copy Report, Cross Promotion
   ========================================================================== */

/* Country Selector */
.country-select-group {
  background: #f1f5f9;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  margin-bottom: 6px;
}

.country-pill-badge {
  font-size: 0.72rem;
  background: #dbeafe;
  color: #1e40af;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
}

.country-select {
  font-weight: 600;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
}

/* Copy Report Button (P2) */
.copy-report-wrapper {
  margin-bottom: 20px;
  position: relative;
}

.btn-copy-report {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #ffffff;
  border: 1.5px solid var(--primary);
  color: var(--primary);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgb(79 70 229 / 0.05);
}

.btn-copy-report:hover {
  background: var(--primary-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgb(79 70 229 / 0.15);
}

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

.btn-icon {
  font-size: 1.1rem;
}

.copy-toast {
  text-align: center;
  margin-top: 8px;
  background: var(--profit-light);
  color: var(--profit-dark);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid #a7f3d0;
  animation: fadeIn 0.2s ease;
}

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

/* Cross-Promotion Card */
.cross-promo-card {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
  color: #ffffff;
  padding: 28px;
  border-radius: var(--radius-lg);
  margin: 32px 0;
  box-shadow: var(--shadow-md);
}

.promo-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.15);
  color: #c7d2fe;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.cross-promo-card h3 {
  color: #ffffff;
  font-size: 1.35rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.cross-promo-card p {
  color: #e0e7ff;
  font-size: 0.95rem;
  margin-bottom: 18px;
}

.btn-cross-promo {
  display: inline-block;
  background: #ffffff;
  color: #312e81;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.92rem;
  padding: 10px 20px;
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.btn-cross-promo:hover {
  background: #eef2ff;
  transform: translateX(4px);
}

/* ==========================================================================
   Theme Toggle, Mode Tabs, Volume Simulator, Export Card Styling
   ========================================================================== */

/* Theme Toggle Button in Header */
.theme-toggle-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--text-main);
}

.theme-toggle-btn:hover {
  background: var(--primary-light);
  border-color: var(--primary);
  transform: rotate(15deg);
}

/* Calculation Mode Tabs (Standard vs Reverse Target Pricing) */
.calc-mode-tabs {
  display: flex;
  background: var(--border);
  padding: 4px;
  border-radius: var(--radius-md);
  margin-bottom: 20px;
  gap: 4px;
}

.mode-tab {
  flex: 1;
  padding: 9px 12px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  border: none;
  border-radius: var(--radius-sm);
  background: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}

.mode-tab:hover {
  color: var(--text-main);
}

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

/* Reverse Mode Target Price Banner */
.reverse-price-banner {
  background: linear-gradient(135deg, #312e81 0%, #4338ca 100%);
  color: #ffffff;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 4px 10px rgb(49 46 129 / 0.3);
}

.reverse-label {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #c7d2fe;
  font-weight: 700;
}

.reverse-val {
  font-family: var(--font-mono);
  font-size: 1.8rem;
  font-weight: 800;
  color: #38bdf8;
}

/* Action Buttons Grid (Copy Report + Export Image + Share Link) */
.action-buttons-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 20px;
}

.btn-copy-report,
.btn-export-img,
.btn-share-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  padding: 11px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-copy-report {
  background: var(--primary);
  border: 1.5px solid var(--primary);
  color: #ffffff;
}

.btn-copy-report:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-export-img {
  background: #ffffff;
  border: 1.5px solid #10b981;
  color: #047857;
}

[data-theme="dark"] .btn-export-img {
  background: #111827;
  color: #34d399;
}

.btn-export-img:hover {
  background: #ecfdf5;
  transform: translateY(-1px);
}

[data-theme="dark"] .btn-export-img:hover {
  background: #064e3b;
}

.btn-share-link {
  background: #ffffff;
  border: 1.5px solid #6366f1;
  color: var(--primary);
}

[data-theme="dark"] .btn-share-link {
  background: #111827;
  color: #818cf8;
  border-color: #818cf8;
}

.btn-share-link:hover {
  background: var(--primary-light);
  transform: translateY(-1px);
}

[data-theme="dark"] .btn-share-link:hover {
  background: #1e1b4b;
}

/* Ad Spend Cushion & Breakeven ROAS Card */
.ad-cushion-card {
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin-bottom: 20px;
}

.cushion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.cushion-title {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.roas-pill {
  font-size: 0.76rem;
  background: #fef3c7;
  color: #92400e;
  padding: 3px 10px;
  border-radius: 999px;
  font-weight: 600;
}

[data-theme="dark"] .roas-pill {
  background: #451a03;
  color: #fde68a;
}

.roas-pill strong {
  font-family: var(--font-mono);
  color: #b45309;
}

[data-theme="dark"] .roas-pill strong {
  color: #f59e0b;
}

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

.cushion-item {
  background: var(--bg-card);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.cushion-lbl {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.cushion-val {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 2px 0;
}

.cushion-sub {
  font-size: 0.68rem;
  color: var(--text-muted);
}

/* Multi-Item Bundle & Volume Discount Matrix */
.bundle-matrix-card {
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-bottom: 20px;
}

.bundle-header {
  margin-bottom: 12px;
}

.bundle-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
}

.bundle-subtitle {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.bundle-table-wrapper {
  overflow-x: auto;
}

.bundle-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.bundle-table th {
  background: var(--bg-card);
  color: var(--text-muted);
  font-weight: 700;
  text-align: left;
  padding: 8px 10px;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

.bundle-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text-main);
  white-space: nowrap;
}

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

.bundle-tag {
  font-size: 0.70rem;
  background: #ecfdf5;
  color: var(--profit-dark);
  padding: 2px 7px;
  border-radius: 999px;
  font-weight: 600;
}

[data-theme="dark"] .bundle-tag {
  background: #064e3b;
  color: #34d399;
}

.bundle-highlight {
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--profit);
}

/* Product Comparison Scratchpad */
.scratchpad-section {
  margin-top: 40px;
}

.scratchpad-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  padding: 28px;
  margin-bottom: 32px;
}

.btn-add-compare {
  background: var(--primary);
  color: #ffffff;
  border: none;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-add-compare:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.scratchpad-table-wrapper {
  overflow-x: auto;
  margin-top: 14px;
}

.scratchpad-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.scratchpad-table th {
  background: var(--bg-main);
  color: var(--text-muted);
  font-weight: 700;
  text-align: left;
  padding: 10px 12px;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}

.scratchpad-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-main);
  white-space: nowrap;
}

.scratchpad-empty {
  text-align: center;
  padding: 28px 20px;
  color: var(--text-muted);
  font-size: 0.88rem;
  background: var(--bg-main);
  border-radius: var(--radius-md);
  border: 1px dashed var(--border);
  margin-top: 12px;
}

.btn-scratch-load {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 4px;
  cursor: pointer;
  margin-right: 6px;
  transition: all 0.15s;
}

.btn-scratch-load:hover {
  background: var(--primary);
  color: #fff;
}

.btn-scratch-del {
  background: none;
  border: 1px solid var(--border);
  color: var(--fee);
  font-size: 0.76rem;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}

.btn-scratch-del:hover {
  background: var(--fee-light);
  border-color: var(--fee);
}

/* Monthly Income Projection Card */
.volume-simulator-card {
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin-bottom: 20px;
}

.volume-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.vol-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
}

.vol-units-badge {
  font-size: 0.78rem;
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 999px;
  font-family: var(--font-mono);
}

.vol-slider-row {
  margin-bottom: 14px;
}

.range-slider {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: var(--border);
  outline: none;
  -webkit-appearance: none;
  cursor: pointer;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  cursor: pointer;
  border: 2px solid #ffffff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.vol-metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.vol-metric {
  background: var(--bg-card);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.vol-m-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

.vol-m-val {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 700;
  margin-top: 2px;
}

.profit-color { color: var(--profit); }
.highlight-color { color: #818cf8; }

/* Legal Pages Styling */
.legal-container {
  max-width: 800px;
  margin: 40px auto 80px;
  padding: 40px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.legal-container h1 {
  font-size: 2rem;
  margin-bottom: 8px;
  color: var(--text-main);
}

.legal-meta {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
}

.legal-container h2 {
  font-size: 1.3rem;
  margin: 28px 0 10px;
  color: var(--text-main);
}

.legal-container p {
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.7;
}

.legal-container code {
  background: var(--bg-main);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--border);
  color: var(--primary);
  font-family: var(--font-mono);
}

.back-link {
  display: inline-block;
  margin-bottom: 20px;
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.15s ease;
}

.back-link:hover {
  text-decoration: underline;
}

@media (max-width: 860px) {
  .header-inner {
    height: auto;
    padding: 14px 0;
    flex-direction: column;
    gap: 12px;
  }
  .nav-links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
  }
}

@media (max-width: 600px) {
  .action-buttons-row {
    grid-template-columns: 1fr;
  }
  .cushion-grid {
    grid-template-columns: 1fr;
  }
  .legal-container {
    padding: 24px 20px;
    margin: 20px auto 40px;
  }
}

/* ==========================================================================
   Killer Feature 1: Platform Showdown Comparison Grid (Etsy vs eBay vs Shopify vs Amazon)
   ========================================================================== */
.platform-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin: 28px 0;
}

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

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

.platform-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: all 0.25s ease;
  box-shadow: var(--shadow-sm);
}

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

.platform-card.winner-card {
  border-color: #10b981;
  box-shadow: 0 0 0 2px rgb(16 185 129 / 0.2), var(--shadow-md);
}

.platform-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.platform-name {
  font-size: 1.15rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}

.platform-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
}

.badge-etsy { background: #fff1eb; color: #d9480f; }
.badge-ebay { background: #e7f5ff; color: #1971c2; }
.badge-shopify { background: #ebfbee; color: #2f9e44; }
.badge-amazon { background: #fff9db; color: #e67700; }

[data-theme="dark"] .badge-etsy { background: #431407; color: #fb923c; }
[data-theme="dark"] .badge-ebay { background: #0c2646; color: #60a5fa; }
[data-theme="dark"] .badge-shopify { background: #052e16; color: #4ade80; }
[data-theme="dark"] .badge-amazon { background: #451a03; color: #fde047; }

.winner-crown {
  position: absolute;
  top: -12px;
  right: 18px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 12px;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgb(16 185 129 / 0.4);
  letter-spacing: 0.04em;
}

.platform-profit-highlight {
  background: var(--bg-main);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  text-align: center;
  margin-bottom: 16px;
  border: 1px solid var(--border);
}

.platform-profit-lbl {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.platform-profit-val {
  font-family: var(--font-mono);
  font-size: 1.7rem;
  font-weight: 800;
  color: var(--profit);
  margin: 4px 0;
}

.platform-margin-sub {
  font-size: 0.80rem;
  color: var(--text-muted);
}

.platform-stat-rows {
  font-size: 0.84rem;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}

.p-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.p-row-val {
  font-family: var(--font-mono);
  font-weight: 600;
}

.p-annual-box {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  font-size: 0.80rem;
  display: flex;
  justify-content: space-between;
  color: var(--text-muted);
}

.p-annual-val {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-main);
}

/* ==========================================================================
   Killer Feature 2: Etsy 13-Tag & SEO Title Generator
   ========================================================================== */
.tag-gen-container {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 28px;
  margin-bottom: 40px;
}

@media (max-width: 900px) {
  .tag-gen-container {
    grid-template-columns: 1fr;
  }
}

.tags-summary-box {
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.tags-counter-pill {
  background: #ecfdf5;
  color: #047857;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.82rem;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #a7f3d0;
}

[data-theme="dark"] .tags-counter-pill {
  background: #064e3b;
  color: #34d399;
  border-color: #047857;
}

.tags-cloud-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}

.tag-chip {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 7px 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

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

.tag-char-badge {
  font-family: var(--font-mono);
  font-size: 0.70rem;
  background: var(--bg-main);
  color: var(--text-muted);
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.tag-chip.copied {
  background: #10b981;
  color: #ffffff;
  border-color: #10b981;
}

.tag-chip.copied .tag-char-badge {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
  border-color: transparent;
}

.btn-copy-all-tags {
  width: 100%;
  background: var(--primary);
  color: #ffffff;
  border: none;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 10px rgb(79 70 229 / 0.25);
  margin-bottom: 28px;
}

.btn-copy-all-tags:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

/* SEO Title Variations Box */
.seo-titles-section {
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
}

.seo-title-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-top: 12px;
  position: relative;
}

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

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

.title-text-content {
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--text-main);
  font-weight: 600;
  margin-bottom: 10px;
  word-break: break-word;
}

.btn-copy-title {
  background: var(--primary-light);
  color: var(--primary);
  border: 1px solid var(--primary);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s;
}

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

.title-chars-counter {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

/* Guide & SEO Article Styles */
.guide-container {
  max-width: 860px;
  margin: 0 auto;
  padding: 30px 20px 80px 20px;
}

.guide-header {
  margin-bottom: 32px;
  text-align: left;
}

.guide-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 14px;
}

.guide-article {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-sm);
  color: var(--text-main);
  line-height: 1.8;
  font-size: 1.05rem;
}

.guide-article h2 {
  font-size: 1.55rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 36px 0 16px 0;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.guide-article h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 24px 0 12px 0;
}

.guide-article p {
  margin-bottom: 18px;
}

.guide-article ul, .guide-article ol {
  margin: 0 0 20px 24px;
}

.guide-article li {
  margin-bottom: 8px;
}

.guide-cta-box {
  background: linear-gradient(135deg, rgba(79, 70, 229, 0.08) 0%, rgba(16, 185, 129, 0.08) 100%);
  border: 1px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 24px 28px;
  margin: 32px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.guide-cta-text h4 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.guide-cta-text p {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-bottom: 0;
}

.guide-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
  transition: all 0.2s;
}

.guide-cta-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
}

@media (max-width: 680px) {
  .guide-article {
    padding: 24px 18px;
  }
  .guide-cta-box {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }
}

/* Site Footer */
.site-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 50px 0 30px;
  margin-top: 60px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 40px;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--border);
}

.footer-brand {
  max-width: 320px;
}

.footer-desc {
  font-size: 0.88rem;
  color: var(--text-muted);
  margin-top: 10px;
  line-height: 1.6;
}

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

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.footer-col a {
  font-size: 0.9rem;
  color: var(--text-main);
  text-decoration: none;
  transition: color 0.15s;
}

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

.footer-bottom {
  padding-top: 24px;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
}





/* Visible calculation scope and source references */
.fee-methodology { margin-top: 20px; margin-bottom: 28px; padding: 20px; border: 1px solid var(--border-color, #94a3b8); border-radius: 12px; line-height: 1.65; }
.fee-methodology h2 { font-size: 1.1rem; margin-bottom: 8px; }
.fee-methodology p { margin: 8px 0; font-size: .9rem; }
.fee-methodology a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.fee-reviewed { font-weight: 600; }

.tax-options { margin: 16px 0; line-height: 1.6; }
.tax-options summary { cursor: pointer; font-weight: 700; }
.tax-options p { font-size: .85rem; margin: 12px 0; }
.tax-options fieldset { padding: 12px; border: 1px solid var(--border-color, #94a3b8); border-radius: 8px; }
.tax-options .checkbox-label { margin: 6px 0; display: flex; gap: 8px; }

.chart-assumptions { font-size: .8rem; line-height: 1.5; margin: 12px 0; }
