/* /calculator/ — free tools page. Uses the v3 tokens from main.css; every class is prefixed cx- to stay clear of main.css. */
.page-calc {
  --cx-prod: #5b6b8c; --cx-ship: #9aa6bd; --cx-fees: var(--word-profit); --cx-ads: #f3b06b; --cx-keep: #1f8a4c; --cx-loss: var(--bad);
  --cx-field: var(--surface); --cx-h: 46px;
}
:root[data-theme="dark"] .page-calc { --cx-prod: #7d8db0; --cx-ship: #4d5870; --cx-ads: #b86a2a; --cx-keep: #4fd08a; --cx-field: #14161b; }
.page-calc .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- hero + tabs ---------- */
.cx-hero { padding: clamp(44px, 6.5vw, 88px) 0 clamp(22px, 3vw, 34px); text-align: center; background: radial-gradient(50% 80% at 50% 0%, rgba(var(--glow), 0.15), transparent 70%); }
.cx-hero .wrap { display: grid; justify-items: center; gap: 14px; }
.cx-hero .eyebrow { margin: 0; }
.cx-hero .display { margin: 0; font-size: clamp(2.3rem, 5.4vw, 4.4rem); font-weight: 800; letter-spacing: -0.045em; line-height: 1.03; max-width: 15ch; }
.cx-hero .lead { margin: 0; max-width: 58ch; }
.cx-tabs { margin-top: 12px; display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--mist); box-shadow: inset 0 0 0 1px var(--line); max-width: 100%; }
.cx-tabs button { min-height: 44px; padding: 0 20px; border-radius: 999px; font-weight: 600; font-size: 0.96rem; color: var(--ink-2); white-space: nowrap; transition: background-color 0.2s, color 0.2s, box-shadow 0.2s; }
.cx-tabs button:hover { color: var(--ink); }
.cx-tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(var(--shade), 0.08), 0 0 0 1px var(--line); }
.cx-tabs button:focus-visible, .page-calc :is(button, input, select, textarea, summary, a, .cx-table):focus-visible { outline: 2px solid var(--word-profit); outline-offset: 2px; }

/* ---------- app window ---------- */
.cx-tools { padding-bottom: clamp(56px, 7vw, 96px); }
.cx-panel { outline: none; }
.cx-panel[hidden] { display: none; }
.cx-panel:not([hidden]) { animation: cx-in 0.4s var(--ease); }
@keyframes cx-in { from { opacity: 0; transform: translateY(8px); } }
.cx-app { border-radius: var(--r-lg); background: var(--surface); box-shadow: 0 0 0 1px var(--line), var(--shadow-frame); overflow: hidden; }
.cx-app .mkt-bar .mini-chip { margin-left: auto; }
.cx-calc { display: grid; grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr); }
.cx-form { margin: 0; padding: clamp(16px, 2.4vw, 28px); display: grid; gap: 16px; align-content: start; border-right: 1px solid var(--line); background: var(--bar); }
.cx-result { padding: clamp(16px, 2.4vw, 28px); display: grid; gap: 18px; align-content: start; min-width: 0; }

/* ---------- fields ---------- */
.cx-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
.cx-field { display: grid; gap: 6px; min-width: 0; margin: 0; padding: 0; border: 0; }
.cx-field > label, .cx-field > legend { padding: 0; font-size: 0.84rem; font-weight: 600; color: var(--ink-2); line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cx-field > legend { margin-bottom: 6px; }
.cx-field small { font-size: 0.76rem; line-height: 1.35; color: var(--ink-3); }
.cx-segf small { margin-top: 6px; display: block; }
.cx-inp { display: flex; align-items: center; min-width: 0; height: var(--cx-h); border-radius: 12px; background: var(--cx-field); box-shadow: inset 0 0 0 1px var(--line-strong); transition: box-shadow 0.18s; }
.cx-inp:focus-within { box-shadow: inset 0 0 0 1.5px var(--ink), 0 0 0 4px rgba(var(--glow), 0.18); }
.cx-inp input, .cx-inp select, .cx-inp textarea { flex: 1; min-width: 0; width: 100%; height: 100%; padding: 0 12px; border: 0; background: transparent; color: var(--ink); font: inherit; font-size: 1rem; outline: none; }
.cx-inp input[type="number"] { font-family: var(--mono); font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.cx-inp input::-webkit-outer-spin-button, .cx-inp input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cx-inp input:focus-visible, .cx-inp select:focus-visible, .cx-inp textarea:focus-visible { outline: none; }
.cx-affix { flex: none; padding-left: 12px; color: var(--ink-3); font-family: var(--mono); font-size: 0.95rem; }
.cx-affix + input { padding-left: 6px; }
.cx-affix.r { padding: 0 12px 0 0; }
.cx-sel { position: relative; }
.cx-sel select { appearance: none; -webkit-appearance: none; padding-right: 36px; cursor: pointer; }
.cx-sel::after { content: ""; position: absolute; right: 14px; top: 50%; width: 8px; height: 8px; margin-top: -6px; border: solid var(--ink-3); border-width: 0 2px 2px 0; transform: rotate(45deg); pointer-events: none; }
.cx-sel option { background: var(--surface); color: var(--ink); }
.cx-step input { text-align: center; padding: 0 4px; }
.cx-step button { flex: none; width: 40px; height: 100%; font-size: 1.2rem; color: var(--ink-2); border-radius: 12px; transition: background-color 0.15s; }
.cx-step button:hover { background: var(--mist); color: var(--ink); }
.cx-area { height: auto; }
.cx-area textarea { padding: 11px 12px; resize: vertical; line-height: 1.45; min-height: var(--cx-h); }

/* segmented control: real radios, equal columns, never wider than its box */
.cx-seg { position: relative; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; padding: 4px; border-radius: 12px; background: var(--mist); box-shadow: inset 0 0 0 1px var(--line); }
.cx-seg label { position: relative; min-width: 0; cursor: pointer; }
.cx-seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.cx-seg span { display: flex; align-items: center; justify-content: center; height: 38px; padding: 0 6px; border-radius: 9px; font-weight: 600; font-size: 0.92rem; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: background-color 0.2s, color 0.2s, box-shadow 0.2s; }
.cx-seg label:hover span { color: var(--ink); }
.cx-seg input:checked + span { background: var(--ink); color: var(--on-ink); box-shadow: 0 1px 3px rgba(var(--shade), 0.2); }
.cx-seg input:focus-visible + span { outline: 2px solid var(--word-profit); outline-offset: 2px; }
#g-sep span { font-family: var(--mono); font-size: 0.82rem; }

/* switches */
.cx-opts { display: grid; gap: 4px; padding-top: 6px; border-top: 1px solid var(--line); }
.cx-switch { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px; min-height: 48px; cursor: pointer; position: relative; }
.cx-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.cx-knob { position: relative; width: 40px; height: 24px; border-radius: 999px; background: var(--line-strong); transition: background-color 0.2s; }
.cx-knob::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25); transition: transform 0.25s var(--ease); }
.cx-switch input:checked + .cx-knob { background: var(--word-profit); }
.cx-switch input:checked + .cx-knob::after { transform: translateX(16px); }
.cx-switch input:focus-visible + .cx-knob { outline: 2px solid var(--word-profit); outline-offset: 2px; }
.cx-sw-t { display: grid; font-size: 0.92rem; font-weight: 600; color: var(--ink); line-height: 1.3; }
.cx-sw-t small { font-weight: 400; font-size: 0.78rem; color: var(--ink-3); }

/* ---------- result ---------- */
.cx-k { margin: 0; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-3); }
.cx-hero-num { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 20px; border-radius: var(--r-md); background: linear-gradient(135deg, rgba(var(--glow), 0.12), rgba(var(--glow), 0.03)); box-shadow: inset 0 0 0 1px rgba(var(--glow), 0.28); }
.cx-hero-num > div { min-width: 0; }
.cx-big { margin: 2px 0 0; font-size: clamp(2.8rem, 5.4vw, 4rem); font-weight: 800; letter-spacing: -0.045em; line-height: 1.05; color: var(--cx-keep); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cx-big.neg { color: var(--cx-loss); }
.cx-sub { margin: 4px 0 0; font-size: 0.86rem; color: var(--ink-2); }
.cx-ring { flex: none; width: 96px; height: 96px; transform: rotate(-90deg); }
.cx-ring circle { fill: none; stroke-width: 5.5; }
.cx-ring .bg { stroke: rgba(var(--shade), 0.08); }
:root[data-theme="dark"] .cx-ring .bg { stroke: rgba(255, 255, 255, 0.08); }
.cx-ring .fg { stroke: var(--cx-keep); stroke-linecap: round; transition: stroke-dasharray 0.7s var(--ease), stroke 0.3s; }
.cx-ring.neg .fg { stroke: var(--cx-loss); }
.cx-ring text { transform: rotate(90deg); transform-origin: 22px 22px; text-anchor: middle; font-family: var(--font); font-size: 8px; font-weight: 700; letter-spacing: -0.03em; fill: var(--ink); }
.cx-ring text.l { font-family: var(--font); font-size: 5px; font-weight: 500; fill: var(--ink-3); }

.cx-tiles { margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.cx-tiles div { display: flex; flex-direction: column-reverse; gap: 2px; padding: 12px 14px; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); min-width: 0; }
.cx-tiles dt { font-size: 0.76rem; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cx-tiles dd { margin: 0; font-size: 1.3rem; font-weight: 700; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; white-space: nowrap; }

.cx-where { display: grid; gap: 10px; }
.cx-stack { position: relative; display: flex; height: 34px; border-radius: 10px; overflow: hidden; background: var(--mist); }
.cx-stack i { display: block; height: 100%; min-width: 0; flex: none; transition: width 0.6s var(--ease); box-shadow: inset -2px 0 0 var(--surface); }
.cx-stack i:last-of-type { box-shadow: none; }
.cx-stack .mark { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink); transition: left 0.6s var(--ease); }
.cx-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.cx-legend li { display: flex; align-items: center; gap: 7px; font-size: 0.84rem; color: var(--ink-2); min-width: 0; }
.cx-legend li i { flex: none; width: 10px; height: 10px; border-radius: 3px; }
.cx-legend li span { white-space: nowrap; }
.cx-legend li b { white-space: nowrap; font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; font-size: 0.8rem; }
.cx-legend li em { font-style: normal; color: var(--ink-3); font-weight: 400; margin-left: 4px; }

.cx-break { border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); }
.cx-break summary { display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding: 0 14px; cursor: pointer; list-style: none; font-weight: 600; font-size: 0.9rem; }
.cx-break summary::-webkit-details-marker { display: none; }
.cx-break summary::after { content: ""; width: 7px; height: 7px; border: solid var(--ink-3); border-width: 0 2px 2px 0; transform: rotate(45deg); margin-top: -4px; transition: transform 0.25s var(--ease); }
.cx-break[open] summary::after { transform: rotate(-135deg); margin-top: 3px; }
.cx-break dl { margin: 0; padding: 0 14px 8px; }
.cx-break dl div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 0.88rem; }
.cx-break dt { color: var(--ink-2); min-width: 0; display: flex; align-items: center; gap: 8px; }
.cx-break dt i { flex: none; width: 8px; height: 8px; border-radius: 50%; }
.cx-break dt small { color: var(--ink-3); font-size: 0.76rem; }
.cx-break dd { margin: 0; font-family: var(--mono); font-variant-numeric: tabular-nums; color: var(--ink); white-space: nowrap; }
.cx-break .out dd { color: var(--ink-2); }
.cx-break .rev dt, .cx-break .rev dd { color: var(--ink); font-weight: 600; }
.cx-break .info dd { text-decoration: line-through; color: var(--ink-3); }
.cx-break .total { border-top: 1.5px solid var(--ink); }
.cx-break .total dt, .cx-break .total dd { font-weight: 700; color: var(--ink); font-size: 0.96rem; }
.cx-break .total dd { color: var(--cx-keep); }
.cx-break .total.neg dd { color: var(--cx-loss); }

.cx-line { margin: 0; padding: 10px 14px; border-radius: 12px; background: var(--bar); font-size: 0.88rem; color: var(--ink-2); }
.cx-line b { color: var(--ink); font-variant-numeric: tabular-nums; }

.cx-export { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.cx-export button, .cx-mini { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 6px 10px; border-radius: 12px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-strong); font-weight: 600; font-size: 0.88rem; color: var(--ink); transition: box-shadow 0.18s, transform 0.18s, background-color 0.18s; min-width: 0; }
.cx-export button:hover, .cx-mini:hover { box-shadow: inset 0 0 0 1.5px var(--ink); background: var(--bar); }
.cx-export button:active, .cx-mini:active { transform: scale(0.97); }
.cx-export button.done, .cx-mini.done { box-shadow: inset 0 0 0 1.5px var(--cx-keep); }
.cx-ficon { flex: none; width: 26px; height: 33px; color: var(--ink-3); overflow: visible; }
.cx-ficon .pg { fill: var(--surface); stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; }
.cx-ficon .fold { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; }
.cx-ficon text { font-family: var(--font); font-size: 7.4px; font-weight: 800; letter-spacing: 0.02em; fill: #fff; }
.cx-note { margin: 14px 4px 0; font-size: 0.82rem; color: var(--ink-3); text-align: center; }
.cx-note a { color: var(--ink-2); text-decoration: underline; text-underline-offset: 2px; }

/* ---------- SKU generator ---------- */
.cx-skugrid { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); }
.cx-skuhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cx-skuact { display: flex; gap: 8px; }
.cx-mini { min-height: 42px; padding: 4px 14px 4px 10px; }
.cx-mini svg:not(.cx-ficon) { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cx-mini .cx-ficon { width: 20px; height: 26px; }
.cx-warn { margin: 0; padding: 10px 14px; border-radius: 12px; background: rgba(201, 47, 53, 0.08); box-shadow: inset 0 0 0 1px rgba(201, 47, 53, 0.3); color: var(--bad); font-size: 0.86rem; }
.cx-warn[hidden] { display: none; }
.cx-table { max-height: 420px; overflow: auto; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); }
.cx-table table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.cx-table th { position: sticky; top: 0; z-index: 1; text-align: left; font-size: 0.72rem; font-weight: 600; color: var(--ink-3); padding: 9px 12px; background: var(--bar); border-bottom: 1px solid var(--line); white-space: nowrap; }
.cx-table td { padding: 8px 12px; border-bottom: 1px solid var(--line); color: var(--ink-2); white-space: nowrap; }
.cx-table tr:last-child td { border-bottom: 0; }
.cx-table td.s { font-family: var(--mono); font-weight: 600; color: var(--ink); }
.cx-table .n { width: 1%; color: var(--ink-3); font-family: var(--mono); font-size: 0.78rem; }
.cx-table tr.dup td { background: rgba(201, 47, 53, 0.07); }
.cx-table tr.dup td.s { color: var(--bad); }
.cx-table tr.new td { animation: cx-flash 0.8s ease-out; }
@keyframes cx-flash { from { background: rgba(var(--glow), 0.16); } }
.cx-table .empty { padding: 24px 12px; text-align: center; color: var(--ink-3); white-space: normal; }
.cx-tip { padding: 12px 14px; border-radius: 12px; background: rgba(var(--glow), 0.08); border-left: 3px solid var(--word-profit); font-size: 0.86rem; color: var(--ink-2); line-height: 1.5; }
.cx-tip b { color: var(--ink); }

/* ---------- FAQ ---------- */
.cx-h2 { margin: 0; font-size: clamp(1.8rem, 3.4vw, 2.6rem); line-height: 1.08; letter-spacing: -0.035em; font-weight: 700; text-wrap: balance; }
.cx-faq { padding: clamp(56px, 7vw, 100px) 0; border-top: 1px solid var(--line); }
.cx-faq-in { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.4fr); gap: clamp(24px, 4vw, 64px); align-items: start; }
.cx-qa { display: grid; }
.cx-qa details { border-bottom: 1px solid var(--line); }
.cx-qa details:first-child { border-top: 1px solid var(--line); }
.cx-qa summary { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 60px; padding: 14px 0; cursor: pointer; list-style: none; font-size: 1.06rem; font-weight: 600; }
.cx-qa summary::-webkit-details-marker { display: none; }
.cx-qa summary::after { content: "+"; flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--mist); color: var(--ink-2); font-weight: 500; transition: transform 0.25s var(--ease); }
.cx-qa details[open] summary::after { transform: rotate(45deg); }
.cx-qa p { margin: 0 0 18px; max-width: 64ch; color: var(--ink-2); line-height: 1.6; }

/* ---------- CTA ---------- */
.cx-cta { padding: 0 0 clamp(56px, 7vw, 100px); }
.cx-cta-in { display: grid; grid-template-columns: minmax(0, 1.4fr) auto; align-items: center; gap: 28px 48px; padding: clamp(28px, 5vw, 60px); border-radius: var(--r-lg); background: radial-gradient(60% 120% at 100% 0%, rgba(var(--glow), 0.32), transparent 60%), var(--night); color: var(--snow); box-shadow: var(--shadow-frame); }
.cx-cta-in .cx-h2 { color: #fff; }
.cx-cta-in p { margin: 12px 0 0; max-width: 56ch; color: var(--snow-2); line-height: 1.55; }
.cx-cta-act { display: grid; justify-items: center; gap: 12px; }
.cx-cta-alt { color: var(--snow-2); font-size: 0.92rem; text-decoration: underline; text-underline-offset: 3px; }
.cx-cta-alt:hover { color: #fff; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .cx-calc, .cx-skugrid { grid-template-columns: minmax(0, 1fr); }
  .cx-form { border-right: 0; border-bottom: 1px solid var(--line); }
  .cx-faq-in, .cx-cta-in { grid-template-columns: minmax(0, 1fr); }
  .cx-cta-act { justify-items: start; }
}
@media (max-width: 520px) {
  .cx-tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .cx-tabs button { padding: 0 10px; font-size: 0.9rem; }
  .cx-hero-num { padding: 16px; }
  .cx-ring { width: 76px; height: 76px; }
  .cx-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .cx-tiles div { padding: 10px; }
  .cx-tiles dd { font-size: 1rem; }
  .cx-export { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cx-app .mkt-bar .mini-chip { display: none; }
  .cx-cta-act, .cx-cta-act .btn { width: 100%; }
}
@media (max-width: 380px) {
  .cx-row { gap: 8px; }
  .cx-field > label { font-size: 0.8rem; }
}

@media (prefers-reduced-motion: reduce) {
  .page-calc *, .page-calc *::before, .page-calc *::after { animation: none !important; transition: none !important; }
}

/* ---------- print: only the clean result card ---------- */
.cx-printcard { display: none; }
@media print {
  body.cx-printing > *:not(main) { display: none !important; }
  body.cx-printing main { padding: 0 !important; }
  body.cx-printing main > *:not(.cx-printcard) { display: none !important; }
  body.cx-printing .cx-printcard { display: block; color: #15171c; background: #fff; font-family: var(--font); -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  @page { margin: 14mm; }
}
.cx-printcard h1 { margin: 0 0 4px; font-size: 22pt; letter-spacing: -0.02em; }
.cx-printcard h1 span { color: #e0670a; }
.cx-printcard .pc-sub { margin: 0 0 18pt; color: #636a76; font-size: 10pt; }
.cx-printcard .pc-big { margin: 0; font-size: 34pt; font-weight: 700; font-family: var(--mono); color: #1f8a4c; }
.cx-printcard .pc-big.neg { color: #c92f35; }
.cx-printcard .pc-m { margin: 0 0 14pt; color: #454a55; font-size: 11pt; }
.cx-printcard .pc-bar { display: flex; height: 14pt; border-radius: 4pt; overflow: hidden; margin-bottom: 16pt; background: #eef0f5; }
.cx-printcard table { width: 100%; border-collapse: collapse; font-size: 10.5pt; }
.cx-printcard td { padding: 5pt 0; border-bottom: 0.5pt solid #e2e5ea; }
.cx-printcard td + td { text-align: right; font-family: var(--mono); }
.cx-printcard tr.t td { font-weight: 700; border-top: 1.2pt solid #15171c; border-bottom: 0; }
.cx-printcard .pc-in td { color: #454a55; }
.cx-printcard h2 { margin: 16pt 0 6pt; font-size: 11pt; text-transform: uppercase; letter-spacing: 0.05em; color: #636a76; }
.cx-printcard .pc-foot { margin-top: 18pt; font-size: 8.5pt; color: #636a76; }

/* ---------- v3.21: focus, ads, what-if ---------- */
.page-calc .cx-inp :is(input, select, textarea):focus-visible { outline: none; }
.cx-inp:focus-within { box-shadow: inset 0 0 0 1.5px var(--word-profit), 0 0 0 4px rgba(var(--glow), 0.16); }
.cx-inp input::selection { background: rgba(var(--glow), 0.3); color: var(--ink); }
.cx-ads { display: grid; gap: 8px; padding: 12px 14px; border-radius: 14px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.cx-adrow { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); align-items: center; gap: 12px; }
.cx-adl { font-size: 0.86rem; font-weight: 600; color: var(--ink-2); }
.cx-ads small { font-size: 0.74rem; line-height: 1.35; color: var(--ink-3); margin-top: -2px; }
.cx-seg-s { padding: 3px; border-radius: 10px; }
.cx-seg-s span { height: 30px; font-size: 0.84rem; border-radius: 7px; }
.cx-unit { height: 40px; padding-right: 3px; }
.cx-unit input { font-family: var(--mono); }
.cx-unit .cx-seg-s { flex: none; width: 84px; box-shadow: none; }
.cx-unit .cx-seg-s span { height: 28px; font-family: var(--mono); }
.cx-wi { display: grid; gap: 12px; padding: 16px; border-radius: 16px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line), 0 0 0 4px rgba(var(--glow), 0.06); }
.cx-wi-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.cx-wi-head p { margin: 0; display: grid; gap: 2px; }
.cx-wi-head b { font-size: 1.05rem; letter-spacing: -0.01em; }
.cx-wi-head span { font-size: 0.78rem; color: var(--ink-3); }
.cx-sl { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; row-gap: 4px; }
.cx-sl label { font-size: 0.84rem; font-weight: 600; color: var(--ink-2); }
.cx-sl output, .cx-wi-t output { font-family: var(--mono); font-size: 0.84rem; font-weight: 600; color: var(--ink); }
.cx-sl input, .cx-wi-t input { grid-column: 1 / -1; width: 100%; accent-color: var(--word-profit); height: 22px; cursor: pointer; }
.cx-wi-out { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 4px 10px; padding: 12px; border-radius: 12px; background: var(--mist); }
.cx-wi-out > div { display: grid; gap: 1px; }
.cx-wi-out span { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; color: var(--ink-3); }
.cx-wi-out b { font-family: var(--mono); font-size: 1.25rem; letter-spacing: -0.02em; }
.cx-wi-out b.neg { color: var(--bad); }
.cx-wi-out em { font-style: normal; font-family: var(--mono); font-size: 0.8rem; color: var(--ink-3); }
.cx-wi-out .arrow { color: var(--ink-3); font-size: 1.1rem; }
.cx-wi-out .d { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: baseline; padding-top: 8px; border-top: 1px solid var(--line); }
.cx-wi-out .d b { font-size: 1rem; }
.cx-wi-out .d b.up { color: var(--cx-keep, #1f8a4c); }
.cx-wi-out .d b.down { color: var(--bad); }
.cx-wi-t { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 6px 12px; padding-top: 10px; border-top: 1px dashed var(--line-strong); }
.cx-wi-t label { grid-column: 1 / -1; display: flex; justify-content: space-between; font-size: 0.84rem; font-weight: 600; color: var(--ink-2); }
.cx-wi-t p { margin: 0; font-size: 0.88rem; line-height: 1.4; color: var(--ink-2); }
.cx-wi-t p b { font-family: var(--mono); color: var(--ink); }
.cx-wi-t .cx-mini:disabled { opacity: 0.45; cursor: default; }

/* ---------- v3.21: what-if take 2 ---------- */
.cx-sls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 18px; }
.cx-wi.on { box-shadow: inset 0 0 0 1.5px var(--word-profit), 0 0 0 4px rgba(var(--glow), 0.12); }
.cx-r { -webkit-appearance: none; appearance: none; background: transparent; height: 22px; margin: 0; --a: 0%; --b: 0%; }
.cx-r::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--line-strong) var(--a), var(--word-profit) var(--a), var(--word-profit) var(--b), var(--line-strong) var(--b)); }
.cx-r::-moz-range-track { height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--line-strong) var(--a), var(--word-profit) var(--a), var(--word-profit) var(--b), var(--line-strong) var(--b)); }
.cx-r::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -7px; border-radius: 50%; background: #fff; border: 2px solid var(--word-profit); box-shadow: 0 1px 4px rgba(var(--shade), 0.25); transition: transform 0.15s; }
.cx-r::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 2px solid var(--word-profit); box-shadow: 0 1px 4px rgba(var(--shade), 0.25); }
.cx-r:active::-webkit-slider-thumb { transform: scale(1.15); }
.cx-r:focus-visible { outline: 2px solid var(--word-profit); outline-offset: 3px; border-radius: 6px; }
.cx-vs { margin: 6px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; font-size: 0.86rem; color: var(--ink-2); }
.cx-vs[hidden] { display: none; }
.cx-vs .tag { padding: 2px 8px; border-radius: 999px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; color: #fff; background: var(--word-profit); }
.cx-vs #cx-vs-t { font-family: var(--mono); font-size: 0.82rem; }
.cx-vs b { font-family: var(--mono); }
.cx-vs b.up { color: var(--cx-keep, #1f8a4c); }
.cx-vs b.down { color: var(--bad); }
@media (max-width: 560px) { .cx-sls { grid-template-columns: minmax(0, 1fr); } }

/* ---------- v3.22: compact extras + what-if ---------- */
.cx-form { gap: 14px; }
.cx-field > label { overflow: visible; display: flex; align-items: center; gap: 6px; }
.cx-q { position: relative; flex: none; display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 50%; font-size: 0.68rem; font-weight: 700; color: var(--ink-3); background: var(--mist); box-shadow: inset 0 0 0 1px var(--line-strong); cursor: help; }
.cx-tip { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 6px); padding: 10px 12px; border-radius: 10px; background: var(--ink); color: var(--on-ink, #fff); font-size: 0.78rem; font-weight: 450; line-height: 1.4; white-space: normal; text-transform: none; letter-spacing: 0; box-shadow: var(--shadow-card); opacity: 0; visibility: hidden; transform: translateY(-4px); transition: opacity 0.15s, transform 0.15s, visibility 0.15s; pointer-events: none; }
.cx-field, .cx-ex { position: relative; }
.cx-q:hover + .cx-tip, .cx-q:focus-visible + .cx-tip { opacity: 1; visibility: visible; transform: none; }
.cx-extras { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 14px; padding: 12px 14px; border-radius: 14px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.cx-ex { display: grid; gap: 6px; align-content: start; min-width: 0; }
.cx-ex .cx-adl { display: flex; align-items: center; gap: 6px; font-size: 0.84rem; font-weight: 600; color: var(--ink-2); }
.cx-ex .cx-seg-s span { height: 32px; }
.cx-ex .cx-unit { height: 40px; }
.cx-tog { grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 10px; padding-top: 10px; border-top: 1px solid var(--line); cursor: pointer; font-size: 0.86rem; font-weight: 600; color: var(--ink); }
.cx-tog input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.cx-tog input:checked + .cx-knob { background: var(--word-profit); }
.cx-tog input:checked + .cx-knob::after { transform: translateX(16px); }
.cx-tog input:focus-visible + .cx-knob { outline: 2px solid var(--word-profit); outline-offset: 2px; }
.cx-tog .cx-tip { top: calc(100% + 4px); }
.cx-wi { gap: 10px; padding: 12px 14px; }
.cx-wi-head { display: flex; align-items: baseline; gap: 10px; }
.cx-wi-head b { font-size: 0.98rem; }
.cx-wi-head span { font-size: 0.76rem; color: var(--ink-3); }
.cx-link { margin-left: auto; font-size: 0.8rem; font-weight: 600; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; background: none; border: 0; cursor: pointer; }
.cx-sls { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px 14px; }
.cx-sl label { font-size: 0.8rem; }
.cx-sl output { font-size: 0.78rem; }
.cx-wi-t { grid-template-columns: auto minmax(80px, 1fr) auto; gap: 6px 12px; padding-top: 8px; }
.cx-wi-t label { grid-column: 1; display: flex; gap: 8px; font-size: 0.8rem; white-space: nowrap; }
.cx-wi-t input { grid-column: 2; }
.cx-wi-t p { grid-column: 1 / 3; font-size: 0.84rem; }
.cx-wi-t .cx-mini { grid-column: 3; grid-row: 1 / 3; align-self: center; }
@media (max-width: 1100px) { .cx-sls { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .cx-extras { grid-template-columns: minmax(0, 1fr); } .cx-wi-t { grid-template-columns: minmax(0, 1fr); } .cx-wi-t label, .cx-wi-t input, .cx-wi-t p, .cx-wi-t .cx-mini { grid-column: 1; grid-row: auto; } }
/* v3.22 balance: both windows end together */
.cx-form { gap: 16px; }
.cx-sls { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 18px; }
.cx-wi { gap: 12px; padding: 14px 16px; }
.cx-result { gap: 14px; }
.cx-break dl div { padding: 5px 0; }
.cx-form { gap: 18px; }
.cx-extras { gap: 14px 16px; padding: 14px 16px; }
.cx-wi { gap: 14px; }
.cx-sls { gap: 12px 18px; }
.cx-shint { margin-top: -10px; font-size: 0.76rem; line-height: 1.35; color: var(--ink-3); }
.cx-field > label .cx-q, .cx-field > label .cx-tip { display: none; }
.cx-wi-head { flex-wrap: wrap; }
.cx-wi-head b { white-space: nowrap; }
@media (max-width: 560px) { .cx-wi-head span { order: 3; flex-basis: 100%; } }

.cx-sub-cta { margin: -6px auto 22px; font-size: 0.9rem; color: var(--ink-3); }
.cx-sub-cta a { color: var(--ink); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--word-profit); }

/* v3.35: link to the guides under the FAQ */
.cx-qa .cx-more { margin: 18px 0 0; font-size: 0.95rem; }
.cx-more a { color: var(--ink); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--word-profit); }

/* v3.35: country picker with each country's regulatory fee on the right; hint on the fee row of the breakdown */
.cx-cs-native { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.cx-cs-btn { flex: 1; min-width: 0; height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 36px 0 12px; border: 0; border-radius: inherit; background: transparent; color: var(--ink); font: inherit; font-size: 1rem; text-align: left; cursor: pointer; }
.cx-cs-btn span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cx-cs-btn small, .cx-cs-list small { flex: none; font-family: var(--mono); font-size: 0.74rem; font-variant-numeric: tabular-nums; color: var(--ink-3); }
.page-calc .cx-cs-btn:focus-visible { outline: none; }
.cx-cs.is-open::after { transform: rotate(-135deg); margin-top: -2px; }
.cx-cs-list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 6px); margin: 0; padding: 6px; list-style: none; max-height: min(380px, 60vh); overflow: auto; overscroll-behavior: contain; border-radius: 12px; background: var(--surface); box-shadow: 0 0 0 1px var(--line-strong), var(--shadow-card); }
.cx-cs-list[hidden] { display: none; }
.cx-cs-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 38px; padding: 0 10px; border-radius: 8px; font-size: 0.95rem; color: var(--ink); cursor: pointer; }
.cx-cs-list .cx-cs-cap { min-height: 28px; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.02em; color: var(--ink-3); cursor: default; }
.cx-cs-list li.is-act { background: var(--mist); }
.cx-cs-list li[aria-selected="true"] { font-weight: 600; }
.cx-cs-list li[aria-selected="true"] small { color: var(--lumi-deep); }
.cx-break dl div { position: relative; }
.cx-break dt .cx-q { margin-left: -2px; }
.cx-break .cx-tip { font-family: var(--font); top: auto; bottom: calc(100% + 6px); }

/* v3.37: phone, long translated labels. They ran over the next field and pushed the field out of its column.
   The field keeps its column; on a narrow screen a label wraps and the two inputs of a row stay on one line. */
.cx-field { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 560px) {
  .cx-row { align-items: end; }
  .cx-field > label, .cx-field > legend { white-space: normal; }
}
