/* CalcWise — shared styles */
:root {
  --ink: #14233a;
  --ink-soft: #3a4a5c;
  --muted: #5c6b7a;
  --paper: #f3efe6;
  --paper-2: #e8e2d4;
  --white: #fffdf8;
  --navy: #14314d;
  --navy-2: #0c2036;
  --teal: #18665f;
  --teal-2: #0e4a45;
  --teal-soft: #e6f3f1;
  --gold: #b8893a;
  --gold-soft: #f6edd8;
  --line: #d6d0c3;
  --line-strong: #c3bbab;
  --ok: #1c6b45;
  --ok-bg: #e7f5ee;
  --warn: #8a5a12;
  --warn-bg: #f8efd8;
  --err: #922c2c;
  --err-bg: #f8e8e8;
  --shadow: 0 1px 2px rgba(20, 35, 58, 0.06), 0 8px 28px rgba(20, 35, 58, 0.07);
  --radius: 14px;
  --header-h: 72px;
  --font-serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-sans: "Source Sans 3", "Source Sans Pro", "Segoe UI", sans-serif;
  --max: 1120px;
  --ad-bg: #f0ebe1;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  min-height: 100vh;
}

img { max-width: 100%; height: auto; }
a { color: var(--teal-2); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--teal); }
:focus-visible {
  outline: 3px solid var(--teal);
  outline-offset: 2px;
}
.skip-link {
  position: absolute;
  left: 12px;
  top: -48px;
  background: var(--navy);
  color: #fff;
  padding: 8px 14px;
  z-index: 1000;
  border-radius: 6px;
}
.skip-link:focus { top: 12px; }

/* Header */
.site-header {
  background: var(--navy-2);
  color: #f4efe6;
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 22px;
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
  font-weight: 650;
  letter-spacing: -0.02em;
}
.logo-mark {
  width: 36px;
  height: 36px;
  flex: none;
}
.logo-word {
  font-family: var(--font-serif);
  font-size: 1.28rem;
  font-optical-sizing: auto;
}
.logo-word span { color: #d8b56a; font-weight: 500; }
.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  border-radius: 8px;
  padding: 8px 12px;
  font: inherit;
  font-size: 0.95rem;
  cursor: pointer;
}
.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 4px 18px;
  flex-wrap: wrap;
  align-items: center;
}
.site-nav a {
  color: #e6e0d4;
  text-decoration: none;
  font-size: 0.98rem;
  font-weight: 550;
  padding: 6px 0;
}
.site-nav a:hover, .site-nav a[aria-current="page"] { color: #fff; }
.site-nav .nav-cta {
  background: var(--teal);
  color: #fff !important;
  padding: 8px 14px;
  border-radius: 8px;
  margin-left: 6px;
}
.site-nav .nav-cta:hover { background: var(--teal-2); }

/* Hero */
.hero {
  background:
    radial-gradient(1200px 420px at 90% -10%, rgba(24,102,95,0.28), transparent 55%),
    linear-gradient(165deg, var(--navy-2) 0%, var(--navy) 58%, #1a3d4a 100%);
  color: #f6f1e6;
  padding: 64px 22px 72px;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 48px;
  background: linear-gradient(to bottom right, transparent 49%, var(--paper) 50%);
}
.hero-inner, .wrap, .page-hero-inner {
  max-width: var(--max);
  margin: 0 auto;
}
.eyebrow {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 650;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #d8b56a;
  margin-bottom: 10px;
}
.hero h1, .page-hero h1 {
  font-family: var(--font-serif);
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin: 0 0 16px;
}
.hero h1 { font-size: clamp(2.2rem, 4.6vw, 3.5rem); max-width: 18ch; }
.hero .lede {
  font-size: 1.18rem;
  max-width: 46ch;
  color: #e4ddd0;
  margin: 0 0 28px;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 10px;
  padding: 11px 18px;
  font: inherit;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
  color: #fff;
  background: var(--teal);
}
.btn:hover { background: var(--teal-2); color: #fff; }
.btn-gold { background: #b8893a; color: #1a1408; }
.btn-gold:hover { background: #a6782c; color: #1a1408; }
.btn-ghost {
  background: transparent;
  color: #f6f1e6;
  border: 1px solid rgba(246,241,230,0.4);
}
.btn-ghost:hover { background: rgba(255,255,255,0.08); color: #fff; }
.btn-secondary {
  background: var(--white);
  color: var(--navy);
  border: 1px solid var(--line-strong);
}
.btn-secondary:hover { background: var(--paper-2); color: var(--navy); }

/* Sections */
.section { padding: 56px 22px; }
.section-head { margin-bottom: 28px; }
.section h2, .prose h2, .tool-body h2 {
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 2.4vw, 2rem);
  font-weight: 650;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
  line-height: 1.2;
}
.section-head p, .subhead { color: var(--ink-soft); margin: 0; max-width: 62ch; }

.tool-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.tool-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 22px 20px;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  min-height: 100%;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.tool-card:hover {
  transform: translateY(-2px);
  border-color: var(--teal);
  color: inherit;
}
.tool-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--teal-soft);
  color: var(--teal-2);
  display: grid;
  place-items: center;
  margin-bottom: 14px;
}
.tool-icon svg { width: 22px; height: 22px; }
.tool-card h3 {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}
.tool-card p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.98rem;
  flex: 1;
}
.tool-card .card-link {
  margin-top: 14px;
  color: var(--teal-2);
  font-weight: 650;
  font-size: 0.95rem;
}

.note-band {
  background: var(--navy);
  color: #efe9dc;
  padding: 28px 22px;
}
.note-band-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 24px;
}
.note-band h2, .note-band h3 {
  font-family: var(--font-serif);
  margin: 0 0 8px;
  font-size: 1.15rem;
  color: #fff;
}
.note-band p { margin: 0; color: #d9d3c6; font-size: 0.98rem; }

/* Footer */
.site-footer {
  background: var(--navy-2);
  color: #d4cec2;
  padding: 48px 22px 24px;
  font-size: 0.98rem;
}
.footer-grid {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 28px;
}
.site-footer h2, .site-footer h3 {
  font-family: var(--font-serif);
  color: #fff;
  font-size: 1.05rem;
  margin: 0 0 12px;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: 0 0 7px; }
.site-footer a { color: #d4cec2; text-decoration: none; }
.site-footer a:hover { color: #fff; }
.footer-legal {
  max-width: var(--max);
  margin: 32px auto 0;
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,0.1);
  color: #a8a193;
  font-size: 0.88rem;
}
.footer-legal p { margin: 0 0 8px; }

/* Inner pages */
.page-hero {
  background: linear-gradient(165deg, var(--navy-2), var(--navy));
  color: #f6f1e6;
  padding: 36px 22px 40px;
}
.page-hero h1 { font-size: clamp(1.8rem, 3.2vw, 2.5rem); max-width: 22ch; }
.page-hero .lede { margin: 0; color: #e4ddd0; max-width: 62ch; }
.crumbs {
  font-size: 0.9rem;
  margin: 0 0 14px;
  color: #c9c2b3;
}
.crumbs a { color: #e8e0d0; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.crumbs li:not(:last-child)::after { content: "/"; margin-left: 6px; opacity: 0.6; }

.layout {
  max-width: var(--max);
  margin: 0 auto;
  padding: 32px 22px 64px;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.7fr);
  gap: 28px;
  align-items: start;
}
.layout-wide { grid-template-columns: 1fr; }
.calc-panel, .result-panel, .content-card, .side-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}
.calc-panel h2, .result-panel h2, .side-card h2 {
  font-size: 1.2rem;
  margin-top: 0;
}
.sticky-result { position: sticky; top: 88px; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
}
.form-grid .full { grid-column: 1 / -1; }
label, .label {
  display: block;
  font-size: 0.92rem;
  font-weight: 650;
  margin-bottom: 5px;
  color: var(--ink);
}
.hint { display: block; font-weight: 400; color: var(--muted); font-size: 0.82rem; margin-top: 3px; }
input[type="text"], input[type="number"], input[type="email"], input[type="date"],
input[type="search"], select, textarea {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}
textarea { min-height: 120px; resize: vertical; }
input:disabled, select:disabled { background: #f2efe8; color: var(--muted); }
.field-row { display: flex; gap: 8px; align-items: center; }
.prefix, .suffix {
  color: var(--muted);
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
}
.input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0 10px;
  background: #fff;
}
.input-wrap input, .input-wrap select {
  border: 0;
  padding: 9px 0;
  outline: none;
}
.form-actions { margin-top: 16px; display: flex; gap: 10px; flex-wrap: wrap; }

.result-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 16px; }
.kpi {
  background: var(--teal-soft);
  border-radius: 10px;
  padding: 12px;
}
.kpi.emphasis { background: var(--navy); color: #fff; grid-column: 1 / -1; }
.kpi .kpi-label { font-size: 0.8rem; font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; opacity: 0.8; }
.kpi .kpi-value { font-family: var(--font-serif); font-size: 1.55rem; font-weight: 650; letter-spacing: -0.02em; line-height: 1.2; margin-top: 2px; }
.kpi.emphasis .kpi-value { font-size: 1.85rem; }
.result-list { list-style: none; margin: 0; padding: 0; }
.result-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.98rem;
}
.result-list li:last-child { border-bottom: 0; }
.result-list .muted { color: var(--muted); }
.empty-result { color: var(--muted); margin: 0; }

.callout, .disclaimer-box {
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 0.92rem;
  margin: 14px 0 0;
}
.disclaimer-box { background: var(--warn-bg); color: #4d3408; border: 1px solid #e6d3a2; }
.callout-ok { background: var(--ok-bg); color: #143d28; }
.callout-info { background: var(--teal-soft); color: var(--teal-2); }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
th { font-size: 0.8rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.table-wrap { overflow-x: auto; margin-top: 12px; max-height: 420px; overflow-y: auto; }
.mono { font-variant-numeric: tabular-nums; }

.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.tab {
  background: var(--paper-2);
  border: 1px solid var(--line);
  color: var(--ink);
  border-radius: 999px;
  padding: 7px 14px;
  font: inherit;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
}
.tab[aria-selected="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }
.tab-panel[hidden] { display: none; }

.prose, .tool-body { max-width: 72ch; }
.prose p, .tool-body p { margin: 0 0 1em; }
.prose h2, .tool-body h2 { margin: 1.4em 0 0.5em; }
.prose h3, .tool-body h3 { font-size: 1.15rem; margin: 1.2em 0 0.4em; }
.prose ul, .tool-body ul, .prose ol, .tool-body ol { margin: 0 0 1em; padding-left: 1.2em; }
.content-block { margin-top: 8px; padding: 8px 2px 0; }

/* FAQ */
.faq { margin-top: 8px; }
.faq details {
  border-bottom: 1px solid var(--line);
  padding: 4px 0;
}
.faq summary {
  cursor: pointer;
  font-weight: 650;
  padding: 12px 0;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  float: right;
  font-weight: 500;
  color: var(--teal);
}
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0 0 14px; color: var(--ink-soft); }

/* Ads */
.ad-slot {
  background: repeating-linear-gradient(-45deg, var(--ad-bg), var(--ad-bg) 10px, #eae4d8 10px, #eae4d8 20px);
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  min-height: 90px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 650;
  margin: 18px 0;
  padding: 16px;
  text-align: center;
}
.ad-slot.ad-sidebar { min-height: 250px; }
.ad-slot.ad-infeed { min-height: 100px; }

.related { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0; padding: 0; list-style: none; }
.related a { text-decoration: none; color: inherit; display: block; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); }
.related a:hover { border-color: var(--teal); }

/* Legal / about */
.legal { max-width: 800px; margin: 0 auto; padding: 36px 22px 72px; }
.legal h1 { font-family: var(--font-serif); font-size: 2.1rem; margin: 0 0 8px; }
.legal .meta { color: var(--muted); margin-bottom: 24px; }

.about-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 36px 22px 72px;
}

/* Debt rows */
.repeat-row {
  display: grid;
  grid-template-columns: 1.3fr 1fr 0.8fr 1fr auto;
  gap: 8px;
  margin-bottom: 8px;
  align-items: end;
}
.icon-btn {
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  font: inherit;
  color: var(--err);
}

.compare-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

@media (max-width: 960px) {
  .tool-grid { grid-template-columns: 1fr 1fr; }
  .layout { grid-template-columns: 1fr; }
  .sticky-result { position: static; }
  .note-band-inner, .footer-grid, .about-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  .nav-toggle { display: inline-flex; }
  .site-nav {
    display: none;
    position: absolute;
    left: 0; right: 0;
    top: 100%;
    background: var(--navy-2);
    padding: 8px 22px 18px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; align-items: flex-start; gap: 10px; }
  .site-nav .nav-cta { margin-left: 0; }
  .tool-grid, .form-grid, .result-kpis, .related, .compare-cols, .repeat-row,
  .note-band-inner, .footer-grid, .about-grid { grid-template-columns: 1fr; }
  .hero { padding: 40px 18px 56px; }
  .repeat-row { grid-template-columns: 1fr 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .tool-card { transition: none; }
}

/* ---- Global tool site additions ---- */
.logo-word .logo-dot { color: #d8b56a; }
.has-sub { position: relative; }
.has-sub > .sub-toggle {
  background: none; border: 0; color: inherit; font: inherit; font-weight: 550;
  padding: 6px 0; cursor: pointer; color: #e6e0d4;
}
.has-sub > .sub-toggle:hover { color: #fff; }
.sub-nav {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 220px;
  background: var(--navy-2);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 10px 0;
  box-shadow: var(--shadow);
  z-index: 60;
}
.has-sub:hover > .sub-nav,
.has-sub:focus-within > .sub-nav,
.has-sub.is-open > .sub-nav { display: block; }
.sub-nav a {
  display: block;
  padding: 8px 16px;
  color: #e6e0d4;
  text-decoration: none;
  font-size: 0.95rem;
}
.sub-nav a:hover { background: rgba(255,255,255,0.06); color: #fff; }
.cat-pills {
  display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 28px;
}
.cat-pills a {
  display: inline-flex; align-items: center;
  padding: 7px 14px; border-radius: 999px;
  background: var(--white); border: 1px solid var(--line);
  color: var(--ink); text-decoration: none; font-weight: 600; font-size: 0.92rem;
}
.cat-pills a:hover, .cat-pills a:focus { border-color: var(--teal); color: var(--teal-2); }
.category-block { margin-bottom: 48px; }
.category-block .section-head { margin-bottom: 18px; }
.badge-us {
  display: inline-block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; background: var(--gold-soft); color: #6a4a12;
  border-radius: 999px; padding: 2px 8px; margin-left: 8px; vertical-align: middle;
}
.omit-list { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px; }
.omit-list ul { margin: 0.4em 0 0; }

.dropzone {
  border: 2px dashed var(--line-strong);
  border-radius: 12px;
  background: var(--paper);
  padding: 28px 18px;
  text-align: center;
  cursor: pointer;
  color: var(--ink-soft);
  transition: border-color 0.15s, background 0.15s;
}
.dropzone:hover, .dropzone.is-drag { border-color: var(--teal); background: var(--teal-soft); color: var(--teal-2); }
.dropzone input[type="file"] { display: none; }
.dropzone strong { color: var(--ink); display: block; margin-bottom: 4px; }
.preview-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.preview-card { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 10px; text-align: center; }
.preview-card img, .preview-card canvas { max-width: 100%; height: auto; border-radius: 6px; background:
  repeating-conic-gradient(#ddd 0% 25%, #fff 0% 50%) 50% / 16px 16px; }
.preview-card figcaption { font-size: 0.85rem; color: var(--muted); margin-top: 6px; }
.file-list { list-style: none; margin: 12px 0 0; padding: 0; }
.file-list li {
  display: flex; justify-content: space-between; gap: 10px; align-items: center;
  padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 0.95rem;
}
.file-list button { font: inherit; font-size: 0.85rem; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }
.chip {
  border: 1px solid var(--line-strong); background: var(--white); border-radius: 999px;
  padding: 5px 10px; font: inherit; font-size: 0.85rem; font-weight: 600; cursor: pointer; color: var(--ink);
}
.chip:hover, .chip[aria-pressed="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }
.output-box {
  width: 100%; min-height: 160px; font: inherit; font-size: 1rem;
  padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff;
}
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0; }
.stat { background: var(--teal-soft); border-radius: 10px; padding: 10px; text-align: center; }
.stat b { display: block; font-family: var(--font-serif); font-size: 1.3rem; }
.stat span { font-size: 0.78rem; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.qr-box { display: grid; place-items: center; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 16px; min-height: 220px; }
.fancy-out { font-size: 1.25rem; line-height: 1.7; word-break: break-word; background: var(--paper); border-radius: 10px; padding: 12px 14px; min-height: 4em; }
.convert-row { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: end; }
.convert-swap { background: var(--paper-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; cursor: pointer; font: inherit; font-weight: 700; }
.range-row { display: flex; align-items: center; gap: 10px; }
.range-row input[type="range"] { flex: 1; }
@media (max-width: 720px) {
  .sub-nav { position: static; min-width: 0; border: 0; box-shadow: none; padding: 4px 0 4px 12px; }
  .preview-wrap, .stat-row, .convert-row { grid-template-columns: 1fr; }
  .convert-swap { justify-self: start; }
}
