/* Hidden fee calculator. Same tokens as article.css. */
.calc-hero { position: relative; overflow: hidden; }
.calc-hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.calc-hero .hero-inner { position: relative; }
.calc-hero h1 span { color: var(--accent); text-shadow: 0 0 32px rgba(166,227,19,.45); }

.calc-wrap { display: grid; gap: 28px; padding-block: clamp(32px, 5vw, 56px) clamp(48px, 8vw, 96px); }
.calc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 900px) { .calc { grid-template-columns: 1fr; } }

.calc-form, .calc-out { border: 1px solid var(--line); border-radius: 22px; background: var(--surface); padding: clamp(20px, 3vw, 28px); display: grid; gap: 16px; }
.calc-out { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 84px); border-color: rgba(166,227,19,.35); background: radial-gradient(80% 60% at 50% 0%, rgba(166,227,19,.12), transparent 70%), var(--surface); }
@media (max-width: 900px) { .calc-out { position: static; } }

.calc-row.two { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 10px; align-items: end; }
.cfield { display: grid; gap: 6px; }
.cfield[hidden] { display: none; }
.cfield label { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.cfield label small { text-transform: none; letter-spacing: 0; font-family: var(--body); }
.cfield select, .unit { width: 100%; font: 600 17px var(--body); color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 12px; transition: border-color .2s, box-shadow .2s; }
.cfield select { padding: 12px 14px; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
.unit { display: flex; align-items: center; gap: 8px; padding: 0 14px; }
.unit:focus-within, .cfield select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.unit input { flex: 1; min-width: 0; font: inherit; color: inherit; background: none; border: 0; padding: 12px 0; outline: none; }
.unit span { font-family: var(--mono); font-size: 13px; color: var(--muted); white-space: nowrap; }
.unit span b { font-weight: 600; }
.mid .unit { border-style: dashed; }
.swap { width: 44px; height: 46px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); color: var(--accent); font-size: 18px; cursor: pointer; transition: transform .3s, border-color .2s; }
.swap:hover { border-color: var(--accent); transform: rotate(180deg); }
.hint { font-size: 13px; color: var(--muted); }

.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); }
.seg button { font: 600 13px var(--body); color: var(--muted); background: none; border: 0; border-radius: 9px; padding: 9px 8px; cursor: pointer; transition: background .2s, color .2s; }
.seg button[aria-checked="true"] { background: var(--surface-2); color: var(--fg); box-shadow: inset 0 0 0 1px rgba(166,227,19,.4); }

.gauge-wrap { position: relative; width: min(220px, 70%); margin: 0 auto; aspect-ratio: 1; }
.gauge { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.gauge circle { fill: none; stroke-width: 16; }
.g-bg { stroke: var(--surface-2); }
.g-fee, .g-fx { stroke-dasharray: 0 100; transition: stroke-dasharray .9s cubic-bezier(.2,.8,.2,1), stroke-dashoffset .9s cubic-bezier(.2,.8,.2,1); stroke-linecap: butt; }
.g-fee { stroke: #E8E8E8; }
.g-fx { stroke: var(--accent); filter: drop-shadow(0 0 6px rgba(166,227,19,.6)); }
.gauge-text { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.gauge-text b { font-family: var(--display); font-size: clamp(30px, 5vw, 42px); font-weight: 800; line-height: 1; }
.gauge-text span { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-top: 6px; }

.o-main { text-align: center; display: grid; gap: 4px; }
.o-label { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.o-cost { font-family: var(--display); font-size: clamp(28px, 4.4vw, 40px); font-weight: 800; color: var(--accent); }
.o-verdict { font-weight: 700; }
.o-verdict.good { color: var(--accent); }
.o-verdict.ok { color: #F2D16B; }
.o-verdict.bad { color: #FF8A7E; }
.o-split { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; font-size: 15px; color: var(--muted); }
.o-split b { color: var(--fg); margin-left: 4px; }
.o-split i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 8px; vertical-align: middle; }
.k-fee { background: #E8E8E8; }
.k-fx { background: var(--accent); }
.o-line { font-size: 15px; color: #D6D9E2; text-align: center; }
.o-line:empty { display: none; }
.o-line strong { color: var(--fg); }

.bench { display: grid; gap: 8px; border-top: 1px solid var(--line); padding-top: 16px; }
.b-row { display: grid; grid-template-columns: 120px minmax(0, 1fr) 60px; gap: 10px; align-items: center; font-size: 13px; color: var(--muted); }
.b-row b { font-family: var(--mono); font-size: 12px; text-align: right; color: var(--fg); }
.b-track { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.b-fill { --w: 0; height: 100%; width: calc(var(--w) / 16 * 100%); max-width: 100%; border-radius: 999px; background: var(--muted); transition: width .9s cubic-bezier(.2,.8,.2,1); }
.b-row.you span, .b-row.you b { color: var(--accent); font-weight: 700; }
.b-row.you .b-fill { background: linear-gradient(90deg, rgba(166,227,19,.3), var(--accent)); box-shadow: 0 0 10px rgba(166,227,19,.5); }
.calc-out .pick-cta { justify-self: center; }

.calc-explain { max-width: 760px; }
.calc-wrap > *, .calc > *, .calc-form > *, .cfield { min-width: 0; }
.cfield select { min-width: 0; text-overflow: ellipsis; }
