/* Cover planner page (design plan: the tool is the opener). */

.tool-opener { position: relative; overflow: clip; isolation: isolate; min-height: 100svh; padding: calc(var(--head-h) + clamp(14px, 2.4vh, 32px)) 0 clamp(36px, 5vh, 64px); }
.tool-glow { position: absolute; z-index: -1; width: 70vmax; height: 70vmax; left: -18vmax; top: 10%; background: radial-gradient(circle, rgba(242,163,58,.12), transparent 60%); animation: glow 8s ease-in-out infinite alternate; pointer-events: none; }
.tool-head { margin-bottom: clamp(14px, 2.4vh, 30px); }
.tool-head h1 { font-size: clamp(2.1rem, 3.4vw, 3.5rem); line-height: 1; margin-bottom: .25em; }
.tool-head .lede { margin: 0; }
.tool { display: grid; grid-template-columns: min(54vh, 480px, 42vw) minmax(0, 1fr); gap: clamp(28px, 4vw, 64px); align-items: start; }
.t-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; align-items: end; }

/* ---------- dial ---------- */
.dial { position: relative; width: 100%; aspect-ratio: 1; border-radius: 50%; background: #0a141b; box-shadow: 0 0 0 1px rgba(255,255,255,.08), 0 40px 80px rgba(0,0,0,.35); touch-action: none; user-select: none; -webkit-user-select: none; }
.dial svg { width: 100%; height: 100%; overflow: visible; }
.d-face { fill: #0a141b; }
.d-night path { fill: rgba(120,150,190,.07); }
.d-track { fill: none; stroke: rgba(255,255,255,.09); stroke-width: 36; }
.d-arc { fill: none; stroke: var(--sodium); stroke-width: 36; filter: drop-shadow(0 0 12px rgba(242,163,58,.45)); }
.d-tick { stroke: rgba(255,255,255,.3); stroke-width: 2; }
.d-tick.major { stroke: rgba(255,255,255,.75); stroke-width: 3; }
.d-num { fill: rgba(255,255,255,.78); font-family: var(--display); font-weight: 650; font-size: 20px; text-anchor: middle; dominant-baseline: middle; }
.d-icon { fill: none; stroke: rgba(255,255,255,.55); stroke-width: 2; }
.d-handle { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%; border: 4px solid var(--night); background: #fff; color: var(--ink); cursor: grab; box-shadow: 0 6px 18px rgba(0,0,0,.4); display: grid; place-items: center; touch-action: none; z-index: 2; }
.d-handle span { font-family: var(--display); font-weight: 750; font-size: .66rem; letter-spacing: .02em; text-transform: uppercase; }
.d-handle.d-end { background: var(--sodium); }
.d-handle:active { cursor: grabbing; }
.d-handle:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.d-read { position: absolute; inset: 31%; border-radius: 50%; display: grid; place-content: center; text-align: center; background: var(--night); box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); pointer-events: none; }
.d-read b { white-space: nowrap; font-family: var(--display); font-stretch: 116%; font-weight: 820; font-size: clamp(1.7rem, 2.7vw, 3rem); line-height: 1; color: #fff; }
.d-read span { margin-top: 6px; font-family: var(--display); font-weight: 620; font-size: .98rem; color: rgba(255,255,255,.85); font-variant-numeric: tabular-nums; }

/* ---------- controls ---------- */
.tool-side { display: grid; gap: clamp(10px, 1.6vh, 18px); }
.t-group { margin: 0; padding: 0; border: 0; min-width: 0; }
.t-group legend, .t-label { display: block; margin-bottom: 10px; font-family: var(--display); font-weight: 650; font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,.75); }
.t-types { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.t-type { position: relative; cursor: pointer; }
.t-type input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.t-type > span { display: block; height: 100%; padding: 12px 14px; border-radius: var(--r); border: 1.5px solid rgba(255,255,255,.2); background: rgba(255,255,255,.03); transition: border-color .35s, background-color .35s, transform .35s var(--ease); }
.t-type strong { display: block; font-family: var(--display); font-stretch: 106%; font-weight: 720; font-size: 1.02rem; color: #fff; }
.t-type small { display: block; margin-top: 3px; font-family: var(--display); font-size: .88rem; line-height: 1.35; color: rgba(255,255,255,.75); }
.t-type input:checked + span { border-color: var(--sodium); background: rgba(242,163,58,.12); }
.t-type input:focus-visible + span { outline: 3px solid var(--sodium); outline-offset: 2px; }
.t-type:hover > span { transform: translateY(-2px); }
.t-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.t-day { min-height: 48px; border-radius: var(--rb); border: 1.5px solid rgba(255,255,255,.22); background: transparent; color: rgba(255,255,255,.8); font-family: var(--display); font-weight: 700; cursor: pointer; transition: background-color .3s, color .3s, border-color .3s; }
.t-day[aria-pressed="true"] { background: var(--sodium); border-color: var(--sodium); color: var(--ink); }
.t-count { display: block; }
.stepper { display: inline-flex; align-items: center; border: 1.5px solid rgba(255,255,255,.22); border-radius: var(--rb); }
.stepper button { width: 48px; height: 48px; background: none; border: 0; color: #fff; font-size: 1.4rem; cursor: pointer; }
.stepper button:hover, .stepper button:focus-visible { background: rgba(255,255,255,.08); }
.stepper output { min-width: 48px; text-align: center; font-weight: 800; font-size: 1.3rem; color: var(--sodium); }
.t-sum { padding: clamp(14px, 1.8vh, 22px); border-radius: var(--r); background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.14); }
.t-sum-main { font-family: var(--display); font-weight: 650; font-size: 1.1rem; color: #fff; }
.t-sum-main b { font-stretch: 116%; font-weight: 820; font-size: clamp(1.9rem, 2.6vw, 2.5rem); color: var(--sodium); line-height: 1; margin-right: 6px; }
.on-dark p.t-sum-line { margin: 2px 0 6px; font-size: 1rem; }
.t-sum-cost { margin: 0 0 4px; font-family: var(--display); font-weight: 600; color: #fff; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.t-sum-cost b { font-size: 1.35rem; color: #fff; }
.t-flag { padding: 3px 8px; border-radius: 4px; background: rgba(242,163,58,.18); color: var(--sodium); font-size: .8rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.on-dark p.t-sum-note { margin: 0 0 12px; font-size: .92rem; line-height: 1.4; color: rgba(255,255,255,.75); }

/* ---------- rate breakdown ---------- */
.rate { padding: clamp(18px, 2.2vw, 30px); background: #fff; border-radius: var(--r); box-shadow: 0 30px 70px rgba(14,27,36,.1); }
.rate-top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 10px 24px; }
.rate-label { font-family: var(--display); font-weight: 680; font-size: 1.1rem; color: var(--ink); }
.rate-val { font-family: var(--display); font-stretch: 114%; font-weight: 820; font-size: clamp(1.8rem, 2.8vw, 2.6rem); color: var(--ink); }
.rate-range { width: 100%; margin: 8px 0 14px; appearance: none; -webkit-appearance: none; height: 44px; background: transparent; cursor: pointer; }
.rate-range::-webkit-slider-runnable-track { height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--sodium) var(--fill, 57%), var(--mist) var(--fill, 57%)); }
.rate-range::-moz-range-track { height: 8px; border-radius: 4px; background: var(--mist); }
.rate-range::-moz-range-progress { height: 8px; border-radius: 4px; background: var(--sodium); }
.rate-range::-webkit-slider-thumb { -webkit-appearance: none; width: 30px; height: 30px; margin-top: -11px; border-radius: 50%; background: var(--ink); border: 4px solid var(--sodium); box-shadow: 0 4px 10px rgba(0,0,0,.25); }
.rate-range::-moz-range-thumb { width: 24px; height: 24px; border-radius: 50%; background: var(--ink); border: 4px solid var(--sodium); }
.rate-bar { display: flex; height: 54px; border-radius: var(--r); overflow: hidden; background: var(--mist); }
.rate-seg { height: 100%; min-width: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; font-family: var(--display); font-weight: 750; font-size: .95rem; color: #fff; white-space: nowrap; }
.rate-key { list-style: none; margin: 16px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px 20px; }
.rate-key li { display: flex; align-items: center; gap: 10px; font-family: var(--display); font-size: .95rem; color: var(--ink); }
.rate-key i { width: 14px; height: 14px; border-radius: 3px; flex: none; }
.rate-key b { margin-left: auto; font-variant-numeric: tabular-nums; }
.rate-pay { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px 48px; align-items: center; margin-top: clamp(16px, 2vw, 24px); padding-top: clamp(14px, 1.8vw, 22px); border-top: 1px solid var(--line-light); }
.rate-pay-big { margin: 0; font-family: var(--display); font-weight: 650; font-size: clamp(1.25rem, 1.7vw, 1.6rem); color: var(--ink); }
.on-light p.rate-pay-big { color: var(--ink); }
.rate-pay-big b { font-stretch: 114%; font-weight: 820; font-size: 1.3em; color: var(--sodium-deep); }
.rate-verdict { margin: 8px 0 0; font-family: var(--display); font-weight: 600; min-height: 4.6em; }
.on-light p.rate-verdict { color: #1d6b39; }
.on-light p.rate-verdict.is-low { color: #a3321f; }
.gauge-track { position: relative; height: 22px; border-radius: 11px; background: var(--mist); }
.gauge-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 50%; border-radius: 11px; background: #2f8a52; transition: background-color .4s; }
.gauge-fill.is-low { background: #c4462f; }
.gauge-nlw { position: absolute; top: -10px; bottom: -10px; width: 3px; background: var(--ink); }
.gauge-nlw em { position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%); white-space: nowrap; font-style: normal; font-family: var(--display); font-weight: 700; font-size: .85rem; color: var(--ink); background: #fff; padding: 0 4px; }
.gauge-scale { display: flex; justify-content: space-between; margin-top: 10px; font-family: var(--display); font-size: .88rem; color: var(--ink-soft); }
.gauge { padding-top: 26px; }
.on-light p.rate-note { margin: clamp(12px, 1.6vw, 18px) 0 0; font-size: .95rem; color: var(--ink-soft); }

/* ---------- next steps ---------- */
.next-grid { display: grid; grid-template-columns: minmax(0, 1fr) min(38vw, 520px); gap: clamp(28px, 4vw, 64px); align-items: center; }
.next-band h2 { color: var(--ink); }
.next-band p { color: #2b2516; }
.next-frame { width: 100%; justify-self: start; }
.next-frame .frame-img { aspect-ratio: 16 / 11; }
.next-frame::before { border-color: var(--ink); }

@media (max-width: 1100px) {
  .t-types { grid-template-columns: 1fr; }
  .rate-key { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .tool, .next-grid, .rate-pay, .t-row { grid-template-columns: 1fr; }
  .dial { width: min(88vw, 400px); justify-self: center; }
  .t-days { gap: 5px; }
  .next-frame { width: min(100%, 520px); }
}
@media (max-width: 640px) {
  .rate-key { grid-template-columns: 1fr; }
  .rate-seg { font-size: .78rem; }
  .d-handle { width: 46px; height: 46px; margin: -23px 0 0 -23px; }
}
.rm .tool-glow { animation: none; }
/* the dial readout waits for the web fonts so the wide figures never jump sideways (head script adds .fonts-in) */
.js:not(.fonts-in) .d-read { opacity: 0; }
.d-read { transition: opacity .4s ease; }
/* short screens: the tool must still fit between the header and the fold */
@media (min-width: 901px) and (max-height: 820px) {
  .t-type small { display: none; }
  .tool-head .lede { font-size: 1.02rem; }
  .tool { grid-template-columns: min(50vh, 440px, 40vw) minmax(0, 1fr); }
}

@media (max-width: 640px) { .rate-verdict { min-height: 6.2em; } }
