/* Remortgage: the fixed-rate countdown in the opener, and the payment chart that changes with each reason. */

/* ---------- opener widget: months left on the deal ---------- */
.rmw { padding: 16px 18px 14px; }
.rmw__top { margin: 0 0 8px; }
.rmw__lbl { font-family: var(--f-display); font-weight: 800; font-size: 1.05rem; color: var(--ink); }
.rmw__row { display: flex; align-items: center; gap: 14px; }
.rmw__ring { flex: none; width: 104px; height: 104px; overflow: visible; }
.rmw__track { fill: none; stroke: var(--mist); stroke-width: 10; }
.rmw__arc { fill: none; stroke: var(--ink); stroke-width: 10; stroke-linecap: round; }
.rmw__num { font-family: var(--f-display); font-weight: 800; font-size: 44px; fill: var(--ink); }
.rmw__unit { font-family: var(--f-display); font-weight: 700; font-size: 15px; fill: var(--slate); }
.rmw__cal { flex: 1; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.rmw__m { padding: 6px 0; background: var(--sky); border-radius: var(--r); text-align: center; font-family: var(--f-display); font-weight: 700; font-size: .9rem; color: var(--ink); transition: background .4s, color .4s; }
.rmw__m.is-gone { background: var(--mist); color: #5d6a72; }
.rmw__note { display: flex; align-items: center; gap: 8px; margin: 10px 0 0; color: var(--ink); }
.rmw__note .hand { font-size: 1.6rem; line-height: 1; }
.rmw__note .pin-ico { color: var(--ink); --pin-house: #fff; width: 24px; height: 32px; }

/* ---------- three reasons: copy scrolls, the chart stays in view ---------- */
.rmx { position: relative; background: var(--ink); color: #fff; padding: clamp(64px, 10vh, 110px) 0 clamp(40px, 8vh, 90px); overflow: clip; }
.rmx__route { position: absolute; inset: 0; width: 100%; height: 100%; color: var(--sky); opacity: .45; pointer-events: none; }
.rmx__grid { position: relative; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(40px, 6vw, 96px); align-items: start; }
.rmx__title { color: #fff; }
.rmx__lede { color: rgba(255,255,255,.84); margin-top: 16px; }
.rmx__steps { margin-top: clamp(24px, 4vh, 40px); }
.rmx__step { padding: 22px 0 26px; border-top: 2px solid rgba(135,192,215,.4); transition: opacity .45s; }
.rmx__tag { margin: 0 0 2px; font-size: 1.6rem; line-height: 1.1; color: var(--sky); }
.rmx__step-t { color: #fff; font-size: clamp(1.45rem, 2vw, 1.9rem); line-height: 1.15; margin-bottom: 10px; }
.rmx__step-p { margin: 0; color: rgba(255,255,255,.86); font-size: 1.08rem; line-height: 1.6; }
.rmx__warn { display: flex; align-items: flex-start; gap: 12px; margin: 18px 0 0; padding: 14px 16px; background: var(--sky); color: var(--ink); border-radius: var(--r); font-size: 1.05rem; line-height: 1.45; }
.rmx__warn svg { flex: none; width: 24px; height: 24px; margin-top: 1px; fill: none; stroke: var(--ink); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.rmx__warn strong { font-family: var(--f-display); font-weight: 800; }

.rmx__art { position: sticky; top: calc(var(--head-h) + 28px); }
.rmx__card { margin: 0; padding: clamp(16px, 2.4vh, 26px) clamp(16px, 2vw, 28px) 16px; background: #2F373C; border-radius: var(--r); border-top: 4px solid var(--sky); box-shadow: 0 40px 80px rgba(0,0,0,.28); transform-style: preserve-3d; }
.rmx__chart { display: block; width: 100%; height: auto; max-height: calc(100svh - var(--head-h) - 150px); overflow: visible; }
.rmx__axis { fill: none; stroke: rgba(255,255,255,.6); stroke-width: 2; }
.rmx__axis-t { font-family: var(--f-display); font-weight: 700; font-size: 16px; fill: rgba(255,255,255,.75); }
.rmx__end { fill: none; stroke: rgba(255,255,255,.45); stroke-width: 2; stroke-dasharray: 6 8; }
.rmx__fixed { fill: none; stroke: var(--sky); stroke-width: 7; stroke-linecap: round; }
.rmx__svr { fill: none; stroke: #fff; stroke-width: 4; stroke-dasharray: 12 9; stroke-linejoin: round; }
.rmx__fork { fill: none; stroke-linecap: round; }
.rmx__fork--a { stroke: var(--sky); stroke-width: 6; }
.rmx__fork--b { stroke: #fff; stroke-width: 3.5; }
.rmx__one { fill: none; stroke: var(--sky); stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; }
.rmx__arrow { fill: none; stroke: var(--sky); stroke-width: 4; stroke-linecap: round; stroke-linejoin: round; }
.rmx__debts rect { fill: var(--steel); stroke: #2F373C; stroke-width: 2; }
.rmx__debts text { font-family: var(--f-display); font-weight: 800; font-size: 16px; fill: #fff; }
.rmx__lbl { font-family: var(--f-display); font-weight: 700; font-size: 17px; fill: #fff; }
.rmx__hand { font-family: var(--f-hand); font-weight: 600; font-size: 27px; fill: var(--sky); }
.rmx__path { fill: none; stroke: none; }
.rmx__dot { fill: #fff; stroke: var(--sky); stroke-width: 3; opacity: 0; }
.rmx__pin { color: var(--sky); --pin-house: var(--ink); }
.rmx__cap { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 6px; }
.rmx__count { font-family: var(--f-display); font-weight: 800; font-size: 1.05rem; color: #fff; }
.rmx__cap .hand { font-size: 1.7rem; color: var(--sky); line-height: 1; }

/* without the script: the jump and the two new deals show together; the debts stay out */
.rmx__st--2 { display: none; }
.rmx__cap { visibility: hidden; }
/* with the script: one reason at a time */
.rmx.is-live .rmx__st--2 { display: inline; }
.rmx.is-live .rmx__cap { visibility: visible; }
.rmx.is-live .rmx__st { opacity: 0; transition: opacity .5s; }
.rmx.is-live .rmx__st.is-on { opacity: 1; }
.rmx.is-live .rmx__step { opacity: .42; }
.rmx.is-live .rmx__step.is-on { opacity: 1; }
.rmx.is-live .rmx__step { min-height: 46vh; }
.rmx.is-live .rmx__step:last-child { min-height: 0; padding-bottom: 12vh; }

@media (max-width: 900px) {
  .rmx__grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .rmx__copy { display: contents; }
  .rmx__title { order: 1; }
  .rmx__lede { order: 2; margin-top: 0; }
  .rmx__art { order: 3; top: var(--head-h); z-index: 2; padding-top: 8px; background: var(--ink); box-shadow: 0 -30px 0 var(--ink), 0 14px 18px -10px rgba(0,0,0,.5); }
  .rmx__steps { order: 4; margin-top: 0; }
  .rmx__card { padding: 12px 12px 10px; }
  .rmx__chart { max-height: 34svh; }
  .rmx.is-live .rmx__step { min-height: 52svh; }
}
@media (max-width: 700px) {
  .rmx__lbl { font-size: 24px; }
  .rmx__axis-t { font-size: 22px; }
  .rmx__debts text { font-size: 22px; }
  .rmx__hand { font-size: 32px; }
  .rmw__ring { width: 84px; height: 84px; }
  .rmw__cal { gap: 4px; }
}
