:root {
  color-scheme: dark;
  --bg: #0b100f;
  --bg-glow: rgba(27, 175, 122, 0.14);
  --surface-1: #121917;
  --surface-2: #18211e;
  --surface-3: #212c28;
  --border: rgba(255, 255, 255, 0.07);
  --border-strong: rgba(255, 255, 255, 0.14);
  --text-primary: #f0efec;
  --text-secondary: #c3c2b7;
  --text-muted: #8c8b82;
  --accent: #34d399;
  --accent-ink: #052e1f;
  --grid: rgba(255, 255, 255, 0.06);

  /* data series (dark steps) */
  --s-buy: #3987e5;
  --s-fee: #d95926;
  --s-creator: #199e70;
  --s-devex: #34d399;

  /* categorical palette, fixed order (dark steps) */
  --c1: #3987e5; --c2: #d95926; --c3: #199e70; --c4: #c98500;
  --c5: #d55181; --c6: #0ca30c; --c7: #9085e9; --c8: #e66767;

  --radius: 18px;
  --shadow: 0 1px 0 rgba(255,255,255,0.04) inset, 0 20px 50px -20px rgba(0,0,0,0.6);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --bg: #f4f5f2;
    --bg-glow: rgba(27, 175, 122, 0.12);
    --surface-1: #fcfcfb;
    --surface-2: #f3f4f1;
    --surface-3: #e8eae5;
    --border: rgba(10, 20, 15, 0.08);
    --border-strong: rgba(10, 20, 15, 0.16);
    --text-primary: #0b0b0b;
    --text-secondary: #52514e;
    --text-muted: #77766f;
    --accent: #0f9f6e;
    --accent-ink: #ffffff;
    --grid: rgba(0, 0, 0, 0.07);
    --s-buy: #2a78d6;
    --s-fee: #eb6834;
    --s-creator: #1baf7a;
    --s-devex: #0f9f6e;
    --c1: #2a78d6; --c2: #eb6834; --c3: #1baf7a; --c4: #eda100;
    --c5: #e87ba4; --c6: #008300; --c7: #6250d6; --c8: #e34948;
    --shadow: 0 1px 2px rgba(0,0,0,0.04), 0 16px 40px -24px rgba(0,0,0,0.18);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background:
    radial-gradient(1200px 600px at 50% -200px, var(--bg-glow), transparent 70%),
    var(--bg);
  color: var(--text-primary);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
button { font: inherit; color: inherit; cursor: pointer; }
.muted { color: var(--text-muted); }
[hidden] { display: none !important; }

/* ---------- top bar ---------- */
.topbar {
  max-width: 1160px; margin: 0 auto; padding: 20px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; }
.brand-mark {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px;
  background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 14px;
}
.brand-name { font-weight: 700; font-size: 17px; }
.fx-pill {
  display: flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px;
  background: var(--surface-1); border: 1px solid var(--border); font-size: 13px; color: var(--text-secondary);
}
.fx-pill strong { color: var(--text-primary); font-variant-numeric: tabular-nums; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); }
.dot.live { background: var(--accent); box-shadow: 0 0 0 0 var(--accent); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); } 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

main { max-width: 1160px; margin: 0 auto; padding: 0 24px 64px; }

/* ---------- hero ---------- */
.hero { text-align: center; padding: 28px 0 28px; }
.hero h1 { font-size: clamp(32px, 5vw, 52px); line-height: 1.05; margin: 0 0 12px; font-weight: 700; }

/* ---------- cards ---------- */
.card {
  background: var(--surface-1); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ---------- converter ---------- */
.converter { padding: 22px; margin-bottom: 20px; }
.seg {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 6px;
  background: var(--surface-2); border-radius: 14px; border: 1px solid var(--border);
}
.seg-btn {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  background: transparent; border: 0; border-radius: 10px; padding: 10px 16px; text-align: left;
  transition: background .2s, box-shadow .2s;
}
.seg-btn:hover { background: var(--surface-3); }
.seg-btn.is-active { background: var(--surface-1); box-shadow: 0 0 0 1px var(--border-strong), 0 4px 14px -6px rgba(0,0,0,.4); }
.seg-title { font-weight: 650; font-size: 15px; }
.seg-sub { font-size: 12.5px; color: var(--text-muted); }
.seg-btn.is-active .seg-title { color: var(--accent); }

.conv-body {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 18px; align-items: center; margin-top: 22px;
}
.conv-body > *, .grid > * { min-width: 0; }
.field label, .result-label {
  display: block; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 8px;
}
.input-wrap {
  display: flex; align-items: center; gap: 10px; padding: 0 18px; height: 76px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px;
  transition: border-color .15s, box-shadow .15s;
}
.input-wrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.unit { font-weight: 700; color: var(--text-muted); font-size: 22px; }
#amount {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text-primary);
  font: 700 34px/1 var(--font); font-variant-numeric: tabular-nums;
}

input[type=range] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 6px; margin: 18px 0 14px;
  border-radius: 999px; background: linear-gradient(to right, var(--accent) var(--fill, 40%), var(--surface-3) var(--fill, 40%));
  outline: none;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: var(--surface-1);
  border: 3px solid var(--accent); box-shadow: 0 2px 6px rgba(0,0,0,.3); cursor: grab;
}
input[type=range]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: var(--surface-1); border: 3px solid var(--accent); cursor: grab; }
input[type=range]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 25%, transparent); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  border: 1px solid var(--border); background: var(--surface-2); border-radius: 999px; padding: 5px 12px;
  font-size: 13px; font-variant-numeric: tabular-nums; color: var(--text-secondary); transition: all .15s;
}
.chip:hover { border-color: var(--border-strong); color: var(--text-primary); }
.chip.is-active { background: color-mix(in srgb, var(--accent) 16%, transparent); border-color: color-mix(in srgb, var(--accent) 50%, transparent); color: var(--text-primary); }

.swap {
  width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--border-strong);
  background: var(--surface-2); display: grid; place-items: center; color: var(--text-secondary);
  transition: transform .35s cubic-bezier(.2,.9,.3,1.3), color .15s;
}
.swap svg { transform: rotate(90deg); }
.swap:hover { color: var(--accent); }
.swap.spin { transform: rotate(180deg); }

.result {
  padding: 22px 24px; border-radius: 16px; min-height: 196px;
  background: linear-gradient(160deg, color-mix(in srgb, var(--accent) 14%, var(--surface-2)), var(--surface-2) 70%);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--border));
  display: flex; flex-direction: column;
}
.result-value {
  font-size: clamp(36px, 5.4vw, 58px); font-weight: 700; line-height: 1.05;
  font-variant-numeric: tabular-nums; word-break: break-all;
}
.result-meta { margin-top: 8px; color: var(--text-secondary); font-size: 14px; }
.result-meta strong { color: var(--text-primary); font-variant-numeric: tabular-nums; }
.result-actions { margin-top: auto; padding-top: 14px; }
.ghost {
  border: 1px solid var(--border-strong); background: transparent; border-radius: 10px; padding: 7px 14px; font-size: 13px; color: var(--text-secondary);
}
.ghost:hover { color: var(--text-primary); background: var(--surface-3); }

.conv-options { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.opt { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: 14px; }
.opt-label { color: var(--text-muted); }
.mini-seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 3px; background: var(--surface-2); border-radius: 10px; border: 1px solid var(--border); }
.mini-seg button { border: 0; background: transparent; padding: 5px 10px; border-radius: 7px; font-size: 13px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.mini-seg button:hover { color: var(--text-primary); }
.mini-seg button.is-active { background: var(--surface-1); color: var(--text-primary); box-shadow: 0 0 0 1px var(--border-strong); }

/* ---------- viz grid ---------- */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; margin-bottom: 20px; }
.span-2 { grid-column: span 2; }
.viz { padding: 22px; display: flex; flex-direction: column; min-width: 0; }
.viz-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.viz-head h2 { margin: 0 0 4px; font-size: 17px; }
.viz-sub { margin: 0; font-size: 13.5px; color: var(--text-muted); }
.viz-sub strong { color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.footnote { margin: 16px 0 0; font-size: 12.5px; color: var(--text-muted); }
.kpi { text-align: right; flex-shrink: 0; }
.kpi-value { display: block; font-size: 32px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1; }
.kpi-label { font-size: 12.5px; color: var(--text-muted); }

/* journey */
.journey { display: grid; gap: 14px; }
.j-row { display: grid; grid-template-columns: 190px 1fr; gap: 16px; align-items: center; }
.j-label { font-size: 13.5px; color: var(--text-secondary); }
.j-label small { display: block; color: var(--text-muted); font-size: 12px; }
.j-track { position: relative; height: 40px; border-radius: 10px; background: var(--surface-2); overflow: hidden; display: flex; }
.j-seg + .j-seg { border-left: 2px solid var(--surface-1); }
.j-seg {
  height: 100%; border-radius: 4px; min-width: 0; transition: width .55s cubic-bezier(.2,.8,.2,1);
  display: flex; align-items: center; padding: 0 12px; overflow: hidden; white-space: nowrap;
  font-size: 13px; font-weight: 650; color: #fff; font-variant-numeric: tabular-nums;
}
.j-seg.buy { background: var(--s-buy); }
.j-seg.fee { background: var(--s-fee); }
.j-seg.creator { background: var(--s-creator); }
.j-seg.devex { background: var(--s-devex); color: #04241a; }
.j-seg.ghost-seg { background: repeating-linear-gradient(135deg, var(--surface-3) 0 6px, transparent 6px 12px); color: var(--text-muted); font-weight: 500; }
.j-value { font-variant-numeric: tabular-nums; }

/* bundle */
.bundle { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.b-row {
  display: grid; grid-template-columns: 54px 1fr auto; gap: 12px; align-items: center;
  padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border);
  animation: rise .35s ease both;
}
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.b-qty { font-weight: 700; font-size: 18px; color: var(--accent); font-variant-numeric: tabular-nums; }
.b-pack { font-weight: 600; font-size: 14.5px; font-variant-numeric: tabular-nums; }
.b-pack small { display: block; font-weight: 400; color: var(--text-muted); font-size: 12px; }
.b-cost { font-weight: 650; font-variant-numeric: tabular-nums; }
.b-empty { color: var(--text-muted); font-size: 14px; padding: 12px 0; }
.bundle-total { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.bundle-total div { display: flex; flex-direction: column; font-size: 12.5px; }
.bundle-total strong { font-size: 18px; font-variant-numeric: tabular-nums; }

/* charts */
.chart { position: relative; width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.axis-text { fill: var(--text-muted); font-size: 11px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.val-text { fill: var(--text-secondary); font-size: 11.5px; font-weight: 600; font-family: var(--font); font-variant-numeric: tabular-nums; }
.val-text.hi { fill: var(--text-primary); }
.gridline { stroke: var(--grid); stroke-width: 1; }
.bar { fill: color-mix(in srgb, var(--s-buy) 45%, var(--surface-3)); transition: fill .2s, height .45s cubic-bezier(.2,.8,.2,1), y .45s cubic-bezier(.2,.8,.2,1); }
.bar.hi { fill: var(--s-buy); }
.bar-hit { fill: transparent; cursor: pointer; }
.bar-hit:hover + .bar, .bar.hover { fill: color-mix(in srgb, var(--s-buy) 75%, var(--surface-3)); }
.fx-line { fill: none; stroke: var(--s-devex); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.fx-area { fill: url(#fxGrad); }
.crosshair { stroke: var(--text-muted); stroke-width: 1; stroke-dasharray: 3 3; }
.fx-dot { fill: var(--s-devex); stroke: var(--surface-1); stroke-width: 2; }
.fx-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border); }
.fx-stats div { display: flex; flex-direction: column; font-size: 12.5px; color: var(--text-muted); }
.fx-stats strong { font-size: 16px; color: var(--text-primary); font-variant-numeric: tabular-nums; }

/* gauge */
.gauge { display: grid; place-items: center; flex: 1; }
.gauge svg { width: 100%; max-width: 320px; height: auto; }
.g-track { fill: none; stroke: var(--surface-3); stroke-width: 18; stroke-linecap: round; }
.g-fill { fill: none; stroke: var(--s-devex); stroke-width: 18; stroke-linecap: round; transition: stroke-dashoffset .6s cubic-bezier(.2,.8,.2,1), stroke .3s; }
.g-fill.short { stroke: var(--s-buy); }
.g-big { fill: var(--text-primary); font-size: 34px; font-weight: 700; font-family: var(--font); font-variant-numeric: tabular-nums; }
.g-small { fill: var(--text-muted); font-size: 12.5px; font-family: var(--font); }
.gauge-caption { text-align: center; margin: 6px 0 0; font-size: 14px; color: var(--text-secondary); }
.gauge-caption strong { color: var(--text-primary); }
.status { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }

/* table */
.table-card { padding: 22px; margin-bottom: 40px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 14.5px; }
th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--border); }
td { padding: 12px 14px; border-bottom: 1px solid var(--border); }
tbody tr { cursor: pointer; transition: background .15s; }
tbody tr:hover { background: var(--surface-2); }
tbody tr.is-current { background: color-mix(in srgb, var(--accent) 10%, transparent); }
tbody tr.is-current td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
td:first-child { font-weight: 650; }

/* faq */
.faq { max-width: 760px; margin: 0 auto; }
.faq h2 { font-size: 24px; margin: 0 0 16px; }
details { border-bottom: 1px solid var(--border); padding: 14px 0; }
summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
summary::after { content: "+"; color: var(--text-muted); font-weight: 400; font-size: 20px; line-height: 1; }
details[open] summary::after { content: "−"; }
summary::-webkit-details-marker { display: none; }
details p { color: var(--text-secondary); margin: 10px 0 0; font-size: 15px; }

.footer { text-align: center; padding: 24px; color: var(--text-muted); font-size: 12.5px; border-top: 1px solid var(--border); }

/* tooltip */
.tooltip {
  position: fixed; z-index: 50; pointer-events: none; padding: 8px 11px; border-radius: 10px;
  background: var(--surface-3); border: 1px solid var(--border-strong); color: var(--text-primary);
  font-size: 12.5px; line-height: 1.4; box-shadow: 0 10px 30px -10px rgba(0,0,0,.5); font-variant-numeric: tabular-nums;
  transform: translate(-50%, calc(-100% - 12px)); white-space: nowrap;
}
.tooltip .t-muted { color: var(--text-muted); }

/* ================= calculator pages ================= */
.crumbs { font-size: 13px; color: var(--text-muted); padding-top: 4px; }
.crumbs a { color: var(--text-secondary); text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
.calc { padding: 22px; margin-bottom: 20px; }
.calc-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 22px; align-items: stretch; }
.calc-inputs { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.f { min-width: 0; }
.f > label, .f-label {
  display: block; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 8px;
}
.f .chips { margin-top: 10px; }
.f-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; }
.num {
  flex: 1; min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; color: var(--text-primary);
  font: 700 30px/1 var(--font); font-variant-numeric: tabular-nums;
}
.input-wrap.sm { height: 56px; padding: 0 14px; }
.input-wrap.sm .num { font-size: 20px; }
.input-wrap.sm .unit { font-size: 16px; }
.suffix { color: var(--text-muted); font-weight: 600; font-size: 15px; }
.f input[type=range] { margin: 14px 0 4px; }
.result .warn { color: var(--c8); }

.legend { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 14px; font-size: 12.5px; color: var(--text-secondary); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; flex-shrink: 0; }

.stack-bar { display: flex; height: 56px; border-radius: 12px; overflow: hidden; background: var(--surface-2); }
.stack-bar > div {
  height: 100%; min-width: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; white-space: nowrap;
  font-size: 12.5px; font-weight: 650; color: #fff; font-variant-numeric: tabular-nums; transition: flex-basis .5s cubic-bezier(.2,.8,.2,1);
}
.stack-bar > div + div { border-left: 2px solid var(--surface-1); }
.stack-bar.thin { height: 36px; }
.hatch { background: repeating-linear-gradient(135deg, var(--surface-3) 0 6px, transparent 6px 12px) !important; color: var(--text-muted) !important; font-weight: 500 !important; }

.line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.pt-dot { stroke: var(--surface-1); stroke-width: 2; }
.refline { stroke: var(--text-muted); stroke-width: 1; stroke-dasharray: 4 4; }
.ref-text { fill: var(--text-secondary); font-size: 11px; font-family: var(--font); }
path.muted-mark { fill: color-mix(in srgb, var(--text-muted) 38%, transparent) !important; }
g.muted-mark { opacity: .4; }
#donut svg { max-width: 340px; margin: 0 auto; }

.kpi-inline { font-size: 14px; color: var(--text-secondary); margin: 14px 0 0; }
.kpi-inline strong { color: var(--text-primary); }

/* data table inside cards */
.dtable td, .dtable th { padding: 10px 12px; }
.dtable tr.is-current td { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.dtable tbody tr { cursor: default; }

/* gift cards */
.gift-cards { display: flex; flex-wrap: wrap; gap: 12px; }
.gcard {
  width: 156px; aspect-ratio: 1.586; border-radius: 12px; padding: 12px 14px; color: #fff;
  background: linear-gradient(135deg, var(--c1), var(--c7)); display: flex; flex-direction: column; justify-content: space-between;
  box-shadow: 0 10px 24px -12px rgba(0,0,0,.5); animation: rise .35s ease both; position: relative; overflow: hidden;
}
.gcard::after { content: ""; position: absolute; right: -30px; top: -30px; width: 90px; height: 90px; border-radius: 50%; background: rgba(255,255,255,.12); }
.gc-top { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; opacity: .85; }
.gc-val { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.gc-bar { height: 6px; border-radius: 3px; background: rgba(255,255,255,.28); overflow: hidden; }
.gc-bar span { display: block; height: 100%; background: #fff; border-radius: 3px; transition: width .5s; }
.gc-more { align-self: center; color: var(--text-muted); font-size: 14px; }

/* waffle + unit grid */
.waffle, .unit-grid { display: grid; grid-template-columns: repeat(10, 1fr); gap: 4px; max-width: 380px; margin: 0 auto; width: 100%; }
.waffle i, .unit-grid i { aspect-ratio: 1; border-radius: 4px; background: var(--surface-3); position: relative; overflow: hidden; }
.waffle i { transition: background .3s; }
.unit-grid i span { position: absolute; inset: 0; background: var(--s-devex); transform-origin: left; transition: transform .4s cubic-bezier(.2,.8,.2,1); border-radius: 3px; }
.grid-caption { text-align: center; font-size: 13.5px; color: var(--text-secondary); margin: 14px 0 0; }
.grid-caption strong { color: var(--text-primary); }

/* group members */
.members { display: flex; flex-direction: column; gap: 8px; }
.m-row { display: grid; grid-template-columns: 12px minmax(0, 1fr) 96px 36px; gap: 8px; align-items: center; }
.m-dot { width: 12px; height: 12px; border-radius: 4px; }
.m-row input {
  width: 100%; min-width: 0; height: 42px; padding: 0 12px; border-radius: 10px; background: var(--surface-2);
  border: 1px solid var(--border); color: var(--text-primary); font: 500 14.5px var(--font); outline: 0;
}
.m-row input:focus { border-color: var(--accent); }
.m-pct { position: relative; }
.m-pct input { padding-right: 26px; text-align: right; font-variant-numeric: tabular-nums; }
.m-pct::after { content: "%"; position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 13px; }
.icon-btn { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--border); background: transparent; color: var(--text-muted); font-size: 18px; line-height: 1; }
.icon-btn:hover { color: var(--c8); border-color: var(--border-strong); }
.add-btn { align-self: flex-start; }
.share-list { display: flex; flex-direction: column; gap: 12px; }
.s-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; gap: 12px; align-items: center; font-size: 14px; }
.s-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.s-track { height: 14px; background: var(--surface-2); border-radius: 7px; overflow: hidden; }
.s-fill { height: 100%; border-radius: 4px; transition: width .5s cubic-bezier(.2,.8,.2,1); }
.s-val { text-align: right; font-variant-numeric: tabular-nums; font-size: 13px; color: var(--text-secondary); }
.s-val strong { color: var(--text-primary); display: block; font-size: 14px; }
.badge { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--border-strong); color: var(--text-secondary); margin-top: 3px; }
.badge.ok { border-color: color-mix(in srgb, var(--accent) 50%, transparent); color: var(--accent); }

/* ================= long-form sections ================= */
.jump {
  position: sticky; top: 10px; z-index: 20; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center;
  width: fit-content; margin: 8px auto 20px; padding: 6px; border-radius: 999px;
  background: color-mix(in srgb, var(--surface-1) 88%, transparent); border: 1px solid var(--border);
  backdrop-filter: blur(10px); box-shadow: var(--shadow);
}
.jump a { padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--text-secondary); text-decoration: none; transition: all .15s; }
.jump a:hover { background: var(--surface-3); color: var(--text-primary); }

.guide { padding: 28px; margin-bottom: 20px; scroll-margin-top: 70px; }
.guide > h2 { font-size: clamp(22px, 2.6vw, 28px); margin: 0 0 10px; line-height: 1.2; }
.guide .lead { margin: 0 0 22px; color: var(--text-secondary); font-size: 16px; max-width: 820px; }
.guide .lead strong, .faq p strong { color: var(--text-primary); }
.guide a, .faq a { color: var(--accent); text-underline-offset: 3px; }

/* steps flow */
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; counter-reset: s; }
.step {
  position: relative; padding: 18px 16px 16px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border);
}
.step:not(:last-child)::after {
  content: ""; position: absolute; top: 33px; right: -14px; width: 14px; height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent); z-index: 1;
}
.step-n {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; margin-bottom: 12px;
  background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent); font-weight: 700; font-size: 15px;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent);
}
.step h3 { margin: 0 0 6px; font-size: 15px; }
.step p { margin: 0; font-size: 13.5px; color: var(--text-secondary); line-height: 1.5; }

/* formula */
.formula-box {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 4px;
  padding: 26px 20px; border-radius: 16px; margin-bottom: 18px; font-size: clamp(15px, 2vw, 20px); font-weight: 600;
  background:
    radial-gradient(80% 120% at 50% 0%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%),
    var(--surface-2);
  border: 1px solid var(--border); font-variant-numeric: tabular-nums;
}
.tok {
  --t: var(--c1); display: inline-block; padding: 4px 12px; border-radius: 9px; white-space: nowrap;
  color: var(--text-primary); background: color-mix(in srgb, var(--t) 20%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--t) 55%, transparent);
}
.t1 { --t: var(--c1); } .t2 { --t: var(--c3); } .t3 { --t: var(--s-devex); } .t4 { --t: var(--c4); } .t5 { --t: var(--c7); }
.op { color: var(--text-muted); padding: 0 4px; font-weight: 500; }
.vars { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; margin: 0 0 18px; }
.var { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.var dt { flex-shrink: 0; font-size: 13px; font-weight: 600; }
.var dd { margin: 0; font-size: 13.5px; color: var(--text-secondary); }
.example { border-radius: 14px; padding: 18px 20px; background: var(--surface-2); border: 1px solid var(--border); border-left: 3px solid var(--accent); }
.example h3 { margin: 0 0 10px; font-size: 15px; }
.example ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 14.5px; color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.example-result {
  display: inline-block; margin: 14px 0 0; padding: 8px 14px; border-radius: 10px; font-weight: 700; font-size: 16px;
  background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--text-primary);
}

/* conversion chart */
.ctable { font-size: 14px; }
.ctable caption { caption-side: bottom; text-align: left; padding-top: 10px; font-size: 12.5px; color: var(--text-muted); }
.ctable th[scope=row] { font-weight: 650; text-align: left; white-space: nowrap; }
.ctable tbody tr { cursor: default; }
.ctable tbody tr:nth-child(even) { background: color-mix(in srgb, var(--surface-2) 55%, transparent); }
.ctable td { white-space: nowrap; }
.has-bar { position: relative; min-width: 150px; }
.cbar {
  position: absolute; left: 6px; top: 7px; bottom: 7px; width: max(4px, calc((100% - 12px) * var(--w) / 100)); border-radius: 6px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 30%, transparent), color-mix(in srgb, var(--accent) 12%, transparent));
}
.cv { position: relative; font-weight: 650; color: var(--text-primary); }

/* faq headings inside summary */
.faq { scroll-margin-top: 70px; }
summary h3 { display: inline; margin: 0; font-size: 16px; font-weight: 600; }
.faq details p { line-height: 1.6; }

/* related links */
.related { margin: 44px 0 36px; display: flex; flex-direction: column; gap: 26px; }
.related h2 { font-size: 24px; margin: 0; }
.rel-group h3 {
  display: flex; align-items: center; gap: 10px; margin: 0 0 12px;
  font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-secondary);
}
.rel-group h3 i { width: 8px; height: 8px; border-radius: 50%; background: var(--g); box-shadow: 0 0 0 4px color-mix(in srgb, var(--g) 18%, transparent); }
.rel-group h3 span {
  font-size: 11.5px; font-weight: 600; color: var(--text-muted); letter-spacing: 0;
  padding: 1px 8px; border-radius: 999px; border: 1px solid var(--border-strong);
}
.rel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.rel-card {
  display: flex; flex-direction: column; border-radius: 16px; overflow: hidden; text-decoration: none; color: inherit;
  background: var(--surface-1); border: 1px solid var(--border); box-shadow: var(--shadow);
  transition: transform .25s cubic-bezier(.2,.8,.2,1), border-color .2s, box-shadow .25s;
}
.rel-card:hover, .rel-card:focus-visible {
  transform: translateY(-3px); border-color: color-mix(in srgb, var(--g) 55%, transparent);
  box-shadow: 0 18px 40px -22px color-mix(in srgb, var(--g) 70%, transparent); outline: none;
}
.rel-thumb {
  position: relative; display: grid; place-items: center; height: 116px; color: var(--g);
  background:
    radial-gradient(120% 90% at 15% 0%, color-mix(in srgb, var(--g) 20%, transparent), transparent 60%),
    linear-gradient(var(--surface-2), var(--surface-2));
  border-bottom: 1px solid var(--border);
}
.rel-thumb::before {
  content: ""; position: absolute; inset: 0; opacity: .5;
  background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 18px 18px; mask-image: radial-gradient(circle at 50% 50%, #000 30%, transparent 80%);
}
.rel-thumb svg { position: relative; width: 158px; height: 74px; transition: transform .35s cubic-bezier(.2,.8,.2,1); }
.rel-card:hover .rel-thumb svg { transform: scale(1.08); }
.rel-body { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px 16px; flex: 1; }
.rel-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.rel-title { font-weight: 650; font-size: 15px; color: var(--text-primary); line-height: 1.3; }
.rel-blurb { font-size: 13px; color: var(--text-muted); }
.rel-go {
  flex-shrink: 0; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--border-strong); color: var(--text-muted); transition: all .25s;
}
.rel-card:hover .rel-go { background: var(--g); border-color: var(--g); color: var(--bg); transform: translateX(2px); }
.rel-home { align-self: flex-start; font-size: 14px; color: var(--text-secondary); text-decoration: none; }
.rel-home:hover { color: var(--accent); }

/* footer links */
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 22px; margin-bottom: 10px; }
.footer-links a { color: var(--text-secondary); text-decoration: none; font-size: 13.5px; font-weight: 500; }
.footer-links a:hover { color: var(--accent); }

/* ================= about us ================= */
.about-intro { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 32px; padding: 30px; margin-bottom: 44px; align-items: center; }
.about-intro h2 { font-size: clamp(22px, 2.6vw, 28px); margin: 0 0 12px; }
.about-intro p { color: var(--text-secondary); font-size: 16px; margin: 0 0 12px; }
.about-intro p strong { color: var(--text-primary); }
.about-flow { display: flex; flex-direction: column; padding: 20px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--border); }
.flow-step { display: grid; grid-template-columns: 22px 1fr; column-gap: 12px; align-items: center; }
.flow-step strong { font-size: 15px; }
.flow-step span:last-child { grid-column: 2; font-size: 13px; color: var(--text-muted); }
.flow-dot { grid-row: span 2; width: 14px; height: 14px; border-radius: 50%; background: var(--g); box-shadow: 0 0 0 5px color-mix(in srgb, var(--g) 22%, transparent); justify-self: center; }
.flow-line { width: 2px; height: 22px; margin: 6px 0 6px 10px; background: linear-gradient(var(--border-strong), transparent); }

.about-section { margin-bottom: 44px; }
.about-section > h2 { font-size: clamp(22px, 2.6vw, 28px); margin: 0 0 6px; }
.section-lead { color: var(--text-secondary); margin: 0 0 18px; }
.story-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.story-grid > .story { grid-column: span 2; }
.story-grid > .story:nth-child(n+4) { grid-column: span 3; }
th[scope=row] { text-transform: none; letter-spacing: 0; font-size: 14.5px; color: var(--text-primary); }
.story { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.story-head { display: flex; gap: 14px; align-items: center; }
.story-icon { flex-shrink: 0; display: grid; place-items: center; width: 74px; height: 52px; border-radius: 12px; color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface-2)); }
.story-icon svg { width: 62px; height: 30px; }
.story h3 { margin: 0; font-size: 16px; }
.story-q { margin: 2px 0 0; color: var(--text-muted); font-size: 14px; font-style: italic; }
.story > p { margin: 0; color: var(--text-secondary); font-size: 14.5px; line-height: 1.6; }
.story > p strong { color: var(--text-primary); }
.story-tools { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.story-tools a {
  font-size: 12.5px; font-weight: 600; padding: 4px 10px; border-radius: 999px; text-decoration: none;
  color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, transparent); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
}
.story-tools a:hover { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.promise-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.promise { padding: 20px; }
.promise h3 { margin: 0 0 6px; font-size: 15.5px; }
.promise p { margin: 0; color: var(--text-secondary); font-size: 14px; }
.not-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 10px; }
.not-list li { padding: 14px 16px 14px 44px; position: relative; border-radius: 14px; background: var(--surface-1); border: 1px solid var(--border); color: var(--text-secondary); font-size: 14.5px; }
.not-list li::before { content: "✕"; position: absolute; left: 16px; top: 13px; color: var(--c8); font-weight: 700; }
.not-list strong { color: var(--text-primary); }
.contact-card { padding: 24px; margin-bottom: 40px; }
.contact-card h2 { margin: 0 0 8px; font-size: 20px; }
.contact-card p { margin: 0; color: var(--text-secondary); }
.contact-card a, .doc a { color: var(--accent); }

/* ================= legal pages ================= */
.doc-grid { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 36px; align-items: start; margin-bottom: 48px; }
.doc-toc { position: sticky; top: 20px; padding: 18px; border-radius: 16px; background: var(--surface-1); border: 1px solid var(--border); }
.doc-updated { margin: 0 0 12px; font-size: 12.5px; color: var(--text-muted); }
.doc-updated strong { color: var(--text-secondary); }
.doc-toc ol { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 7px; font-size: 13.5px; }
.doc-toc a { color: var(--text-secondary); text-decoration: none; }
.doc-toc a:hover { color: var(--accent); }
.doc { max-width: 760px; }
.doc-summary { position: relative; padding: 22px 22px 18px; margin-bottom: 30px; border-left: 3px solid var(--accent); }
.doc-summary-tag { display: inline-block; margin-bottom: 8px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); }
.doc-summary p { margin: 0; font-size: 16px; color: var(--text-secondary); }
.doc-summary strong { color: var(--text-primary); }
.doc-section { scroll-margin-top: 20px; padding-bottom: 22px; margin-bottom: 22px; border-bottom: 1px solid var(--border); }
.doc-section h2 { display: flex; align-items: center; gap: 12px; font-size: 20px; margin: 0 0 12px; }
.doc-n { display: grid; place-items: center; flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%; font-size: 13.5px; color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
.doc-section p, .doc-section li { color: var(--text-secondary); font-size: 15.5px; line-height: 1.65; }
.doc-section strong { color: var(--text-primary); }
.doc-section ul { padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.doc-section code { font-size: 14px; padding: 1px 6px; border-radius: 6px; background: var(--surface-3); }
.doc-table { font-size: 14px; margin: 6px 0 12px; }
.doc-table th[scope=row] { font-weight: 600; text-align: left; }
.doc-table th[scope=row] a { text-decoration: none; }
.doc-table tbody tr { cursor: default; }

/* ================= skip link, header nav, language switcher ================= */
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 16px; border-radius: 10px;
  background: var(--accent); color: var(--accent-ink); font-weight: 700; text-decoration: none; transition: top .15s;
}
.skip-link:focus { top: 12px; }
.topnav { display: flex; gap: 4px; margin-inline-start: auto; }
.topnav a { padding: 7px 12px; border-radius: 10px; color: var(--text-secondary); text-decoration: none; font-size: 14px; font-weight: 500; }
.topnav a:hover, .topnav a:focus-visible { color: var(--text-primary); background: var(--surface-2); }
.lang-switch { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 12px; margin: 0 auto 12px; max-width: 900px; font-size: 13px; }
.lang-label { color: var(--text-muted); }
.lang-switch a { color: var(--text-secondary); text-decoration: none; }
.lang-switch a:hover { color: var(--accent); }
.lang-switch a[aria-current] { color: var(--accent); font-weight: 700; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

/* mobile menu button (shown by script on small screens) */
.menu-btn {
  display: none; align-items: center; gap: 6px; margin-inline-start: auto; padding: 7px 12px; border-radius: 10px;
  border: 1px solid var(--border-strong); background: var(--surface-1); color: var(--text-secondary); font-size: 14px; font-weight: 600;
}
.menu-btn:hover { color: var(--text-primary); }

/* ================= ad slots (only rendered when an ad unit ID is set) ================= */
.ad-slot {
  margin: 36px auto; max-width: 970px; min-height: 300px; padding: 10px 12px 12px; border-radius: 14px;
  background: var(--surface-1); border: 1px dashed var(--border-strong); text-align: center;
}
.ad-label { display: block; margin-bottom: 6px; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted); }

/* ================= contact ================= */
.contact-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; align-items: start; margin-bottom: 48px; }
.contact-form-card { padding: 26px; }
.contact-form-card h2, .contact-side h2 { margin: 0 0 6px; font-size: 20px; }
.contact-side { display: flex; flex-direction: column; gap: 14px; }
.contact-side .contact-card { margin: 0; padding: 20px; }
.contact-form { display: flex; flex-direction: column; gap: 16px; }
.cf-field { display: flex; flex-direction: column; gap: 6px; }
.cf-field label { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.cf-field input, .cf-field textarea {
  width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2);
  color: var(--text-primary); font: 15px/1.5 var(--font); outline: none; transition: border-color .15s, box-shadow .15s;
}
.cf-field textarea { resize: vertical; min-height: 140px; }
.cf-field input:focus, .cf-field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.cf-field [aria-invalid="true"] { border-color: var(--c8); }
.cf-error { font-size: 13px; color: var(--c8); }
.cf-submit {
  display: inline-flex; align-items: center; justify-content: center; align-self: flex-start; gap: 8px;
  padding: 12px 22px; border-radius: 12px; border: 0; background: var(--accent); color: var(--accent-ink);
  font-weight: 700; font-size: 15px; text-decoration: none; transition: filter .15s, transform .15s;
}
.cf-submit:hover { filter: brightness(1.08); transform: translateY(-1px); }
.cf-submit:disabled { opacity: .6; cursor: progress; transform: none; }
.cf-status { margin: 0; padding: 12px 14px; border-radius: 12px; font-size: 14.5px; border: 1px solid var(--border); }
.cf-status.sending { color: var(--text-secondary); background: var(--surface-2); }
.cf-status.success { color: var(--text-primary); background: color-mix(in srgb, var(--accent) 14%, transparent); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.cf-status.error { color: var(--text-primary); background: color-mix(in srgb, var(--c8) 14%, transparent); border-color: color-mix(in srgb, var(--c8) 40%, transparent); }
.cf-status a { color: var(--accent); }
.contact-topics { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.contact-topics li { display: flex; flex-direction: column; font-size: 14px; color: var(--text-secondary); }
.contact-topics strong { color: var(--text-primary); }

/* ================= sitemap + 404 ================= */
.sitemap-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-bottom: 48px; }
.sitemap-card { padding: 22px; scroll-margin-top: 20px; }
.sitemap-card h2 { margin: 0 0 12px; font-size: 18px; }
.sitemap-card ul { margin: 0; padding-inline-start: 18px; display: flex; flex-direction: column; gap: 7px; font-size: 14.5px; }
.sitemap-card a { color: var(--text-secondary); text-decoration: none; }
.sitemap-card a:hover { color: var(--accent); }
.sitemap-langs { columns: 2; display: block !important; }
.sitemap-langs li { margin-bottom: 7px; }
.notfound { padding-top: 40px; }
.notfound-code { margin: 0; font-size: clamp(72px, 14vw, 140px); font-weight: 800; line-height: 1; color: color-mix(in srgb, var(--accent) 60%, transparent); }
.notfound .section-lead { margin: 10px 0 22px; }
.notfound-home { align-self: center; }
.notfound-links { max-width: 560px; margin: 0 auto 60px; }

/* ================= right-to-left (Arabic) ================= */
[dir="rtl"] .brand-mark, [dir="rtl"] .unit { direction: ltr; }
[dir="rtl"] .rel-go svg, [dir="rtl"] .swap svg { transform: scaleX(-1); }
[dir="rtl"] .j-seg + .j-seg { border-left: 0; border-right: 2px solid var(--surface-1); }
[dir="rtl"] .kpi { text-align: left; }
[dir="rtl"] summary::after { margin-right: auto; }
[dir="rtl"] .step:not(:last-child)::after { right: auto; left: -14px; background: linear-gradient(270deg, var(--accent), transparent); }
[dir="rtl"] input[type=range] { direction: ltr; }
[dir="rtl"] .tooltip { direction: rtl; }

@media (max-width: 860px) {
  .contact-grid { grid-template-columns: minmax(0, 1fr); }
  .topbar { position: relative; flex-wrap: wrap; }
  .menu-btn:not([hidden]) { display: inline-flex; }
  .topnav { display: none; }
  .topnav.is-open {
    display: flex; flex-direction: column; position: absolute; top: calc(100% - 6px); inset-inline-end: 14px; z-index: 40;
    min-width: 200px; padding: 8px; border-radius: 14px; background: var(--surface-1); border: 1px solid var(--border-strong); box-shadow: var(--shadow);
  }
  .topnav.is-open a { padding: 10px 12px; }
  .ad-slot { min-height: 280px; margin: 28px 0; }
  .about-intro { grid-template-columns: minmax(0, 1fr); padding: 22px; }
  .story-grid { grid-template-columns: minmax(0, 1fr); }
  .story-grid > .story, .story-grid > .story:nth-child(n+4) { grid-column: auto; }
  .doc-grid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .doc-toc { position: static; }
}

/* responsive */
@media (max-width: 860px) {
  .conv-body { grid-template-columns: minmax(0, 1fr); }
  .swap { justify-self: center; }
  .swap svg { transform: none; }
  .grid { grid-template-columns: minmax(0, 1fr); }
  .span-2 { grid-column: auto; }
  .j-row { grid-template-columns: 1fr; gap: 6px; }
  .viz-head { flex-direction: column; }
  .kpi { text-align: left; }
  .calc-grid, .f-row { grid-template-columns: minmax(0, 1fr); }
  .s-row { grid-template-columns: 80px minmax(0, 1fr) auto; }
  .gcard { width: calc(50% - 6px); }
}
@media (max-width: 520px) {
  main, .topbar { padding-left: 14px; padding-right: 14px; }
  .fx-pill { font-size: 12px; padding: 6px 10px; }
  .seg-sub { display: none; }
  .converter, .viz, .table-card { padding: 16px; }
  .rel-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .rel-thumb { height: 84px; }
  .rel-thumb svg { width: 112px; height: 52px; }
  .rel-body { padding: 12px; }
  .rel-title { font-size: 13.5px; }
  .rel-blurb { font-size: 12px; }
  .rel-go { display: none; }
  .guide { padding: 18px; }
  .step:not(:last-child)::after { display: none; }
  .jump { top: 6px; }
  .jump a { padding: 5px 10px; font-size: 12px; }
  .rel-card:last-child:nth-child(odd) { grid-column: span 2; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
