:root {
  color-scheme: dark;
  --canvas: #0a101d;
  --surface: #101a2c;
  --surface-2: #152237;
  --input: #0c1627;
  --text: #eff5ff;
  --soft: #dbe7fb;
  --muted: #a9b9d1;
  --line: #2a3b56;
  --mint: #7bf0bd;
  --mint-dark: #0e3026;
  --blue: #89caff;
  --lavender: #b5b8ff;
  --warning: #ffc989;
  --danger: #ffb1bc;
  --chart-base: #aab3ff;
  --chart-time: #66e6b5;
  --chart-payment: #7fc7ff;
  --chart-capital: #aab3ff;
  --chart-interest: #66e6b5;
  --chart-charges: #f1c485;
  --chart-upfront: #e4a6fa;
  --chart-financed: #f3a19f;
  --chart-grid: #2b3950;
  --chart-axis: #aebbd0;
  --chart-cursor: #d3dcef;
  --chart-point-border: #080e1c;
  --page-width: 70rem;
  --dock-height: calc(2.5rem + 32px + env(safe-area-inset-bottom, 0px));
  --viewport-height: 100vh;
  font: 400 100%/1.5 "Aptos", "Segoe UI", system-ui, sans-serif;
  color: var(--text);
  background: var(--canvas);
}

:root[data-theme="light"] {
  color-scheme: light;
  --canvas: #f1f5fa;
  --surface: #f8fbff;
  --surface-2: #ffffff;
  --input: #ffffff;
  --text: #142137;
  --soft: #293d58;
  --muted: #4a5d76;
  --line: #c1d1e3;
  --mint: #0b7155;
  --mint-dark: #ffffff;
  --blue: #165e9a;
  --lavender: #5547a8;
  --warning: #884811;
  --danger: #a6293d;
  --chart-base: #6054c7;
  --chart-time: #08775a;
  --chart-payment: #1764a6;
  --chart-capital: #6853c4;
  --chart-interest: #087b61;
  --chart-charges: #99601c;
  --chart-upfront: #883b9c;
  --chart-financed: #ad494e;
  --chart-grid: #cbd7e5;
  --chart-axis: #435671;
  --chart-cursor: #50657e;
  --chart-point-border: #f7faff;
}

@supports (height: 100dvh) {
  :root { --viewport-height: 100dvh; }
}

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

html, body {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  background: radial-gradient(ellipse at 29% 8%, #172442, transparent 62%), var(--canvas);
}

[hidden] { display: none !important; }
button, input, select { font: inherit; }
button, select, summary, input[type="range"] { cursor: pointer; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: default; opacity: .48; }

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

h1, h2, h3, p, dl, dd, figure { margin: 0; }

h1, h2, h3 {
  letter-spacing: -.037em;
  line-height: 1.13;
}

h1 {
  font-size: clamp(2rem, 5.7vw, 3.2rem);
  font-weight: 760;
  text-wrap: pretty;
}

h2 { font-size: clamp(1.18rem, 3.45vw, 1.48rem); }
h3 { font-size: 1rem; }
a { color: var(--mint); }
fieldset { min-width: 0; margin: 0; border: 0; padding: 0; }
legend { padding: 0; }
small { font-size: .83rem; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

.skip-link {
  position: fixed;
  z-index: 9;
  inset: .5rem auto auto .5rem;
  padding: .7rem 1rem;
  border-radius: .6rem;
  background: var(--mint);
  color: var(--mint-dark);
  transform: translateY(calc(-100% - 1rem));
}

.skip-link:focus { transform: none; }

.app-frame {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) var(--dock-height);
  height: var(--viewport-height);
  width: 100%;
  overflow: hidden;
}

.site-header {
  position: relative;
  z-index: 1;
  border-bottom: 1px solid #263650;
  background: #0b1322df;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) 0 env(safe-area-inset-left, 0px);
  touch-action: pan-y pinch-zoom;
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .2rem 1rem;
  min-height: min(3.75rem, 96px);
  width: min(var(--page-width), calc(100% - min(2rem, 32px)));
  margin-inline: auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: clamp(.45rem, 2vw, .7rem);
  min-width: 0;
  text-decoration: none;
}

.brand-logo {
  display: block;
  flex: 0 1 auto;
  width: clamp(122px, 36vw, 158px);
  min-width: 96px;
  height: 44px;
  padding: 2px 5px;
  border: 1px solid #d2deec;
  border-radius: .55rem;
  background: #ffffff;
  object-fit: contain;
}

.brand-product {
  min-width: 0;
  padding-inline-start: clamp(.48rem, 2vw, .7rem);
  border-inline-start: 1px solid var(--line);
  color: var(--text);
  font-size: clamp(.92rem, 3.65vw, 1.12rem);
  font-weight: 760;
  line-height: 1.12;
  letter-spacing: -.023em;
  overflow-wrap: anywhere;
}

:root[data-theme="light"] .brand-logo { border-color: transparent; background: transparent; }

.local-label {
  display: inline-flex;
  align-items: center;
  gap: .42rem;
  color: var(--muted);
  font-weight: 550;
  font-size: .72rem;
  text-align: end;
}

.local-label::before {
  flex: none;
  width: .4rem;
  height: .4rem;
  border-radius: 50%;
  background: var(--mint);
  content: "";
}

.header-tools {
  display: flex;
  flex: none;
  align-items: center;
  gap: .65rem;
  min-width: 0;
  max-width: 100%;
}

.theme-toggle,
.areas-toggle {
  display: grid;
  flex: 0 0 44px;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #3d5674;
  border-radius: .68rem;
  background: #172641;
  color: var(--soft);
}

.theme-toggle:hover,
.areas-toggle:hover { border-color: #728bad; background: #243754; color: var(--text); }
.theme-toggle:focus-visible,
.areas-toggle:focus-visible { outline-offset: 2px; }

.area-switcher { position: relative; }

.areas-panel {
  position: absolute;
  inset-block-start: calc(100% + .5rem);
  inset-inline-end: 0;
  display: grid;
  width: min(15rem, calc(100vw - 2rem));
  max-height: min(16rem, 65vh);
  overflow: auto;
  padding: .3rem;
  border: 1px solid var(--line);
  border-radius: .75rem;
  background: var(--surface);
  box-shadow: 0 .65rem 1.5rem #0004;
}

.areas-panel a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: .35rem .65rem;
  border-radius: .5rem;
  color: var(--text);
  text-decoration: none;
}

.areas-panel a:hover,
.areas-panel a[aria-current] { background: var(--surface-2); }
.areas-panel a[aria-current] { color: var(--mint); }
.areas-panel a:focus-visible { outline-offset: -2px; }

.theme-toggle svg {
  width: 1.2rem;
  height: 1.2rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.theme-toggle .theme-moon,
:root[data-theme="light"] .theme-toggle .theme-sun { display: none; }

:root[data-theme="light"] .theme-toggle .theme-moon { display: block; }

.main-frame,
.carousel,
.carousel-track {
  min-width: 0;
  min-height: 0;
  width: 100%;
  height: 100%;
}

.carousel { overflow: clip; touch-action: pan-y pinch-zoom; }

.carousel-track {
  display: flex;
  transform: translate3d(calc(var(--carousel-offset, 0%) + var(--drag-offset, 0px)), 0, 0);
}

.carousel-track[data-dragging] { user-select: none; }

.carousel-panel {
  flex: 0 0 100%;
  min-width: 0;
  height: 100%;
  overflow: hidden auto;
  overscroll-behavior: contain;
  scroll-padding-block: 1rem;
  scrollbar-color: #3e536d transparent;
  scrollbar-width: thin;
  touch-action: pan-y pinch-zoom;
}

.carousel-panel[inert] { pointer-events: none; }

.slide-content {
  display: grid;
  gap: 1rem;
  width: min(var(--page-width), calc(100% - min(2rem, 32px)));
  min-width: 0;
  margin-inline: auto;
  padding-block: clamp(min(1.25rem, 20px), 4vw, min(2.8rem, 44.8px)) 1.55rem;
}

.slide-header {
  display: grid;
  gap: min(.47rem, 10px);
  min-width: 0;
}

.slide-header h1[tabindex="-1"]:focus { outline: none; }

.slide-header p {
  max-width: 58ch;
  color: var(--muted);
  font-size: clamp(.88rem, 2.2vw, 1.04rem);
  line-height: 1.45;
}

.slide-body {
  display: grid;
  align-content: start;
  gap: .9rem;
  min-width: 0;
}

.carousel-panel:has(> .slide-content > .section-viewport) { container: carousel-panel / size; }

.slide-content:has(> .section-viewport) {
  --section-dot-height: 44px;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 100%;
  padding-block-end: 0;
}

.slide-content:has(> .section-viewport) > .slide-header {
  flex: none;
  margin-block-end: min(1rem, 20px);
}

.section-viewport {
  --pagination-height: 0px;
  flex: 1 1 0;
  display: block;
  min-width: 0;
  /* Let the panel scroll before a tall heading collapses the section. */
  min-height: clamp(1px, 100cqh - var(--pagination-height), 3.75rem);
  overflow: clip;
}

.section-viewport:has(+ .section-dots:not([hidden])) {
  --pagination-height: var(--section-dot-height);
}

.section-track {
  display: flex;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  transform: translate3d(calc(var(--section-offset, 0%) + var(--section-drag, 0px)), 0, 0);
}

.section-track[data-dragging] { user-select: none; }

.section-page {
  flex: 0 0 100%;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden auto;
  scroll-padding-block: .7rem;
  scrollbar-color: #3e536d transparent;
  scrollbar-width: thin;
  touch-action: pan-y pinch-zoom;
}

.section-page[inert] { pointer-events: none; }

.section-page-content {
  display: grid;
  align-content: start;
  gap: .9rem;
  min-width: 0;
}

.section-page-content:has(> [data-page-fill]:only-child) {
  height: 100%;
  align-content: stretch;
  grid-template-rows: minmax(0, 1fr);
}

.section-dots {
  position: sticky;
  z-index: 1;
  inset-block-end: 0;
  flex: 0 0 var(--section-dot-height);
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 0;
  min-height: var(--section-dot-height);
  overflow: auto hidden;
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
  touch-action: pan-x pinch-zoom;
}

@container carousel-panel (height < 13rem) {
  .section-dots { background: var(--canvas); }
}

.section-dot {
  display: grid;
  flex: 0 0 44px;
  place-items: center;
  width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: .65rem;
  background: transparent;
  color: var(--muted);
}

.section-dot:first-child { margin-inline-start: auto; }
.section-dot:last-child { margin-inline-end: auto; }
.section-dot:focus-visible { outline-offset: -3px; }
.section-dot:hover { color: var(--text); }

.section-dot::before {
  width: .42rem;
  height: .42rem;
  border-radius: 6rem;
  background: currentColor;
  content: "";
}

.section-dot[aria-current]:not([aria-current="false"]) { color: var(--mint); }
.section-dot[aria-current]:not([aria-current="false"])::before { width: 1.12rem; }

.bottom-nav {
  position: fixed;
  z-index: 5;
  inset: auto 0 auto;
  top: calc(var(--viewport-height) - var(--dock-height));
  min-width: 0;
  height: var(--dock-height);
  padding: .3rem env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
  border-top: 1px solid #2c405b;
  background: #0e1828fa;
  box-shadow: 0 -12px 42px #060a1388;
  touch-action: pan-y pinch-zoom;
}

.bottom-nav-inner {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 2px;
  width: min(34rem, calc(100% - min(.95rem, 16px)));
  height: 100%;
  margin-inline: auto;
  padding-bottom: .26rem;
}

.nav-button {
  position: relative;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: .25rem;
  min-width: 0;
  min-height: 48px;
  border: 1px solid transparent;
  border-radius: .85rem;
  padding: 3px .1rem;
  background: transparent;
  color: var(--muted);
  font-size: clamp(.62rem, 2.72vw, .77rem);
  font-weight: 650;
  line-height: 1.15;
}

.nav-button:hover { color: var(--text); }

.nav-button > span:last-child {
  max-width: 100%;
  min-width: 0;
  text-align: center;
  overflow-wrap: anywhere;
  hyphens: auto;
}

.nav-button[aria-current="page"] {
  border-color: #2c4c53;
  background: linear-gradient(145deg, #183239, #172236);
  color: var(--mint);
}

.nav-icon {
  display: grid;
  place-items: center;
  min-height: min(1.5rem, 28px);
}

.nav-icon svg,
.detail-header svg {
  width: 1.33rem;
  height: 1.33rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.7;
}

.nav-icon svg { width: min(1.33rem, 28px); height: min(1.33rem, 28px); }

.button, .icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .42rem;
  min-width: 0;
  min-height: 44px;
  border: 1px solid #3b506c;
  border-radius: .64rem;
  padding: .53rem .83rem;
  background: #18273c;
  color: var(--soft);
  font-size: .88rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
}

.button:hover, .icon-button:hover {
  border-color: #6e83a0;
  background: #22354f;
  color: var(--text);
}

.button-primary {
  border-color: #94f5ca;
  background: var(--mint);
  color: var(--mint-dark);
}

.button-primary:hover {
  border-color: #c2fbe3;
  background: #a9f6d6;
  color: #09231a;
}

.button-quiet {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
}

.icon-button {
  flex: none;
  width: 44px;
  padding: .4rem;
  font-size: 1.15rem;
}

.panel,
.loan-editor,
.addon-panel,
.option-panel,
.chart-panel,
.timeline-panel,
.detail-summary {
  min-width: 0;
  padding: clamp(.85rem, 2.15vw, 1.3rem);
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: linear-gradient(160deg, var(--surface-2), var(--surface) 72%);
}

.panel-head,
.panel-actions,
.reset-row,
.addon-actions,
.data-actions,
.suggestions,
.loan-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem .68rem;
  min-width: 0;
}

.panel-head { justify-content: space-between; }
.panel-actions { row-gap: .6rem; }
.loan-card-head { justify-content: space-between; }
.loan-card-head > div { min-width: 0; }
.loan-card-head h2 { overflow-wrap: anywhere; }
.loan-card-head p { color: var(--muted); font-size: .76rem; }
.data-actions { margin-top: .15rem; }

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  min-height: 1.75rem;
  padding: .24rem .58rem;
  border: 1px solid #4b5480;
  border-radius: 9rem;
  background: #272e53;
  color: #e4e6ff;
  font-size: .72rem;
  font-weight: 700;
}

.status-badge::before {
  width: .4rem;
  height: .4rem;
  border-radius: 9rem;
  background: var(--lavender);
  content: "";
}

.loan-card,
.projection-hero {
  position: relative;
  isolation: isolate;
  display: grid;
  align-content: start;
  gap: .35rem;
  min-width: 0;
  overflow: hidden;
  padding: clamp(1rem, 5vw, 2rem);
  border: 1px solid #465782;
  border-radius: 1.1rem;
  background: linear-gradient(138deg, #242f59, #171f37 76%);
}

.loan-card::after,
.projection-hero::after {
  position: absolute;
  z-index: -1;
  right: -4.8rem;
  top: -6.8rem;
  width: 21rem;
  height: 21rem;
  border-radius: 50%;
  background: repeating-radial-gradient(circle, transparent 0 19px, #b6d3ff19 20px 21px, transparent 22px 28px);
  pointer-events: none;
  content: "";
  mask-image: linear-gradient(125deg, #000, transparent 78%);
}

.loan-card h2, .projection-caption {
  color: #d9e4ff;
  font-size: .86rem;
  font-weight: 680;
  letter-spacing: 0;
}

.loan-amount,
.projection-value {
  color: var(--text);
  font-size: clamp(2rem, 8vw, 3.35rem);
  font-weight: 760;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.055em;
  line-height: 1.06;
  overflow-wrap: anywhere;
}

.loan-card > :is(p, small):not(.loan-amount),
.projection-copy {
  max-width: 64ch;
  color: var(--soft);
  font-size: .9rem;
}

.loan-stats,
.projection-kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .54rem;
  margin: .25rem 0 0;
}

.projection-kpis > :last-child:nth-child(odd) { grid-column: 1 / -1; }

.loan-stats > div,
.projection-kpis > div {
  min-width: 0;
  padding: .68rem .72rem;
  border: 1px solid #4f658677;
  border-radius: .7rem;
  background: #0b172aa8;
}

.loan-stats dt,
.metric-label {
  display: block;
  color: var(--muted);
  font-size: .73rem;
  line-height: 1.24;
}

.loan-stats dd,
.metric-value {
  display: block;
  margin-top: .24rem;
  color: var(--text);
  font-size: clamp(.84rem, 3vw, 1.04rem);
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.loan-card .panel-actions { margin-top: .55rem; }

.loan-dashboard {
  display: grid;
  grid-template-rows: auto minmax(min-content, 1fr);
  gap: .9rem;
  min-width: 0;
  min-height: 0;
}

.loan-mix {
  container: loan-mix / inline-size;
  --capital-color: #b7beff;
  --interest-color: #92f5ca;
  --dial-color: var(--capital-color);
  --capital-arc-start: #748cf5;
  --capital-arc-middle: #a099ff;
  --capital-arc-end: #c0c5ff;
  --interest-arc-start: #2cbf9c;
  --interest-arc-middle: #60e0b2;
  --interest-arc-end: #a3fbd6;
  display: grid;
  grid-template-rows: auto minmax(min-content, 1fr);
  gap: .58rem;
  min-width: 0;
  min-height: 8.5rem;
  border-color: #40577c;
  background: radial-gradient(ellipse at 8% 100%, #24355b, transparent 73%),
    radial-gradient(ellipse at 95% 2%, #203647, transparent 64%), #111d30;
}

.loan-mix[data-active-part="principal"] {
  --interest-arc-start: #448f81;
  --interest-arc-middle: #62b49c;
  --interest-arc-end: #8ed1bb;
}

.loan-mix[data-active-part="interest"] {
  --dial-color: var(--interest-color);
  --capital-arc-start: #6479b4;
  --capital-arc-middle: #8989cf;
  --capital-arc-end: #a5afd9;
}

.loan-mix h2 {
  color: var(--text);
  font-size: clamp(1.04rem, 3.5vw, 1.36rem);
}

.loan-mix-body {
  display: grid;
  grid-template-columns: minmax(4.25rem, .94fr) minmax(0, 1.06fr);
  align-items: center;
  gap: clamp(.68rem, 3vw, 1.3rem);
  min-width: 0;
  min-height: 0;
}

.loan-mix-plot {
  container-type: size;
  display: grid;
  place-items: center;
  align-self: stretch;
  min-width: 0;
  min-height: 0;
}

.loan-mix-dial {
  position: relative;
  isolation: isolate;
  container-type: inline-size;
  display: grid;
  place-items: center;
  width: min(100%, 13rem);
  width: min(100%, 100cqh, 13rem);
  aspect-ratio: 1;
  overflow: clip;
}

.loan-mix-dial::before {
  position: absolute;
  inset: 18.5%;
  border: 1px solid #576b916b;
  border-radius: 50%;
  background: radial-gradient(circle at 42% 18%, #283754, #132039 81%);
  box-shadow: inset 0 .25rem .65rem #0b142a80;
  content: "";
}

.loan-mix-ring {
  position: absolute;
  inset: 0;
  border: 1px solid #d2ecff75;
  border-radius: 50%;
  background: radial-gradient(circle at 33% 12%, #f7fbff41, transparent 53%),
    conic-gradient(from -82deg,
      var(--capital-arc-start) 0%, var(--capital-arc-middle) calc(var(--capital-share) * .58), var(--capital-arc-end) var(--capital-share),
      var(--interest-arc-start) var(--capital-share), var(--interest-arc-middle) calc((100% + var(--capital-share)) / 2), var(--interest-arc-end) 100%);
  -webkit-mask-image: radial-gradient(farthest-side, transparent 63%, #000 65%);
  mask-image: radial-gradient(farthest-side, transparent 63%, #000 65%);
}

.loan-mix-runner {
  position: absolute;
  z-index: 1;
  inset: 0;
  opacity: 0;
  transform: rotate(var(--mix-angle, -82deg));
  pointer-events: none;
}

.loan-mix-runner::after {
  position: absolute;
  top: 9%;
  left: 50%;
  width: clamp(.44rem, 6cqw, .86rem);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, #f5fffb 0 41%, var(--dial-color) 74%);
  box-shadow: 0 0 .3rem var(--dial-color), 0 0 .76rem var(--dial-color);
  transform: translate(-50%, -50%);
  content: "";
}

.loan-mix-focus {
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: .11rem;
  width: min(61%, 9rem);
  min-width: 0;
  text-align: center;
}

.loan-mix-focus-value {
  color: var(--dial-color);
  font-size: 1rem;
  font-size: clamp(.9rem, 17cqw, 2.2rem);
  font-weight: 790;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.055em;
  line-height: 1.05;
  white-space: nowrap;
}

.loan-mix-focus-label {
  color: var(--soft);
  font-size: .64rem;
  font-size: clamp(.59rem, 8.6cqw, .85rem);
  font-weight: 650;
  line-height: 1.16;
}

.loan-mix-parts {
  display: grid;
  gap: .63rem;
  min-width: 0;
  font-variant-numeric: tabular-nums;
}

.loan-mix-part {
  --part-color: var(--capital-color);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  align-content: center;
  gap: .16rem .24rem;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: .37rem .52rem;
  border: 1px solid #415779;
  border-radius: .66rem;
  background: #172844;
  color: var(--soft);
  text-align: start;
}

.loan-mix-part[data-loan-part="interest"] { --part-color: var(--interest-color); }

.loan-mix-part[aria-pressed="true"] {
  border-color: #7aabbb;
  border-color: color-mix(in srgb, var(--part-color) 67%, #354965);
  background: #233b52;
  background: linear-gradient(140deg, color-mix(in srgb, var(--part-color) 18%, #112742), #152942 83%);
  box-shadow: inset 0 0 0 1px #bdd7fa17, 0 .24rem .68rem #050e2680;
}

.loan-mix-part:focus-visible { outline-offset: -3px; }

.loan-mix-name {
  display: flex;
  align-items: center;
  gap: .34rem;
  min-width: 0;
  color: var(--soft);
  font-size: clamp(.68rem, 2.95vw, .85rem);
  font-weight: 690;
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.loan-mix-name::before {
  flex: none;
  width: .49rem;
  height: .49rem;
  border-radius: 50%;
  background: var(--part-color);
  content: "";
}

.loan-mix-amount {
  flex: 0 1 100%;
  order: 2;
  min-width: 0;
  color: var(--text);
  font-size: clamp(.76rem, 3.35vw, 1.05rem);
  font-weight: 750;
  line-height: 1.16;
  overflow-wrap: anywhere;
}

.loan-mix-percent {
  order: 1;
  margin-inline-start: auto;
  color: var(--part-color);
  font-size: clamp(.67rem, 2.95vw, .81rem);
  font-weight: 730;
  line-height: 1.12;
  white-space: nowrap;
}

@container loan-mix (width < 14rem) {
  .loan-mix-body { grid-template-columns: minmax(0, 1fr); }
  .loan-mix-plot { min-height: clamp(100px, 37vw, 144px); }
}

@media (hover: hover) {
  .loan-mix-part:not([aria-pressed="true"]):hover {
    border-color: color-mix(in srgb, var(--part-color) 46%, #354965);
  }
}

.loan-detail-card {
  display: grid;
  align-content: start;
  gap: .62rem;
  min-width: 0;
}

.loan-regular-payment { grid-template-columns: minmax(0, 1fr); }

.loan-regular-payment > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .22rem .48rem;
}

.loan-regular-payment dd {
  margin-top: 0;
  color: var(--lavender);
  font-size: clamp(.96rem, 3.6vw, 1.15rem);
}

.loan-detail-card .loan-stats > :last-child:nth-child(odd) { grid-column: 1 / -1; }

.loan-editor,
.loan-fields,
.technical-options,
.option-body,
.option-panel[open],
.addon-panel,
.timeline-panel {
  display: grid;
  gap: .75rem;
  min-width: 0;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: .7rem;
  min-width: 0;
}

.field {
  display: grid;
  gap: .3rem;
  min-width: 0;
  align-content: start;
}

.field-wide { grid-column: 1 / -1; }

.field label, legend, .check-field {
  color: var(--soft);
  font-size: .82rem;
  font-weight: 675;
}

.field input:not([type="checkbox"], [type="radio"], [type="range"]),
.field select,
.detail-toolbar select {
  display: block;
  width: 100%;
  min-height: 44px;
  min-width: 0;
  max-width: 100%;
  border: 1px solid #3b506b;
  border-radius: .62rem;
  padding: .53rem .65rem;
  background: var(--input);
  color: var(--text);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.field input[type="number"] { appearance: textfield; }

.field input[type="number"]::-webkit-inner-spin-button,
.field input[type="number"]::-webkit-outer-spin-button {
  margin: 0;
  appearance: none;
}

.field input[type="date"] { appearance: none; }
.field input::placeholder { color: #91a5c2; }
.field [aria-invalid="true"] { border-color: var(--danger) !important; }
fieldset:disabled { opacity: .58; }

.input-with-unit {
  position: relative;
  min-width: 0;
}

.input-with-unit:has(.unit) input { padding-inline-end: 3rem; }

.input-with-unit .unit {
  position: absolute;
  top: 50%;
  right: .72rem;
  color: var(--muted);
  font-size: .78rem;
  transform: translateY(-50%);
  pointer-events: none;
}

.field-hint, .field-error, .effective-date {
  color: var(--muted);
  font-size: .8rem;
  line-height: 1.4;
}

.field-error { color: var(--danger); }

input[type="range"], [type="checkbox"], [type="radio"] { accent-color: var(--mint); }

.check-field, .option-toggle {
  display: flex;
  align-items: center;
  gap: .55rem;
  min-height: 44px;
}

.check-field input,
.option-toggle input {
  width: 1.1rem;
  height: 1.1rem;
  flex: none;
  margin: 0;
}

.technical-options,
.option-panel {
  padding: .65rem .84rem;
  border: 1px solid var(--line);
  border-radius: .72rem;
  background: #101b2d;
}

details > summary {
  min-height: 44px;
  padding: .6rem 0;
  color: var(--soft);
  font-size: .91rem;
  font-weight: 720;
}

details > summary::marker { color: var(--mint); }

.quick-panel,
.quick-result,
.quick-footer,
.advanced-toolbar {
  width: min(100%, 43rem);
  min-width: 0;
}

.quick-main {
  display: grid;
  align-content: start;
  gap: .62rem;
  min-width: 0;
}

.quick-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: .42rem;
  border-color: #3d546e;
  background: linear-gradient(145deg, #192b40, var(--surface) 76%);
}

.quick-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .65rem;
  min-height: 44px;
}

.quick-label-row label {
  color: var(--text);
  font-size: 1rem;
  font-weight: 710;
}

.quick-input { position: relative; min-width: 0; }

.quick-panel #quick-amount {
  width: 100%;
  min-width: 0;
  min-height: 56px;
  border: 1px solid #52708b;
  border-radius: .73rem;
  padding: .65rem 4rem .65rem .83rem;
  background: #0b1627;
  color: var(--text);
  font-size: clamp(1.18rem, 6vw, 1.58rem);
  font-weight: 720;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  appearance: textfield;
}

.quick-panel #quick-amount::placeholder { color: #95abc5; }
.quick-panel #quick-amount::-webkit-inner-spin-button,
.quick-panel #quick-amount::-webkit-outer-spin-button { appearance: none; }
.quick-panel #quick-amount[aria-invalid="true"] { border-color: var(--danger); }

.quick-currency {
  position: absolute;
  top: 50%;
  inset-inline-end: .9rem;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 700;
  transform: translateY(-50%);
  pointer-events: none;
}

.quick-date { padding-top: .12rem; }

.quick-date > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .6rem;
  min-height: 44px;
  list-style: none;
  padding-block: .36rem;
  color: var(--muted);
  font-size: .84rem;
  font-weight: 620;
}

.quick-date > summary::-webkit-details-marker { display: none; }

.quick-date-value {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  color: var(--soft);
}

.quick-date-value::after {
  width: .43rem;
  height: .43rem;
  border-inline-end: 1.5px solid currentColor;
  border-block-end: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  content: "";
}

.quick-date[open] .quick-date-value::after { transform: translateY(2px) rotate(225deg); }

.quick-date-note,
.quick-error {
  margin-top: .24rem;
  color: var(--muted);
  font-size: .77rem;
  line-height: 1.4;
}

.quick-error { color: var(--danger); }

.quick-placeholder {
  padding-inline: .16rem;
  color: var(--muted);
  font-size: .88rem;
}

.quick-outcomes {
  display: grid;
  gap: .62rem;
}

.quick-outcome {
  display: grid;
  align-content: start;
  gap: .3rem;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: .86rem;
  padding: .68rem clamp(.82rem, 3.5vw, 1.28rem);
  overflow-wrap: anywhere;
}

.quick-outcome[data-quick-outcome="time"] {
  --quick-accent: #a2ffd1;
  gap: .24rem;
  border-color: #529785;
  background: radial-gradient(ellipse at 90% 0%, #2a6255, transparent 70%),
    linear-gradient(145deg, #18423b, #14263a 88%);
  box-shadow: 0 .35rem 1.2rem #071d2455;
}

.quick-outcome[data-savings="neutral"] {
  --quick-accent: var(--soft);
  border-color: #52667d;
  background: linear-gradient(150deg, #23334a, #142338 85%);
}

.quick-outcome[data-savings="negative"] {
  --quick-accent: #ffcf9a;
  border-color: #936b50;
  background: linear-gradient(150deg, #443026, #242135 87%);
}

.quick-outcome[data-quick-outcome="payment"] {
  --quick-accent: var(--blue);
  border-color: #446187;
  background: linear-gradient(150deg, #1d334f, #152338 82%);
}

.quick-outcome h2 {
  color: var(--soft);
  font-size: .86rem;
  letter-spacing: -.01em;
}

.quick-outcome .quick-hero-label {
  color: var(--quick-accent);
  font-size: .91rem;
  font-weight: 730;
}

.quick-payment-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .25rem .55rem;
  min-width: 0;
}

.quick-payment-values {
  min-width: 0;
  color: var(--soft);
  font-size: .8rem;
  font-variant-numeric: tabular-nums;
}

.quick-value {
  min-width: 0;
  color: var(--quick-accent);
  font-size: clamp(1.04rem, 4.35vw, 1.35rem);
  font-weight: 770;
  font-variant-numeric: tabular-nums;
  line-height: 1.13;
  letter-spacing: -.033em;
}

.quick-outcome[data-quick-outcome="time"] .quick-value {
  font-size: clamp(2rem, 10.5vw, 3.65rem);
  font-weight: 790;
  line-height: 1.03;
  letter-spacing: -.05em;
}

.quick-context,
.quick-savings {
  color: var(--muted);
  font-size: .76rem;
  line-height: 1.35;
}

.quick-savings { color: var(--soft); }

.quick-outcome[data-quick-outcome="time"] .quick-savings {
  color: var(--text);
  font-size: .86rem;
}

.quick-outcome[data-quick-outcome="time"] .quick-context {
  display: flex;
  flex-wrap: wrap;
  gap: .18rem .65rem;
  margin-top: .18rem;
  border-top: 1px solid #c0fbe532;
  padding-top: .4rem;
}

.quick-context strong { color: var(--soft); }

.quick-footer,
.advanced-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .38rem .65rem;
}

.quiet-action,
.quick-reset {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: .48rem;
  padding: .44rem .2rem;
  background: transparent;
  color: var(--muted);
  font-size: .83rem;
  font-weight: 650;
  text-align: start;
}

.quiet-action { text-decoration: underline; text-underline-offset: .22em; }
.quiet-action:hover, .quick-reset:hover { color: var(--text); }
.quick-reset { font-size: .77rem; }

.addon-overview,
.addon-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .55rem .7rem;
  min-width: 0;
}

.addon-overview strong,
.addon-summary strong { overflow-wrap: anywhere; }

.addon-overview p { color: var(--muted); font-size: .83rem; }
.addon-overview h2 { color: var(--mint); }

.addon-list,
.sub-options {
  display: grid;
  gap: .65rem;
  min-width: 0;
}

.addon-list { margin: 0; padding: 0; list-style: none; }

.addon-card {
  display: grid;
  gap: .7rem;
  min-width: 0;
  padding: .82rem;
  border: 1px solid #31455f;
  border-radius: .78rem;
  background: #0d1729;
}

.addon-card[open] { border-color: #486d72; }

.addon-summary > :first-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.addon-summary p, .addon-summary small {
  color: var(--muted);
  font-size: .8rem;
}

.addon-summary .effective-date { margin-top: .35rem; }
.effective-date:empty { display: none; }

.addon-fields {
  display: grid;
  gap: .68rem;
  min-width: 0;
}

.suggestions > span {
  color: var(--muted);
  font-size: .8rem;
}

.suggestions .button {
  border-color: #384f70;
  border-radius: 100px;
  padding-inline: .73rem;
  color: #bfdcff;
  font-variant-numeric: tabular-nums;
}

.empty-inline {
  color: var(--muted);
  font-size: .88rem;
}

.effective-date {
  padding: .55rem .65rem;
  border-left: 2px solid #509d8d;
  border-radius: .25rem;
  background: #143039;
  color: #d3eee9;
}

.reset-row { justify-content: space-between; }
.reset-row p { color: var(--muted); font-size: .83rem; }

.fee-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: .62rem;
}

.fees-group {
  display: grid;
  gap: .55rem;
  margin-block: .65rem;
}

.optional-preview {
  display: grid;
  justify-items: start;
  gap: .35rem;
  padding: .74rem .85rem;
  border: 1px solid #3f5674;
  border-radius: .72rem;
  background: #16263d;
}

.optional-preview p { color: var(--muted); font-size: .82rem; }

.projection-hero[data-tone="time"] {
  border-color: #3d716d;
  background: linear-gradient(139deg, #153d3d, #14233a 75%);
}
.projection-hero[data-tone="payment"] {
  border-color: #455e8c;
  background: linear-gradient(139deg, #1f3658, #17253b 76%);
}
.projection-hero[data-tone="time"] .projection-value { color: var(--mint); }
.projection-hero[data-tone="payment"] .projection-value { color: var(--blue); }

.projection-grid {
  display: grid;
  align-items: start;
  gap: .84rem;
  min-width: 0;
}

.projection-info {
  display: grid;
  align-content: start;
  gap: .76rem;
  min-width: 0;
}

.timeline {
  display: grid;
  gap: .8rem;
  margin: 0;
  padding: .15rem 0 .25rem 1.15rem;
  list-style: none;
}

.timeline > li {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, auto);
  gap: .2rem .55rem;
  min-width: 0;
  color: var(--soft);
  font-size: .84rem;
}

.timeline > li > div:last-child { text-align: end; }
.timeline p { color: var(--muted); font-size: .78rem; }

.timeline > li::before {
  position: absolute;
  top: .38rem;
  left: -1.1rem;
  width: .52rem;
  height: .52rem;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 3px #89caff24;
  content: "";
}

.timeline > li:not(:last-child)::after {
  position: absolute;
  top: 1rem;
  bottom: -.93rem;
  left: -.88rem;
  width: 1px;
  background: #49698a;
  content: "";
}

.timeline :is(time, small) { color: var(--muted); }
.timeline strong { overflow-wrap: anywhere; }
.timeline-more { color: var(--muted); font-size: .82rem; }

.chart-panel { min-width: 0; }

.chart-host { min-width: 0; }

.chart-panel h2 { margin-bottom: .4rem; }

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem .76rem;
  margin: .5rem 0;
  padding: 0;
  list-style: none;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: .42rem;
  min-width: 0;
}

.legend-item { color: var(--soft); font-size: .77rem; }

.legend-dot {
  display: inline-block;
  flex: none;
  width: .61rem;
  height: .61rem;
  border-radius: 50%;
  background: var(--series, var(--lavender));
}

.chart-axis-note { color: var(--muted); font-size: .76rem; }

.balance-canvas,
.payment-canvas,
.series-canvas,
.chart-panel canvas {
  display: block;
  width: 100%;
  height: clamp(11rem, 44vw, 17.5rem);
  max-width: 100%;
  touch-action: pan-y pinch-zoom;
}

.chart-scrub {
  display: flex;
  align-items: center;
  gap: .72rem;
  margin-top: .22rem;
  color: var(--soft);
}

.chart-scrub label { font-size: .8rem; font-weight: 650; }
.chart-scrub input { flex: 1 1 0; min-width: 0; min-height: 44px; margin: 0; }

.chart-readout {
  display: grid;
  gap: .34rem;
  min-height: 2.7rem;
  margin-block: .32rem .45rem;
  padding: .48rem .63rem;
  border: 1px solid #2b405c;
  border-radius: .62rem;
  background: var(--input);
  color: var(--soft);
  font-size: .79rem;
  font-variant-numeric: tabular-nums;
}

.chart-readout > div,
.chart-readout > div > span {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .25rem .62rem;
  min-width: 0;
}

.chart-readout > div > span { gap: .23rem .34rem; }
.chart-readout b { color: var(--text); overflow-wrap: anywhere; }

.bar-list {
  display: grid;
  gap: .78rem;
  margin-block: .66rem;
}

.bar-item {
  display: grid;
  gap: .26rem;
}

.bar-label, .bar-values {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: .18rem .6rem;
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: .82rem;
  font-variant-numeric: tabular-nums;
}

.bar-label { justify-content: space-between; color: var(--soft); }
.bar-values { padding: 0; margin: 0; list-style: none; color: var(--muted); font-size: .73rem; }
.bar-values b { color: var(--soft); }

.bar-track {
  display: flex;
  min-width: 0;
  height: .7rem;
  overflow: hidden;
  border-radius: 5rem;
  background: #25354c;
}

.bar-fill {
  position: relative;
  display: flex;
  flex: none;
  min-width: 0;
  max-width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: inherit;
}

.bar-segment { display: block; flex: none; height: 100%; }

.bar-control {
  display: grid;
  align-content: center;
  gap: .34rem;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: .54rem;
  padding: .4rem .48rem;
  background: transparent;
  color: var(--text);
  text-align: start;
}

.bar-control:hover,
.bar-control[aria-expanded="true"],
.bar-control[aria-pressed="true"] {
  border-color: #3b536f;
  background: #1b2a43;
}

.compare-overview {
  display: grid;
  grid-template-rows: auto minmax(min-content, 1fr);
  min-width: 0;
  min-height: min-content;
  padding: 0;
  overflow: hidden;
  border-color: #354d69;
  background: linear-gradient(150deg, #172942, #101c30 78%);
}

.compare-highlight {
  --compare-tone: #a2ffd1;
  position: relative;
  isolation: isolate;
  display: grid;
  align-content: start;
  gap: .2rem;
  min-width: 0;
  padding: clamp(.78rem, 3vw, 1.35rem);
  overflow: hidden;
  border-bottom: 1px solid #548b7f85;
  background: radial-gradient(ellipse at 90% 10%, #2e6054, transparent 67%),
    linear-gradient(132deg, #1a4840, #152a3d 90%);
}

.compare-highlight[data-tone="neutral"] {
  --compare-tone: var(--lavender);
  border-color: #63779f80;
  background: linear-gradient(134deg, #253956, #17283e 85%);
}

.compare-highlight::after {
  position: absolute;
  z-index: -1;
  top: -6.2rem;
  right: -2.4rem;
  width: 17rem;
  height: 17rem;
  border-radius: 50%;
  background: repeating-radial-gradient(circle, transparent 0 14px, #c4f9e521 15px 16px, transparent 17px 22px);
  mask-image: linear-gradient(134deg, #000, transparent 76%);
  pointer-events: none;
  content: "";
}

.compare-highlight-label {
  color: var(--compare-tone);
  font-size: .84rem;
  font-weight: 740;
}

.compare-highlight-amount {
  color: var(--compare-tone);
  font-size: clamp(1.95rem, 9.25vw, 3.65rem);
  font-weight: 790;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.047em;
  line-height: 1.07;
  overflow-wrap: anywhere;
}

.compare-highlight-note {
  max-width: 57ch;
  color: var(--soft);
  font-size: .81rem;
  line-height: 1.34;
}

.compare-plot,
.compare-plot .chart-host {
  display: grid;
  min-width: 0;
  min-height: 0;
}

.compare-plot {
  grid-template-rows: auto minmax(min-content, 1fr);
  gap: .42rem;
  padding: clamp(.66rem, 2.6vw, 1.28rem);
}

.compare-plot .chart-host {
  grid-template-rows: auto minmax(min-content, 1fr) auto;
  gap: .42rem;
}

.compare-plot .chart-legend {
  gap: .18rem .56rem;
  margin: 0;
}

.compare-plot .legend-item { font-size: .72rem; }
.compare-plot .legend-dot { width: .52rem; height: .52rem; }

.compare-plot .bar-list {
  grid-auto-rows: minmax(min-content, 1fr);
  gap: .43rem;
  margin: 0;
}

.compare-plot .bar-control {
  gap: .32rem;
  min-height: 44px;
  border-color: #355171;
  border-radius: .69rem;
  padding: .34rem .53rem;
  background: #15243b;
}

.compare-plot .bar-control[data-featured="true"] {
  border-color: #4d8e82;
  background: #183745;
}

.compare-plot .bar-control:hover,
.compare-plot .bar-control[aria-expanded="true"] {
  border-color: #829fba;
  background: #233752;
}

.compare-plot .bar-control:focus-visible { outline-offset: -3px; }

.compare-plot .bar-label {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 52%);
  align-items: start;
  gap: .1rem .45rem;
  font-size: clamp(.73rem, 3.2vw, .93rem);
  line-height: 1.18;
}

.compare-plot .bar-total {
  min-width: 0;
  color: var(--text);
  font-size: clamp(.8rem, 3.55vw, 1.1rem);
  font-weight: 780;
  text-align: end;
}

.compare-plot .bar-track {
  height: clamp(.88rem, 4.4vw, 1.2rem);
  background: #273953;
}

.compare-plot .bar-control[data-featured="true"] .bar-label strong { color: #b4f1dc; }
.compare-plot .bar-control[data-featured="true"] .bar-track { background: #25465a; }

.compare-breakdown {
  padding: .45rem .53rem;
  border: 1px solid #365071;
  border-radius: .56rem;
  background: var(--input);
}

.compare-matrix,
.compare-concept {
  display: grid;
  grid-template-rows: auto minmax(min-content, 1fr);
  gap: .65rem;
  min-width: 0;
  min-height: min-content;
  border-color: #3b526e;
  background: linear-gradient(154deg, #182943, #101b2f 79%);
}

.compare-reference,
.compare-concept-head {
  display: grid;
  gap: .28rem;
  min-width: 0;
  padding: .64rem .7rem;
  border: 1px solid #485b80;
  border-radius: .72rem;
  background: linear-gradient(133deg, #263652, #1a2941 75%);
}

.compare-reference-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .35rem .55rem;
  min-width: 0;
}

.compare-reference-head h2 { font-size: clamp(.94rem, 3.8vw, 1.24rem); }

.compare-detail-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 0;
  padding: .16rem .42rem;
  border: 1px solid transparent;
  border-radius: .42rem;
  background: transparent;
  color: var(--lavender);
  font-size: .75rem;
  font-weight: 700;
  white-space: nowrap;
}

.compare-detail-button:hover { color: var(--text); background: #2b3f61; }
.compare-detail-button:focus-visible { outline-offset: -2px; }

.compare-reference-values {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .55rem;
  font-variant-numeric: tabular-nums;
}

.compare-reference-values > div { min-width: 0; }
.compare-reference-values dt { color: var(--muted); font-size: .73rem; line-height: 1.18; }

.compare-reference-values dd {
  margin-top: .16rem;
  color: var(--text);
  font-size: clamp(.86rem, 3.75vw, 1.1rem);
  font-weight: 750;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.compare-table {
  --compare-row-gap: .28rem;
  width: 100%;
  height: 100%;
  min-width: 0;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  color: var(--soft);
  font-variant-numeric: tabular-nums;
}

.compare-table th, .compare-table td {
  min-width: 0;
  padding: var(--compare-row-gap) .36rem;
  border-block-end: 1px solid #304760;
  vertical-align: middle;
  overflow-wrap: anywhere;
}

.compare-table thead th {
  padding-block: 0 .26rem;
  border-block-end: 0;
}

.compare-table .compare-metric-col { width: 25%; }

.compare-table thead th:first-child {
  color: var(--muted);
  font-size: .73rem;
  line-height: 1.16;
  text-align: start;
}

.compare-column {
  display: grid;
  place-items: center;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: .28rem .23rem;
  border: 1px solid #496882;
  border-color: color-mix(in srgb, var(--compare-series) 46%, #354758);
  border-radius: .54rem;
  background: #192c46;
  background: color-mix(in srgb, var(--compare-series) 12%, #12233a);
  color: var(--compare-series, var(--text));
  font-size: clamp(.73rem, 3.2vw, .99rem);
  font-weight: 760;
  line-height: 1.13;
  overflow-wrap: anywhere;
}

button.compare-column:hover { filter: brightness(1.2); }
.compare-column:focus-visible { outline-offset: -3px; }
.compare-column small { color: var(--soft); font-size: .65rem; font-weight: 620; }

.compare-table tbody th {
  color: var(--muted);
  font-size: clamp(.68rem, 2.95vw, .91rem);
  font-weight: 680;
  line-height: 1.16;
  text-align: start;
}

.compare-table tbody td {
  border-inline-start: 1px solid #304760;
  background: #14283d;
  text-align: end;
}

.compare-table tbody td:nth-child(2) { background: #152d39; }
.compare-table tbody td:nth-child(3) { background: #172c47; }

.compare-cell-value,
.compare-cell-note {
  display: block;
  min-width: 0;
  line-height: 1.17;
  overflow-wrap: anywhere;
}

.compare-cell-value {
  color: var(--text);
  font-size: clamp(.74rem, 3.28vw, 1.08rem);
  font-weight: 750;
}

.compare-cell-note {
  margin-top: .13rem;
  color: var(--muted);
  font-size: clamp(.64rem, 2.82vw, .83rem);
}

.compare-saving-row th,
.compare-table .compare-saving-row td:nth-child(n) { background: #193a42; }
.compare-table .compare-saving-row th { color: #c0f6dc; }
.compare-saving-row .compare-cell-value { font-weight: 800; }
.compare-table td[data-tone="positive"] .compare-cell-value { color: var(--mint); }
.compare-table td[data-tone="negative"] .compare-cell-value { color: var(--warning); }
.compare-table td[data-tone="neutral"] .compare-cell-value { color: var(--soft); }

.compare-issue { color: var(--muted); font-size: .76rem; line-height: 1.29; }

.compare-concept {
  --compare-concept-ink: var(--lavender);
  gap: .85rem;
}

.compare-concept[data-compare-concept="quota"] { --compare-concept-ink: var(--blue); }
.compare-concept[data-compare-concept="savings"] { --compare-concept-ink: var(--mint); }

.compare-concept-head {
  gap: .5rem;
  padding: clamp(.8rem, 4vw, 1.46rem);
  background: radial-gradient(ellipse at 92% 10%, #344b71, transparent 68%), #1b2d4a;
}

.compare-concept-head h2 {
  color: var(--compare-concept-ink);
  font-size: clamp(1.36rem, 6.1vw, 2.36rem);
}

.compare-concept-head p { color: var(--soft); font-size: .87rem; line-height: 1.34; }
.compare-concept-table { --compare-row-gap: .43rem; }
.compare-concept-table .compare-metric-col { width: 22%; }
.compare-concept-table .compare-cell-value { font-size: clamp(.88rem, 3.93vw, 1.38rem); }
.compare-concept[data-compare-concept="savings"] .compare-table td {
  padding-inline: clamp(.2rem, 1.25vw, .36rem);
}

.compare-concept[data-compare-concept="savings"] .compare-cell-value {
  font-family: Arial, "Liberation Sans", sans-serif;
  font-size: clamp(.76rem, 3.4vw, 1.38rem);
  font-weight: 700;
  letter-spacing: -.018em;
}

.detail-total {
  color: var(--text);
  font-size: clamp(1.3rem, 4.5vw, 2.02rem);
  font-weight: 760;
  letter-spacing: -.035em;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.cashflow-pairs,
.detail-summary dl {
  display: grid;
  gap: 0;
  min-width: 0;
}

.cashflow-pairs > div,
.detail-summary dl > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, auto);
  align-items: baseline;
  gap: .6rem;
  min-width: 0;
  padding: .46rem 0;
  border-block-end: 1px solid #2c405b;
  font-size: .79rem;
  line-height: 1.35;
}

.cashflow-pairs dt,
.detail-summary dt { color: var(--muted); }

.cashflow-pairs dd,
.detail-summary dd {
  color: var(--soft);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: end;
  overflow-wrap: anywhere;
}

.empty-state, .error-state, .callout {
  padding: .75rem .85rem;
  border: 1px solid #3f5872;
  border-radius: .72rem;
  background: #18273b;
  color: var(--soft);
}

.empty-state > * + * { margin-top: .6rem; }
.empty-state p, .callout { font-size: .88rem; }
.error-state { border-color: #b9738580; color: var(--danger); background: #362338; }

.loan-editor-dialog {
  position: fixed;
  inset: var(--loan-viewport-top, 0px) auto auto var(--loan-viewport-left, 0px);
  width: var(--loan-viewport-width, 100%);
  height: var(--loan-viewport-height, var(--viewport-height));
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: radial-gradient(ellipse at 7% 0%, #1a2945, transparent 65%), #0d1728;
  color: var(--text);
}

.loan-editor-dialog[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.loan-editor-dialog::backdrop { background: #080f1d; }

.loan-editor-header,
.loan-editor-body,
.loan-editor-actions {
  min-width: 0;
  padding-inline: max(1rem, env(safe-area-inset-left, 0px)) max(1rem, env(safe-area-inset-right, 0px));
}

.loan-editor-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding-block: calc(.72rem + env(safe-area-inset-top, 0px)) .72rem;
  border-bottom: 1px solid var(--line);
  background: #121f34;
}

.loan-editor-header h2 {
  font-size: clamp(1.23rem, 5vw, 1.58rem);
  overflow-wrap: anywhere;
}

.loan-editor-body {
  min-height: 0;
  overflow: hidden auto;
  overscroll-behavior: contain;
  padding-block: .9rem;
  scroll-padding-block: .82rem;
  scrollbar-color: #3e536d transparent;
  scrollbar-width: thin;
  touch-action: pan-y pinch-zoom;
}

.loan-editor-body .loan-editor {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.loan-editor-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .62rem;
  padding-block: .65rem calc(.65rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  background: #111e32;
}

.loan-editor-actions #save-loan { flex: 1 1 auto; }

.detail-dialog {
  position: fixed;
  inset: auto 0 0;
  width: min(100%, 61.25rem);
  max-width: none;
  max-height: min(calc(var(--viewport-height) - 1.3rem), 54rem);
  margin: 0 auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid #465c79;
  border-radius: 1.14rem 1.14rem 0 0;
  background: #111c2e;
  color: var(--text);
  box-shadow: 0 1rem 3rem #05080e91;
}

.detail-dialog[open] { display: flex; flex-direction: column; }
.detail-dialog::backdrop { background: #060a15b8; backdrop-filter: blur(3px); }

.detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .8rem;
  padding: .65rem 1rem;
  border-bottom: 1px solid var(--line);
}

.detail-body {
  display: grid;
  gap: .85rem;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: .9rem 1rem calc(1.05rem + env(safe-area-inset-bottom, 0px));
}

.detail-body > * { min-width: 0; }
.detail-body ul { margin: 0; padding-left: 1.1rem; }
.detail-body li + li { margin-top: .45rem; }
.detail-summary, .schedule-panel { display: grid; gap: .65rem; min-width: 0; }

.table-wrap {
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  border: 1px solid var(--line);
  border-radius: .7rem;
  touch-action: pan-x pan-y pinch-zoom;
}

html[data-zoomed] :is(.site-header, .carousel, .carousel-panel, .section-page,
  .section-dots, .bottom-nav, .chart-panel canvas, .loan-editor-body, .table-wrap) {
  touch-action: pan-x pan-y pinch-zoom;
}

.schedule-table {
  width: 100%;
  border-collapse: collapse;
  color: var(--soft);
  font-size: .79rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.schedule-table :is(th, td) {
  border-bottom: 1px solid #2a3d58;
  padding: .55rem .67rem;
  text-align: right;
}

.schedule-table th { color: var(--text); background: #203249; }
.schedule-table tr:nth-child(2n) td { background: #142238; }
.schedule-table :is(th, td):first-child { text-align: left; }

.schedule-pages,
.schedule-pages > div {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .4rem .55rem;
}

.schedule-pages { justify-content: space-between; }
.table-caption { color: var(--muted); font-size: .77rem; }

@media (max-width: 22.75rem) {
  .header-inner, .slide-content { width: calc(100% - min(1.5rem, 24px)); }
  .header-inner, .header-tools { column-gap: .35rem; }
  .brand-logo { width: clamp(96px, 32vw, 122px); }
  .local-label { font-size: .67rem; }
  .panel-actions .button { padding-inline: .68rem; }
}

@media (max-width: 30rem) {
  .header-inner { flex-wrap: nowrap; }
  .header-tools .local-label { display: none; }
}

@media (max-width: 41.999rem) {
  body:has(.loan-editor-dialog[open]) .app-frame { visibility: hidden; }
}

@media (min-width: 42rem) {
  :root { --dock-height: calc(min(4.85rem, 112px) + env(safe-area-inset-bottom, 0px)); }
  .header-inner { min-height: min(4.1rem, 96px); }
  .slide-content { width: min(var(--page-width), calc(100% - 4rem)); gap: 1.3rem; }
  .slide-content:has(> .section-viewport) > .slide-header { margin-block-end: 1.3rem; }
  .slide-body, .section-page-content { gap: 1.02rem; }
  .nav-button { font-size: .79rem; }
  .brand { font-size: 1.08rem; }
  .local-label { font-size: .79rem; }
  .loan-stats, .projection-kpis { gap: .72rem; }
  .loan-detail-card .loan-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .loan-detail-card .loan-stats > :last-child:nth-child(odd) { grid-column: span 2; }
  .addon-fields:has(> .field) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .addon-fields > :is(.check-field, .field-hint, .effective-date, .addon-actions) { grid-column: 1 / -1; }
  .loan-editor-dialog {
    inset-block-start: calc(var(--loan-viewport-top, 0px) + var(--loan-viewport-height, var(--viewport-height)) / 2);
    inset-inline-start: calc(var(--loan-viewport-left, 0px) + var(--loan-viewport-width, 100%) / 2);
    width: min(calc(var(--loan-viewport-width, 100%) - 2rem), 43rem);
    height: min(calc(var(--loan-viewport-height, var(--viewport-height)) - 2rem), 44rem);
    border: 1px solid #465c79;
    border-radius: 1rem;
    box-shadow: 0 1rem 3rem #05080e91;
    transform: translate(-50%, -50%);
  }
  .loan-editor-dialog::backdrop { background: #060a15b8; backdrop-filter: blur(3px); }
  .loan-editor-header, .loan-editor-body, .loan-editor-actions { padding-inline: 1.35rem; }
  .loan-editor-actions #save-loan { flex: none; }
  .detail-dialog { inset: 0; margin: auto; border-radius: 1rem; width: min(calc(100% - 3rem), 61.25rem); }
  .detail-header { padding-inline: 1.3rem; }
  .detail-body { padding-inline: 1.3rem; }
}

@media (min-width: 58rem) {
  .projection-grid { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
  .projection-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .projection-kpis > :last-child:nth-child(odd) { grid-column: auto; }
  .projection-grid > .chart-panel:only-child { grid-column: 1 / -1; }
  .loan-dashboard { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: minmax(min-content, 1fr); }
  .loan-dashboard > .loan-card { align-content: center; }
  .loan-mix-dial { width: min(100%, 100cqh, 16rem); }
  .compare-overview, .compare-matrix, .compare-concept { max-width: 62rem; }
  .section-page-content > :is(.loan-card, .loan-detail-card, .loan-editor, .addon-panel, .addon-card, .option-panel, .projection-hero) { max-width: 59rem; width: 100%; }
}

@media (max-width: 41.999rem) {
  .section-viewport .chart-panel canvas { height: clamp(8.75rem, 40vw, 17.5rem); }
}

@media (max-width: 41.999rem) and (max-height: 44.375rem) {
  .slide-content:has(> .section-viewport) { padding-block-start: .85rem; }
  .slide-content:has(> .section-viewport) > .slide-header { margin-block-end: .7rem; }
  .slide-content:has(> .section-viewport) h1 { font-size: clamp(1.7rem, 7vw, 2rem); }
  .section-page-content { gap: .62rem; }
  .quick-main { gap: .36rem; }
  .quick-panel { padding-block: .46rem; }
  .quick-panel #quick-amount { min-height: 48px; }
  .quick-outcome { padding-block: .6rem; }
  .section-viewport .loan-card { gap: .25rem; padding-block: .72rem; }
  .loan-dashboard { gap: .62rem; }
  .loan-mix { gap: .3rem; padding-block: .56rem; }
  .loan-mix-parts { gap: .38rem; }
  .section-viewport .loan-detail-card { gap: .51rem; padding-block: .68rem; }
  .section-viewport .loan-stats { gap: .43rem; }
  .section-viewport .loan-stats > div { padding-block: .3rem; }
  .section-viewport .loan-stats:not(.loan-regular-payment) dd { margin-top: .14rem; }
  .section-viewport .loan-card .panel-actions { margin-top: .24rem; }
  .section-viewport .projection-info { gap: .6rem; }
  .section-viewport .projection-hero { padding-block: .72rem; }
  .section-viewport .projection-kpis > div { padding-block: .52rem; }
  .section-viewport .chart-panel { padding-block: .62rem; }
  .section-viewport .chart-panel h2 { margin-bottom: .3rem; }
  .section-viewport .chart-panel canvas { height: 7rem; }
  .section-viewport .chart-legend { margin-block: .25rem; }
  .section-viewport .chart-scrub { margin-top: 0; }
  .section-viewport .chart-readout { margin-block: .18rem .31rem; padding-block: .27rem; }
  .section-viewport .bar-list { gap: .33rem; margin-block: .3rem; }
  .section-viewport .bar-item { gap: .14rem; }
  .section-viewport .compare-plot .bar-list { margin: 0; }
  .compare-highlight { padding-block: .66rem; }
  .compare-plot { gap: .34rem; padding-block: .55rem; }
  .compare-matrix { gap: .44rem; padding: .58rem; }
  .compare-reference { gap: .15rem; padding: .3rem .56rem; }
  .compare-table { --compare-row-gap: .19rem; }
}

:root[data-theme="light"] body {
  background: radial-gradient(ellipse at 29% 8%, #e0eafb, transparent 62%), var(--canvas);
}

:root[data-theme="light"] .site-header {
  border-color: #d1deed;
  background: #fafcfff2;
}

:root[data-theme="light"] .bottom-nav {
  border-color: #cbd9e9;
  background: #fafdfffa;
  box-shadow: 0 -9px 32px #1b355817;
}

:root[data-theme="light"] .nav-button[aria-current="page"] {
  border-color: #a4cdbc;
  background: linear-gradient(145deg, #dbf3ea, #e5eff8);
}

:root[data-theme="light"] :is(.button:not(.button-primary, .button-quiet), .icon-button, .theme-toggle, .areas-toggle) {
  border-color: #afc2d7;
  background: #f2f7fe;
  color: var(--soft);
}

:root[data-theme="light"] :is(.button:not(.button-primary, .button-quiet), .icon-button, .theme-toggle, .areas-toggle):hover {
  border-color: #7794b5;
  background: #e2edf9;
  color: var(--text);
}

:root[data-theme="light"] .button-primary { border-color: #085d46; }

:root[data-theme="light"] .button-primary:hover {
  border-color: #064a37;
  background: #085d46;
  color: var(--mint-dark);
}

:root[data-theme="light"] .status-badge {
  border-color: #c5bae8;
  background: #eeeafa;
  color: var(--lavender);
}

:root[data-theme="light"] :is(.loan-card, .projection-hero) {
  border-color: #bac9e9;
  background: linear-gradient(138deg, #e9ebfb, #f7faff 80%);
}

:root[data-theme="light"] :is(.loan-card, .projection-hero)::after {
  background: repeating-radial-gradient(circle, transparent 0 19px, #5b70b822 20px 21px, transparent 22px 28px);
}

:root[data-theme="light"] :is(.loan-card h2, .projection-caption) { color: #3c4d79; }

:root[data-theme="light"] :is(.loan-stats, .projection-kpis) > div {
  border-color: #bdcce3;
  background: #ffffffc9;
}

:root[data-theme="light"] .loan-mix {
  --capital-color: #5542a8;
  --interest-color: #086951;
  --capital-arc-start: #5847bb;
  --capital-arc-middle: #7459d1;
  --capital-arc-end: #8170d8;
  --interest-arc-start: #07654f;
  --interest-arc-middle: #0c8a68;
  --interest-arc-end: #199879;
  --loan-mix-rail-start: #d6e3f0;
  --loan-mix-rail-end: #e8eff8;
  border-color: #bccde4;
  background: radial-gradient(ellipse at 8% 100%, #e3eaff, transparent 73%),
    radial-gradient(ellipse at 95% 2%, #dcf1ee, transparent 64%), #f8fbff;
}

:root[data-theme="light"] .loan-mix[data-active-part="principal"] {
  --interest-arc-start: #468d80;
  --interest-arc-middle: #539a8a;
  --interest-arc-end: #629e92;
}

:root[data-theme="light"] .loan-mix[data-active-part="interest"] {
  --capital-arc-start: #766bb0;
  --capital-arc-middle: #8a7fc0;
  --capital-arc-end: #8c83bb;
}

:root[data-theme="light"] .loan-mix-dial::before {
  border-color: #a7b7d6;
  background: radial-gradient(circle at 42% 18%, #ffffff, #eef4ff 81%);
  box-shadow: inset 0 .25rem .62rem #45638f23;
}

:root[data-theme="light"] .loan-mix-ring { border-color: #22366548; }

:root[data-theme="light"] .loan-mix-part {
  border-color: #bdcde0;
  background: #fcfdff;
}

:root[data-theme="light"] .loan-mix-part[aria-pressed="true"] {
  border-color: #82acac;
  border-color: color-mix(in srgb, var(--part-color) 48%, #cbd9e8);
  background: #e2f0f2;
  background: linear-gradient(140deg, color-mix(in srgb, var(--part-color) 13%, #ffffff), #fcfdff 83%);
  box-shadow: inset 0 0 0 1px #21395409, 0 .24rem .68rem #1f3e6d14;
}

:root[data-theme="light"] .loan-mix-part:not([aria-pressed="true"]):hover { border-color: #8aabc8; }

:root[data-theme="light"] :is(.field input:not([type="checkbox"], [type="radio"], [type="range"]), .field select, .detail-toolbar select) {
  border-color: #9fb4ce;
}

:root[data-theme="light"] .field input::placeholder,
:root[data-theme="light"] .quick-panel #quick-amount::placeholder { color: #566882; }

:root[data-theme="light"] :is(.technical-options, .option-panel) { background: #f4f8fd; }

:root[data-theme="light"] .quick-panel {
  border-color: #b7cbe2;
  background: linear-gradient(145deg, #e8f2fc, #f9fcff 76%);
}

:root[data-theme="light"] .quick-panel #quick-amount {
  border-color: #89a8c5;
  background: var(--input);
}

:root[data-theme="light"] .quick-panel #quick-amount[aria-invalid="true"] { border-color: var(--danger); }

:root[data-theme="light"] .quick-outcome[data-quick-outcome="time"] {
  --quick-accent: #085f48;
  border-color: #a3cdbd;
  background: radial-gradient(ellipse at 90% 0%, #d5f3e6, transparent 70%),
    linear-gradient(145deg, #e6f8f0, #f7fcff 88%);
  box-shadow: 0 .35rem 1.2rem #2b5f561a;
}

:root[data-theme="light"] .quick-outcome[data-savings="neutral"] {
  --quick-accent: #344f6e;
  border-color: #bccadd;
  background: linear-gradient(150deg, #e7edf6, #f7faff 85%);
}

:root[data-theme="light"] .quick-outcome[data-savings="negative"] {
  --quick-accent: #814214;
  border-color: #ddbd9d;
  background: linear-gradient(150deg, #fdf0e0, #fffaf4 87%);
}

:root[data-theme="light"] .quick-outcome[data-quick-outcome="payment"] {
  border-color: #aac5e6;
  background: linear-gradient(150deg, #e4effd, #f7fbff 83%);
}

:root[data-theme="light"] .quick-outcome[data-quick-outcome="time"] .quick-context { border-color: #789e9560; }

:root[data-theme="light"] :is(.addon-card, .optional-preview) {
  border-color: #bbcee2;
  background: #f8fbff;
}

:root[data-theme="light"] .addon-card[open] { border-color: #91b9ba; }
:root[data-theme="light"] .suggestions .button { color: var(--blue); }

:root[data-theme="light"] .effective-date {
  border-color: #51aa94;
  background: #e2f2ef;
  color: #195948;
}

:root[data-theme="light"] .projection-hero[data-tone="time"] {
  border-color: #a3cbbd;
  background: linear-gradient(139deg, #ddf4e9, #f5fbff 78%);
}

:root[data-theme="light"] .projection-hero[data-tone="payment"] {
  border-color: #a9c1e1;
  background: linear-gradient(139deg, #e0edff, #f7faff 78%);
}

:root[data-theme="light"] .timeline > li::before { box-shadow: 0 0 0 3px #346cba27; }
:root[data-theme="light"] .timeline > li::after { background: #93b4d8; }
:root[data-theme="light"] .chart-readout { border-color: #bacde3; }

:root[data-theme="light"] :is(.bar-track, .compare-plot .bar-track) { background: #dce7f4; }

:root[data-theme="light"] :is(.compare-overview, .compare-matrix, .compare-concept) {
  border-color: #b8cade;
  background: linear-gradient(150deg, #f7faff, #edf4fb 78%);
}

:root[data-theme="light"] .compare-highlight {
  --compare-tone: #085f48;
  border-color: #a1c9bb;
  background: radial-gradient(ellipse at 90% 10%, #bbebdb, transparent 67%),
    linear-gradient(132deg, #dbf5eb, #edf6ff 90%);
}

:root[data-theme="light"] .compare-highlight[data-tone="neutral"] {
  --compare-tone: var(--lavender);
  border-color: #bdc8e3;
  background: linear-gradient(134deg, #e7eafd, #f3f7fe 85%);
}

:root[data-theme="light"] .compare-highlight::after {
  background: repeating-radial-gradient(circle, transparent 0 14px, #3f877d25 15px 16px, transparent 17px 22px);
}

:root[data-theme="light"] .compare-plot .bar-control {
  border-color: #b7cbe4;
  background: #fcfdff;
}

:root[data-theme="light"] .compare-plot .bar-control[data-featured="true"] {
  border-color: #9cc9b7;
  background: #e8f7f0;
}

:root[data-theme="light"] .compare-plot :is(.bar-control:hover, .bar-control[aria-expanded="true"]) {
  border-color: #81a2c7;
  background: #edf5fd;
}

:root[data-theme="light"] .compare-plot .bar-control[data-featured="true"] .bar-label strong { color: #125e47; }
:root[data-theme="light"] .compare-plot .bar-control[data-featured="true"] .bar-track { background: #cde7de; }
:root[data-theme="light"] .compare-breakdown { border-color: #b7cae1; }

:root[data-theme="light"] .compare-reference {
  border-color: #b9c7df;
  background: linear-gradient(133deg, #e5ebfa, #f8faff 75%);
}

:root[data-theme="light"] .compare-detail-button:hover { background: #e0eaf8; }

:root[data-theme="light"] .compare-column {
  border-color: #abc2db;
  border-color: color-mix(in srgb, var(--compare-series) 36%, #cfdded);
  background: #f2f7fd;
  background: color-mix(in srgb, var(--compare-series) 9%, #ffffff);
}

:root[data-theme="light"] .compare-table :is(th, td) { border-color: #cbd9e9; }
:root[data-theme="light"] .compare-table tbody td:nth-child(2) { background: #eaf6f1; }
:root[data-theme="light"] .compare-table tbody td:nth-child(3) { background: #eaf2fe; }

:root[data-theme="light"] .compare-table .compare-saving-row :is(th, td) { background: #ddf0e9; }
:root[data-theme="light"] .compare-table .compare-saving-row th { color: #185c46; }

:root[data-theme="light"] .compare-concept-head {
  border-color: #becce2;
  background: radial-gradient(ellipse at 92% 10%, #d9e6fc, transparent 68%), #eef4fd;
}

:root[data-theme="light"] :is(.cashflow-pairs, .detail-summary dl) > div { border-color: #cbd9e9; }

:root[data-theme="light"] :is(.empty-state, .callout) {
  border-color: #b5c7df;
  background: #eaf2fc;
}

:root[data-theme="light"] .error-state {
  border-color: #dcb2b9;
  background: #fff0f2;
}

:root[data-theme="light"] .loan-editor-dialog {
  background: radial-gradient(ellipse at 7% 0%, #e3eefb, transparent 65%), #f8fbff;
}

:root[data-theme="light"] .loan-editor-dialog::backdrop { background: #f0f5fb; }

:root[data-theme="light"] :is(.loan-editor-header, .loan-editor-actions) { background: #f6faff; }

:root[data-theme="light"] :is(.carousel-panel, .section-page, .loan-editor-body) { scrollbar-color: #91a9c7 transparent; }

:root[data-theme="light"] .detail-dialog {
  border-color: #b5c8df;
  background: #f8fbff;
  box-shadow: 0 1rem 3rem #182e4e34;
}

:root[data-theme="light"] .detail-dialog::backdrop { background: #182e4e61; }
:root[data-theme="light"] .schedule-table :is(th, td) { border-color: #cbd9e9; }
:root[data-theme="light"] .schedule-table th { background: #e3edf8; }
:root[data-theme="light"] .schedule-table tr:nth-child(2n) td { background: #eff5fc; }

@media (min-width: 42rem) {
  :root[data-theme="light"] .loan-editor-dialog { border-color: #b5c8df; box-shadow: 0 1rem 3rem #182e4e34; }
  :root[data-theme="light"] .loan-editor-dialog::backdrop { background: #182e4e61; }
}

@media (prefers-reduced-motion: no-preference) {
  .carousel-track:not([data-dragging]),
  .section-track:not([data-dragging]) { transition: transform 290ms cubic-bezier(.2, .72, .26, 1); }
  .nav-button, .button, .icon-button { transition: color 140ms ease, background-color 140ms ease, border-color 140ms ease; }
  .carousel-panel:not([inert]) .section-page:not([inert]) .compare-plot .bar-fill {
    --bar-reveal: 1050ms cubic-bezier(.24, .61, .36, 1) 155ms both;
    animation: reveal-compare-bar var(--bar-reveal);
  }
  .carousel-panel:not([inert]) .section-page:not([inert]) .compare-plot .bar-fill::after {
    position: absolute;
    inset-block: 0;
    width: clamp(.5rem, 3.3vw, 1.22rem);
    background: linear-gradient(90deg, transparent, #f7fffaab);
    transform: translateX(-100%);
    pointer-events: none;
    animation: follow-compare-bar var(--bar-reveal);
    content: "";
  }
  .loan-mix[data-motion="revealing"] .loan-mix-ring::after {
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    background: conic-gradient(from -82deg, transparent 0% var(--mix-sweep, 100%),
      var(--loan-mix-rail-start, #31435e) var(--mix-sweep, 100%), var(--loan-mix-rail-end, #1e2d45) 100%);
    content: "";
  }
  .loan-mix[data-motion="revealing"] .loan-mix-runner { opacity: 1; }
  .loan-mix[data-motion="selecting"] .loan-mix-focus-value { animation: loan-mix-focus-pop 320ms ease-out both; }
  .loan-mix-part, .loan-mix-focus-value { transition: color 180ms ease, background-color 180ms ease, border-color 180ms ease; }
}

@keyframes reveal-compare-bar {
  from { clip-path: inset(0 100% 0 0); }
  to { clip-path: inset(0); }
}

@keyframes follow-compare-bar {
  0% { inset-inline-start: 0%; opacity: 0; }
  14%, 84% { opacity: .78; }
  100% { inset-inline-start: 100%; opacity: 0; }
}

@keyframes loan-mix-focus-pop {
  0% { transform: scale(.9); }
  58% { transform: scale(1.1); }
  100% { transform: scale(1); }
}
