:root {
  --bg: #000000;
  --card: #131417;
  --card-hi: #1c1e22;
  --ink: #f5f4f0;
  --soft: rgba(245, 244, 240, 0.54);
  --line: rgba(255, 255, 255, 0.09);
  --accent: #5ee6b0;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Mona Sans Variable", "Mona Sans", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.stage {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: 16px;
}

.mg {
  width: min(352px, 100%);
  padding: 18px 18px 14px;
  border-radius: 26px;
  background: linear-gradient(180deg, var(--card-hi), var(--card));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 0 1px var(--line),
    0 34px 70px -34px color-mix(in srgb, var(--accent) 34%, transparent);
}
.mg__head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.mg__title { font-size: 13px; font-weight: 560; color: var(--soft); }
.mg__terms { font-size: 12px; font-weight: 520; color: var(--soft); white-space: nowrap; }
.mg__pay { display: flex; align-items: baseline; gap: 8px; margin: 6px 0 14px; }
.mg__pay b { display: inline-block; font-size: clamp(38px, 12vw, 46px); line-height: 1; font-weight: 700; font-stretch: 106%; letter-spacing: -0.03em; }
.mg__pay i { font-style: normal; font-size: 13.5px; font-weight: 520; color: var(--soft); }

/* what you pay back in all: the loan on the left, the interest on the right; the gap between them moves */
.split { display: flex; gap: 3px; height: 14px; }
.split__loan { flex: none; width: 70%; border-radius: 99px 4px 4px 99px; background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 80%, #ffffff), var(--accent)); box-shadow: 0 0 16px -2px color-mix(in srgb, var(--accent) 60%, transparent); }
.split__int { flex: 1; border-radius: 4px 99px 99px 4px; background: repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.3) 0 3px, rgba(255, 255, 255, 0.14) 3px 6px); }
.legend { display: flex; justify-content: space-between; margin: 9px 0 16px; font-size: 12px; font-weight: 500; color: var(--soft); }
.legend__item { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.legend__item b { font-weight: 660; color: var(--ink); }

.yrs { position: relative; height: 62px; padding-top: 34px; border-top: 1px solid var(--line); }
.yrs__track { position: relative; height: 8px; margin: 0 11px; border-radius: 99px; background: rgba(255, 255, 255, 0.1); }
.yrs__fill { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; border-radius: 99px; background: rgba(255, 255, 255, 0.55); transform-origin: 0 50%; }
.yrs__ticks { position: absolute; left: 0; right: 0; top: 13px; display: flex; justify-content: space-between; }
.yrs__ticks i { width: 1px; height: 5px; background: rgba(255, 255, 255, 0.22); }
.yrs__thumb { position: absolute; left: 11px; top: 27px; width: 0; height: 22px; pointer-events: none; }
.yrs__knob { position: absolute; left: -11px; top: 0; width: 22px; height: 22px; border-radius: 50%; background: linear-gradient(180deg, #ffffff, #dcdcd6); box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6), inset 0 -1px 0 rgba(0, 0, 0, 0.12); }
.yrs__bubble { position: absolute; left: 0; bottom: 27px; transform: translateX(-50%); height: 22px; padding: 0 9px; border-radius: 99px; background: rgba(255, 255, 255, 0.1); box-shadow: inset 0 0 0 1px var(--line); font-size: 12px; line-height: 22px; font-weight: 640; white-space: nowrap; }
.yrs__bubble span { display: block; }
.yrs__input { position: absolute; left: 0; right: 0; top: 18px; width: 100%; height: 40px; margin: 0; opacity: 0; cursor: grab; touch-action: pan-y; }
.yrs__input:active { cursor: grabbing; }
.yrs:has(.yrs__input:focus-visible) .yrs__knob { outline: 2px solid var(--accent); outline-offset: 2px; }

.ghost {
  position: fixed;
  left: 0;
  top: 0;
  width: 22px;
  height: 22px;
  pointer-events: none;
  fill: #ffffff;
  stroke: #14151a;
  stroke-width: 1.4;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.6));
  opacity: 0;
  visibility: hidden;
  z-index: 5;
}
