/* PayoffCompare styles */
:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-muted: #64748b;
  --text-subtle: #94a3b8;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-soft: #eef2ff;
  --avalanche: #4f46e5;
  --avalanche-soft: #eef2ff;
  --snowball: #f59e0b;
  --snowball-soft: #fffbeb;
  --hybrid: #10b981;
  --hybrid-soft: #ecfdf5;
  --danger: #ef4444;
  --success: #16a34a;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 2px rgba(15,23,42,0.04);
  --shadow: 0 1px 3px rgba(15,23,42,0.06), 0 1px 2px rgba(15,23,42,0.04);
  --shadow-md: 0 4px 12px rgba(15,23,42,0.06);
  --max: 1180px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

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

/* Header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: var(--text);
  font-size: 18px;
  letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--surface-2);
}
.brand-text span {
  color: var(--text-muted);
  font-weight: 500;
  margin-left: 2px;
}
.site-nav {
  display: flex;
  gap: 22px;
  font-size: 14px;
}
.site-nav a {
  color: var(--text-muted);
  font-weight: 500;
}
.site-nav a:hover { color: var(--text); text-decoration: none; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
}
.btn:hover { text-decoration: none; background: var(--border); }
.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--primary-hover); }
.btn-secondary {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}
.btn-secondary:hover { background: var(--surface-2); }
.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-muted);
}
.btn-ghost:hover { color: var(--text); background: var(--surface-2); }
.btn-small { padding: 6px 12px; font-size: 13px; }

/* Hero */
.hero { padding: 56px 0 32px; }
.hero-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 40px;
  align-items: center;
}
.eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  background: var(--primary-soft);
  padding: 4px 10px;
  border-radius: 999px;
  margin: 0 0 14px;
}
.hero-copy h1 {
  font-size: 40px;
  line-height: 1.1;
  margin: 0 0 16px;
  letter-spacing: -0.02em;
}
.lead {
  font-size: 17px;
  color: var(--text-muted);
  margin: 0 0 20px;
  max-width: 540px;
}
.hero-actions { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.hero-points {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  color: var(--text-muted);
}
.hero-points li {
  padding-left: 20px;
  position: relative;
}
.hero-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 7px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--success);
  opacity: 0.5;
}
.hero-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-md);
}
.glance-row {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.glance-row:last-of-type { border-bottom: none; }
.glance-row span {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.glance-row em {
  font-style: normal;
  font-size: 12px;
  color: var(--text-subtle);
}
.glance-note {
  margin-top: 12px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

/* Comparer */
.comparer { padding: 32px 0 56px; }
.comparer-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 24px;
  align-items: start;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 10px;
  flex-wrap: wrap;
}
.panel-head h2 {
  font-size: 18px;
  margin: 0;
  letter-spacing: -0.01em;
}
.panel-actions { display: flex; gap: 6px; flex-wrap: wrap; }

.extra-pay, .hybrid-control {
  margin-bottom: 16px;
  padding: 14px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
}
.extra-pay label, .hybrid-control label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}
.hint {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}
.input-affix {
  position: relative;
  display: inline-block;
  width: 100%;
  max-width: 220px;
}
.input-affix .affix {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
  pointer-events: none;
}
input[type="number"], input[type="text"] {
  font-family: inherit;
  font-size: 14px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input[type="number"]:focus, input[type="text"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,0.1);
}
.input-affix input { padding-left: 24px; }

/* Debt table */
.debt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin-bottom: 12px;
}
.debt-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 8px 6px;
  border-bottom: 1px solid var(--border);
}
.debt-table td {
  padding: 6px 6px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.debt-table tr:last-child td { border-bottom: none; }
.col-name { width: 30%; }
.col-balance { width: 22%; }
.col-rate { width: 18%; }
.col-min { width: 22%; }
.col-action { width: 8%; text-align: right; }
.debt-table input { width: 100%; }
.row-delete {
  background: transparent;
  border: none;
  color: var(--text-subtle);
  cursor: pointer;
  font-size: 18px;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  line-height: 1;
}
.row-delete:hover { color: var(--danger); background: #fef2f2; }
.panel-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.row-count {
  font-size: 12px;
  color: var(--text-muted);
}
.save-status {
  margin-top: 10px;
  font-size: 12px;
  color: var(--success);
  min-height: 16px;
}

/* Results panel */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}
.empty-state svg { margin-bottom: 12px; opacity: 0.7; }
.empty-state h3 { margin: 0 0 6px; font-size: 16px; color: var(--text); }
.empty-state p { margin: 0; font-size: 14px; }

.summary-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
.summary-card {
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  text-align: left;
  font-family: inherit;
  width: 100%;
}
.summary-card:hover { border-color: var(--primary); }
.summary-card.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(79,70,229,0.15);
}
.summary-card .sc-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.summary-card .sc-interest {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.summary-card .sc-date {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
.summary-card.card-avalanche { border-top: 3px solid var(--avalanche); }
.summary-card.card-snowball { border-top: 3px solid var(--snowball); }
.summary-card.card-hybrid { border-top: 3px solid var(--hybrid); }

.strategy-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}
.tab {
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 14px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  margin-bottom: -1px;
}
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--primary); border-bottom-color: var(--primary); }

.result-block { margin-bottom: 20px; }
.result-block h3 { margin: 0 0 6px; font-size: 16px; }
.result-block p { margin: 0 0 12px; color: var(--text-muted); font-size: 14px; }
.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.stat {
  background: var(--surface-2);
  padding: 12px;
  border-radius: var(--radius-sm);
}
.stat span {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.stat strong {
  display: block;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.milestone-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.milestone-list li {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  font-size: 14px;
}
.milestone-list .ms-month {
  font-weight: 700;
  color: var(--primary);
  font-size: 13px;
}
.milestone-list .ms-name {
  font-weight: 600;
}
.milestone-list .ms-balance {
  font-size: 13px;
  color: var(--text-muted);
}

.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 140px;
  padding: 10px 0 0;
  border-bottom: 1px solid var(--border);
}
.bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
  justify-content: flex-end;
}
.bar-col .bar {
  width: 100%;
  max-width: 32px;
  background: var(--primary);
  border-radius: 4px 4px 0 0;
  min-height: 2px;
  transition: height 0.3s;
}
.bar-col .bar-label {
  font-size: 10px;
  color: var(--text-muted);
  text-align: center;
}
.bar-col .bar-value {
  font-size: 10px;
  font-weight: 600;
  color: var(--text);
}

/* Content sections */
.content-section { padding: 48px 0; border-top: 1px solid var(--border); }
.content-section h2 { font-size: 26px; margin: 0 0 12px; letter-spacing: -0.01em; }
.section-lede { color: var(--text-muted); margin: 0 0 24px; max-width: 640px; }

.how-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.how-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
}
.how-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 10px;
}
.how-card h3 { margin: 0 0 6px; font-size: 16px; }
.how-card p { margin: 0; font-size: 14px; color: var(--text-muted); }

.scenario-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.scenario {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}
.scenario h3 { margin: 0 0 6px; font-size: 16px; }
.scenario-meta {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 12px;
}
.scenario ul {
  margin: 0 0 12px;
  padding-left: 18px;
  font-size: 14px;
  color: var(--text-muted);
}
.scenario ul li { margin-bottom: 4px; }
.scenario p { margin: 0; font-size: 14px; color: var(--text-muted); }

.mistake-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.mistake {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  border-left: 3px solid var(--snowball);
}
.mistake h3 { margin: 0 0 6px; font-size: 16px; }
.mistake p { margin: 0; font-size: 14px; color: var(--text-muted); }

.assumption-list {
  margin: 0 0 16px;
  padding-left: 20px;
  font-size: 14px;
  color: var(--text-muted);
}
.assumption-list li { margin-bottom: 6px; }

.faq {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.faq dt {
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
  margin-bottom: 4px;
}
.faq dd {
  margin: 0;
  font-size: 14px;
  color: var(--text-muted);
}

.checklist {
  margin: 0;
  padding-left: 20px;
  font-size: 14px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fine-print {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 780px;
}

/* Footer */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 32px 0;
  margin-top: 32px;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
}
.footer-brand {
  display: flex;
  flex-direction: column;
  font-size: 14px;
}
.footer-brand span { color: var(--text-muted); font-size: 13px; }
.footer-links {
  display: flex;
  gap: 16px;
  font-size: 14px;
  flex-wrap: wrap;
}
.footer-links a { color: var(--text-muted); }
.footer-links a:hover { color: var(--text); }
.footer-copy {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 12px;
  color: var(--text-subtle);
}

/* Print */
@media print {
  .site-header, .site-footer, .panel-actions, .hero-actions, .hero-points, .btn, .save-status, .row-delete, .panel-foot { display: none !important; }
  .comparer-grid { grid-template-columns: 1fr; }
  .content-section { page-break-inside: avoid; }
  body { background: #fff; }
}

/* Responsive */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-copy h1 { font-size: 32px; }
  .comparer-grid { grid-template-columns: 1fr; }
  .how-grid { grid-template-columns: repeat(2, 1fr); }
  .scenario-grid { grid-template-columns: 1fr; }
  .mistake-grid { grid-template-columns: 1fr; }
  .summary-cards { grid-template-columns: repeat(3, 1fr); }
  .footer-inner { grid-template-columns: 1fr; text-align: center; }
  .footer-links { justify-content: center; }
}

@media (max-width: 640px) {
  .site-nav { display: none; }
  .how-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .summary-cards { grid-template-columns: 1fr; }
  .debt-table th, .debt-table td { padding: 6px 4px; font-size: 13px; }
  .col-name { width: 28%; }
  .col-balance { width: 24%; }
  .col-rate { width: 18%; }
  .col-min { width: 22%; }
  .col-action { width: 8%; }
  .hero-copy h1 { font-size: 28px; }
  .content-section h2 { font-size: 22px; }
}



/* Factory-injected deployment helpers. The AI owns the site design above this block. */
.ad-unit {
  width: min(100%, 720px);
  min-height: 120px;
  margin: 24px auto;
  display: block;
}

.legal-page {
  width: min(900px, calc(100% - 32px));
  margin: 40px auto;
}

.factory-fallback-nav {
  width: min(900px, calc(100% - 32px));
  margin: 24px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  font-size: 0.95rem;
}

.factory-fallback-nav a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}
