:root {
  color-scheme: light;
  --ink: #102a3d;
  --ink-muted: #4b6572;
  --edge: #d6e1e5;
  --paper: #ffffff;
  --canvas: #f4f8f9;
  --accent: #087a61;
  --accent-strong: #005943;
  --mint: #d9f5eb;
  --navy: #112b42;
  --error: #a63b34;
  font-family: "Avenir Next", Avenir, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--canvas); color: var(--ink); }
button, input, select { font: inherit; }
a { color: inherit; }
button { cursor: pointer; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 3px solid #15a786; outline-offset: 3px; }
[hidden] { display: none !important; }

.site-header { background: var(--navy); color: #fff; border-bottom: 3px solid #4de0b2; }
.header-inner { max-width: 1260px; min-height: 76px; padding: 0 28px; margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.brand { display: inline-flex; align-items: center; gap: 12px; font-size: 1.3rem; font-weight: 800; letter-spacing: -.035em; text-decoration: none; white-space: nowrap; }
.brand-mark { width: 34px; height: 34px; display: inline-grid; place-items: center; border: 2px solid #65e1bc; border-radius: 8px; color: #fff; font-family: Georgia, serif; line-height: 1; position: relative; }
.brand-mark span { position: absolute; right: -6px; top: -8px; font: 800 .75rem "Segoe UI", sans-serif; background: var(--navy); color: #65e1bc; }
.main-nav { display: flex; gap: 9px; flex-wrap: wrap; }
.main-nav a { font-size: .91rem; color: #d9e6e9; text-decoration: none; padding: 8px 12px; border-radius: 6px; }
.main-nav a:hover, .main-nav a[aria-current] { color: #fff; background: #254761; }

.eyebrow, .card-kicker, .footer-label { display: inline-block; color: var(--accent); font-size: .74rem; line-height: 1.3; letter-spacing: .15em; font-weight: 850; }
h1,h2,h3,p { margin-top: 0; }
h1,h2,h3 { line-height: 1.14; letter-spacing: -.035em; }
h1 { font-size: clamp(2.25rem, 4.5vw, 4rem); font-weight: 780; }
h2 { font-size: clamp(1.5rem, 2.2vw, 2rem); }
h3 { font-size: 1.2rem; }

.home-main { max-width: 1260px; margin: 0 auto; padding: 46px 28px 96px; }
.home-intro { max-width: 930px; padding: 18px 0 42px; }
.home-intro h1 { max-width: 900px; margin: 18px 0 18px; }
.home-intro p { font-size: 1.14rem; color: var(--ink-muted); max-width: 680px; }
.home-groups { border-top: 1px solid var(--edge); }
.tool-group { padding: 40px 0 52px; border-bottom: 1px solid var(--edge); scroll-margin-top: 20px; }
.group-head { display: flex; justify-content: space-between; align-items: end; gap: 25px; margin-bottom: 22px; }
.group-head > div { display: flex; align-items: baseline; gap: 15px; }
.group-head h2 { margin: 0; }
.group-head p { max-width: 400px; margin: 0; color: var(--ink-muted); }
.section-index { color: var(--accent); font: 800 .8rem "SFMono-Regular", Consolas, monospace; letter-spacing: .08em; }
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.tool-card { min-height: 225px; display: flex; flex-direction: column; align-items: start; padding: 27px 28px; border: 1px solid var(--edge); border-top: 4px solid var(--accent); border-radius: 12px; background: var(--paper); text-decoration: none; box-shadow: 0 2px 8px rgba(22,57,76,.035); transition: transform .2s, box-shadow .2s; }
.tool-card:hover { transform: translateY(-3px); box-shadow: 0 11px 24px rgba(22,57,76,.09); }
.tool-card strong { margin: 11px 0 9px; font-size: 1.35rem; letter-spacing: -.025em; }
.tool-card > span:nth-of-type(2) { color: var(--ink-muted); line-height: 1.45; }
.card-link { margin-top: auto; padding-top: 19px; color: var(--accent-strong); font-weight: 750; }
.card-link span { margin-left: 5px; }
.home-method { margin-top: 64px; border-radius: 14px; padding: 38px 42px; background: var(--navy); color: #fff; }
.home-method .eyebrow { color: #6ce5bf; }
.home-method h2 { margin: 13px 0 10px; }
.home-method p { color: #d4e6e8; max-width: 690px; margin: 0; }

.calculator-page { max-width: 1260px; margin: 0 auto; padding: 20px 28px 95px; }
.breadcrumb { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 0 31px; color: #627782; font-size: .88rem; }
.breadcrumb a { color: var(--accent-strong); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.tool-intro { max-width: 850px; margin-bottom: 28px; }
.tool-intro h1 { margin: 10px 0 13px; }
.tool-intro p { color: var(--ink-muted); font-size: 1.08rem; max-width: 750px; margin: 0; }
.mobile-summary { display: none; }
.workspace { display: grid; grid-template-columns: minmax(0, 1.06fr) minmax(345px, .94fr); gap: 20px; align-items: start; }
.input-panel, .results, .assumption-note, .diagram-wrap { background: var(--paper); border: 1px solid var(--edge); border-radius: 13px; }
.input-panel { padding: 26px; }
.panel-head { margin-bottom: 21px; }
.panel-head h2 { font-size: 1.55rem; margin: 8px 0 7px; }
.panel-head p { color: var(--ink-muted); margin: 0; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 16px; }
.field { min-width: 0; }
.field label { display: block; font-size: .91rem; font-weight: 750; line-height: 1.25; margin-bottom: 7px; }
.field-control { display: flex; align-items: center; border: 1px solid #b9cbd1; border-radius: 7px; background: #fff; min-height: 48px; overflow: hidden; }
.field-control:focus-within { outline: 2px solid #0e9271; outline-offset: 1px; }
.field-control input { min-width: 0; width: 100%; padding: 10px 11px; border: 0; color: var(--ink); background: transparent; outline: none; font-weight: 700; }
.unit { flex-shrink: 0; padding: 0 10px; color: var(--ink-muted); white-space: nowrap; background: #f3f8f8; align-self: stretch; display: grid; place-items: center; border-left: 1px solid #d6e1e5; font-size: .87rem; }
.field select { width: 100%; min-height: 48px; padding: 8px 10px; color: var(--ink); border: 1px solid #b9cbd1; border-radius: 7px; background: white; }
.field small { display: block; margin-top: 5px; color: var(--ink-muted); font-size: .79rem; line-height: 1.3; }
.field-tip { margin: 23px 0 15px; color: var(--ink-muted); font-size: .84rem; }
.field-tip code { color: var(--ink); background: #eaf3f2; border-radius: 4px; padding: 2px 5px; }
.calculate-button { width: 100%; display: flex; justify-content: space-between; align-items: center; min-height: 51px; padding: 11px 17px; border: 0; border-radius: 7px; background: var(--accent-strong); color: #fff; font-weight: 800; }
.calculate-button:hover { background: #064b3c; }
.error { border: 1px solid #d7a19b; background: #fff2f0; color: var(--error); border-radius: 8px; padding: 12px 14px; font-weight: 700; margin-bottom: 12px; }
.output-column { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.results { overflow: hidden; }
.result-heading { display: flex; align-items: center; justify-content: space-between; padding: 23px 24px 19px; border-bottom: 1px solid var(--edge); }
.result-heading h2 { font-size: 1.6rem; margin: 7px 0 0; }
.result-badge { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--mint); color: var(--accent-strong); font-size: .76rem; font-weight: 750; }
.result-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.result-item { min-width: 0; padding: 22px 24px; border-bottom: 1px solid var(--edge); }
.result-item:nth-child(odd) { border-right: 1px solid var(--edge); }
.result-item:nth-last-child(-n + 2) { border-bottom: 0; }
.result-primary { background: #e9f9f2; }
.result-label { display: block; color: var(--ink-muted); font-size: .84rem; font-weight: 700; }
.result-item strong { display: block; margin: 8px 0 4px; font-size: clamp(1.5rem, 2.5vw, 2rem); line-height: 1.1; letter-spacing: -.035em; overflow-wrap: anywhere; }
.result-item small { color: var(--ink-muted); font-size: .78rem; line-height: 1.3; }
.result-footnote { margin: 0; padding: 13px 24px 16px; border-top: 1px solid var(--edge); color: var(--ink-muted); font-size: .8rem; }
.assumption-note { padding: 19px 22px; background: #eff5f7; }
.assumption-note strong { display: block; font-size: .88rem; margin-bottom: 6px; }
.assumption-note p { color: var(--ink-muted); font-size: .83rem; line-height: 1.45; margin: 0; }
.diagram-wrap { padding: 17px 21px 18px; }
.diagram-title, .diagram-axis { display: flex; justify-content: space-between; gap: 12px; }
.diagram-title strong { font-size: .86rem; }
.diagram-title span, .diagram-axis { color: var(--ink-muted); font-size: .73rem; }
.diagram { position: relative; height: 90px; margin: 17px 2px 5px; border: 1px solid #7e9dab; background: repeating-linear-gradient(90deg,#f4f8f9 0,#f4f8f9 24px,#edf3f5 25px); }
.diagram-batten { position: absolute; top: 0; bottom: 0; background: #0b7961; box-shadow: 1px 0 0 rgba(0,0,0,.12); }

.explanation { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 55px; margin-top: 66px; padding-top: 45px; border-top: 1px solid var(--edge); }
.article-main { max-width: 790px; }
.article-main section { margin-bottom: 47px; scroll-margin-top: 25px; }
.article-main h2 { margin: 11px 0 15px; }
.article-main p { color: #405967; line-height: 1.7; margin-bottom: 14px; }
.article-main .answer { border-left: 4px solid #27b38a; padding-left: 20px; }
.example { padding: 26px 29px; background: #e9f2f4; border-radius: 10px; }
.example p { margin-bottom: 0; }
.faq details { padding: 16px 0; border-bottom: 1px solid var(--edge); }
.faq summary { cursor: pointer; font-weight: 750; padding-right: 22px; }
.faq details p { margin: 12px 0 0; }
.article-aside { align-self: start; position: sticky; top: 20px; padding: 25px 22px; border: 1px solid var(--edge); border-radius: 11px; background: #fff; }
.article-aside h3 { margin: 10px 0 18px; }
.article-aside a { display: flex; justify-content: space-between; gap: 10px; padding: 11px 0; border-top: 1px solid var(--edge); font-weight: 700; font-size: .91rem; text-decoration: none; }
.article-aside a:hover { color: var(--accent); }
.article-aside p { margin: 21px 0 0; font-size: .8rem; color: var(--ink-muted); }

.site-footer { background: var(--navy); color: #fff; }
.footer-inner { max-width: 1260px; padding: 47px 28px 55px; margin: auto; display: grid; grid-template-columns: 1.15fr 1fr 1fr; gap: 35px; }
.footer-brand { font-size: 1.3rem; font-weight: 800; letter-spacing: -.03em; text-decoration: none; }
.footer-inner p { color: #c1d4da; font-size: .85rem; margin: 11px 0 0; max-width: 310px; }
.footer-label { color: #69e0bc; margin-bottom: 10px; }
.footer-inner > div:nth-child(2) a { display: block; font-size: .85rem; margin: 6px 0; color: #e7f1f3; text-decoration: none; }
.footer-inner > div:nth-child(2) a:hover { text-decoration: underline; }
.footer-note { align-self: start; }

@media (max-width: 900px) {
  .workspace, .explanation { grid-template-columns: 1fr; }
  .article-aside { position: static; }
  .group-head { display: block; }
  .group-head p { margin-top: 8px; max-width: none; }
}

@media (max-width: 620px) {
  .header-inner { padding: 14px 18px; align-items: start; flex-direction: column; gap: 10px; }
  .main-nav { gap: 2px; margin-left: -10px; }
  .main-nav a { padding: 6px 10px; font-size: .85rem; }
  .home-main, .calculator-page { padding-left: 18px; padding-right: 18px; }
  .home-intro { padding-top: 8px; padding-bottom: 23px; }
  .home-intro p, .tool-intro p { font-size: 1rem; }
  .cards { grid-template-columns: 1fr; }
  .tool-card { min-height: 195px; padding: 22px; }
  .home-method { padding: 26px 23px; }
  .calculator-page { padding-top: 13px; }
  .breadcrumb { margin-bottom: 17px; }
  .breadcrumb span:nth-of-type(2), .breadcrumb span:nth-of-type(3) { display: none; }
  .tool-intro { margin-bottom: 23px; }
  .mobile-summary { display: flex; align-items: center; flex-wrap: wrap; column-gap: 15px; row-gap: 2px; margin: 0 0 15px; padding: 12px 15px; background: #e8f9f1; border: 1px solid #b6dfce; border-radius: 9px; }
  .mobile-summary > span { flex-basis: 100%; color: var(--accent-strong); font-size: .69rem; font-weight: 850; letter-spacing: .13em; }
  .mobile-summary strong { font-size: 1.3rem; line-height: 1.1; }
  .mobile-summary small { color: var(--ink-muted); font-size: .82rem; }
  .input-panel { padding: 20px; }
  .fields { grid-template-columns: 1fr; gap: 17px; }
  .result-item { padding: 17px 16px; }
  .result-heading { padding: 20px 18px; }
  .result-footnote { padding-left: 18px; padding-right: 18px; }
  .result-item strong { font-size: 1.55rem; }
  .explanation { gap: 8px; margin-top: 47px; padding-top: 36px; }
  .footer-inner { grid-template-columns: 1fr; gap: 25px; padding: 38px 18px; }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .tool-card { transition: none; } }

/* Longer formulas, calendar fields and repayment tables. */
.result-item strong { overflow-wrap: anywhere; }
.header-inner { flex-wrap: wrap; }
.field-control input[type="date"], .field-control input[type="time"] { min-width: 0; width: 100%; }
.today-button, .download-button { border: 1px solid var(--edge); border-radius: 6px; background: white; color: var(--accent-strong); padding: 8px 12px; cursor: pointer; font: inherit; font-weight: 700; }
.today-button { margin: 6px 0; font-size: .8rem; }
.schedule-section { margin-top: 30px; padding: 24px; border: 1px solid var(--edge); border-radius: 10px; background: white; }
.schedule-section summary { font-weight: 750; cursor: pointer; }
.table-scroll { overflow: auto; max-height: 480px; margin-top: 18px; }
.table-scroll table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.table-scroll th, .table-scroll td { padding: 12px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--edge); }
.table-scroll thead th { position: sticky; top: 0; background: #edf4f5; }
.table-scroll caption { text-align: left; margin-bottom: 12px; color: var(--ink-muted); }
.download-button { margin-top: 18px; }
[hidden] { display: none !important; }

/* Shared directory and working-tool design. */
:root { --canvas: #f7f9fa; --ink: #172c3a; --ink-muted: #526570; --edge: #dce4e8; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
h1,h2,h3 { text-wrap: balance; letter-spacing: -.03em; }
p { text-wrap: pretty; }
h1 { font-size: 2.75rem; }
h2 { font-size: 1.65rem; }
.site-header { background: #fff; color: var(--ink); border-bottom: 1px solid var(--edge); }
.brand-mark { color: var(--accent-strong); border-color: var(--accent); }
.brand-mark span { background: white; color: var(--accent-strong); }
.main-nav a { color: var(--ink-muted); font-weight: 600; }
.main-nav a:hover,.main-nav a[aria-current] { color: var(--accent-strong); background: #edf5f2; }
.header-inner { min-height: 80px; }
.skip-link { position: absolute; top: -100px; left: 20px; padding: 12px; background: white; z-index: 10; }
.skip-link:focus { top: 10px; }
.home-main { padding-top: 38px; }
.home-intro { display: grid; grid-template-columns: minmax(0,1fr) 330px; gap: 70px; max-width: none; padding: 22px 0 54px; align-items: center; }
.home-intro h1 { margin: 18px 0 22px; font-size: 3.65rem; max-width: 650px; line-height: 1.08; }
.intro-label { font-size: .86rem; font-weight: 650; color: var(--accent-strong); }
.home-intro p { max-width: 580px; font-size: 1.05rem; line-height: 1.7; }
.text-link { display: inline-flex; gap: 15px; color: var(--accent-strong); font-weight: 650; text-decoration: none; }
.season-feature { background: #173d43; color: white; padding: 28px; border-radius: 16px; }
.season-feature > span { color: #b3dcd3; font-size: .85rem; }
.season-feature h2 { margin: 15px 0 24px; font-size: 1.65rem; }
.season-feature a { display: block; padding: 12px 0; border-top: 1px solid #44676b; font-size: .87rem; text-decoration: none; }
.season-feature a:hover { text-decoration: underline; }
.catalog { scroll-margin-top: 24px; }
.catalog-toolbar { border-top: 1px solid var(--edge); border-bottom: 1px solid var(--edge); padding: 24px 0; display: flex; gap: 30px; align-items: end; justify-content: space-between; }
.search-box { width: min(620px,100%); }
.search-box label { display: block; margin-bottom: 9px; font-size: .9rem; font-weight: 650; }
.search-box > div { display: flex; background: white; border: 1px solid #b7c8cd; border-radius: 8px; }
.search-box input { width: 100%; min-width: 0; border: 0; background: transparent; padding: 14px; color: var(--ink); }
.search-box input::placeholder { color: #64727b; }
.search-box button { background: transparent; border: 0; padding: 0 16px; color: var(--accent-strong); font-size: .85rem; }
.catalog-toolbar p { color: var(--ink-muted); font-size: .85rem; margin-bottom: 14px; }
.catalog-layout { display: grid; grid-template-columns: 205px minmax(0,1fr); gap: 46px; align-items: start; }
.category-rail { position: sticky; top: 24px; padding: 32px 0; display: flex; flex-direction: column; gap: 3px; }
.category-rail > span { color: var(--ink-muted); font-size: .8rem; margin: 0 10px 10px; }
.category-rail a { display: flex; justify-content: space-between; padding: 10px 12px; text-decoration: none; font-size: .9rem; border-radius: 6px; }
.category-rail a:hover { background: #eaf2ee; color: var(--accent-strong); }
.category-rail a span { color: var(--ink-muted); font-size: .8rem; }
.home-groups { border: 0; }
.tool-group { padding: 32px 0; }
.group-head { display: block; margin-bottom: 18px; }
.group-head > div { justify-content: space-between; }
.group-head h2 { font-size: 1.35rem; }
.group-head h2 a { text-decoration: none; }
.group-head h2 a:hover { text-decoration: underline; }
.group-head p { max-width: none; margin-top: 8px; font-size: .9rem; }
.group-count { color: var(--ink-muted); font-size: .8rem; }
.cards { gap: 0 28px; }
.tool-card { min-height: 0; display: flex; flex-direction: row; gap: 16px; align-items: start; padding: 20px 0; border: 0; border-top: 1px solid var(--edge); border-radius: 0; box-shadow: none; background: transparent; transition: background .18s ease-out; }
.tool-card:hover { transform: none; box-shadow: none; background: #edf3f1; }
.tool-row-content { flex: 1; min-width: 0; }
.tool-card strong { display: block; font-size: 1rem; letter-spacing: -.015em; margin: 0 0 7px; color: var(--ink); }
.tool-row-content > span { display: block; font-size: .84rem; line-height: 1.5; color: var(--ink-muted); }
.tool-arrow { color: var(--accent-strong); font-size: 1.15rem; }
.home-method { margin-top: 35px; background: #eaf2ef; color: var(--ink); border-radius: 10px; padding: 30px; }
.home-method p { color: var(--ink-muted); }
.category-intro { margin: 24px 0 36px; }
.category-intro p { color: var(--ink-muted); max-width: 650px; }
.category-tools { padding-top: 20px; }
.page-jumps { display: flex; gap: 24px; border-bottom: 1px solid var(--edge); margin: 0 0 24px; padding-bottom: 14px; }
.page-jumps a { font-size: .9rem; color: var(--ink-muted); text-decoration: none; }
.page-jumps a:hover { color: var(--accent-strong); }
.tool-intro h1 { font-size: 2.5rem; }
.input-panel { border-radius: 12px; padding: 28px; }
.output-column { position: sticky; top: 24px; }
.panel-head h2,.result-heading h2 { font-size: 1.3rem; margin-top: 0; }
.result-heading { padding: 24px; }
.result-primary { background: #e7f3ec; }
.result-item strong { font-size: 1.8rem; font-variant-numeric: tabular-nums; }
.result-item:first-child { grid-column: 1/-1; border-right: 0; border-bottom: 1px solid var(--edge); }
.result-item:first-child strong { font-size: 2.25rem; }
.result-item:nth-child(odd) { border-right: 0; }
.result-item:nth-child(even) { border-right: 1px solid var(--edge); }
.result-item:last-child:nth-child(even) { grid-column: 1/-1; border-right: 0; border-top: 1px solid var(--edge); }
.assumption-note { border: 0; background: transparent; padding: 10px 4px; }
.article-main .answer { border: 0; padding-left: 0; }
.article-main p { max-width: 72ch; }
.article-main h2 { font-size: 1.55rem; }
.reset-button { display: block; margin: 14px auto 0; background: transparent; border: 0; color: var(--ink-muted); text-decoration: underline; font-size: .85rem; }
.course-list { grid-column: 1/-1; margin: 0; border: 0; padding: 0; min-width: 0; }
.course-list legend { font-size: .95rem; font-weight: 650; margin-bottom: 12px; }
.course-row { display: grid; grid-template-columns: 1fr 1fr auto; align-items: end; gap: 10px; margin-bottom: 16px; }
.course-row label { font-size: .8rem; color: var(--ink-muted); }
.course-row input { display: block; width: 100%; min-width: 0; padding: 10px; margin-top: 5px; border: 1px solid #b9cbd1; border-radius: 6px; }
.course-row button { background: transparent; color: #8c3434; border: 0; padding: 10px 0; font-size: .8rem; }
.secondary-button { padding: 10px 16px; border: 1px solid var(--edge); border-radius: 6px; color: var(--accent-strong); background: white; font-weight: 650; }
.course-list p { color: var(--ink-muted); font-size: .8rem; margin-top: 14px; }
button:disabled { cursor: not-allowed; opacity: .6; }
.footer-inner { grid-template-columns: 1fr 1.2fr 1fr; }
.footer-categories { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 20px; }
.footer-categories a { font-size: .83rem; text-decoration: none; color: #d6e5e9; }
.footer-inner > div > a:not(.footer-brand) { display: block; margin-top: 20px; font-size: .85rem; }
@media(min-width: 1000px) { .workspace { grid-template-columns: minmax(0,1.12fr) minmax(0,.88fr); gap: 32px; } }
@media(max-width: 1000px) { .home-intro { gap: 30px; grid-template-columns: minmax(0,1fr) 290px; } .home-intro h1 { font-size: 2.8rem; } .catalog-layout { grid-template-columns: 170px minmax(0,1fr); gap: 24px; } .cards { grid-template-columns: 1fr; } }
@media(max-width: 900px) { .output-column { position: static; } }
@media(max-width: 700px) { .home-intro { grid-template-columns: 1fr; gap: 26px; } .season-feature { padding: 22px; } .season-feature h2 br { display: none; } .catalog-layout { grid-template-columns: 1fr; gap: 0; } .category-rail { position: static; flex-direction: row; flex-wrap: wrap; padding: 22px 0 8px; gap: 8px; } .category-rail > span { display: none; } .category-rail a { border: 1px solid var(--edge); padding: 7px 10px; gap: 8px; font-size: .8rem; background: white; } .catalog-toolbar { flex-direction: column; align-items: stretch; gap: 12px; } .catalog-toolbar p { margin: 0; } .footer-inner { grid-template-columns: 1fr; } .footer-categories { max-width: 450px; } }
@media(max-width: 620px) { .home-main { padding-top: 25px; } .home-intro h1 { font-size: 2.5rem; } .tool-intro h1 { font-size: 2rem; } .header-inner { gap: 10px; } .main-nav { flex-wrap: nowrap; overflow-x: auto; max-width: calc(100vw - 26px); padding-bottom: 3px; } .main-nav a { white-space: nowrap; font-size: .8rem; padding: 7px 9px; } .tool-card { min-height: 0; padding: 20px 0; } .input-panel { padding: 20px; } .result-item strong { font-size: 1.5rem; } .page-jumps { gap: 22px; } .schedule-section { padding: 18px 12px; } .course-row { gap: 8px; } .mobile-summary { margin-bottom: 20px; } }

@media(max-width:620px) {
 body { padding-bottom: 96px; }
 .mobile-summary { position: fixed; bottom: 0; left: 0; right: 0; z-index: 5; margin: 0; padding: 10px 18px calc(12px + env(safe-area-inset-bottom)); border: 0; border-top: 1px solid #bad5c6; border-radius: 0; background: #eaf5ee; column-gap: 12px; }
 .mobile-summary > span { letter-spacing: 0; font-size: .74rem; }
 .mobile-summary strong { overflow-wrap: anywhere; max-width: 65%; font-size: 1.25rem; }
 .mobile-summary small { display: none; }
 .mobile-summary a { margin-left: auto; color: var(--accent-strong); font-size: .82rem; font-weight: 650; text-decoration: none; }
}

.mobile-nav { display: none; position: relative; }
.mobile-nav summary { font-size: .88rem; font-weight: 650; cursor: pointer; padding: 10px 13px; background: #edf3f0; color: var(--accent-strong); border-radius: 7px; }
.mobile-nav nav { position: absolute; top: calc(100% + 12px); right: 0; width: 245px; max-height: 65vh; overflow: auto; z-index: 8; background: white; border: 1px solid var(--edge); border-radius: 10px; padding: 8px; }
.mobile-nav nav a { display: block; padding: 11px 14px; text-decoration: none; font-size: .9rem; border-radius: 5px; }
.mobile-nav nav a:hover { background: #edf5f0; }
@media(max-width:620px) {
 .main-nav { display: none; }
 .mobile-nav { display: block; }
 .header-inner { flex-direction: row; align-items: center; min-height: 72px; }
 .home-intro { padding-bottom: 30px; }
 .home-intro h1 { font-size: 2.3rem; }
 .season-feature { display: none; }
}

/* Validation reserves feedback space and preserves the last valid layout shell. */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.field-feedback { display: grid; margin-top: 6px; min-block-size: 4.05em; font-size: .79rem; line-height: 1.35; }
.field-feedback small { grid-area: 1 / 1; margin: 0; font-size: inherit; line-height: inherit; }
.field-error { visibility: hidden; }
.field[data-feedback] .field-help { visibility: hidden; }
.field[data-feedback] .field-error { visibility: visible; }
.field[data-feedback="error"] .field-error { color: #94312b; }
.field[data-feedback="pending"] .field-error { color: var(--ink-muted); }
.field input[aria-invalid="true"], .field select[aria-invalid="true"] { outline: 2px solid #b44137; outline-offset: -2px; }
.result-item [data-value] { position: relative; }
.results[data-state="pending"] [data-value] { visibility: hidden; }
.results[data-state="pending"] [data-value]::after { content: '—'; position: absolute; left: 0; top: 0; visibility: visible; color: var(--ink-muted); }
.results[data-state="pending"] [data-detail] { visibility: hidden; }
.result-badge { min-width: 78px; text-align: center; white-space: nowrap; }
.results[data-state="pending"] .result-badge { background: #eef0f1; color: #526570; }
.schedule-status { display: grid; min-height: 3em; margin: 0 0 12px; font-size: .85rem; color: var(--ink-muted); }
.schedule-status span { grid-area: 1 / 1; }
.schedule-pending { visibility: hidden; }
.schedule-section[data-state="pending"] .schedule-ready { visibility: hidden; }
.schedule-section[data-state="pending"] .schedule-pending { visibility: visible; }
.schedule-section[data-state="pending"] tbody { visibility: hidden; }
.diagram[data-state="pending"] .diagram-batten { visibility: hidden; }
.mobile-summary[data-state="pending"] { background: #edf1f2; }
.reset-button,.today-button,.course-row button { min-height: 44px; }
.course-row { grid-template-columns: minmax(0,1fr) minmax(0,1fr) auto; align-items: start; border-bottom: 1px solid var(--edge); padding-bottom: 16px; }
.course-row .field { min-width: 0; }
.course-number { grid-column: 1/-1; font-size: .82rem; font-weight: 650; }
.course-row label { display: block; min-height: 18px; margin-bottom: 5px; }
.course-row input,.course-row select { min-height: 44px; margin-top: 0; font-weight: 500; }
.course-row button { margin-top: 23px; }
.course-row .course-level { grid-column: 1 / 3; }
.course-row .field-feedback { min-block-size: 4.05em; }
@media(max-width:620px) { .field-feedback { min-block-size: 4.05em; } .mobile-summary [data-headline] { min-height: 1.1em; } }
.field-group { grid-column: 1/-1; border-top: 1px solid var(--edge); padding-top: 4px; min-width: 0; }
.field-group > summary { padding: 14px 0; min-height: 48px; cursor: pointer; font-weight: 650; color: var(--accent-strong); }
.field-group > .fields { padding: 12px 0 6px; }
.field-group:has([aria-invalid="true"]) > summary { color: #94312b; }

/* Regional choices are explicit controls; changing validation never collapses their layout. */
.preference-bar { max-width: 1260px; padding: 0 28px 12px; margin: auto; }
.regional-preferences { color: var(--ink-muted); border-top: 1px solid var(--edge); }
.regional-preferences > summary { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 14px; min-height: 44px; padding: 9px 0; cursor: pointer; font-size: .82rem; }
.regional-preferences > summary::before { content: '+'; color: var(--accent-strong); font-weight: 750; }
.regional-preferences[open] > summary::before { content: '−'; }
.regional-preferences > summary strong { color: var(--accent-strong); font-size: inherit; min-width: 8.2rem; text-align: right; }
.preference-panel { padding: 16px 0 4px; border-top: 1px solid var(--edge); max-width: 720px; margin-left: auto; }
.preference-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.preference-fields > div { min-width: 0; }
.preference-fields label { display: block; font-size: .85rem; font-weight: 650; margin-bottom: 6px; }
.preference-fields select { width: 100%; min-width: 0; min-height: 44px; border: 1px solid #b9cbd1; border-radius: 6px; background: white; color: var(--ink); padding: 8px; }
.preference-panel p { font-size: .8rem; line-height: 1.5; margin: 12px 0; overflow-wrap: anywhere; }
.preference-source { min-height: 3em; }
.panel-head .regional-context { font-size: .79rem; line-height: 1.45; min-height: 3em; padding-top: 12px; border-top: 1px solid var(--edge); color: var(--ink-muted); }
.reference-units { border-left: 3px solid var(--edge); padding: 12px 16px; font-size: .82rem; color: var(--ink-muted); background: #f0f4f3; }
.field-control .unit { max-width: 42%; flex-shrink: 0; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
@media(max-width:620px) {
 .preference-bar { padding: 0 18px 8px; }
 .regional-preferences > summary { justify-content: flex-start; gap: 9px; font-size: .78rem; }
 .regional-preferences > summary strong { margin-left: auto; min-width: 0; white-space: nowrap; }
 .preference-panel { padding-top: 12px; }
 .preference-fields { grid-template-columns: minmax(0,1fr); gap: 12px; }
}


/* Task workflows share the same stable form/result shell. */
.shift-list { grid-column: 1/-1; min-width: 0; }
.shift-list h3 { font-size: 1.1rem; margin-bottom: 8px; }
.shift-intro,.shift-limit { font-size: .85rem; color: var(--ink-muted); }
.shift-row { margin: 0 0 18px; padding: 12px 0 8px; border: 0; border-bottom: 1px solid var(--edge); min-width: 0; }
.shift-row legend { font-size: .88rem; font-weight: 700; padding: 0; }
.shift-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 4px 14px; }
.shift-row input { display: block; width: 100%; min-width: 0; min-height: 48px; padding: 8px; color: var(--ink); background: white; border: 1px solid #b9cbd1; border-radius: 6px; }
.shift-row label { min-height: 2.5em; }
.shift-row .field-feedback { min-block-size: 5.4em; }
.remove-shift { min-height: 44px; padding: 8px 0; border: 0; background: none; color: #94312b; text-decoration: underline; }
.field:has(textarea) { grid-column: 1/-1; }
.field textarea { width: 100%; max-width: 100%; min-height: 110px; padding: 12px; resize: vertical; font: inherit; color: var(--ink); border: 1px solid #b9cbd1; border-radius: 6px; }
.field textarea::placeholder { color: var(--ink-muted); opacity: 1; }
.field textarea:focus-visible { outline: 3px solid #15a786; outline-offset: 3px; }
.field textarea[aria-invalid=true] { outline: 2px solid #b44137; outline-offset: -2px; }
.details-assumptions { font-size: .87rem; max-width: 75ch; color: var(--ink-muted); }
.calculation-detail-section[data-state=pending] .details-assumptions { visibility: hidden; }
.calculation-detail-section .table-scroll { max-height: 32rem; }
.calculation-detail-section table { font-variant-numeric: tabular-nums; }
.calculation-detail-section summary { min-height: 44px; cursor: pointer; padding: 10px 0; }
@media(max-width:360px) { .shift-fields { grid-template-columns: minmax(0,1fr); gap: 4px; } .shift-row label { min-height: 0; } .shift-row .field-feedback { min-block-size: 4.05em; } }

/* Scale secondary amounts to their actual column, keeping currency and number legible. */
.result-item { container-type: inline-size; }
.result-item strong { font-size: clamp(1rem, 10cqi, 1.6rem); }
.result-primary strong { font-size: clamp(1.5rem, 9cqi, 2.3rem); }

/* Reflow in-page navigation and reserve validation copy even with enlarged text. */
.page-jumps { flex-wrap: wrap; row-gap: 12px; }
.field-feedback::after { content: "Use a number such as 30000 or 30,000. Check comma placement and try again."; visibility: hidden; grid-area: 1 / 1; font: inherit; }
@media(max-width:620px) { body { padding-bottom: max(96px, 6rem); } }

.tool-intro h1,.result-label { overflow-wrap: anywhere; }
.field-control .unit { white-space: normal; text-align: center; }
.result-heading { flex-wrap: wrap; gap: 10px; }
.result-badge { flex-shrink: 0; }
@media(max-width:620px) { .result-grid { grid-template-columns: repeat(auto-fit,minmax(min(100%,10rem),1fr)); } }

.swap-units { margin-top: 14px; min-height: 44px; width: 100%; }

/* Long precise rates and dimensions in exported assumptions must reflow at large text sizes. */
.details-assumptions { overflow-wrap: anywhere; }

.debt-list { grid-column: 1/-1; min-width: 0; }
.debt-list h3 { font-size: 1.1rem; }
.debt-list > p { font-size: .85rem; color: var(--ink-muted); }
.debt-row { min-width: 0; border: 0; border-bottom: 1px solid var(--edge); margin: 0 0 18px; padding: 12px 0; }
.debt-row legend { padding: 0; font-weight: 700; }
.debt-fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px 14px; }
.debt-fields .field:first-child { grid-column: 1/-1; }
@media(max-width:360px) { .debt-fields { grid-template-columns: minmax(0,1fr); } }

.detail-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.csv-preview { margin-top: 20px; min-width: 0; }
.csv-preview label { display: block; font-weight: 700; }
.csv-preview p { font-size: .85rem; color: var(--ink-muted); max-width: 75ch; }
.csv-preview textarea { width: 100%; max-width: 100%; height: 15rem; min-height: 10rem; resize: vertical; white-space: pre; padding: 12px; border: 1px solid var(--edge); border-radius: 6px; font: .8rem/1.5 ui-monospace,monospace; color: var(--ink); background: white; }
.csv-preview textarea::placeholder { color: var(--ink-muted); opacity: 1; }
