/* P. 08 Cost: a deep red panel where the multiples punch in, a log-scale monthly estimator and a
   "same budget, more pages" tile visual. Never shows competitor prices, only the multiples. */
.cost-mod { position: relative; overflow-x: clip; }
.cost-head { margin-bottom: clamp(36px, 5vw, 64px); }

/* ---------- red panel ---------- */
.cost-panel { position: relative; overflow: hidden; isolation: isolate; border-radius: var(--r-lg); padding: clamp(24px, 4.2vw, 60px) clamp(22px, 4.4vw, 64px) clamp(22px, 3.4vw, 46px); color: #fff; background: radial-gradient(120% 130% at 0% 0%, #D24F31 0%, #B53B20 34%, #8F2C16 70%, #6E2210 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24), inset 0 0 0 1px rgba(255, 255, 255, 0.07), 0 70px 140px -60px rgba(183, 57, 31, 0.6), 0 30px 70px -40px rgba(0, 0, 0, 0.85); transform-origin: 50% 60%; }
.cost-panel::before { content: ""; position: absolute; z-index: -1; inset: 0; background-image: repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 30px); -webkit-mask-image: linear-gradient(105deg, transparent 20%, #000 75%); mask-image: linear-gradient(105deg, transparent 20%, #000 75%); }
.cost-panel::after { content: ""; position: absolute; z-index: -1; inset: 0; background: radial-gradient(420px 320px at var(--mx, 78%) var(--my, 20%), rgba(255, 196, 170, 0.2), transparent 70%); transition: background-position 0.2s; pointer-events: none; }
.cost-panel__light { position: absolute; z-index: -1; top: -30%; bottom: -30%; left: 0; width: 38%; background: linear-gradient(100deg, transparent, rgba(255, 230, 220, 0.16) 45%, rgba(255, 255, 255, 0.24) 50%, rgba(255, 230, 220, 0.16) 55%, transparent); transform: translateX(-120%) skewX(-12deg); pointer-events: none; }
.cost-panel.is-sweep .cost-panel__light { animation: cost-sweep 1.6s var(--ease-io) both; }
@keyframes cost-sweep { to { transform: translateX(330%) skewX(-12deg); } }
.cost-panel.is-bump { animation: cost-bump 0.5s var(--ease-out); }
@keyframes cost-bump { 0% { transform: scale(1); } 30% { transform: scale(1.006); } 100% { transform: scale(1); } }

.cost-panel__top { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.cost-panel__label { font: 500 var(--t-label)/1.2 var(--f-mono); letter-spacing: 0.14em; text-transform: uppercase; color: rgba(255, 255, 255, 0.78); }
.cost-panel__pill { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px; border-radius: 999px; background: rgba(0, 0, 0, 0.16); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18); font: 500 0.78rem/1 var(--f-ui); color: #fff; white-space: nowrap; }
.cost-panel__pill i { width: 6px; height: 6px; border-radius: 50%; background: #fff; box-shadow: 0 0 10px #fff; }

.cost-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: clamp(28px, 4vw, 56px); }
.cost-stat { position: relative; min-width: 0; }
.cost-stat + .cost-stat { padding-left: clamp(24px, 4vw, 56px); border-left: 1px solid rgba(255, 255, 255, 0.2); }
.cost-stat:first-child { padding-right: clamp(24px, 4vw, 56px); }
.cost-stat::before { content: ""; position: absolute; left: 10%; top: 0; width: 60%; height: 80%; background: radial-gradient(closest-side, rgba(255, 236, 228, 0.55), transparent); opacity: 0; pointer-events: none; }
.cost-stat.is-hit::before { animation: cost-flash 0.9s var(--ease-out) both; }
@keyframes cost-flash { 0% { opacity: 0.9; transform: scale(0.6); } 100% { opacity: 0; transform: scale(1.4); } }
.cost-big { display: flex; align-items: baseline; flex-wrap: nowrap; margin: 0; font: 700 clamp(3.5rem, 1.1rem + 6.5vw, 8.6rem)/0.9 var(--f-disp); letter-spacing: -0.055em; white-space: nowrap; transform-origin: 0 80%; }
.cost-big__a { font-variant-numeric: tabular-nums; }
.cost-big__to { font-size: 0.4em; font-weight: 500; letter-spacing: -0.02em; margin: 0 0.3em 0 0.24em; color: rgba(255, 255, 255, 0.74); }
.cost-big__x { display: inline-block; margin-left: 0.02em; color: rgba(255, 255, 255, 0.92); transform-origin: 0 80%; }
.cost-cap { margin: clamp(12px, 1.4vw, 18px) 0 0; font: 500 clamp(1rem, 0.92rem + 0.4vw, 1.3rem)/1.35 var(--f-ui); letter-spacing: -0.01em; color: rgba(255, 255, 255, 0.88); max-width: 34ch; }
.js .cost-panel:not(.is-static) .cost-big { opacity: 0; }
.js .cost-panel:not(.is-static) .cost-big__x, .js .cost-panel:not(.is-static) .cost-cap { opacity: 0; }
.cost-stat.is-hit .cost-big { animation: cost-punch 0.85s cubic-bezier(0.2, 0.9, 0.25, 1) both; }
.cost-stat.is-hit .cost-big__x { animation: cost-pop 0.6s 0.55s cubic-bezier(0.3, 1.6, 0.5, 1) both; }
.cost-stat.is-hit .cost-cap { animation: rise 0.9s 0.45s var(--ease-out) both; }
@keyframes cost-punch { 0% { opacity: 0; transform: scale(1.65); filter: blur(18px); } 45% { opacity: 1; filter: blur(0); } 70% { transform: scale(0.985); } 100% { opacity: 1; transform: scale(1); filter: none; } }
@keyframes cost-pop { 0% { opacity: 0; transform: scale(0.4) translateY(0.1em); } 100% { opacity: 1; transform: none; } }

.cost-line { display: flex; align-items: center; gap: 14px; margin: clamp(32px, 4vw, 52px) 0 0; padding-top: clamp(18px, 2vw, 24px); border-top: 1px solid rgba(255, 255, 255, 0.18); font: 400 clamp(1rem, 0.94rem + 0.3vw, 1.2rem)/1.4 var(--f-ui); color: rgba(255, 255, 255, 0.86); }
.cost-line b { font-weight: 600; color: #fff; }
.cost-nb { white-space: nowrap; }
.cost-line__rule { flex: none; width: 22px; height: 2px; background: #fff; border-radius: 1px; }

/* ---------- cards ---------- */
.cost-tools { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr); gap: clamp(14px, 1.8vw, 22px); margin-top: clamp(14px, 1.8vw, 22px); }
.cost-card { position: relative; min-width: 0; display: flex; flex-direction: column; border-radius: var(--r-lg); padding: clamp(22px, 2.6vw, 36px); background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.018)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), inset 0 0 0 1px var(--line), 0 40px 80px -50px rgba(0, 0, 0, 0.9); }
.cost-card__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 20px; }
.cost-card__title { margin: 0; font: 600 var(--t-h3)/1.2 var(--f-disp); letter-spacing: -0.02em; }
.cost-card__tag { font: 500 var(--t-label)/1 var(--f-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-3); }

/* estimator */
.cost-est__out { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; margin-top: clamp(26px, 3vw, 40px); }
.cost-est__about, .cost-est__per { font: 500 clamp(1rem, 0.9rem + 0.4vw, 1.25rem)/1 var(--f-ui); color: var(--fg-2); }
.cost-est__usd { font: 700 clamp(3.2rem, 1.6rem + 3.8vw, 5.6rem)/0.9 var(--f-disp); letter-spacing: -0.05em; color: #fff; font-variant-numeric: tabular-nums; }
.cost-est__pages { margin-top: clamp(22px, 2.6vw, 34px); }
.cost-est__label { font: 500 0.95rem/1.3 var(--f-ui); color: var(--fg-2); }
.cost-est__count { font: 600 1.15rem/1 var(--f-disp); letter-spacing: -0.01em; color: var(--fg); margin-right: 4px; }
.cost-range { --thumb: 28px; --p: 0.5; position: relative; height: 44px; margin: 10px 0 52px; }
.cost-range__track { position: absolute; left: calc(var(--thumb) / 2); right: calc(var(--thumb) / 2); top: 50%; height: 6px; margin-top: -3px; border-radius: 3px; background: rgba(255, 255, 255, 0.1); pointer-events: none; }
.cost-range__fill { position: absolute; left: 0; top: 0; bottom: 0; width: calc(var(--p) * 100%); border-radius: 3px; background: linear-gradient(90deg, var(--red), var(--red-lift)); box-shadow: 0 0 18px rgba(226, 85, 60, 0.45); }
.cost-range__minor { position: absolute; inset: 0; }
.cost-range__minor i { position: absolute; top: 50%; width: 1px; height: 4px; margin-top: 5px; background: rgba(255, 255, 255, 0.22); }
.cost-range__minor i.is-major { height: 9px; margin-top: 5px; background: rgba(255, 255, 255, 0.45); }
.cost-range__input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer; touch-action: pan-y; }
.cost-range__input:focus { outline: none; }
.cost-range__input::-webkit-slider-runnable-track { height: 44px; background: transparent; border: 0; }
.cost-range__input::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: var(--thumb); height: var(--thumb); margin-top: 8px; border: 0; border-radius: 50%; background: radial-gradient(circle at 50% 50%, var(--red-lift) 0 4px, #fff 4.5px); box-shadow: 0 0 0 6px rgba(226, 85, 60, 0.22), 0 6px 18px rgba(0, 0, 0, 0.55); transition: box-shadow 0.3s, transform 0.3s var(--ease-out); }
.cost-range__input:active::-webkit-slider-thumb { transform: scale(1.1); box-shadow: 0 0 0 10px rgba(226, 85, 60, 0.2), 0 6px 18px rgba(0, 0, 0, 0.55); }
.cost-range__input:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--ink), 0 0 0 5px var(--red-lift), 0 6px 18px rgba(0, 0, 0, 0.55); }
.cost-range__input::-moz-range-track { height: 44px; background: transparent; border: 0; }
.cost-range__input::-moz-range-thumb { width: var(--thumb); height: var(--thumb); border: 0; border-radius: 50%; background: radial-gradient(circle at 50% 50%, var(--red-lift) 0 4px, #fff 4.5px); box-shadow: 0 0 0 6px rgba(226, 85, 60, 0.22), 0 6px 18px rgba(0, 0, 0, 0.55); }
.cost-range__input:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 3px var(--ink), 0 0 0 5px var(--red-lift); }
.cost-range__ticks { position: absolute; top: 100%; left: calc(var(--thumb) / 2); right: calc(var(--thumb) / 2); height: 48px; }
.cost-tick { position: absolute; top: 0; left: calc(var(--x) * 100%); transform: translateX(-50%); min-width: 48px; height: 48px; padding: 4px 6px 0; border-radius: 8px; display: flex; flex-direction: column; align-items: center; gap: 5px; font: 500 0.75rem/1 var(--f-mono); letter-spacing: 0.04em; color: var(--fg-3); text-align: center; transition: color 0.3s; }
.cost-tick small { font: 500 0.75rem/1 var(--f-mono); color: var(--fg-3); opacity: 0.75; letter-spacing: 0; }
.cost-tick.is-near small { color: var(--red-lift); opacity: 1; }
.cost-tick:hover, .cost-tick.is-near { color: var(--fg); }
.cost-tick:first-child { transform: translateX(-30%); align-items: flex-start; }
.cost-tick:last-child { transform: translateX(-70%); align-items: flex-end; }
.cost-est__math { margin: 0; padding: 12px 14px; border-radius: 10px; background: rgba(255, 255, 255, 0.03); box-shadow: inset 0 0 0 1px var(--line); font: 500 0.8rem/1.4 var(--f-mono); color: var(--fg-2); overflow-wrap: anywhere; }
.cost-est__math b { color: var(--fg); font-weight: 600; }
.cost-est__fine { margin: auto 0 0; padding-top: 16px; }

/* same budget */
.cost-bud__head { flex-direction: column; align-items: flex-start; }
.cost-seg { position: relative; display: inline-grid; grid-auto-flow: column; padding: 4px; border-radius: 999px; background: rgba(255, 255, 255, 0.045); box-shadow: inset 0 0 0 1px var(--line); max-width: 100%; }
.cost-seg__btn { position: relative; z-index: 1; min-height: 40px; padding: 0 16px; border-radius: 999px; font: 500 0.86rem/1.2 var(--f-ui); color: var(--fg-2); white-space: nowrap; transition: color 0.3s; }
.cost-seg__btn:hover { color: var(--fg); }
.cost-seg__btn[aria-pressed="true"] { color: #fff; }
.cost-seg__pill { position: absolute; top: 4px; bottom: 4px; left: var(--pl, 4px); width: var(--pw, 0); border-radius: 999px; background: linear-gradient(180deg, rgba(226, 85, 60, 0.32), rgba(183, 57, 31, 0.26)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), inset 0 0 0 1px rgba(226, 85, 60, 0.45), 0 8px 20px -10px rgba(226, 85, 60, 0.6); transition: left 0.55s var(--ease-out), width 0.55s var(--ease-out); }

.cost-lanes { --tw: 34px; --tg: 8px; display: grid; gap: 22px; margin-top: clamp(22px, 2.6vw, 32px); }
.cost-lanes.is-parse { --tw: 17px; --tg: 5px; }
.cost-lane__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 12px; }
.cost-lane__name { font: 500 var(--t-label)/1.2 var(--f-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-3); }
.cost-lane__name--us { color: var(--red-lift); }
.cost-lane__val { font: 500 0.95rem/1 var(--f-ui); color: var(--fg-2); white-space: nowrap; }
.cost-lane__val b { font: 700 1.3rem/1 var(--f-disp); letter-spacing: -0.02em; color: var(--fg); }
.cost-lane--us .cost-lane__val b { color: #fff; }
.cost-tiles { display: flex; flex-wrap: wrap; align-content: flex-start; gap: var(--tg); min-height: calc(var(--tw) * 1.3); }
.cost-tile { --c: rgba(255, 255, 255, 0.16); position: relative; flex: none; width: var(--tw); height: calc(var(--tw) * 1.3); border-radius: max(2px, calc(var(--tw) * 0.09)); box-shadow: inset 0 0 0 1px var(--line-2); background: linear-gradient(var(--c), var(--c)) 24% 28% / 52% max(1px, calc(var(--tw) * 0.05)) no-repeat, linear-gradient(var(--c), var(--c)) 24% 46% / 38% max(1px, calc(var(--tw) * 0.05)) no-repeat, linear-gradient(var(--c), var(--c)) 24% 64% / 46% max(1px, calc(var(--tw) * 0.05)) no-repeat; opacity: 0; transform: translateY(6px) scale(0.7); transition: opacity 0.5s var(--ease-out), transform 0.7s var(--ease-out), background-color 0.5s, box-shadow 0.5s; transition-delay: calc(var(--dl, 0) * 1ms); }
.cost-tiles.is-lit .cost-tile { opacity: 1; transform: none; }
.cost-tile--solid { --c: rgba(255, 255, 255, 0.8); background-color: var(--red-lift); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 0 14px -2px rgba(226, 85, 60, 0.55); }
.cost-tile--band { --c: rgba(255, 210, 196, 0.6); box-shadow: inset 0 0 0 1px rgba(226, 85, 60, 0.75); background-color: transparent; }
.cost-tile--band::before { content: ""; position: absolute; inset: 1px; border-radius: inherit; background: repeating-linear-gradient(45deg, rgba(226, 85, 60, 0.38) 0 1.5px, transparent 1.5px 4px); z-index: -1; }
.cost-tile--band { isolation: isolate; }
.cost-tile--band::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: rgba(255, 140, 110, 0.35); opacity: 0; }
.cost-mod.is-live .cost-tiles.is-lit .cost-tile--band::after { animation: cost-shimmer 2.8s ease-in-out infinite; animation-delay: calc(var(--wv, 0) * 1ms + 1200ms); }
@keyframes cost-shimmer { 0%, 100% { opacity: 0; } 18% { opacity: 1; } 40% { opacity: 0; } }
.cost-tile--them { --c: rgba(11, 13, 16, 0.55); background-color: #C9CCD2; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 0 14px -4px rgba(255, 255, 255, 0.3); }
.cost-more { flex: none; display: flex; align-items: center; width: 0; margin-left: calc(-1 * var(--tg)); height: calc(var(--tw) * 1.3); overflow: visible; white-space: nowrap; font: 600 1rem/1 var(--f-mono); color: var(--red-lift); opacity: 0; transition: opacity 0.5s var(--ease-out); transition-delay: calc(var(--dl, 0) * 1ms); }
.cost-more span { padding-left: 7px; }
.cost-tiles.is-lit .cost-more { opacity: 1; }

.cost-legend { display: flex; flex-wrap: wrap; gap: 10px 20px; margin-top: 22px; font: 500 0.8rem/1.2 var(--f-ui); color: var(--fg-2); }
.cost-legend > span { display: inline-flex; align-items: center; gap: 8px; }
.cost-key { width: 12px; height: 15px; border-radius: 2px; flex: none; }
.cost-key--solid { background: var(--red-lift); }
.cost-key--band { box-shadow: inset 0 0 0 1px rgba(226, 85, 60, 0.75); background: repeating-linear-gradient(45deg, rgba(226, 85, 60, 0.45) 0 1.5px, transparent 1.5px 4px); }
.cost-key--them { background: #C9CCD2; }
.cost-bud__fine { margin: auto 0 0; padding-top: 16px; }

@media (max-width: 900px) {
  .cost-tools { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .cost-stats { grid-template-columns: minmax(0, 1fr); }
  .cost-stat + .cost-stat { padding-left: 0; border-left: 0; margin-top: 28px; padding-top: 26px; border-top: 1px solid rgba(255, 255, 255, 0.2); }
  .cost-stat:first-child { padding-right: 0; }
  .cost-panel__top { flex-wrap: wrap; }
  .cost-seg { display: grid; grid-template-columns: 1fr 1fr; grid-auto-flow: row; width: 100%; border-radius: 16px; }
  .cost-seg__btn { white-space: normal; padding: 8px 10px; min-height: 48px; border-radius: 12px; }
  .cost-seg__pill { border-radius: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .cost-tile, .cost-more { transition: none; }
  .cost-mod.is-live .cost-tiles.is-lit .cost-tile--band::after { animation: none; }
}
.cost-tiles:not(.is-lit) .cost-tile, .cost-tiles:not(.is-lit) .cost-more { transition-delay: 0s; transition-duration: 0.25s; }
