/* Capital gains tax calculator page. Design plan: _work/design-plan.md (tool row: the calculator is the opener).
   The opener is a sale sheet on graph paper beside a gain waterfall that falls from the sale price to the tax. */

/* ---------- Opener: graph paper ---------- */
.cgt-open { --c-lo: #E58A9E; --c-hi: var(--claret); position: relative; overflow: clip; background: var(--blush); padding: calc(var(--head-h) + clamp(14px, 2vh, 28px)) 0 clamp(40px, 5vh, 70px); }
.cgt-open__grid { position: absolute; inset: -48px; pointer-events: none; background-image: linear-gradient(rgba(117,21,35,.075) 1px, transparent 1px), linear-gradient(90deg, rgba(117,21,35,.075) 1px, transparent 1px), linear-gradient(rgba(117,21,35,.04) 1px, transparent 1px), linear-gradient(90deg, rgba(117,21,35,.04) 1px, transparent 1px); background-size: 48px 48px, 48px 48px, 12px 12px, 12px 12px; animation: cgt-grid 40s linear infinite; }
@keyframes cgt-grid { to { transform: translate(48px, 48px); } }
.rm .cgt-open__grid { animation: none; }
.cgt-open__head { position: relative; margin-bottom: clamp(12px, 1.8vh, 20px); }
.cgt-open h1 { font-size: clamp(2.2rem, 3.6vw, 3.5rem); margin-bottom: 4px; }
.cgt-open__head .lede { margin: 0; max-width: 120ch; }
.motion:not(.motion-fail) [data-cgt-in], .motion:not(.motion-fail) [data-cgt-in-sheet] { opacity: 0; }

.cgt-form { position: relative; }
.cgt-strip { display: grid; grid-template-columns: auto auto minmax(0, 1fr) minmax(0, 1fr); align-items: end; gap: 12px clamp(16px, 2vw, 30px); padding: 10px 16px 10px; background: #fff; border: 1px solid var(--rule); border-top: 4px solid var(--claret); margin-bottom: clamp(14px, 2vh, 22px); }
.cgt-f { margin: 0; padding: 0; border: 0; min-width: 0; }
.cgt-f legend, .cgt-f__l { display: block; padding: 0; margin-bottom: 6px; font-size: .875rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--claret); }
.cgt-f__h { display: block; margin-top: 4px; font-size: .875rem; color: var(--ink-soft); line-height: 1.3; }
.cgt-f--inc { min-width: 0; }
.cgt-seg { position: relative; display: flex; padding: 3px; background: var(--blush); border: 1px solid var(--rule); }
.cgt-seg label { position: relative; z-index: 1; flex: 1 1 auto; cursor: pointer; }
.cgt-seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.cgt-seg span { display: flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 12px; border-radius: var(--btn-r); font-weight: 700; font-size: .98rem; white-space: nowrap; color: var(--ink); transition: color .3s var(--ease); }
.cgt-seg label:hover span { color: var(--crimson); }
.cgt-seg input:checked + span { color: #fff; }
.cgt-seg input:focus-visible + span { outline: 3px solid var(--highlight); outline-offset: 2px; }
.cgt-seg__ink { position: absolute; z-index: 0; left: 0; top: 3px; bottom: 3px; width: 0; border-radius: var(--btn-r); background: var(--claret); box-shadow: 0 6px 14px rgba(117,21,35,.28); }
.no-js .cgt-seg__ink, .motion-fail .cgt-seg__ink { display: none; }
.no-js .cgt-seg input:checked + span, .motion-fail .cgt-seg input:checked + span { background: var(--claret); }

.cgt-body { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 6fr); gap: clamp(20px, 2.6vw, 44px); align-items: stretch; }

/* The sale sheet: a filed sheet of figures, the inputs written on its lines */
.sheet { --paper-c: #FFFDF6; position: relative; background: var(--paper-c); padding: 16px clamp(16px, 1.8vw, 26px) 14px clamp(30px, 2.8vw, 44px); box-shadow: 0 1px 0 rgba(0,0,0,.04), 16px 16px 0 rgba(117,21,35,.08), 0 26px 40px -24px rgba(34,9,15,.35); transform-origin: 50% 0; }
.sheet__holes { position: absolute; left: 10px; top: 0; bottom: 0; width: 12px; background: radial-gradient(circle at 6px 50%, var(--blush) 0 5px, rgba(0,0,0,.12) 5.5px, transparent 6.5px) 0 22% / 12px 12px no-repeat, radial-gradient(circle at 6px 50%, var(--blush) 0 5px, rgba(0,0,0,.12) 5.5px, transparent 6.5px) 0 78% / 12px 12px no-repeat; }
.sheet::before { content: ''; position: absolute; top: 0; bottom: 0; left: clamp(24px, 2.3vw, 36px); width: 1px; background: rgba(163,24,62,.35); }
.sheet p { margin: 0; }
.sheet__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 8px; border-bottom: 3px double var(--ink); }
.sheet__title { font-family: var(--serif); font-size: clamp(1.3rem, 1.7vw, 1.6rem); line-height: 1.1; }
.sheet__asset { font-size: .875rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--claret); text-align: right; }
.sh { display: grid; }
.sh__r { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 32px; padding: 3px 0; border-bottom: 1px dotted #D9CACE; font-size: .98rem; line-height: 1.25; }
.sh__r label, .sh__r > span { color: var(--ink); font-weight: 600; }
.sh__r small { font-weight: 500; font-size: .875rem; color: #6A5B60; margin-left: 4px; }
.sh__minus { color: var(--crimson); font-weight: 700; }
.sh__r--less label { font-weight: 500; }
.sh__r--less label { color: var(--ink); }
.sh__r--sum { border-top: 1.5px solid var(--ink); border-bottom: 1.5px solid var(--ink); margin: 2px 0; background: rgba(242,214,75,.0); font-weight: 700; }
.sh__r--sum b { font-size: 1.15rem; }
.sh__r--calc { color: #6A5B60; }
.sh__r--calc > span { font-weight: 500 !important; }
.sh__r--calc b { font-weight: 600; color: var(--ink); }
.sh__r--rate > span { font-weight: 500 !important; color: #5A4C50 !important; }
.sh__r--rate b { font-weight: 600; }
.sh__r[data-off] { display: none; }
.sh__r--total { border-bottom: 0; border-top: 3px double var(--ink); padding-top: 8px; }
.sh__r--total > span { font-size: .9rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--claret) !important; }
.sh__r--total b { font: 600 clamp(1.8rem, 2.4vw, 2.3rem)/1 var(--sans); letter-spacing: -.03em; color: var(--crimson); }
.sh__in { display: inline-flex; align-items: baseline; gap: 2px; padding: 0 2px; border-bottom: 1.5px solid var(--ink); background: linear-gradient(rgba(242,214,75,.55), rgba(242,214,75,.55)) no-repeat 0 100% / 100% 0; transition: background-size .4s var(--ease); }
.sh__in:focus-within { background-size: 100% 100%; }
.sh__in > span { color: var(--crimson); font-weight: 700; }
.sh__in input { width: 7.4ch; border: 0; background: transparent; padding: 4px 0 3px; text-align: right; font: 600 1.02rem/1.2 var(--sans); color: var(--ink); font-variant-numeric: tabular-nums; }
.sh__in input:focus { outline: none; }
.sh__in input { min-height: 44px; padding-block: 12px 11px; margin-block: -9px -8px; } /* a full tap target, the line keeps its height */
.sh__in:has(input:focus-visible) { outline: 3px solid var(--highlight); outline-offset: 2px; }
.sh__in--strip { display: flex; background-color: #fff; border: 1px solid var(--rule); border-bottom: 2px solid var(--ink); padding: 0 10px; height: 48px; align-items: center; }
.sh__in--strip input { width: 100%; text-align: left; font-size: 1.15rem; }
.sh__msg { margin-top: 6px !important; font-size: .92rem; font-weight: 600; color: var(--crimson); }
.sh__msg:empty { display: none; }
.cgt-go { margin-top: 12px; }
.js .cgt-go { display: none; }

/* The waterfall, drawn on graph paper */
.wf { position: relative; display: flex; flex-direction: column; min-width: 0; background: #fff; border: 1px solid var(--rule); padding: clamp(14px, 1.6vw, 22px) clamp(14px, 1.8vw, 26px) 12px; box-shadow: 16px 16px 0 rgba(117,21,35,.08); background-image: linear-gradient(rgba(19,32,47,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(19,32,47,.05) 1px, transparent 1px); background-size: 24px 24px; }
.wf p { margin: 0; }
.wf__top { position: relative; padding-right: 150px; padding-bottom: 8px; border-bottom: 2px solid var(--ink); }
.wf__k { font-size: .9rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--claret); }
.wf__v { font: 600 clamp(2.4rem, 3.6vw, 3.4rem)/1.04 var(--sans); letter-spacing: -.04em; color: var(--crimson); }
.wf__s { font-size: .98rem; color: var(--ink-soft); }
.wf__s span:first-child { font-weight: 700; color: var(--ink); }
.wf__stamp { position: absolute; right: 2px; top: 4px; width: 132px; height: 82px; border: 3px solid var(--crimson); outline: 1.5px solid var(--crimson); outline-offset: -8px; border-radius: 50%; display: grid; place-content: center; text-align: center; color: var(--crimson); transform: rotate(-9deg); background: rgba(255,255,255,.85); pointer-events: none; }
.wf__stamp span { font-family: var(--serif); font-size: 1.3rem; line-height: 1; text-transform: uppercase; letter-spacing: .03em; }
.wf__stamp small { font-weight: 700; font-size: .68rem; text-transform: uppercase; letter-spacing: .14em; margin-top: 2px; }

.wf__chart { position: relative; flex: 1 1 auto; display: flex; min-height: clamp(220px, 34vh, 360px); padding: 30px 0 48px; margin-top: 4px; }
.wf__zero { position: absolute; left: 0; right: 0; bottom: calc(48px + var(--zero, 0) * (100% - 78px)); height: 2px; background: var(--ink); }
.wf__col { position: relative; flex: 1 1 0; min-width: 0; }
.wf__bar { position: absolute; left: 13%; right: 13%; bottom: calc(var(--a) * 100%); height: max(2px, calc((var(--b) - var(--a)) * 100%)); transform-origin: 50% 100%; display: flex; flex-direction: column-reverse; overflow: hidden; }
.wf__col--total .wf__bar { background: var(--ink-blue); }
.wf__col--drop .wf__bar { background: repeating-linear-gradient(-45deg, #E9B9C5 0 5px, #F3D6DD 5px 10px); box-shadow: inset 0 0 0 1px rgba(163,24,62,.25); transform-origin: 50% 0; }
.wf__col--sub .wf__bar { background: var(--crimson); }
.wf__col--sub[data-neg] .wf__bar { background: #8C9AAB; }
.wf__col--split .wf__bar, .wf__col--tax .wf__bar { background: var(--c-hi); }
.wf__p1 { display: block; flex: none; height: calc(var(--s, 1) * 100%); background: var(--c-lo); }
.wf__p2 { display: block; flex: 1 1 auto; }
.wf__col--tax .wf__bar { background: var(--wine); box-shadow: 0 0 0 3px rgba(242,214,75,.9); }
.wf__col--tax .wf__p1 { background: var(--crimson); }
.wf__col[data-zero] .wf__bar { background: var(--ink); opacity: .35; }
.wf__col::after { content: ''; position: absolute; left: 87%; width: 26%; bottom: calc(var(--c) * 100%); border-top: 1.5px dashed rgba(28,19,22,.45); }
.wf__col:last-child::after, .wf__col--split::after { display: none; }
.wf__amt { position: absolute; left: -10%; right: -10%; bottom: calc(var(--b) * 100% + 6px); text-align: center; font-size: .8rem; font-weight: 700; color: var(--ink); white-space: nowrap; letter-spacing: -.01em; }
.wf__col--drop .wf__amt { color: var(--crimson); bottom: auto; top: calc((1 - var(--a)) * 100% + 5px); }
.wf__col--tax .wf__amt { font-size: .98rem; color: var(--crimson); }
.wf__lab { position: absolute; left: -4%; right: -4%; top: calc(100% + 8px); text-align: center; font-size: .8rem; font-weight: 600; line-height: 1.15; color: var(--ink-soft); hyphens: manual; }
.wf__col--tax .wf__lab, .wf__col--sub .wf__lab, .wf__col--split .wf__lab { color: var(--ink); font-weight: 700; }
.wf__key { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-top: 6px; padding-top: 8px; border-top: 1px dashed #D9CACE; font-size: .9rem; color: var(--ink-soft); }
.wf__key li { display: flex; align-items: center; gap: 8px; }
.wf__key li[data-off] { display: none; }
.wf__key i { width: 14px; height: 10px; }
.k-lo i { background: var(--c-lo); } .k-hi i { background: var(--c-hi); }
.cgt-note { position: relative; margin: 14px 0 0; font-size: .95rem; color: var(--ink-soft); }
.cgt-note__tel { font-weight: 700; color: var(--claret); white-space: nowrap; }

/* Phones: a chip with the tax while the waterfall is out of sight */
.cgt-peek { display: none; }
@media (max-width: 1099px) {
  .cgt-peek { position: fixed; z-index: 50; right: 16px; bottom: 14px; width: 13rem; justify-content: space-between; display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: var(--wine); color: #fff; text-decoration: none; border-radius: var(--btn-r); box-shadow: 0 14px 30px rgba(34,9,15,.35); transform: translateY(140%); opacity: 0; transition: transform .45s var(--ease), opacity .3s; }
  .cgt-peek.is-on { transform: none; opacity: 1; }
  .cgt-peek span { font-size: .9rem; font-weight: 600; color: var(--on-dark-soft); }
  .cgt-peek b { font-size: 1.1rem; }
  .cgt-body { grid-template-columns: minmax(0, 1fr); }
  .cgt-strip { grid-template-columns: auto minmax(0, 1fr); }
  .cgt-f--asset { grid-column: 2; grid-row: 1; }
}
@media (max-width: 760px) {
  .cgt-strip { grid-template-columns: minmax(0, 1fr); padding: 12px; }
  .cgt-f--asset { grid-row: auto; grid-column: auto; }
  .cgt-f--asset .cgt-seg { flex-direction: column; }
  .cgt-f--asset .cgt-seg span { justify-content: flex-start; }
  .cgt-f--inc { max-width: none; }
  .wf__top { padding-right: 0; }
  .wf__stamp { position: relative; float: right; width: 100px; height: 62px; margin: 0 0 4px 8px; }
  .wf__stamp span { font-size: 1.05rem; }
  /* The waterfall turns on its side: one row per step, the bars run left to right */
  .wf__chart { flex-direction: column; padding: 8px 0 4px; min-height: 0; }
  .wf__zero { top: 8px; bottom: 4px; left: calc(8.6rem + var(--zero, 0) * (100% - 8.6rem)); width: 2px; height: auto; right: auto; }
  .wf__col { flex: none; height: 38px; }
  .wf__bar { left: calc(8.6rem + var(--a) * (100% - 8.6rem)); width: max(2px, calc((var(--b) - var(--a)) * (100% - 8.6rem))); right: auto; top: 7px; bottom: 7px; height: auto; flex-direction: row; transform-origin: 0 50%; }
  .wf__col--drop .wf__bar { transform-origin: 100% 50%; }
  .wf__p1 { height: auto; width: calc(var(--s, 1) * 100%); }
  .wf__col::after { display: none; }
  .wf__lab { left: 0; right: auto; top: 3px; width: 8.2rem; text-align: left; font-size: .875rem; }
  .wf__amt, .wf__col--drop .wf__amt { left: 0; right: auto; top: auto; bottom: 2px; width: 8.2rem; text-align: left; font-size: .875rem; }
  .wf__lab br { display: none; }
}
@media (max-width: 600px) {
  .cgt-open { padding-top: calc(var(--head-h) + 18px); }
  .cgt-open h1 { font-size: clamp(2rem, 8.8vw, 2.5rem); }
  .cgt-open__head .lede { font-size: 1.02rem; }
  .sheet { padding: 14px 12px 12px 30px; }
  .sh__r { font-size: .95rem; }
  .sh__in input { width: 6.6ch; }
}
/* Shorter desktop screens: keep the sheet and the chart on the first screen */
@media (min-width: 1100px) and (max-height: 860px) {
  .cgt-open { padding: calc(var(--head-h) + 8px) 0 18px; }
  .cgt-open h1 { font-size: clamp(2rem, 3vw, 2.6rem); margin-bottom: 0; }
  .cgt-open__head .lede { font-size: 1rem; }
  .cgt-strip { padding: 8px 14px; margin-bottom: 10px; }
  .cgt-seg span { min-height: 36px; }
  .sh__in--strip { height: 40px; }
  .cgt-f__h { display: none; }
  .sh__r { min-height: 31px; padding: 1px 0; font-size: .93rem; }
  .sh__r small { display: none; }
  .sh__in input { padding: 2px 0; }
  .wf__chart { min-height: 220px; }
  .wf__v { font-size: 2.4rem; }
}

/* ---------- Rates, allowance and the 60-day rule (ink-blue) ---------- */
.cgt-rules { overflow: clip; padding-block: clamp(64px, 7vw, 104px); }
.cgt-rules::before { content: ''; position: absolute; inset: 0; background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 35px, rgba(255,255,255,.04) 35px, rgba(255,255,255,.04) 36px); animation: cgt-rule 22s linear infinite; pointer-events: none; }
@keyframes cgt-rule { to { background-position: 0 36px; } }
.rm .cgt-rules::before { animation: none; }
.cgt-rules__oval { position: absolute; left: -22vw; bottom: -30%; width: 70vw; height: 110%; border-radius: 50%; border: 1px solid rgba(255,255,255,.1); box-shadow: inset 0 0 0 46px rgba(255,255,255,.02), inset 0 0 0 92px rgba(255,255,255,.015); animation: wobble 22s ease-in-out infinite alternate; pointer-events: none; }
.cgt-rules h2 { color: #fff; }
.cgt-rules .sec-head { margin-bottom: clamp(26px, 3.4vw, 46px); }
.cgt-rules__grid { position: relative; display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(22px, 3vw, 48px); align-items: start; }
.rcards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.rcard { position: relative; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.14); border-top: 3px solid var(--crimson); padding: 20px 20px 18px; overflow: hidden; transition: background .35s var(--ease); }
.rcard::after { content: ''; position: absolute; inset: 0; background: radial-gradient(300px circle at var(--lx, 50%) var(--ly, 50%), rgba(242,214,75,.12), transparent 60%); opacity: 0; transition: opacity .35s; pointer-events: none; }
.rcard:hover { background: rgba(255,255,255,.08); }
.rcard:hover::after { opacity: 1; }
.rcard p { margin: 0; }
.rcard__v { font: 600 clamp(1.8rem, 2.4vw, 2.4rem)/1.05 var(--sans); letter-spacing: -.03em; color: var(--highlight); margin-bottom: 8px !important; }
.rcard__v small { font-size: .5em; font-weight: 700; color: #fff; letter-spacing: 0; }
.rcard__h { color: #fff; font-weight: 700; font-size: 1.12rem; margin-bottom: 6px !important; }
.rcard p:last-child { color: var(--on-dark-soft); font-size: .98rem; line-height: 1.5; }
.days { position: relative; background: #fff; color: var(--ink); padding: 22px 24px 20px; border-left: 4px solid var(--highlight); box-shadow: 18px 18px 0 rgba(0,0,0,.22); display: grid; align-content: start; gap: 8px; }
.days p { margin: 0; }
.days__h { font-family: var(--serif); font-size: clamp(1.3rem, 1.7vw, 1.6rem); line-height: 1.2; margin-bottom: 6px !important; }
.days__l { font-size: .875rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--claret); }
.days__date { width: 100%; height: 50px; padding: 0 12px; border: 1px solid var(--rule); border-bottom: 2px solid var(--ink); border-radius: 0; background: #fff; font: 600 1.02rem/1 'Hanken Fallback', Arial, sans-serif; color: var(--ink); }
.days__date:focus-visible { outline: 3px solid var(--highlight); outline-offset: 2px; }
.days__track { position: relative; height: 34px; margin: 8px 0 2px; background: var(--blush); }
.days__fill { position: absolute; left: 0; top: 0; bottom: 0; width: calc(var(--f, 0) * 100%); background: var(--crimson); }
.days__fill::after { content: 'Today'; position: absolute; right: 0; top: -22px; transform: translateX(50%); font-size: .875rem; font-weight: 700; color: var(--crimson); white-space: nowrap; }
.days__track { margin-top: 28px !important; }
.days__ticks { position: absolute; inset: 0; display: flex; }
.days__ticks i { flex: 1 1 0; border-right: 1px solid rgba(255,255,255,.75); }
.days__ticks i:nth-child(10n) { border-right-width: 3px; }
.days__out { display: flex; flex-direction: column; padding-top: 6px; border-top: 1px dashed #C9BBBF; }
.days__out span { font-size: .92rem; color: var(--ink-soft); font-weight: 600; }
.days__out b { font: 600 clamp(1.6rem, 2.2vw, 2rem)/1.15 var(--sans); letter-spacing: -.02em; color: var(--crimson); }
.days__left { font-weight: 700; font-size: 1rem; }
.days__left:empty { display: none; }
.js .days__go { display: none; }
.days__go { justify-self: start; }
@media (max-width: 1099px) { .cgt-rules__grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) { .rcards { grid-template-columns: minmax(0, 1fr); } .days { padding: 18px 16px; } }

/* ---------- What you can take off (white) ---------- */
.cgt-costs { overflow: clip; }
.cgt-costs__grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(32px, 5vw, 88px); align-items: center; }
.cgt-costs__media { position: relative; }
.cgt-costs__frame { position: relative; height: min(62vh, 560px); clip-path: inset(0); box-shadow: 24px -24px 0 rgba(19,32,47,.1); }
.cgt-costs__frame img { position: absolute; inset: -6% 0 auto; height: 112%; }
.cgt-costs__tag { position: absolute; z-index: 3; left: -14px; top: 26px; margin: 0; padding: 12px 18px 14px; background: var(--ink-blue); color: #fff; box-shadow: 0 18px 34px rgba(34,9,15,.25); display: grid; line-height: 1.25; }
.cgt-costs__tag span { font-size: .875rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--highlight); }
.cgt-costs__tag b { font-family: var(--serif); font-weight: 400; font-size: 1.3rem; }
.cgt-costs__copy .lede { margin: 16px 0 22px; }
.cgt-costs__cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 28px; border-top: 2px solid var(--ink); padding-top: 16px; }
.cl__h { font-weight: 700; font-size: 1.1rem; margin-bottom: 10px; }
.cl--no .cl__h { color: var(--claret); }
.cl li { font-size: 1rem; color: var(--ink-soft); }
.crosses li { position: relative; padding-left: 30px; margin-bottom: 10px; }
.crosses li::before, .crosses li::after { content: ''; position: absolute; left: 3px; top: .72em; width: 15px; height: 2.5px; background: var(--claret); transform: rotate(45deg) scaleX(var(--tick, 1)); }
.crosses li::after { transform: rotate(-45deg) scaleX(var(--tick, 1)); }
@media (max-width: 900px) {
  .cgt-costs__grid { grid-template-columns: minmax(0, 1fr); }
  .cgt-costs__frame { height: min(48vh, 380px); }
  .cgt-costs__tag { left: -4px; }
  .cgt-costs__cols { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- Ways to keep more (blush) ---------- */
.cgt-plan { overflow: clip; padding-block: clamp(64px, 7vw, 104px); }
.cgt-plan__bg { position: absolute; inset: -48px; pointer-events: none; background-image: linear-gradient(rgba(117,21,35,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(117,21,35,.05) 1px, transparent 1px); background-size: 48px 48px; animation: cgt-grid 50s linear infinite reverse; -webkit-mask-image: radial-gradient(ellipse at 70% 40%, #000 15%, transparent 70%); mask-image: radial-gradient(ellipse at 70% 40%, #000 15%, transparent 70%); }
.rm .cgt-plan__bg { animation: none; }
.cgt-plan .sec-head { position: relative; }
.plan { position: relative; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.plan__c { position: relative; background: #fff; padding: 22px 20px 20px; border: 1px solid var(--rule); border-bottom: 4px solid var(--crimson); box-shadow: 12px 12px 0 rgba(117,21,35,.06); transition: transform .45s var(--ease), box-shadow .45s var(--ease); }
.plan__c:hover { transform: translateY(-6px); box-shadow: 12px 18px 0 rgba(117,21,35,.1); }
.plan__c p { margin: 0; }
.plan__n { font: 600 clamp(1.7rem, 2.3vw, 2.2rem)/1.05 var(--sans); letter-spacing: -.03em; color: var(--crimson); margin-bottom: 12px !important; padding-bottom: 10px; border-bottom: 1px dashed #D9CACE; }
.plan__h { font-weight: 700; font-size: 1.08rem; margin-bottom: 6px !important; }
.plan__c p:last-child { font-size: .98rem; color: var(--ink-soft); line-height: 1.5; }
@media (max-width: 1099px) { .plan { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .plan { grid-template-columns: minmax(0, 1fr); } }

/* ---------- CTA and onward links (crimson) ---------- */
.cgt-cta { overflow: clip; padding-block: clamp(64px, 7vw, 100px); }
.cgt-cta__lines { position: absolute; inset: -40% -10%; pointer-events: none; background-image: repeating-linear-gradient(-32deg, transparent 0 46px, rgba(255,255,255,.05) 46px 47px); animation: cgt-lines 30s linear infinite; }
@keyframes cgt-lines { to { transform: translateX(110px); } }
.rm .cgt-cta__lines { animation: none; }
.cgt-cta__top { position: relative; display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: clamp(28px, 4vw, 72px); align-items: start; }
.cgt-cta h2 { color: #fff; margin-bottom: 16px; }
.cgt-cta .lede { margin-bottom: 26px; max-width: 120ch; }
.cgt-cta__tag { position: relative; justify-self: end; width: min(100%, 330px); padding: 26px 26px 24px 56px; background: #FFFDF6; color: var(--ink); clip-path: polygon(30px 0, 100% 0, 100% 100%, 30px 100%, 0 50%); filter: drop-shadow(0 26px 30px rgba(34,9,15,.4)); transform-origin: 0 50%; }
.cgt-cta__tag p { margin: 0; }
.tag__hole { position: absolute; left: 22px; top: 50%; width: 14px; height: 14px; margin-top: -7px; border-radius: 50%; background: var(--crimson); box-shadow: inset 0 2px 3px rgba(0,0,0,.35); }
.tag__k { font-size: .875rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--claret); }
.tag__v { font: 600 clamp(2.2rem, 3.2vw, 2.9rem)/1.1 var(--sans); letter-spacing: -.035em; color: var(--crimson); }
.tag__s { font-size: .98rem; color: var(--ink-soft); }
.cgt-next { position: relative; margin-top: clamp(36px, 4.4vw, 60px); }
.cgt-next__h { color: #fff; font-family: var(--serif); font-weight: 400; font-size: clamp(1.35rem, 1.8vw, 1.7rem); margin-bottom: 14px; }
.cgt-next__list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.cgt-next__list a { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 14px; padding: 16px 18px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.22); color: #fff; text-decoration: none; height: 100%; transition: background .35s var(--ease); overflow: hidden; }
.cgt-next__list a::after { content: ''; position: absolute; inset: 0; background: radial-gradient(300px circle at var(--lx, 50%) var(--ly, 50%), rgba(242,214,75,.16), transparent 60%); opacity: 0; transition: opacity .35s; pointer-events: none; }
.cgt-next__list a:hover { background: rgba(255,255,255,.14); }
.cgt-next__list a:hover::after { opacity: 1; }
.cgt-next__t { font-weight: 700; font-size: 1.08rem; }
.cgt-next__s { grid-column: 1 / -1; font-size: .95rem; color: #FBE3E8; }
.cgt-next__go { grid-column: 2; grid-row: 1; align-self: center; width: 22px; height: 22px; color: var(--highlight); transition: transform .35s var(--ease); }
.cgt-next__list a:hover .cgt-next__go { transform: translateX(4px); }
@media (max-width: 1099px) { .cgt-next__list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) { .cgt-cta__top { grid-template-columns: minmax(0, 1fr); } .cgt-cta__tag { justify-self: start; } }
@media (max-width: 600px) { .cgt-next__list { grid-template-columns: minmax(0, 1fr); } }
.wf__col { transition: opacity .3s; }
.wf__chart.is-focus .wf__col:not(.is-on) { opacity: .35; }
.wf__chart.is-focus .wf__col.is-on .wf__amt { transform: scale(1.12); }
.wf__amt { transition: transform .3s var(--ease); }

/* Ambient highlights that walk through the items */
.plan__c.is-lit { transform: translateY(-8px); box-shadow: 12px 20px 0 rgba(117,21,35,.12); border-bottom-color: var(--highlight); }
.rcard.is-lit { background: rgba(255,255,255,.1); border-top-color: var(--highlight); }
.rcard { transition: background .6s var(--ease), border-color .6s; }
@media (max-width: 600px) {
  .sheet__head { flex-wrap: wrap; gap: 2px 12px; }
  .sheet__asset { text-align: left; }
}

form.days[hidden] { display: none; }
.k-guide { margin-left: auto; font-weight: 600; color: var(--ink); }
/* Very short desktop screens (1366x768, 1280x720): the whole tool on the first screen */
@media (min-width: 1100px) and (max-height: 800px) {
  .cgt-open__head .lede { font-size: .95rem; }
  .sh__r { min-height: 28px; font-size: .9rem; }
  .sheet { padding-top: 10px; padding-bottom: 8px; }
  .sheet__head { padding-bottom: 4px; }
  .sh__r--total { padding-top: 4px; }
  .sh__r--total b { font-size: 1.8rem; }
  .wf__top { padding-bottom: 4px; }
  .wf__v { font-size: 2.1rem; }
  .wf__s { font-size: .9rem; }
  .wf__chart { min-height: 200px; padding-bottom: 40px; }
  .wf__stamp { width: 110px; height: 68px; }
}
@media (min-width: 1100px) and (max-height: 740px) {
  .cgt-open__head .lede { display: none; }
}
