/* ============================================================
   Calculator Wizard — shared stylesheet
   ------------------------------------------------------------
   This one file styles every page on the site. Each page should
   carry ONE line in its <head>:

       <link rel="stylesheet" href="styles.css">

   ...and no <style> block of its own. Change a color or the nav
   here and it changes everywhere, instead of in 30 files.

   The design language matches the Debt Payoff Planner.
   ============================================================ */

:root {
  /* Surfaces */
  --bg:            #F3F5F0;   /* page background — warm off-white */
  --surface:       #FFFFFF;   /* cards and panels */
  --surface-sunk:  #F7F9F6;   /* inset boxes, table stripes */

  /* Text */
  --ink:           #1B2B22;   /* headings */
  --ink-soft:      #55645A;   /* body copy */
  --ink-faint:     #8A9A8C;   /* captions, labels */

  /* Brand */
  --primary:       #2F6F4E;   /* green — links, buttons, accents */
  --primary-dark:  #204F37;   /* hover */
  --primary-tint:  #E4EEE7;   /* highlight backgrounds */
  --gold:          #B8862F;   /* secondary accent, results */
  --gold-tint:     #F6ECD9;
  --line:          #DBE1D9;   /* borders and rules */

  /* Type */
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body:    'Karla', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:    ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

:focus-visible {
  outline: 2.5px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ---------- Header & navigation ---------- */

header {
  width: 100%;
  text-align: center;
  padding: 26px 0 0;
  margin-bottom: 34px;
  border-bottom: 1px solid var(--line);
}

.site-title {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 14px 0;
  text-decoration: none;
  display: inline-block;
}

/* The site has no logo image. "Wizard" carries the brand colour instead —
   the same move the Debt Payoff Planner's hero makes with "debt-free". */
.site-title em {
  font-style: italic;
  font-weight: 600;
  color: var(--primary);
}


.header-nav-row {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

nav { grid-column: 2; text-align: center; }

nav a {
  display: inline-block;
  margin: 0 2px;
  padding: 10px 12px;
  font-weight: 600;
  font-size: 15px;
  color: var(--ink-soft);
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

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

nav a.current {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tools-button-header {
  grid-column: 3;
  justify-self: end;
  color: #fff;
  background: var(--primary);
  font-weight: 600;
  text-decoration: none;
  font-size: 14px;
  white-space: nowrap;
  padding: 9px 18px;
  border-radius: 999px;
  margin-bottom: 8px;
}

.tools-button-header:hover { background: var(--primary-dark); }

/* ---------- Page containers ---------- */

.container {
  max-width: 820px;
  margin: 0 auto 48px auto;
  padding: 30px 34px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

/* Wide, transparent section used on the homepage between cards */
.container.plain {
  background: transparent;
  border: none;
  padding: 0 20px;
  max-width: 900px;
  margin: 44px auto;
}

h1, h2, h3 {
  font-family: var(--font-display);
  color: var(--ink);
  font-weight: 600;
  line-height: 1.2;
}

h1 { font-size: 32px; margin: 0 0 16px; letter-spacing: -0.01em; }
h2 { font-size: 22px; margin: 32px 0 12px; }
h3 { font-size: 17px; margin: 24px 0 6px; }

.container > h1:first-child,
.content-inner > h2:first-child { margin-top: 0; }

p  { margin: 0 0 14px; }
ul, ol { margin: 0 0 14px; padding-left: 22px; }
li { margin-bottom: 7px; }

.content-inner {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}

.content-inner p { color: var(--ink-soft); }

.lead {
  font-size: 17px;
  color: var(--ink-soft);
}

/* ---------- Homepage intro ---------- */

.intro-wrapper {
  max-width: 900px;
  margin: 0 auto 40px auto;
  padding: 0 20px;
  text-align: center;
}

.intro-section h1 {
  font-size: clamp(28px, 4.5vw, 38px);
  margin: 0 0 14px;
}

.intro-section p { max-width: 60ch; margin-left: auto; margin-right: auto; }

/* ---------- Calculator cards ---------- */

.calculator-container {
  max-width: 860px;
  margin: auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  align-items: start;
}

.calc-card {
  background: var(--surface);
  padding: 20px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.calc-card h2 {
  text-align: center;
  margin: 0 0 16px;
  font-size: 18px;
}

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

.row span { font-size: 14px; color: var(--ink-faint); }

.row input,
.full-input {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--bg);
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--ink);
}

.row input { width: 46%; min-width: 0; }

.full-input {
  width: 100%;
  margin-bottom: 10px;
}

.row input:focus,
.full-input:focus {
  outline: none;
  border-color: var(--primary);
}

button {
  width: 100%;
  margin-top: 12px;
  padding: 12px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

button:hover { background: var(--primary-dark); }

.result-box {
  margin-top: 14px;
  background: var(--primary-tint);
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid #CBDFD3;
  font-size: 16px;
  color: var(--ink);
}

.result-box strong {
  font-family: var(--font-display);
  font-size: 19px;
  color: var(--primary-dark);
}

.steps-box {
  margin-top: 10px;
  background: var(--surface-sunk);
  padding: 12px 14px;
  border-left: 3px solid var(--gold);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--ink-soft);
}

.card-more-link {
  text-align: center;
  margin: 12px 0 0;
  font-size: 13px;
}

.card-more-link a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

.card-more-link a:hover { text-decoration: underline; }

/* ---------- Content grids ---------- */

.formula-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  text-align: left;
  margin-top: 20px;
}

.formula-grid-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px 20px;
}

.container.plain .formula-grid-item { background: var(--surface); }

.formula-grid-item h3 {
  margin: 0 0 8px 0;
  font-size: 16px;
  color: var(--primary-dark);
}

.formula-grid-item p {
  margin: 0 0 8px 0;
  font-size: 14px;
}

.formula-grid-item p:last-child { margin-bottom: 0; }

.more-calc-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  text-align: left;
  margin-top: 20px;
}

.more-calc-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  text-decoration: none;
  color: var(--ink-soft);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.more-calc-card:hover {
  background: var(--primary-tint);
  border-color: var(--primary);
}

.more-calc-card strong {
  font-family: var(--font-display);
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 3px;
}

.more-calc-card span { font-size: 13px; color: var(--ink-faint); }

/* A card flagged as the site's headline tool */
.more-calc-card.featured {
  background: var(--gold-tint);
  border-color: #E6D3AE;
}

.more-calc-card.featured:hover { border-color: var(--gold); }

.featured-flag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 5px;
}

/* ---------- Tables ---------- */

.conversion-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
  font-size: 15px;
  background: var(--surface);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.conversion-table th,
.conversion-table td {
  border-bottom: 1px solid var(--line);
  padding: 11px 10px;
  text-align: center;
}

.conversion-table th {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  background: var(--surface-sunk);
  font-weight: 500;
}

.conversion-table td { font-family: var(--font-mono); color: var(--ink); }
.conversion-table tr:last-child td { border-bottom: none; }

/* ---------- Callouts ---------- */

.email-box {
  background: var(--primary-tint);
  border: 1px solid #CBDFD3;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  margin: 16px 0;
  font-size: 16px;
}

.email-box a {
  color: var(--primary-dark);
  font-family: var(--font-mono);
  text-decoration: none;
  font-weight: 600;
  /* A long address in a monospace font can't wrap on its own and pushes the
     whole page sideways on a narrow phone. Let it break anywhere. */
  overflow-wrap: anywhere;
  word-break: break-word;
  display: inline-block;
  max-width: 100%;
}

.email-box a:hover { text-decoration: underline; }

.note-box {
  background: var(--gold-tint);
  border: 1px solid #E6D3AE;
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin: 18px 0;
  font-size: 15px;
  color: var(--ink-soft);
}

.note-box strong { color: var(--ink); }

.faq-item { margin-bottom: 20px; }

.faq-item h3 {
  margin: 0 0 4px;
  font-size: 17px;
  color: var(--ink);
}

.faq-item p { margin: 0; }

.updated-date {
  font-family: var(--font-mono);
  color: var(--ink-faint);
  font-size: 12.5px;
  margin: -8px 0 24px;
}

/* ---------- Share section ---------- */

.share-section {
  max-width: 520px;
  margin: 30px auto;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  text-align: center;
}

.share-section h3 { margin: 0 0 4px; font-size: 17px; }

.share-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 14px;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: auto;
  margin-top: 0;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}

.share-btn svg { display: block; }
.share-btn:hover { background: var(--primary-tint); border-color: var(--primary); }

.share-btn.fb { color: #1877F2; }
.share-btn.x { color: #000000; }
.share-btn.reddit { color: #FF4500; }
.share-btn.wa { color: #25D366; }

/* ---------- Footer ---------- */

footer {
  text-align: center;
  padding: 30px 20px 40px;
  margin-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 13.5px;
  color: var(--ink-faint);
}

footer a {
  display: inline-block;
  margin: 0 9px;
  padding: 3px 0;
  color: var(--ink-soft);
  text-decoration: none;
}

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

.footer-links { margin: 12px 0; }

.footer-tagline { color: var(--ink-faint); }

/* ---------- Responsive ---------- */

@media (max-width: 700px) {
  .calculator-container { grid-template-columns: 1fr; }
  .formula-grid { grid-template-columns: 1fr; }
  .more-calc-grid { grid-template-columns: 1fr; }
  .container { padding: 24px 20px; margin-left: 14px; margin-right: 14px; }
}

@media (max-width: 600px) {
  .header-nav-row { grid-template-columns: 1fr; gap: 6px; }
  nav { grid-column: 1; }
  nav a { margin: 0; padding: 8px 9px; font-size: 14px; }
  .tools-button-header {
    grid-column: 1;
    justify-self: center;
    margin-top: 6px;
    margin-bottom: 14px;
  }
  h1 { font-size: 27px; }
}

/* ---------- Homepage featured tool ---------- */

.hero-feature {
  max-width: 860px;
  background: var(--gold-tint);
  border-color: #E6D3AE;
  text-align: center;
  margin-bottom: 34px;
}

.hero-feature h2 {
  margin: 6px 0 12px;
  font-size: clamp(26px, 4vw, 34px);
}

.hero-feature p {
  max-width: 58ch;
  margin: 0 auto 20px;
  color: var(--ink-soft);
}

.hero-feature-btn {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
  padding: 14px 30px;
  border-radius: var(--radius-md);
}

.hero-feature-btn:hover { background: var(--primary-dark); }

/* ============================================================
   Components used by the individual calculator & article pages
   ============================================================ */

/* The main heading on a calculator page. This is an <h1> — every
   calculator page needs exactly one, for search engines. */
.page-title {
  text-align: center;
  font-family: var(--font-display);
  font-size: clamp(26px, 4vw, 34px);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 4px auto 28px;
  padding: 0 20px;
  max-width: 800px;
}

/* A single calculator, centered. The homepage adds .grid for its
   multi-calculator layout instead. */
.calculator-container {
  max-width: 460px;
  margin: 0 auto 30px auto;
  padding: 0 20px;
  display: block;
}

.calculator-container.grid {
  max-width: 860px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  align-items: start;
}

.disclaimer-box {
  max-width: 500px;
  margin: 0 auto 40px auto;
  padding: 0 20px;
}

.disclaimer-box p {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-faint);
  text-align: center;
  margin: 0;
  line-height: 1.6;
}

.optional-label {
  font-size: 12.5px;
  color: var(--ink-faint);
  margin: 10px 0 6px 2px;
}

/* ---------- Long-form article column ---------- */

.article-wrapper {
  max-width: 740px;
  margin: 0 auto 50px auto;
  padding: 0 20px;
}

.article-wrapper h2 { font-size: 24px; margin-top: 40px; }
.article-wrapper h3 { font-size: 18px; margin-top: 28px; }
.article-wrapper p  { font-size: 16px; }
.article-wrapper > h2:first-child { margin-top: 0; }

.formula-box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--primary);
  padding: 16px 20px;
  margin: 20px 0;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--ink);
}

.formula-box strong { font-weight: 500; }

.example-box {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 18px 20px;
  margin: 18px 0;
  border-radius: var(--radius-md);
}

.example-box h4 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--primary-dark);
}

.example-box p { margin-bottom: 10px; }
.example-box p:last-child { margin-bottom: 0; }
.example-box strong { color: var(--ink); }

.compare-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 15px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.compare-table th,
.compare-table td {
  border-bottom: 1px solid var(--line);
  padding: 11px 14px;
  text-align: left;
}

.compare-table th {
  background: var(--surface-sunk);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 500;
}

.compare-table tr:last-child td { border-bottom: none; }
.compare-table a { color: var(--primary); font-weight: 600; }

/* Tables can be wide — let them scroll rather than break the page */
.table-scroll { overflow-x: auto; }

.cta-box {
  background: var(--gold-tint);
  border: 1px solid #E6D3AE;
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  margin: 40px 0;
}

.cta-box p { margin: 0; font-size: 16px; color: var(--ink); }

.cta-box a.cta-link {
  display: inline-block;
  margin-top: 14px;
  background: var(--primary);
  color: #fff;
  text-decoration: none;
  padding: 12px 26px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 15px;
}

.cta-box a.cta-link:hover { background: var(--primary-dark); }

/* ---------- Hover/tap definition terms ---------- */

.term {
  position: relative;
  border-bottom: 1px dotted var(--primary);
  color: var(--primary);
  cursor: help;
  font-weight: 600;
}

.term .tooltip-box {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  bottom: 130%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  text-align: left;
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
  width: 220px;
  box-shadow: 0 6px 18px rgba(27, 43, 34, 0.25);
  transition: opacity 0.15s ease;
  z-index: 10;
}

.term .tooltip-box::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -6px;
  border-width: 6px;
  border-style: solid;
  border-color: var(--ink) transparent transparent transparent;
}

.term:hover .tooltip-box,
.term.tap-active .tooltip-box { visibility: visible; opacity: 1; }

@media (max-width: 480px) {
  .term .tooltip-box { width: 180px; }
}

/* ---------- Directory page (calculators.html) ---------- */

.page-intro {
  max-width: 720px;
  margin: 0 auto 36px auto;
  padding: 0 20px;
  text-align: center;
}

.page-intro h1 { font-size: clamp(28px, 4vw, 36px); margin-bottom: 12px; }
.page-intro p { font-size: 17px; color: var(--ink-soft); }

.category-section {
  max-width: 900px;
  margin: 0 auto 40px auto;
  padding: 0 20px;
}

.category-section h2 {
  font-size: 20px;
  margin: 0 0 16px;
  padding-bottom: 9px;
  border-bottom: 2px solid var(--line);
}

.calc-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.calc-card-link {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  text-decoration: none;
  color: var(--ink-soft);
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.calc-card-link:hover {
  border-color: var(--primary);
  background: var(--primary-tint);
}

.calc-card-link h3 {
  font-size: 17px;
  margin: 0 0 6px 0;
  color: var(--ink);
}

.calc-card-link p {
  font-size: 14px;
  color: var(--ink-faint);
  margin: 0;
  flex-grow: 1;
}

.calc-card-link.featured {
  background: var(--gold-tint);
  border-color: #E6D3AE;
}

.calc-card-link.featured:hover { border-color: var(--gold); }

@media (max-width: 700px) {
  .calc-grid { grid-template-columns: 1fr; }
  .calculator-container.grid { grid-template-columns: 1fr; }
}

/* ---------- Guide article extras ---------- */

.breadcrumb {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-faint);
  margin-bottom: 20px;
  letter-spacing: 0.02em;
}

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

.article-wrapper h1 {
  font-size: clamp(28px, 4vw, 36px);
  margin: 0 0 8px;
}

.article-meta {
  font-family: var(--font-mono);
  color: var(--ink-faint);
  font-size: 12px;
  margin-bottom: 34px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

/* ---------- Guides directory ---------- */

.guides-grid {
  max-width: 900px;
  margin: 0 auto 50px auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.guide-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
}

.guide-card h2 {
  font-size: 19px;
  margin: 0 0 10px 0;
}

.guide-card p {
  font-size: 14.5px;
  color: var(--ink-soft);
  flex-grow: 1;
  margin-bottom: 0;
}

.guide-card a.read-link {
  display: inline-block;
  margin-top: 16px;
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  font-size: 15px;
}

.guide-card a.read-link:hover { text-decoration: underline; }

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

/* ---------- Body fat gender toggle ---------- */

.gender-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.gender-toggle button {
  flex: 1;
  width: auto;
  margin-top: 0;
  padding: 10px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink-soft);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.gender-toggle button.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ---------- 404 ---------- */

.big-404 {
  font-family: var(--font-display);
  font-size: 76px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 10px;
}

.home-btn {
  display: inline-block;
  margin-top: 18px;
  padding: 13px 30px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
}

.home-btn:hover { background: var(--primary-dark); }

.helpful-links {
  margin-top: 32px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
  font-size: 15px;
}

.helpful-links a {
  color: var(--primary);
  text-decoration: none;
  margin: 0 8px;
}

.helpful-links a:hover { text-decoration: underline; }

/* ---------- Labelled calculator fields ---------- */
/* Every input gets a visible label. Placeholders alone vanish the moment
   someone types, and screen readers get nothing from them. */

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 12px;
}

.field label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.field input { width: 100%; margin-bottom: 0; }

.row {
  align-items: flex-start;
  gap: 10px;
}

.row .field {
  flex: 1 1 44%;
  min-width: 0;
  margin-bottom: 0;
}

.row .field input { width: 100%; }

/* an inline connector word between two fields, e.g. "is what % of" */
.row > span {
  align-self: center;
  padding-top: 14px;
}

@media (max-width: 480px) {
  .row .field { flex: 1 1 100%; }
  .row > span { padding-top: 0; }
}

/* The 404's headline is an h1 but shouldn't shout like a page title */
.container .big-404 + h1 { font-size: 22px; margin: 0 0 10px; }

/* ============================================================
   Traditional calculators page
   ------------------------------------------------------------
   These two are deliberately skeuomorphic — a dark handheld
   calculator, not a site form. Namespaced as .ti-calc so the
   site's own .calc-card styling doesn't fight with it.
   ============================================================ */

.tool-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  max-width: 740px;
  margin: 40px auto;
  padding: 0 20px;
}

.tool-left { width: 100%; display: flex; justify-content: center; }

.tool-right {
  width: 100%;
  max-width: 620px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.tool-right h3 { margin-top: 0; font-size: 21px; }
.tool-right h4 { margin: 20px 0 4px; font-size: 15px; color: var(--primary-dark); }
.tool-right p { font-size: 15px; }

.ti-calc {
  background: #23302A;
  border: 2px solid #16211C;
  padding: 20px;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 320px;
  margin: 0 auto;
  color: #fff;
}

.ti-calc h2 {
  color: #fff;
  font-size: 17px;
  text-align: center;
  margin: 0 0 16px;
}

.calc-display {
  width: 100%;
  padding: 14px;
  font-family: var(--font-mono);
  font-size: 24px;
  border: 2px solid #16211C;
  margin: 0 auto 18px auto;
  text-align: right;
  border-radius: var(--radius-sm);
  background: #E4EEE7;
  color: var(--ink);
  box-sizing: border-box;
}

.calc-buttons,
.sci-buttons {
  display: grid;
  gap: 8px;
  width: 100%;
}

.calc-buttons { grid-template-columns: repeat(4, 1fr); }
.sci-buttons  { grid-template-columns: repeat(5, 1fr); }

.ti-calc button {
  width: auto;
  margin-top: 0;
  padding: 14px 0;
  font-family: var(--font-body);
  font-size: 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid #16211C;
  font-weight: 600;
  background: #3C4E45;
  color: #fff;
  text-align: center;
}

.ti-calc .btn-num        { background: #45594F; }
.ti-calc .btn-num:hover  { background: #556C60; }
.ti-calc .btn-op         { background: var(--primary); }
.ti-calc .btn-op:hover   { background: #3A8560; }
.ti-calc .btn-clear      { background: #A6432E; }
.ti-calc .btn-clear:hover{ background: #BF5340; }
.ti-calc .btn-func       { background: #8A6520; }
.ti-calc .btn-func:hover { background: var(--gold); }

@media (min-width: 820px) {
  .tool-row { flex-direction: row; align-items: flex-start; max-width: 980px; }
  .tool-left { width: auto; }
  .tool-right { padding-top: 0; border-top: none; }
}




/* The Spanish-version link under the homepage's Debt Payoff Planner block.
   Deliberately quiet — it should be findable by someone looking for it,
   not compete with the main call to action. */
.hero-feature-alt {
  margin: 12px 0 0 0;
}

.hero-feature-alt a {
  font-size: 14px;
  color: var(--primary-dark);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  padding-bottom: 1px;
}

.hero-feature-alt a:hover {
  border-bottom-color: var(--primary-dark);
}


/* Source list at the foot of a guide — smaller and quieter than body copy,
   but still readable. Citations are the point, not decoration. */
.sources-note {
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--ink-soft);
  border-top: 1px solid var(--line);
  padding-top: 14px;
}


/* "Also available in <other language>" under an article title. Quiet, but
   written in the target language so the right reader spots it immediately. */
.lang-offer-inline {
  margin: -6px 0 18px 0;
  font-size: 14px;
}

.lang-offer-inline a {
  color: var(--primary-dark);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}

.lang-offer-inline a:hover { border-bottom-color: var(--primary-dark); }
