/* ==========================================================================
   Shared stylesheet for all tool pages.
   One file, linked by every tool. Edit here, changes everywhere.
   ========================================================================== */

:root {
  --paper:      #FBFAF7;
  --surface:    #FFFFFF;
  --ink:        #16191D;
  --ink-2:      #5A6069;
  --ink-3:      #8A9099;
  --rule:       #E4E2DC;
  --pine:       #0E5C48;
  --pine-deep:  #0A4436;
  --pine-tint:  #EBF3F0;
  --amber:      #8A5A00;
  --amber-tint: #FDF6E6;

  --measure: 66ch;
  --radius: 6px;
  --shadow: 0 1px 2px rgba(22,25,29,.06), 0 4px 16px rgba(22,25,29,.04);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--pine); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--pine-deep); }

:focus-visible {
  outline: 2px solid var(--pine);
  outline-offset: 2px;
  border-radius: 3px;
}

/* --- Shell ---------------------------------------------------------------- */

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

.masthead {
  border-bottom: 1px solid var(--rule);
  background: var(--surface);
}
.masthead .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
}
.logo {
  font-weight: 600;
  font-size: 1.0625rem;
  letter-spacing: -.01em;
  color: var(--ink);
  text-decoration: none;
}
.logo span { color: var(--pine); }
.masthead nav { display: flex; gap: 20px; font-size: .9375rem; }
.masthead nav a { color: var(--ink-2); text-decoration: none; }
.masthead nav a:hover { color: var(--pine); }

.crumbs {
  font-size: .8125rem;
  color: var(--ink-3);
  padding: 14px 0 0;
}
.crumbs a { color: var(--ink-3); text-decoration: none; }
.crumbs a:hover { color: var(--pine); text-decoration: underline; }

main { padding-bottom: 64px; }

.page-head { padding: 18px 0 26px; max-width: var(--measure); }
.page-head h1 {
  font-size: clamp(1.6rem, 4vw, 2.1rem);
  line-height: 1.2;
  letter-spacing: -.02em;
  font-weight: 600;
  margin: 0 0 8px;
}
.page-head p { margin: 0; color: var(--ink-2); font-size: 1.0625rem; }

/* --- Tool panel ----------------------------------------------------------- */

.tool {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 380px);
  gap: 24px;
  align-items: start;
}
@media (max-width: 820px) {
  .tool { grid-template-columns: 1fr; }
}

.panel {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}

.field { margin-bottom: 18px; }
.field:last-child { margin-bottom: 0; }

.field label {
  display: block;
  font-size: .875rem;
  font-weight: 500;
  margin-bottom: 6px;
}
.field .hint {
  display: block;
  font-size: .8125rem;
  color: var(--ink-3);
  font-weight: 400;
  margin-top: 5px;
  line-height: 1.45;
}

.control { position: relative; display: flex; align-items: stretch; }
.control .affix {
  display: flex;
  align-items: center;
  padding: 0 11px;
  background: var(--paper);
  border: 1px solid var(--rule);
  color: var(--ink-2);
  font-size: .9375rem;
}
.control .affix.pre  { border-right: 0; border-radius: var(--radius) 0 0 var(--radius); }
.control .affix.post { border-left: 0;  border-radius: 0 var(--radius) var(--radius) 0; }

input[type="number"], input[type="text"], select, textarea {
  width: 100%;
  min-width: 0;
  font: inherit;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 9px 11px;
}
.control .affix.pre + input  { border-radius: 0 var(--radius) var(--radius) 0; }
.control input:has(+ .affix.post) { border-radius: var(--radius) 0 0 var(--radius); }

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--pine);
  box-shadow: 0 0 0 3px var(--pine-tint);
}

textarea { resize: vertical; line-height: 1.6; }

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 520px) { .row { grid-template-columns: 1fr; } }

.btn {
  font: inherit;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius);
  padding: 9px 16px;
  border: 1px solid var(--rule);
  background: var(--surface);
  color: var(--ink);
}
.btn:hover { background: var(--paper); }
.btn-primary {
  background: var(--pine);
  border-color: var(--pine);
  color: #fff;
}
.btn-primary:hover { background: var(--pine-deep); border-color: var(--pine-deep); }

.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }

/* --- Result --------------------------------------------------------------- */

.result {
  background: var(--pine);
  color: #fff;
  border-radius: var(--radius);
  padding: 22px;
}
.result .result-label {
  font-size: .875rem;
  color: rgba(255,255,255,.78);
  margin: 0 0 2px;
}
.result .result-value {
  font-size: clamp(2rem, 7vw, 2.75rem);
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1.1;
  margin: 0;
}
.result .result-note {
  font-size: .8125rem;
  color: rgba(255,255,255,.72);
  margin: 6px 0 0;
}

.breakdown { margin-top: 18px; border-top: 1px solid rgba(255,255,255,.2); }
.breakdown dl { margin: 0; }
.breakdown .line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(255,255,255,.12);
  font-size: .9375rem;
}
.breakdown .line:last-child { border-bottom: 0; }
.breakdown dt { color: rgba(255,255,255,.8); margin: 0; }
.breakdown dd { margin: 0; font-weight: 500; }
.breakdown .line.total { font-weight: 600; }

/* Light-panel stat grid, for tools without a single headline number */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--rule); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
.stats .stat { background: var(--surface); padding: 14px 16px; }
.stats .stat .n { font-size: 1.5rem; font-weight: 600; letter-spacing: -.02em; display: block; line-height: 1.2; }
.stats .stat .k { font-size: .8125rem; color: var(--ink-2); }
.stats .stat.wide { grid-column: 1 / -1; }

/* --- Provenance / disclosure --------------------------------------------- */

.provenance {
  margin-top: 14px;
  padding: 11px 13px;
  background: var(--amber-tint);
  border: 1px solid #F0E2BE;
  border-radius: var(--radius);
  font-size: .8125rem;
  color: var(--amber);
  line-height: 1.5;
}

.privacy-note {
  margin-top: 14px;
  font-size: .8125rem;
  color: var(--ink-2);
}

/* --- Ad slots ------------------------------------------------------------- */
/* Replace the inner markup with your AdSense unit. Keep the wrapper so
   layout does not shift when the ad loads (prevents CLS penalties). */

.ad-slot {
  margin: 28px 0;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--rule);
  border-radius: var(--radius);
  color: var(--ink-3);
  font-size: .75rem;
}
.ad-slot::before { content: attr(data-slot); }

/* --- Article content ------------------------------------------------------ */

.article { max-width: var(--measure); margin-top: 40px; }
.article h2 {
  font-size: 1.3125rem;
  letter-spacing: -.015em;
  margin: 34px 0 10px;
  padding-top: 20px;
  border-top: 1px solid var(--rule);
}
.article h2:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.article h3 { font-size: 1.0625rem; margin: 22px 0 6px; }
.article p { margin: 0 0 14px; color: #262A2F; }
.article ul, .article ol { margin: 0 0 14px; padding-left: 22px; color: #262A2F; }
.article li { margin-bottom: 6px; }
.article table { width: 100%; border-collapse: collapse; margin: 0 0 18px; font-size: .9375rem; }
.article th, .article td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--rule); }
.article th { font-weight: 600; background: var(--surface); }

.faq details {
  border-bottom: 1px solid var(--rule);
  padding: 13px 0;
}
.faq summary {
  cursor: pointer;
  font-weight: 500;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--pine); font-size: 1.2rem; line-height: 1; }
.faq details[open] summary::after { content: "\2013"; }
.faq details p { margin: 10px 0 0; color: var(--ink-2); }

/* --- Related tools -------------------------------------------------------- */
/* Pageviews per session is the whole ballgame on a tool site. Every page
   ends with this. Do not ship a tool page without it. */

.related { margin-top: 44px; }
.related h2 { font-size: 1.125rem; margin: 0 0 14px; }
.related ul {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}
.related a {
  display: block;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 13px 15px;
  text-decoration: none;
  color: var(--ink);
}
.related a:hover { border-color: var(--pine); }
.related a strong { display: block; font-weight: 500; font-size: .9375rem; }
.related a span { display: block; font-size: .8125rem; color: var(--ink-2); margin-top: 2px; }

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

.site-foot {
  border-top: 1px solid var(--rule);
  background: var(--surface);
  padding: 26px 0;
  font-size: .875rem;
  color: var(--ink-2);
}
.site-foot .wrap { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; }
.site-foot a { color: var(--ink-2); text-decoration: none; }
.site-foot a:hover { color: var(--pine); text-decoration: underline; }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 8px 18px; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* --- Home page ----------------------------------------------------------- */

.home-page {
  background: #f7f8f4;
}

.home-page .masthead {
  background: rgba(247,248,244,.84);
  border-bottom-color: rgba(22,25,29,.08);
  backdrop-filter: blur(12px);
}

.home-hero {
  overflow: hidden;
  padding: 88px 0 100px;
  background:
    radial-gradient(circle at 82% 16%, rgba(157,192,167,.25), transparent 24rem),
    linear-gradient(135deg, #f7f8f4 10%, #e8f0e8 100%);
}

.home-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, .8fr);
  align-items: center;
  gap: 72px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--pine);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.home-hero h1,
.home-why h2 {
  max-width: 720px;
  margin: 0;
  font-family: "DM Serif Display", Georgia, serif;
  font-size: clamp(3.2rem, 8vw, 6.5rem);
  font-weight: 400;
  letter-spacing: -.045em;
  line-height: .98;
}

.home-hero h1 em {
  color: var(--pine);
  font-style: normal;
}

.hero-copy {
  max-width: 540px;
  margin: 25px 0 0;
  color: var(--ink-2);
  font-size: 1.125rem;
}

.hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 22px;
  margin-top: 32px;
}

.home-page .btn {
  border-radius: 10px;
}

.text-link {
  color: var(--ink);
  font-size: .9375rem;
  font-weight: 500;
  text-decoration: none;
}

.text-link span {
  margin-left: 6px;
  color: var(--pine);
  font-size: 1.15rem;
}

.hero-card {
  position: relative;
  overflow: hidden;
  min-height: 355px;
  padding: 27px;
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 20px;
  background:
    radial-gradient(circle at 100% 0, rgba(255,255,255,.2), transparent 15rem),
    linear-gradient(145deg, #185f4d, #092f27);
  color: white;
  box-shadow: 0 24px 60px rgba(9,47,39,.22);
  transform: rotate(2deg);
}

.hero-card::after {
  position: absolute;
  right: -80px;
  bottom: -105px;
  width: 260px;
  height: 260px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 50%;
  box-shadow: 0 0 0 28px rgba(255,255,255,.04), 0 0 0 56px rgba(255,255,255,.03);
  content: "";
}

.hero-card-top,
.hero-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: rgba(255,255,255,.7);
  font-size: .75rem;
}

.hero-dot {
  width: 8px;
  height: 8px;
  margin-right: auto;
  border-radius: 50%;
  background: #d6eec8;
  box-shadow: 0 0 0 5px rgba(214,238,200,.13);
}

.hero-live {
  color: #d6eec8;
}

.hero-number {
  margin-top: 72px;
  font-size: clamp(3rem, 7vw, 4.7rem);
  font-weight: 600;
  letter-spacing: -.06em;
  line-height: 1;
}

.hero-label {
  margin-top: 8px;
  color: rgba(255,255,255,.72);
  font-size: .875rem;
}

.hero-bars {
  display: flex;
  align-items: end;
  gap: 7px;
  height: 58px;
  margin-top: 34px;
}

.hero-bars i {
  display: block;
  width: 15%;
  border-radius: 5px 5px 0 0;
  background: rgba(214,238,200,.72);
}

.hero-bars i:nth-child(1) { height: 28%; }
.hero-bars i:nth-child(2) { height: 42%; }
.hero-bars i:nth-child(3) { height: 67%; }
.hero-bars i:nth-child(4) { height: 100%; background: #d6eec8; }

.hero-card-foot {
  position: absolute;
  right: 27px;
  bottom: 25px;
  left: 27px;
}

.home-section {
  padding-top: 96px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  margin-bottom: 26px;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.75rem);
  letter-spacing: -.045em;
  line-height: 1;
}

.section-heading > p {
  max-width: 280px;
  margin: 0 0 2px;
  color: var(--ink-2);
  font-size: .9375rem;
  text-align: right;
}

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

.tool-card {
  display: flex;
  min-height: 320px;
  flex-direction: column;
  padding: 28px;
  border: 1px solid #dce2da;
  border-radius: 16px;
  background: rgba(255,255,255,.68);
  color: var(--ink);
  text-decoration: none;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.tool-card:hover {
  border-color: #a9c8b5;
  color: var(--ink);
  box-shadow: 0 18px 38px rgba(14,92,72,.1);
  transform: translateY(-4px);
}

.tool-card-featured {
  border-color: #b8d2bd;
  background: #eaf2e9;
}

.tool-card-writing {
  max-width: 530px;
}

.tool-icon {
  display: grid;
  width: 45px;
  height: 45px;
  place-items: center;
  border-radius: 12px;
  background: var(--pine);
  color: white;
  font-size: 1.25rem;
  font-weight: 500;
}

.card-kicker {
  margin-top: 32px;
  color: var(--pine);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.tool-card h3 {
  margin: 7px 0 8px;
  font-size: 1.5rem;
  letter-spacing: -.025em;
}

.tool-card p {
  max-width: 410px;
  margin: 0;
  color: var(--ink-2);
}

.card-link {
  margin-top: auto;
  padding-top: 30px;
  color: var(--pine-deep);
  font-size: .875rem;
  font-weight: 600;
}

.card-link b {
  margin-left: 7px;
  font-size: 1.1rem;
}

.home-why {
  margin-top: 96px;
  padding: 84px 0;
  background: var(--pine-deep);
  color: white;
}

.why-grid {
  display: grid;
  grid-template-columns: .85fr 1fr;
  gap: 80px;
}

.home-why h2 {
  font-size: clamp(2.7rem, 5vw, 4.5rem);
}

.home-why .eyebrow {
  color: #cfe8c3;
}

.why-points {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  align-items: start;
}

.why-points > div {
  padding-top: 15px;
  border-top: 1px solid rgba(255,255,255,.25);
}

.why-points strong {
  font-size: .9375rem;
}

.why-points p {
  margin: 10px 0 0;
  color: rgba(255,255,255,.66);
  font-size: .875rem;
  line-height: 1.55;
}

@media (max-width: 820px) {
  .home-hero { padding: 62px 0 72px; }
  .home-hero-grid,
  .why-grid { grid-template-columns: 1fr; gap: 45px; }
  .hero-card { max-width: 500px; transform: none; }
  .section-heading { align-items: start; flex-direction: column; gap: 12px; }
  .section-heading > p { text-align: left; }
  .why-points { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .home-hero h1 { font-size: 3.35rem; }
  .tool-cards { grid-template-columns: 1fr; }
  .hero-card { min-height: 310px; }
}

/* --- Compound interest calculator ---------------------------------------- */

.compound-page {
  background:
    radial-gradient(circle at 85% 8%, rgba(14,92,72,.10), transparent 28rem),
    linear-gradient(180deg, #f7fbf9 0, var(--paper) 34rem);
}

.compound-page .masthead {
  background: rgba(255,255,255,.88);
  backdrop-filter: blur(10px);
}

.compound-page .page-head {
  max-width: 760px;
  padding-top: 34px;
}

.compound-page .page-head h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  letter-spacing: -.045em;
}

.compound-page .page-head p {
  max-width: 600px;
  font-size: 1.125rem;
}

.compound-page .tool {
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: 30px;
}

.compound-page .panel {
  border-color: #d8e7e1;
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(14,92,72,.08);
  padding: 28px;
}

.compound-page .field {
  margin-bottom: 20px;
}

.compound-page .field label {
  color: var(--ink);
  letter-spacing: .01em;
}

.compound-page input[type="number"],
.compound-page select {
  min-height: 48px;
  border-color: #d5e0dc;
  border-radius: 9px;
  background: #fcfefd;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.compound-page input[type="number"]:hover,
.compound-page select:hover {
  border-color: #a9c8bd;
  background: #fff;
}

.compound-page input[type="number"]:focus,
.compound-page select:focus {
  border-color: var(--pine);
  box-shadow: 0 0 0 4px rgba(14,92,72,.12);
  background: #fff;
}

.compound-page .control .affix {
  border-color: #d5e0dc;
  background: #edf6f2;
  color: var(--pine-deep);
  font-weight: 500;
}

.compound-page .btn-row {
  margin-top: 24px;
}

.compound-page .btn {
  border-color: #cbded7;
  border-radius: 9px;
  background: #f5faf8;
  color: var(--pine-deep);
  transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.compound-page .btn:hover {
  border-color: #8eb9aa;
  background: #eaf5f0;
  box-shadow: 0 4px 12px rgba(14,92,72,.10);
  transform: translateY(-1px);
}

.compound-page .result {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  padding: 28px;
  background:
    radial-gradient(circle at 100% 0, rgba(255,255,255,.20), transparent 18rem),
    linear-gradient(145deg, #0e5c48, #083f33);
  box-shadow: 0 16px 36px rgba(8,63,51,.20);
}

.compound-page .result::after {
  content: "";
  position: absolute;
  width: 190px;
  height: 190px;
  right: -72px;
  bottom: -92px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 50%;
  box-shadow: 0 0 0 20px rgba(255,255,255,.04), 0 0 0 40px rgba(255,255,255,.03);
  pointer-events: none;
}

.compound-page .result-value {
  font-size: clamp(2.5rem, 7vw, 3.75rem);
  letter-spacing: -.055em;
}

.compound-page .breakdown {
  position: relative;
  z-index: 1;
  margin-top: 24px;
}

.compound-page .breakdown .line {
  padding: 11px 0;
}

.compound-page .provenance {
  margin-top: 16px;
  border-color: #ead9ac;
  border-radius: 10px;
  background: rgba(253,246,230,.86);
}

.compound-page #schedule {
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(22,25,29,.04);
}

.compound-page #schedule th {
  background: #edf6f2;
  color: var(--pine-deep);
  font-size: .8125rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.compound-page #schedule td {
  color: var(--ink-2);
}

.compound-page #schedule tbody tr:nth-child(even) td {
  background: #fbfdfc;
}

.compound-page #schedule tbody tr:hover td {
  background: #f0f8f4;
}

.compound-page .rate-scenarios {
  max-width: none;
  margin-top: 42px;
}

.compound-page .rate-scenarios h2 {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.compound-page .scenario-intro {
  color: var(--ink-2);
}

.compound-page .scenario-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.compound-page .scenario-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(22,25,29,.04);
}

.compound-page .scenario-card .scenario-label {
  color: var(--ink-2);
  font-size: .8125rem;
}

.compound-page .scenario-card strong {
  font-size: 1.25rem;
  color: var(--pine-deep);
}

.compound-page .scenario-card span:last-child {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
}

.compound-page .scenario-low {
  border-color: #e2d8c4;
  background: #fffdf8;
}

.compound-page .scenario-base {
  border-color: #a9c8bd;
  background: #f1f8f5;
}

.compound-page .scenario-high {
  border-color: #b7d2c7;
  background: #f7fbf9;
}

@media (max-width: 820px) {
  .compound-page .page-head { padding-top: 24px; }
  .compound-page .panel,
  .compound-page .result { padding: 22px; }
  .compound-page .scenario-grid { grid-template-columns: 1fr; }
}

/* --- Mortgage calculator ------------------------------------------------- */

.mortgage-page {
  background:
    radial-gradient(circle at 12% 6%, rgba(138,90,0,.08), transparent 24rem),
    linear-gradient(180deg, #fffdf8 0, var(--paper) 34rem);
}

.mortgage-page .masthead {
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(10px);
}

.mortgage-page .page-head {
  max-width: 760px;
  padding-top: 34px;
}

.mortgage-page .page-head h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  letter-spacing: -.045em;
}

.mortgage-page .page-head p {
  max-width: 640px;
  font-size: 1.125rem;
}

.mortgage-page .tool {
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: 30px;
}

.mortgage-page .panel {
  border-color: #e8dfca;
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(138,90,0,.08);
  padding: 28px;
}

.mortgage-page .field {
  margin-bottom: 20px;
}

.mortgage-page .field label {
  color: var(--ink);
  letter-spacing: .01em;
}

.mortgage-page input[type="number"],
.mortgage-page select {
  min-height: 48px;
  border-color: #ded9cc;
  border-radius: 9px;
  background: #fffefa;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.mortgage-page input[type="number"]:hover,
.mortgage-page select:hover {
  border-color: #cbbd9e;
  background: #fff;
}

.mortgage-page input[type="number"]:focus,
.mortgage-page select:focus {
  border-color: var(--pine);
  box-shadow: 0 0 0 4px rgba(14,92,72,.12);
  background: #fff;
}

.mortgage-page .control .affix {
  border-color: #ded9cc;
  background: #f8f3e7;
  color: var(--amber);
  font-weight: 500;
}

.mortgage-page .btn-row {
  margin-top: 24px;
}

.mortgage-page .btn {
  border-color: #d9ccb0;
  border-radius: 9px;
  background: #fffaf0;
  color: #704900;
  transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.mortgage-page .btn:hover {
  border-color: #bda875;
  background: #fff5dc;
  box-shadow: 0 4px 12px rgba(138,90,0,.10);
  transform: translateY(-1px);
}

.mortgage-page .result {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  padding: 28px;
  background:
    radial-gradient(circle at 100% 0, rgba(255,255,255,.20), transparent 18rem),
    linear-gradient(145deg, #0e5c48, #083f33);
  box-shadow: 0 16px 36px rgba(8,63,51,.20);
}

.mortgage-page .result::after {
  content: "";
  position: absolute;
  width: 190px;
  height: 190px;
  right: -72px;
  bottom: -92px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 50%;
  box-shadow: 0 0 0 20px rgba(255,255,255,.04), 0 0 0 40px rgba(255,255,255,.03);
  pointer-events: none;
}

.mortgage-page .result-value {
  font-size: clamp(2.5rem, 7vw, 3.75rem);
  letter-spacing: -.055em;
}

.mortgage-page .breakdown {
  position: relative;
  z-index: 1;
  margin-top: 24px;
}

.mortgage-page .breakdown .line {
  padding: 11px 0;
}

.mortgage-page .provenance {
  margin-top: 16px;
  border-color: #ead9ac;
  border-radius: 10px;
  background: rgba(253,246,230,.86);
}

.mortgage-page .mortgage-schedule {
  max-width: none;
  margin-top: 42px;
}

.mortgage-page .mortgage-schedule h2 {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.mortgage-page .schedule-intro {
  color: var(--ink-2);
}

.mortgage-page .schedule-scroll {
  overflow-x: auto;
  border: 1px solid #e8dfca;
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(138,90,0,.05);
}

.mortgage-page #mortgageSchedule {
  min-width: 620px;
  margin: 0;
}

.mortgage-page #mortgageSchedule th {
  background: #f8f3e7;
  color: #704900;
  font-size: .8125rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.mortgage-page #mortgageSchedule td {
  color: var(--ink-2);
}

.mortgage-page #mortgageSchedule tbody tr:nth-child(even) td {
  background: #fffdf8;
}

.mortgage-page #mortgageSchedule tbody tr:hover td {
  background: #fff5dc;
}

@media (max-width: 820px) {
  .mortgage-page .page-head { padding-top: 24px; }
  .mortgage-page .panel,
  .mortgage-page .result { padding: 22px; }
}

/* --- Word counter -------------------------------------------------------- */

.word-counter-page {
  background:
    radial-gradient(circle at 88% 7%, rgba(14,92,72,.09), transparent 25rem),
    linear-gradient(180deg, #f8fcfb 0, var(--paper) 34rem);
}

.word-counter-page .masthead {
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(10px);
}

.word-counter-page .page-head {
  max-width: 760px;
  padding-top: 34px;
}

.word-counter-page .page-head h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  letter-spacing: -.045em;
}

.word-counter-page .page-head p {
  max-width: 600px;
  font-size: 1.125rem;
}

.word-counter-page .tool {
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: 30px;
}

.word-counter-page .panel {
  border-color: #d8e7e1;
  border-radius: 14px;
  box-shadow: 0 12px 32px rgba(14,92,72,.08);
  padding: 28px;
}

.word-counter-page textarea {
  min-height: 360px;
  border-color: #d5e0dc;
  border-radius: 10px;
  background: #fcfefd;
  line-height: 1.7;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.word-counter-page textarea:hover {
  border-color: #a9c8bd;
  background: #fff;
}

.word-counter-page textarea:focus {
  border-color: var(--pine);
  box-shadow: 0 0 0 4px rgba(14,92,72,.12);
  background: #fff;
}

.word-counter-page .btn-row {
  margin-top: 24px;
}

.word-counter-page .btn {
  border-color: #cbded7;
  border-radius: 9px;
  background: #f5faf8;
  color: var(--pine-deep);
  transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}

.word-counter-page .btn:hover {
  border-color: #8eb9aa;
  background: #eaf5f0;
  box-shadow: 0 4px 12px rgba(14,92,72,.10);
  transform: translateY(-1px);
}

.word-counter-page .mic-btn {
  color: #8b3030;
  border-color: #e2c5c5;
  background: #fff8f8;
}

.word-counter-page .mic-btn:hover {
  color: #762424;
  border-color: #d59e9e;
  background: #fff0f0;
}

.word-counter-page .mic-btn.is-listening {
  color: #fff;
  border-color: #b84747;
  background: #b84747;
  box-shadow: 0 0 0 4px rgba(184,71,71,.14);
}

.word-counter-page .mic-btn span {
  display: inline-block;
  margin-right: 4px;
  font-size: .65rem;
  vertical-align: 1px;
}

.word-counter-page .result {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  padding: 28px;
  background:
    radial-gradient(circle at 100% 0, rgba(255,255,255,.20), transparent 18rem),
    linear-gradient(145deg, #0e5c48, #083f33);
  box-shadow: 0 16px 36px rgba(8,63,51,.20);
}

.word-counter-page .result::after {
  content: "";
  position: absolute;
  width: 190px;
  height: 190px;
  right: -72px;
  bottom: -92px;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 50%;
  box-shadow: 0 0 0 20px rgba(255,255,255,.04), 0 0 0 40px rgba(255,255,255,.03);
  pointer-events: none;
}

.word-counter-page .result-value {
  font-size: clamp(2.5rem, 7vw, 3.75rem);
  letter-spacing: -.055em;
}

.word-counter-page .breakdown {
  position: relative;
  z-index: 1;
  margin-top: 24px;
}

.word-counter-page .breakdown .line {
  padding: 11px 0;
}

.word-counter-page .panel[style] {
  border-color: #d8e7e1;
  background: rgba(255,255,255,.82);
}

.word-counter-page #density {
  line-height: 1.45;
}

.word-counter-page .narrator {
  margin-top: 24px;
  padding: 17px;
  border: 1px solid #d8e7e1;
  border-radius: 11px;
  background: #f7fbf9;
}

.word-counter-page .narrator-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 13px;
}

.word-counter-page .narrator-head strong {
  color: var(--pine-deep);
}

.word-counter-page #narratorStatus {
  color: var(--ink-3);
  font-size: .8125rem;
}

.word-counter-page .narrator-controls {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto minmax(100px, .7fr) auto;
  align-items: center;
  gap: 8px;
  font-size: .8125rem;
  color: var(--ink-2);
}

.word-counter-page .narrator-controls select {
  min-height: 40px;
  padding: 7px 9px;
}

.word-counter-page .narrator-controls input[type="range"] {
  width: 100%;
  accent-color: var(--pine);
}

.word-counter-page .narrator-controls output {
  min-width: 25px;
  color: var(--pine-deep);
  font-weight: 500;
}

.word-counter-page .narrator-buttons {
  margin-top: 15px;
}

.word-counter-page .narrator-buttons .btn:disabled {
  cursor: not-allowed;
  opacity: .5;
  transform: none;
}

.word-counter-page .narrator-note {
  margin: 12px 0 0;
  color: var(--ink-3);
  font-size: .75rem;
  line-height: 1.45;
}

.word-counter-page .dictation-status {
  margin: 12px 0 0;
  color: var(--ink-2);
  font-size: .8125rem;
}

.word-counter-page .article table {
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(22,25,29,.04);
}

.word-counter-page .article th {
  background: #edf6f2;
  color: var(--pine-deep);
  font-size: .8125rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.word-counter-page .article tbody tr:nth-child(even) td {
  background: #fbfdfc;
}

.word-counter-page .article tbody tr:hover td {
  background: #f0f8f4;
}

@media (max-width: 820px) {
  .word-counter-page .page-head { padding-top: 24px; }
  .word-counter-page .panel,
  .word-counter-page .result { padding: 22px; }
  .word-counter-page textarea { min-height: 280px; }
  .word-counter-page .narrator-controls {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }
  .word-counter-page .narrator-controls label:nth-of-type(2) {
    grid-column: 1;
  }
  .word-counter-page .narrator-controls input[type="range"] {
    grid-column: 2;
  }
  .word-counter-page .narrator-controls output {
    grid-column: 3;
  }
}
