/* ---------- brand fonts (self-hosted, SIL OFL; see web/fonts/OFL-*.txt) ---------- */
@font-face {
  font-family: "Geist Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/geist-sans-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Geist Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/geist-sans-latin-600-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Geist Sans";
  font-style: normal;
  font-weight: 700 900;
  font-display: swap;
  src: url("fonts/geist-sans-latin-700-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Poltawski Nowy";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("fonts/poltawski-nowy-latin-700-normal.woff2") format("woff2");
}

/*
 * Longbridge brand theme. Brand tokens (--lbf-*) match the corporate site;
 * the semantic tokens below map the app's roles onto them.
 */
:root {
  --lbf-darkgreen: #1f4534;
  --lbf-darkgreen-deep: #173527;
  --lbf-lightgreen: #8dc641;
  --lbf-lightgreen-alt: #cdf7b1;
  --lbf-lightgreen-alt-2: #e7f2df;
  --lbf-mediumgreen: #008610;
  --lbf-neutral: #f6f5ef;

  --navy: var(--lbf-darkgreen-deep);
  --navy-2: var(--lbf-darkgreen);
  --green: var(--lbf-lightgreen);
  --green-deep: #007a0e; /* mediumgreen, a shade darker so it passes AA on tinted fills */
  --green-ink: var(--lbf-darkgreen);
  --green-bg: var(--lbf-lightgreen-alt-2);
  --green-border: #c5e3ad;
  --page: var(--lbf-neutral);
  --card: #ffffff;
  --border: #e3e6df;
  --border-strong: #cfd4cb;
  /* text is brand dark green, as on the corporate site */
  --ink: var(--lbf-darkgreen);
  --ink-2: #2f5242;
  --label: #4b6457; /* 6.0:1 on white (WCAG AA) */
  --row-hover: var(--lbf-lightgreen-alt-2);
  --hover-bg: var(--lbf-lightgreen-alt); /* corporate hover: #cdf7b1 with dark green text */
  --blue: #2563eb;
  --amber: #e8a33d;
  --red: #b3372f;
  --font:
    "Geist Sans", proxima-nova, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    sans-serif;
  --font-display: "Poltawski Nowy", Georgia, "Times New Roman", serif;
}
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html,
body {
  height: 100%;
}
body {
  font-family: var(--font);
  background: var(--page);
  color: var(--ink);
  font-size: 15px;
}

/* ---------- topbar (Longbridge header) ---------- */
.topbar {
  background: var(--lbf-darkgreen);
  color: #fff;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding: 12px 28px;
  min-height: 88px;
}
.brand {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 20px;
}
.lbf-logo {
  display: block;
  height: 48px;
  width: auto;
}
.brand-divider {
  align-self: stretch;
  width: 1px;
  margin: 6px 0;
  background: rgba(255, 255, 255, 0.28);
}
.brand-product {
  display: flex;
  align-items: center;
  gap: 14px;
}
.brand-lockup {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}
/*
 * The product name uses Geist Sans (the corporate body face) rather than the
 * Poltawski Nowy display face: Poltawski's lowercase "s" is much narrower than
 * its "o", so "Boost" read as if the "s" were smaller.
 */
.brand-name {
  font-family: var(--font);
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.015em;
  white-space: nowrap;
}
.brand-name .plat {
  color: #fff;
}
.brand-name .boost {
  margin-left: 8px;
  color: var(--lbf-lightgreen-alt);
}
.brand-tag {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #c7dbcf;
  margin-top: 6px;
}

/* ---------- shell ---------- */
.shell {
  max-width: 1380px;
  margin: 0 auto;
  padding: 24px 28px 60px;
}
.top-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(31, 69, 52, 0.05);
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}
.card-title {
  font-size: 16px;
  font-weight: 700;
}
.card-hint {
  font-size: 12px;
  color: var(--label);
}

/* ---------- inputs (vertical, left) ---------- */
.inputs-body {
  padding: 10px 16px 12px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px 18px;
  /* top-aligned, so a message under one field does not shift its neighbours */
  align-items: start;
}
.fld {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.fld .cap-line,
.fld .warn {
  grid-column: auto;
}
.fld.span2 .cap-line {
  line-height: 1.45;
}
.fld.span2 {
  grid-column: span 2;
}
.fld.spanall {
  grid-column: 1 / -1;
}
.info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  margin-left: 6px;
  background: var(--border-strong);
  color: #fff;
  font-size: 9.5px;
  font-weight: 700;
  font-style: italic;
  cursor: help;
  position: relative;
  vertical-align: middle;
  text-transform: none;
  letter-spacing: 0;
}
.info:hover,
.info:focus {
  background: var(--navy-2);
}
.info:focus-visible {
  outline: 2px solid var(--navy-2);
  outline-offset: 2px;
}
.info .tip {
  display: none;
  position: absolute;
  left: -10px;
  top: calc(100% + 15px);
  transform: none;
  width: 250px;
  padding: 9px 11px;
  border-radius: 6px;
  background: var(--navy);
  color: #e7f2df;
  font-size: 11.5px;
  font-weight: 400;
  font-style: normal;
  line-height: 1.45;
  letter-spacing: 0.01em;
  text-transform: none;
  text-align: left;
  white-space: normal;
  word-break: normal;
  box-shadow: 0 6px 18px rgba(23, 53, 39, 0.28);
  z-index: 40;
}
.info .tip::before {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 14px;
  border: 5px solid transparent;
  border-bottom-color: var(--navy);
}
.info:hover .tip,
.info:focus .tip {
  display: block;
}
/* Escape dismisses the tip until the next hover or focus (WCAG 1.4.13) */
.info.dismissed .tip {
  display: none;
}
.minnote {
  font-size: 10px;
  font-weight: 600;
  color: var(--label);
  letter-spacing: 0.06em;
  margin-left: 4px;
}
.fld input.bad {
  border-color: #d99b95;
  background: #fdf5f4;
}
/* a default the user has not confirmed yet (Compare gate) */
.inputs-body .fld input.needsyou {
  border-color: #d99b95;
  background: #fdf5f4;
}
/* a value that is not valid: strong red border plus the message in words below */
.inputs-body .fld input.invalid,
.inputs-body .fld input.invalid:focus {
  border: 2px solid var(--red);
  background: #fdf5f4;
  padding: 4px 8px; /* keeps the same outer size with the 2px border */
}
.fld-err {
  margin: 2px 0 0;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  color: #8c2f28; /* 7.3:1 on white */
  white-space: normal;
}
.fld-err::before {
  content: "⚠ ";
}
.fld-label {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--label);
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fld > input[type="text"],
.fld > input[type="date"] {
  max-width: none;
  width: 100%;
}
.fld input[type="text"],
.fld input[type="date"] {
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 5px 9px;
  font-size: 14px;
  color: var(--ink);
  width: 100%;
  background: #fff;
  font-family: var(--font);
  font-variant-numeric: tabular-nums;
}
.fld input:focus {
  outline: 2px solid var(--navy-2);
  outline-offset: 1px;
  border-color: var(--navy-2);
}
.slider-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}
.slider-row input[type="text"] {
  width: 120px;
  flex: 0 0 auto;
}
.slider-row input[type="range"] {
  flex: 1;
  accent-color: var(--green-deep);
  height: 26px;
}
.cap-line {
  font-size: 11.5px;
  color: var(--label);
  line-height: 1.35;
}
.cap-line b {
  color: var(--ink-2);
}
.warn {
  background: #fbeeed;
  border: 1px solid #ecc9c5;
  color: #8c2f28;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: 5px;
  padding: 6px 10px;
  display: none;
}
.warn.show {
  display: block;
}

/* ---------- outputs (right) ---------- */
.out-body {
  display: flex;
  flex-direction: column;
}
.terms-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--border);
}
.term {
  padding: 7px 16px;
  border-right: 1px solid var(--border);
}
.term:last-child {
  border-right: 0;
}
.term-label {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--ink-2);
  text-transform: uppercase;
}
.term-val {
  font-size: 16px;
  font-weight: 400;
  margin-top: 3px;
  font-variant-numeric: tabular-nums;
}
.kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}
.kpi {
  padding: 12px 18px;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.kpi:last-child {
  border-right: 0;
}
.kpi-label {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--ink-2);
  text-transform: uppercase;
}
.kpi-value {
  font-size: 26px;
  font-weight: 400;
  margin-top: 4px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.kpi-sub {
  font-size: 12.5px;
  color: var(--label);
  margin-top: 4px;
}
.kpi.hero .kpi-value {
  color: var(--green-deep);
  font-weight: 800;
}

button.btn.btn-go {
  background: var(--navy-2);
  color: #fff;
  border-color: var(--navy-2);
  font-size: 14px;
  font-weight: 800;
  padding: 8px 24px;
  letter-spacing: 0.02em;
}
button.btn.btn-go:hover {
  background: #2b5c45;
  color: #fff;
}
button.btn.btn-go.rerun {
  background: #fff;
  color: var(--navy-2);
}
.cmp-run {
  justify-content: flex-end;
}
.cmp-gate {
  padding: 22px 20px 26px;
  text-align: center;
}
.cmp-gate p {
  font-size: 13.5px;
  color: var(--label);
  line-height: 1.5;
}
.cmp-gate p.bad {
  color: #8c2f28;
  font-weight: 600;
}
.cmp-hidden {
  display: none !important;
}

/* ---------- comparison band ---------- */

.compare {
  margin-top: 16px;
}
.bottomline {
  margin-top: 16px;
}
.cmp-inputs {
  display: flex;
  align-items: flex-end;
  gap: 18px;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: #fbfbf8;
}
.cfld {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.cfld-label {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--ink-2);
  text-transform: uppercase;
  white-space: nowrap;
}
.cfld input[type="text"],
.cfld input[type="date"] {
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 6px 9px;
  font-size: 14px;
  color: var(--ink);
  width: 150px;
  background: #fff;
  font-family: var(--font);
  font-variant-numeric: tabular-nums;
}
.cfld input:focus {
  outline: 2px solid var(--navy-2);
  outline-offset: 1px;
  border-color: var(--navy-2);
}
.cfld input[readonly] {
  background: #f1f3ee;
  color: var(--ink-2);
  cursor: default;
  border-style: dashed;
}
.cfld-sep {
  width: 1px;
  align-self: stretch;
  background: var(--border);
  margin: 0 2px;
}
.cfld.derived {
  justify-content: flex-end;
}
.cfld-derived {
  font-size: 13.5px;
  color: var(--ink);
  padding: 6px 0;
  font-variant-numeric: tabular-nums;
}
.cfld-derived.bad {
  color: #8c2f28;
  font-weight: 700;
}
.cmp-legend {
  padding: 12px 20px 10px;
}
.cmp-hidden-always {
  display: none;
}
.cmp-legend .dot.bar {
  border-radius: 1px;
  height: 12px;
  width: 7px;
}
.legend .dot.line {
  width: 20px;
  height: 3px;
  border-radius: 2px;
}
.cmp-chart-wrap {
  padding: 0 14px;
}
.cesblock {
  margin-top: 16px;
}
.cesblock .main {
  margin-top: 0;
  padding: 14px 16px 16px;
}
.cesblock .main > .card {
  box-shadow: none;
}

/*
 * Defaults versus values the user entered, as in the original tool: a default
 * is light neutral grey and normal weight; once edited (or tabbed through) the
 * value turns dark green and bold. #707070 is about the lightest grey that
 * still meets WCAG AA on both backgrounds: 4.9:1 on white and 4.6:1 on the pink
 * "needs you" fill. The original's #9aa3b2 is about 2.5:1.
 */
.inputs-body .fld input[type="text"],
.inputs-body .fld input[type="date"] {
  font-weight: 600;
}
.inputs-body .fld input.untouched,
.inputs-body .fld .slider-row input.untouched {
  color: #707070;
  font-weight: 400;
}
.fld input.untouched::placeholder {
  color: #b8b8b8;
}

/* ---------- merged-input + gate styling ---------- */
.fld-sub {
  grid-column: 1 / -1;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 3px 0 0;
  padding-top: 6px;
  border-top: 1px solid var(--border);
}
.fld.derived-row .cfld-derived {
  font-size: 13px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  padding-bottom: 7px;
}
.fld.derived-row .cfld-derived.bad {
  color: #8c2f28;
  font-weight: 700;
}
.fld.compare-row {
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
  margin-top: 2px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.fld.compare-row .btn-go {
  width: auto;
  min-width: 190px;
}

.gate-msg {
  font-size: 12.5px;
  color: var(--label);
  margin: 0;
  margin-right: auto;
}
.gate-msg.bad {
  color: #8c2f28;
  font-weight: 600;
}
.out-gate,
.cmp-gate {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 190px;
  padding: 28px 20px;
  text-align: center;
}
.out-gate p,
.cmp-gate p {
  font-size: 14px;
  color: var(--label);
}
.out-gate b {
  color: var(--navy-2);
}

/* ---------- dashboard polish ---------- */
body {
  background: #f3f4ef;
}
.card {
  border-radius: 14px;
  box-shadow:
    0 1px 3px rgba(31, 69, 52, 0.06),
    0 8px 22px rgba(31, 69, 52, 0.04);
}
.card-head {
  padding: 11px 18px;
}
.card-title {
  font-size: 15.5px;
  letter-spacing: -0.01em;
}
.kpis {
  border-radius: 0;
}
.kpi {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  text-align: left;
}
.kpi-ico {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eef4e9;
}
.kpi-ico svg {
  width: 24px;
  height: 24px;
}
.kpi-body {
  min-width: 0;
}
.kpi-value {
  font-size: 24px;
  margin-top: 1px;
}
.terms-strip {
  background: #fbfbf8;
}
.term-val {
  font-size: 15.5px;
}
.term-sub {
  font-size: 11.5px;
  color: var(--label);
  margin-top: 2px;
}

/* legend rail beside the charts */
.chart-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 268px;
  gap: 16px;
  align-items: start;
}
.lrail {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 16px 14px 0;
}
.lrail .lcard {
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 11px 13px;
  background: #fbfbf8;
}
.lrail .lk {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12.5px;
  color: var(--ink-2);
}
.lrail .lk i {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex: 0 0 auto;
}
.lrail .lk i.line {
  width: 18px;
  height: 3px;
  border-radius: 2px;
}
.lrail .lv {
  font-size: 20px;
  font-weight: 800;
  margin-top: 5px;
  font-variant-numeric: tabular-nums;
}
.lrail .ls {
  font-size: 11.5px;
  color: var(--label);
  margin-top: 1px;
}
@media (max-width: 1150px) {
  .chart-row {
    grid-template-columns: 1fr;
  }
  .lrail {
    padding: 0 16px 14px;
  }
}

/* ---------- action tiles ---------- */
.actions {
  margin-top: 16px;
}
.itiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 18px 20px;
}
.itile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: #fff;
  padding: 18px 12px 14px;
  cursor: pointer;
  font-family: var(--font);
  transition:
    border-color 0.12s ease,
    box-shadow 0.12s ease,
    transform 0.12s ease;
}
.itile:hover {
  border-color: var(--green-deep);
  box-shadow: 0 4px 14px rgba(31, 69, 52, 0.1);
  transform: translateY(-1px);
}
.itile:focus-visible {
  outline: 2px solid var(--navy-2);
  outline-offset: 2px;
}
.itile svg {
  width: 46px;
  height: 46px;
}
.itile span {
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
}
.itile small {
  font-size: 11.5px;
  color: var(--label);
  text-align: center;
  line-height: 1.35;
}

/* ---------- module internals ---------- */
.modtabs {
  display: flex;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  overflow: hidden;
  margin-right: 4px;
}
.modtab {
  border: 0;
  border-right: 1px solid var(--border-strong);
  background: #fff;
  cursor: pointer;
  font-family: var(--font);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-2);
  padding: 7px 13px;
}
.modtab:last-child {
  border-right: 0;
}
.modtab.on {
  background: var(--navy-2);
  color: #fff;
}
.donutgrid {
  display: grid;
  grid-template-columns: minmax(0, 230px) minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}
.donut {
  width: 100%;
  height: auto;
}
.donut .dlab {
  font-size: 13px;
  fill: var(--label);
  font-family: var(--font);
}
.donut .dval {
  font-size: 23px;
  font-weight: 800;
  fill: var(--ink);
  font-family: var(--font);
}
.lg {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.lgrow {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13px;
}
.lgrow i {
  width: 11px;
  height: 11px;
  border-radius: 3px;
  flex: 0 0 auto;
}
.lgrow b {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}
.modnotes {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.modnotes b {
  font-size: 13.5px;
}
.modnotes p {
  font-size: 12.5px;
  color: var(--ink-2);
  line-height: 1.45;
  margin-top: 2px;
}
.modctl {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  flex-wrap: wrap;
  padding: 12px 14px;
  margin-bottom: 14px;
  background: #fbfbf8;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.modctl label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.modctl input {
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  padding: 6px 9px;
  width: 124px;
  font-family: var(--font);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.modasof {
  margin-left: auto;
  font-size: 12.5px;
  color: var(--label);
}
.modstat {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.modstat > div {
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 9px 11px;
  background: #fff;
}
.modstat span {
  display: block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--label);
}
.modstat b {
  font-size: 19px;
  font-variant-numeric: tabular-nums;
}
.modstat b.neg {
  color: var(--red);
}
.modstat b.pos {
  color: var(--green-deep);
}
.minichart {
  width: 100%;
  height: auto;
}
.minileg {
  display: flex;
  gap: 14px;
  font-size: 12px;
  color: var(--ink-2);
  margin-top: 4px;
}
.minileg i {
  display: inline-block;
  width: 10px;
  height: 3px;
  border-radius: 2px;
  margin-right: 6px;
  vertical-align: middle;
}
.modsum {
  font-size: 12.5px;
  color: var(--ink-2);
  margin-bottom: 10px;
}
.modnote {
  font-size: 12px;
  color: var(--label);
  line-height: 1.5;
  margin-top: 8px;
}

/* ---------- amortization module: one blended schedule ---------- */
.factgrid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  overflow: hidden;
  margin-bottom: 12px;
}
.factcell {
  padding: 7px 12px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.factcell span {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.factcell b {
  font-size: 14.5px;
  font-variant-numeric: tabular-nums;
}
/* which lien is which, above the blended schedule */
.amort-key {
  font-size: 13.5px;
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 10px;
}
.amort-key span {
  font-weight: 600;
  color: var(--label);
}
@media (max-width: 1000px) {
  .factgrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.modnote.savenote {
  margin: 0 0 12px;
}
.sched-scroll.blend {
  max-height: 66vh;
}
table.sched-tbl.blend td:first-child {
  text-align: center;
  font-weight: 700;
}
table.sched-tbl.blend td:nth-child(2) {
  text-align: right;
  color: var(--ink);
}
table.sched-tbl.blend thead th,
table.sched-tbl.blend thead th:first-child,
table.sched-tbl.blend thead th:nth-child(2) {
  text-align: center;
  font-weight: 800;
  color: var(--ink);
}
table.sched-tbl.blend .grp-head th {
  text-align: center;
}
table.sched-tbl.blend th.sep,
table.sched-tbl.blend td.sep {
  border-left: 2px solid var(--border-strong);
}
table.sched-tbl.blend td.save {
  font-weight: 800;
  color: var(--green-deep);
}
table.sched-tbl.blend td.save.neg {
  color: var(--red);
}
table.sched-tbl.blend tr.milestone td {
  background: var(--row-hover);
  font-weight: 700;
}
table.sched-tbl.blend tr.grand td {
  border-top: 2px solid var(--border-strong);
  background: #f4f6f1;
  font-weight: 800;
}

/* ---------- branded printout: header and footer only on paper ---------- */
.printhead,
.printfoot {
  display: none;
}

/* ---------- amortization schedule modal ---------- */
/* native <dialog> filling the viewport; the panel inside scrolls with it */
dialog.sched-wrap {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  border: 0;
  padding: 28px 18px;
  background: transparent;
  overflow: auto;
  color: inherit;
}
dialog.sched-wrap::backdrop {
  background: rgba(23, 53, 39, 0.55);
}
.sched {
  background: #fff;
  border-radius: 10px;
  max-width: 1960px;
  width: 98%;
  margin: 0 auto;
  box-shadow: 0 24px 60px rgba(23, 53, 39, 0.4);
  overflow: hidden;
}
.sched-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
}
.sched-title {
  font-size: 21px;
  font-weight: 800;
}
.sched-sub {
  font-size: 13.5px;
  color: var(--label);
}
.sched-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sched-x {
  border: 1px solid var(--border-strong);
  background: #fff;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 15px;
  color: var(--ink-2);
  cursor: pointer;
  line-height: 1;
}
.sched-x:hover {
  background: var(--row-hover);
}
.sched-body {
  padding: 20px 24px 28px;
}
.sched-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  overflow: hidden;
}
.sched-cell {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 12px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
}
.sched-cell .k {
  color: var(--ink-2);
}
.sched-cell .v {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.sched-cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 22px;
}
/* keep the two schedule panels in lockstep so their tables start on the same line */
.sched-cols {
  align-items: start;
}
.sched-panel {
  display: flex;
  flex-direction: column;
}
.sched-panel .sched-grid {
  min-height: 190px;
  align-content: start;
}
.sched-cell {
  min-height: 31px;
  align-items: center;
}
.sched-panel .sched-scroll {
  margin-top: auto;
}

.sched-panel {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px 4px;
  background: #fdfdfb;
}
.sched-ptitle {
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 2px;
}
.sched-panel .sched-sub {
  display: block;
  margin-bottom: 10px;
}
.sched-panel .sched-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 12px;
}
.sched-scroll {
  overflow-x: auto;
  max-height: 62vh;
  overflow-y: auto;
}
@media (max-width: 1250px) {
  .sched-cols {
    grid-template-columns: 1fr;
  }
}

.sched-note {
  font-size: 11.5px;
  color: var(--label);
  line-height: 1.5;
  margin: 12px 2px 18px;
}
table.sched-tbl {
  width: 100%;
  border-collapse: collapse;
}
table.sched-tbl thead th {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  color: var(--ink-2);
  text-align: right;
  padding: 8px 10px;
  border-bottom: 1.5px solid var(--border-strong);
  position: sticky;
  top: 0;
  background: #fff;
}
table.sched-tbl thead th:first-child,
table.sched-tbl thead th:nth-child(2) {
  text-align: left;
}
table.sched-tbl td {
  padding: 6px 10px;
  text-align: right;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  border-bottom: 1px solid #f1f3ee;
}
table.sched-tbl td:first-child,
table.sched-tbl td:nth-child(2) {
  text-align: left;
  color: var(--ink-2);
}
table.sched-tbl tbody tr:nth-child(even) {
  background: #fbfbf8;
}
table.sched-tbl td.neg {
  color: var(--red);
  font-weight: 700;
}
.grp-head th {
  font-size: 12px;
  font-weight: 800;
  color: var(--ink);
  text-align: center;
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
}
@media print {
  @page {
    size: landscape;
    margin: 9mm 10mm;
  }
  body {
    background: #fff;
  }
  body > *:not(.sched-wrap) {
    display: none !important;
  }
  dialog.sched-wrap {
    position: static;
    width: auto;
    height: auto;
    background: none;
    padding: 0;
    overflow: visible;
  }
  dialog.sched-wrap::backdrop {
    background: none;
  }
  .sched {
    box-shadow: none;
    max-width: none;
    width: 100%;
    border-radius: 0;
  }
  /* the branded header replaces the on-screen dialog header */
  .sched-head,
  .sched-actions,
  .modtabs,
  .modctl,
  .sched-note {
    display: none !important;
  }
  .sched-body {
    padding: 0;
  }

  .printhead {
    display: flex;
    align-items: flex-end;
    gap: 18px;
    padding: 0 0 6px;
    margin-bottom: 8px;
    border-bottom: 2.5px solid var(--lbf-darkgreen);
  }
  .ph-brand {
    display: flex;
    align-items: center;
    gap: 12px;
  }
  .ph-mark {
    width: 34px;
    height: 34px;
  }
  .ph-co {
    font-family: var(--font-display);
    font-size: 16.5px;
    font-weight: 700;
    color: var(--lbf-darkgreen);
    line-height: 1.1;
  }
  .ph-prod {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--green-deep);
  }
  .ph-doc {
    margin-left: auto;
    text-align: right;
  }
  .ph-title {
    font-family: var(--font-display);
    font-size: 16px;
    font-weight: 700;
    color: var(--lbf-darkgreen);
    line-height: 1.15;
  }
  .ph-sub {
    font-size: 10.5px;
    color: var(--ink-2);
  }
  .ph-date {
    font-size: 10px;
    color: var(--label);
    margin-top: 1px;
  }
  .printfoot {
    display: flex;
    flex-direction: column;
    gap: 1px;
    margin-top: 6px;
    padding-top: 4px;
    border-top: 1px solid var(--border-strong);
    font-size: 8.5px;
    line-height: 1.35;
    color: var(--label);
  }
  .printfoot span:first-child {
    font-weight: 700;
    color: var(--lbf-darkgreen);
  }

  .amort-key {
    font-size: 10.5px;
    margin: 0 0 6px;
  }
  .factgrid {
    grid-template-columns: repeat(4, 1fr);
    margin-bottom: 6px;
  }
  .factcell {
    padding: 1.5px 8px;
    line-height: 1.2;
  }
  .factcell span {
    font-size: 8.5px;
  }
  .factcell b {
    font-size: 10.5px;
  }
  .modnote.savenote {
    font-size: 8.5px;
    margin: 0 0 5px;
    line-height: 1.25;
  }

  .sched-scroll,
  .sched-scroll.blend {
    max-height: none !important;
    overflow: visible !important;
  }
  /* tighter rows, as in the original tool, so more years fit on a page */
  table.sched-tbl {
    font-size: 8px;
    width: 100%;
  }
  table.sched-tbl thead th,
  table.sched-tbl.blend thead th {
    position: static;
    background: #fff;
    padding: 2px 4px;
    line-height: 1.12;
    font-size: 7.5px;
    font-weight: 800;
    text-align: center;
    border-bottom: 1.5px solid var(--lbf-darkgreen);
    color: var(--lbf-darkgreen);
  }
  table.sched-tbl .grp-head th {
    font-size: 8px;
    padding: 2px 4px;
  }
  table.sched-tbl td,
  table.sched-tbl tbody td:first-child {
    padding: 0.8px 4px;
    line-height: 1.12;
    font-size: 8px;
  }
  thead {
    display: table-header-group;
  }
  tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  /* simulator and schedules: the two panels side by side */
  .sched-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  /*
   * A schedule panel is taller than a page, so it must be allowed to break.
   * "avoid" here pushed both panels to page 2 and printed page 1 with only
   * the header. The small blocks inside still stay whole.
   */
  .sched-panel {
    break-inside: auto;
    page-break-inside: auto;
    border: 1px solid var(--border-strong);
    background: #fff;
    margin: 0;
    padding: 9px 11px;
  }
  .sched-panel .sched-grid,
  .sched-panel .modstat,
  .sched-panel .minichart {
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .sched-panel .sched-grid {
    min-height: 0;
  }
  /* long values such as "Platinum Boost + Boost CES" wrap instead of overlapping */
  .sched-cell .v {
    white-space: normal;
    text-align: right;
  }
  .sched-ptitle {
    font-size: 12px;
  }
  .modstat {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }
  .modstat b {
    font-size: 13px;
  }
  .minichart {
    max-width: 100%;
  }
  .lgrow,
  .modnotes > div {
    break-inside: avoid;
  }
}

/* floating chart tooltip */
.chart-tip {
  position: fixed; /* viewport coordinates; works on the page and inside dialogs */
  display: none;
  z-index: 200;
  pointer-events: none;
  min-width: 208px;
  max-width: 330px;
  background: var(--navy);
  color: #eef6e8;
  border: 1px solid #2b5c45;
  border-radius: 8px;
  padding: 10px 12px;
  box-shadow: 0 10px 26px rgba(23, 53, 39, 0.34);
  font-family: var(--font);
  font-size: 12.5px;
  line-height: 1.45;
}
.chart-tip .tip-h {
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  padding-bottom: 7px;
  margin-bottom: 7px;
  border-bottom: 1px solid #2b5c45;
}
.chart-tip .tip-r {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.chart-tip .tip-r + .tip-r {
  margin-top: 4px;
}
.chart-tip .tip-k {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #c7dbcf;
}
.chart-tip .tip-v {
  margin-left: auto;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #fff;
}
.chart-tip .tip-d {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  flex: 0 0 auto;
}
.chart-tip .tip-sep {
  height: 1px;
  background: #2b5c45;
  margin: 7px 0;
}
.chart-tip .tip-note {
  color: #a9c4b5;
  font-size: 11.5px;
  margin-top: 6px;
}

/* editable extra-principal rows, aligned to the chart columns */
.xrows {
  position: relative;
  width: 100%;
  margin-top: -2px;
}
.xrow {
  position: relative;
  height: 30px;
  background: #fff8d6;
  border-left: 1px solid #f0e08a;
  border-right: 1px solid #f0e08a;
}
.xrow:first-child {
  border-top: 1px solid #f0e08a;
}
.xrow:last-child {
  border-bottom: 1px solid #f0e08a;
}
.xlabel {
  position: absolute;
  left: 0.5%;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11.5px;
  font-weight: 700;
  color: #7a5c05;
  white-space: nowrap;
}
.xcell {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  border: 1px solid #e3d08a;
  border-radius: 4px;
  background: #fffdf2;
  font-family: var(--font);
  font-size: 11px;
  font-weight: 700;
  color: #5c4604;
  text-align: center;
  padding: 3px 1px;
  font-variant-numeric: tabular-nums;
  min-width: 30px;
}
.xcell:focus {
  outline: 2px solid var(--navy-2);
  outline-offset: 1px;
  background: #fff;
}
.xcell.has {
  background: #ffe9a8;
  border-color: #d9b94b;
}
.xcell:disabled {
  background: transparent;
  border-color: transparent;
  cursor: default;
}
.xtot {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 12.5px;
  font-weight: 800;
  color: #7a5c05;
}

.cmp-sentence {
  margin: 0;
  padding: 22px 26px;
  border-radius: 12px;
  background: linear-gradient(100deg, #f1f8ec, #e7f2df);
  border: 1.5px solid var(--green-border);
  box-shadow: 0 1px 3px rgba(31, 69, 52, 0.05);
  font-size: 21px;
  line-height: 1.5;
  color: var(--ink);
}
.cmp-sentence b {
  font-weight: 800;
  color: var(--green-deep);
}
@media (max-width: 1000px) {
  .cmp-sentence {
    font-size: 18px;
    padding: 18px 20px;
  }
}

/* ---------- name key: Platinum Boost (1st lien) and Boost CES (2nd lien) ---------- */
.namekey {
  margin-bottom: 16px;
}
.nk-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 14px 16px 0;
}
.nk-card {
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 11px 14px;
  background: #fbfbf8;
}
.nk-card.nk-first {
  border-left: 4px solid var(--lbf-darkgreen);
}
.nk-card.nk-second {
  border-left: 4px solid var(--lbf-lightgreen);
}
.nk-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
  background: var(--lbf-darkgreen);
  border-radius: 4px;
  padding: 2px 8px;
}
.nk-card.nk-second .nk-tag {
  background: var(--green-deep);
}
.nk-card h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--lbf-darkgreen);
  margin: 7px 0 4px;
}
.nk-card p {
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.5;
  margin: 0;
}
.nk-foot {
  font-size: 12.5px;
  color: var(--label);
  margin: 0;
  padding: 10px 16px 14px;
}
@media (max-width: 900px) {
  .nk-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- lower grid ---------- */
.main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
  margin-top: 16px;
  align-items: start;
}
.chart-wrap {
  padding: 14px 18px 6px;
}
.legend {
  display: flex;
  gap: 16px;
  padding: 0 20px 12px;
  font-size: 12.5px;
  color: var(--ink-2);
  flex-wrap: wrap;
}
.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
}

/* ---------- table ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border-strong);
  background: #fff;
  border-radius: 6px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  font-family: var(--font);
}
.btn:hover {
  background: var(--row-hover);
}
.btn:focus-visible {
  outline: 2px solid var(--navy-2);
}
.tbl-scroll {
  max-height: 600px;
  overflow-y: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
}
thead th {
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 2;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--label);
  text-transform: uppercase;
  text-align: right;
  padding: 9px 9px;
  border-bottom: 1px solid var(--border);
}
thead th:first-child {
  text-align: left;
}
tbody td {
  padding: 7px 9px;
  border-bottom: 1px solid #ebeee8;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-size: 13.5px;
  color: var(--ink);
}
tbody td:first-child {
  text-align: left;
  font-size: 14px;
  font-weight: 700;
}
tr.year-row {
  cursor: pointer;
  background: #fbfbf8;
}
tr.year-row:hover {
  background: var(--row-hover);
}
tr.year-row td:first-child .tri {
  display: inline-block;
  color: var(--label);
  font-size: 9px;
  margin-right: 8px;
  transition: transform 0.12s ease;
  transform: rotate(0deg);
}
tr.year-row.open td:first-child .tri {
  transform: rotate(90deg);
}
tr.month-row {
  display: none;
}
tr.month-row.show {
  display: table-row;
}
tr.month-row td:first-child {
  font-weight: 400;
  color: var(--ink-2);
  padding-left: 26px;
  font-size: 13px;
}
tr.month-row:hover {
  background: var(--row-hover);
}
td input.xtr {
  width: 78px;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  padding: 4px 8px;
  font-size: 13px;
  text-align: right;
  color: var(--ink);
  font-family: var(--font);
  font-variant-numeric: tabular-nums;
  background: #fff;
}
td input.xtr:focus {
  outline: 2px solid var(--navy-2);
  outline-offset: 1px;
}
td input.xtr.applied {
  border-color: var(--green-border);
  background: var(--green-bg);
}
td input.xtr.yr {
  font-weight: 700;
}
td input.xtr.yr::placeholder {
  font-weight: 400;
  font-style: italic;
  color: #9aa49d;
}
tr.total-row td {
  font-weight: 700;
  border-top: 2px solid var(--border-strong);
  background: #fbfbf8;
}
.neg-check {
  color: var(--label);
  font-size: 12px;
  padding: 10px 20px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
@media (max-width: 1000px) {
  .inputs-body {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .main {
    grid-template-columns: 1fr;
  }
  .kpis {
    grid-template-columns: 1fr;
  }
  .kpi {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
}

/* ---------- Static Web App additions ---------- */
.signout {
  color: #cfdcc9;
  font-size: 12.5px;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid #2b5c45;
  border-radius: 6px;
  padding: 6px 12px;
}
.signout:hover,
.signout:focus-visible {
  color: #fff;
  border-color: #a9c4b5;
}
.card-tools {
  display: flex;
  align-items: center;
  gap: 14px;
}
.dot-balance {
  background: #2563eb;
}
.dot-interest {
  background: #1f3a68;
}
.dot-extra {
  background: #4caf50;
}
.api-status {
  margin: 0 0 14px;
  padding: 10px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  background: #fbeeed;
  border: 1px solid #ecc9c5;
  color: #8c2f28;
}
.api-status.info {
  background: #eef4e9;
  border-color: #cfd4cb;
  color: #1f4534;
}
.api-status[hidden] {
  display: none;
}
body.is-busy .kpi-value,
body.is-busy .term-val {
  opacity: 0.55;
  transition: opacity 0.15s;
}
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
h2.card-title,
h2.sched-title {
  margin: 0;
}
/* brand headings: serif display face, like the corporate site */
.card-title,
.sched-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--lbf-darkgreen);
  letter-spacing: 0;
  white-space: nowrap; /* the hint next to it wraps instead */
}
.card-head {
  gap: 8px 16px;
}

/*
 * ---------- buttons and tiles: corporate style ----------
 * Every button and "Take it further" tile is solid dark green with white
 * text (10.7:1). Hover is the corporate light green #cdf7b1 with dark green
 * text (9.0:1), with the site's 0.4 s transition.
 */
.btn,
.itile,
.sched-x,
tr.year-row,
tr.month-row {
  transition:
    background-color 0.4s ease,
    color 0.4s ease,
    border-color 0.4s ease;
}
.btn,
button.btn.btn-go,
button.btn.btn-go.rerun {
  justify-content: center;
  background: var(--lbf-darkgreen);
  border: 1px solid var(--lbf-darkgreen);
  border-radius: 12px;
  color: #fff;
  font-weight: 600;
}
.btn:hover:not(:disabled),
button.btn.btn-go:hover:not(:disabled),
button.btn.btn-go.rerun:hover:not(:disabled) {
  background: var(--hover-bg);
  border-color: var(--hover-bg);
  color: var(--lbf-darkgreen);
}
.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.btn:focus-visible,
.itile:focus-visible {
  outline: 2px solid var(--lbf-darkgreen);
  outline-offset: 2px;
}
.sched-x:hover {
  background: var(--hover-bg);
  color: var(--lbf-darkgreen);
}
/* dialog tabs: the active one is solid dark green; the others get the hover */
.modtab {
  transition:
    background-color 0.4s ease,
    color 0.4s ease;
}
.modtab:not(.on):hover {
  background: var(--hover-bg);
  color: var(--lbf-darkgreen);
}

.itile {
  background: var(--lbf-darkgreen);
  border: 1px solid var(--lbf-darkgreen);
  border-radius: 16px;
}
.itile span {
  color: #fff;
}
.itile small {
  color: #c7dbcf;
}
.itile:hover {
  background: var(--hover-bg);
  border-color: var(--hover-bg);
  box-shadow: 0 4px 14px rgba(31, 69, 52, 0.12);
}
.itile:hover span,
.itile:hover small {
  color: var(--lbf-darkgreen);
}
/* tile icons: light strokes on dark green, dark strokes on the hover fill */
.itile svg .ic-main {
  stroke: #fff;
}
.itile svg .ic-soft {
  stroke: rgba(255, 255, 255, 0.45);
}
.itile svg .ic-accent {
  stroke: var(--lbf-lightgreen);
}
.itile svg .ic-alt {
  stroke: var(--lbf-lightgreen-alt);
}
.itile svg .ic-dot {
  fill: var(--lbf-darkgreen);
  stroke: var(--lbf-lightgreen);
}
.itile:hover svg .ic-main,
.itile:hover svg .ic-alt {
  stroke: var(--lbf-darkgreen);
}
.itile:hover svg .ic-soft {
  stroke: rgba(31, 69, 52, 0.4);
}
.itile:hover svg .ic-accent {
  stroke: #007a0e;
}
.itile:hover svg .ic-dot {
  fill: var(--hover-bg);
  stroke: #007a0e;
}
.itile svg * {
  transition:
    stroke 0.4s ease,
    fill 0.4s ease;
}
.tip-note.lead {
  margin: 0 0 6px;
}
body.modal-open {
  overflow: hidden;
}
.sched-bar,
.hover-zone {
  cursor: pointer;
}
:focus-visible {
  outline: 2px solid var(--navy-2);
  outline-offset: 2px;
}
.yr-toggle {
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0;
  text-align: left;
  white-space: nowrap;
}
.api-ref {
  font-weight: 400;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12px;
  user-select: all;
}
@media print {
  .chart-tip {
    display: none !important;
  }
}

/* mini charts in the simulator: hover tracker like the main charts */
.minichart .hover-zone {
  cursor: crosshair;
}

/* ---------- upstream 089e7d30: max-loan list, second lien, autopay, explainer videos ---------- */

/* max loan: the four limits, with the lowest (binding) one marked */
.capmin {
  font-size: 11.5px;
  color: var(--label);
  margin-bottom: 1px;
}
.capmin b,
.caplist li b {
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.caphead {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-2);
  margin-bottom: 1px;
}
.caplist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1px;
}
.caplist li {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px 7px;
  font-size: 11.5px;
  color: var(--label);
}
.caplist li.binds {
  color: var(--ink);
}
.caplist li.binds b {
  color: var(--green-deep);
  font-weight: 800;
}
.caplist li em {
  font-style: normal;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--green-deep);
  white-space: nowrap;
}

/* existing second lien: a toggle in the section title, fields off until checked */
.subtoggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-left: 14px;
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 600;
  font-size: 12px;
  color: var(--ink-2);
}
.subtoggle input,
.autopay input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--lbf-darkgreen);
  cursor: pointer;
}
.fld.secfld input:disabled {
  background: #f1f3ee;
  border-style: dashed;
  cursor: not-allowed;
}
.fld.secfld.off .fld-label {
  color: #707070;
}

/* rate with the autopay opt-out */
.rateline {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.rateline .term-sub {
  font-size: 12px;
  color: var(--label);
}
.autopay {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 5px;
  cursor: pointer;
}
.autopay span {
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1.2;
}
.autopay i {
  font-style: normal;
  color: var(--label);
}

/* explainer videos */
.vq-host:empty {
  display: none;
}
.inputs-body .vq-host {
  grid-column: 1 / -1;
}
.vq-after-sentence {
  margin-top: -6px;
}
.vq-stack {
  padding: 0 16px 14px;
}
.vq-row {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  background: #fbfbf8;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 14px;
  cursor: pointer;
  font-family: var(--font);
  text-align: left;
  transition:
    border-color 0.4s ease,
    background-color 0.4s ease;
}
.vq-row:hover,
.vq.open .vq-row {
  border-color: var(--lbf-darkgreen);
  background: var(--row-hover);
}
.vq.open .vq-row {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}
.vq-play {
  display: flex;
  color: var(--green-deep);
  flex: 0 0 auto;
}
.vq-play svg {
  width: 21px;
  height: 21px;
}
.vq-q {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
  min-width: 0;
}
.vq-cta {
  margin-left: auto;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--green-deep);
  white-space: nowrap;
}
.vq-empty .vq-play,
.vq-empty .vq-cta {
  color: #707070;
}
.vq-chev {
  color: var(--label);
  font-size: 11px;
  transition: transform 0.15s ease;
}
.vq.open .vq-chev {
  transform: rotate(180deg);
}
.vq-body {
  border: 1px solid var(--lbf-darkgreen);
  border-top: 0;
  border-radius: 0 0 10px 10px;
  background: var(--lbf-darkgreen-deep);
  padding: 14px;
}
.vq-frame {
  position: relative;
  max-width: 860px;
  margin: 0 auto;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 7px;
  overflow: hidden;
}
.vq-frame iframe,
.vq-frame video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
.vq-soon {
  max-width: 860px;
  margin: 0 auto;
  padding: 22px 18px;
  text-align: center;
  color: #c7dbcf;
  font-size: 13px;
  border: 1px dashed #4b6457;
  border-radius: 7px;
}
@media print {
  .vq-host {
    display: none !important;
  }
}

/* ---------- APD-1812: compliance disclaimer ---------- */
/* on screen: plain italic text at the very bottom of the page */
.disclaimer {
  max-width: 1380px;
  margin: 0 auto;
  padding: 0 28px 40px;
  font-size: 12px;
  font-style: italic;
  line-height: 1.55;
  color: var(--label);
}
.disclaimer .disc-title {
  margin: 0 0 4px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-2);
}
.disclaimer .disc-head {
  font-weight: 700;
  letter-spacing: 0.02em;
}
.disclaimer p {
  margin: 0 0 8px;
  max-width: 150ch;
}
.print-disclaimer {
  display: none;
}
@media (max-width: 700px) {
  .disclaimer {
    padding: 0 16px 32px;
  }
}
@media print {
  /* in every printout: inside the page, at the bottom, after the schedule */
  .print-disclaimer {
    display: block;
    margin-top: 6px;
    padding-top: 4px;
    border-top: 1px solid var(--border-strong);
    column-count: 2;
    column-gap: 14px;
    font-size: 6.4px;
    font-style: italic;
    line-height: 1.3;
    color: #4a5568;
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .print-disclaimer .disc-title {
    margin: 0;
    font-size: 7.5px;
    font-weight: 700;
    color: var(--lbf-darkgreen);
  }
  .print-disclaimer .disc-head {
    font-weight: 700;
  }
  .print-disclaimer p {
    margin: 0 0 2.5px;
  }
}
