:root {
  --canvas: #f6f8f6;
  --surface: #fff;
  --soft: #eef3f0;
  --line: #dce5e0;
  --ink: #11241f;
  --muted: #53665e;
  --success: #087356;
  --lime: #dcf58e;
  --forest: #173e34;
  --danger: #a82d33;
  --radius: 12px;
  --control-height: 32px;
  --field-height: 44px;
}
* { box-sizing: border-box; }
html { background: var(--canvas); scroll-padding-top: 100px; }
body { margin: 0; min-height: 100svh; color: var(--ink); font-family: "IBM Plex Sans", "Segoe UI", sans-serif; font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
button, input { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; }
button { transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease; }
button:focus-visible, a:focus-visible, input:focus-visible, summary:focus-visible { outline: 3px solid var(--success); outline-offset: 4px; }
button:disabled { cursor: default; opacity: .5; }
p, h1, h2, h3 { margin: 0; }
svg { display: block; flex-shrink: 0; }
.skip-link { position: fixed; left: 16px; top: 12px; z-index: 50; transform: translateY(-150%); background: var(--ink); color: white; padding: 12px 16px; border-radius: 8px; }
.skip-link:focus { transform: translateY(0); }
.site-header { position: sticky; top: 0; z-index: 20; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); }
.header-inner { max-width: 1100px; margin: auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px; padding: 6px 12px; }
.brand { display: flex; align-items: center; gap: 8px; min-height: var(--control-height); text-decoration: none; font-size: 17px; font-weight: 700; letter-spacing: -.5px; }
.brand-icon { width: 32px; height: 32px; color: var(--ink); }
.brand-accent { color: var(--success); }
.brand small { display: none; margin-top: 2px; font-size: 11px; line-height: 1.4; font-weight: 500; letter-spacing: .2px; color: var(--muted); }
.view-nav { display: flex; width: auto; gap: 4px; padding: 2px; border-radius: 8px; background: var(--soft); }
.view-nav button { min-height: var(--control-height); border: 0; border-radius: 6px; padding: 4px 8px; color: var(--muted); background: transparent; font-size: 12px; font-weight: 600; }
.view-nav button[aria-pressed="true"] { color: var(--ink); background: white; box-shadow: 0 1px 4px #11241f0d; }
.view-nav button:hover { color: var(--ink); }
.view-nav .version-link { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: var(--control-height); margin-left: 2px; padding: 4px 8px; border-left: 1px solid var(--line); border-radius: 0 6px 6px 0; color: var(--success); font-size: 12px; font-weight: 600; text-decoration: none; transition: background-color 160ms ease, color 160ms ease; }
.view-nav .version-link:hover { background: var(--surface); color: var(--ink); }
.view-nav .version-link:active { background: var(--line); }
.page-shell { max-width: 1060px; margin: auto; padding: 12px; }
.intro { margin-bottom: 10px; }
.eyebrow { display: inline-flex; align-items: center; gap: 7px; color: var(--success); font-size: 12px; font-weight: 600; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success); }
h1 { margin-top: 4px; font-size: clamp(24px, 6vw, 36px); line-height: 1.15; letter-spacing: -.045em; font-weight: 600; text-wrap: balance; }
h1:focus { outline: none; }
.intro > p { margin-top: 4px; max-width: 510px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.market-rates { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 8px; width: 100%; min-width: 0; margin-top: 8px; padding: 8px 12px; }
.market-quote.input-shell { display: flex; align-items: center; gap: 6px; min-width: 0; min-height: var(--field-height); padding: 4px 8px; align-self: center; }
.market-quote h2 { flex-shrink: 0; font-size: 12px; font-weight: 500; color: var(--muted); }
.market-quote.input-shell input { flex: 1 1 70px; min-width: 0; color: var(--success); font-size: 20px; line-height: 1.3; font-weight: 600; letter-spacing: -.025em; }
.market-currency { flex-shrink: 0; font-size: 12px; font-weight: 500; color: var(--muted); }
.rate-edit-icon { width: 14px; height: 14px; color: var(--muted); }
.market-rates.is-manual .market-quote { border-color: var(--success); }
.market-rates #simulation-rate-error { grid-column: 1 / -1; margin-top: 0; font-size: 12px; }
.market-origin { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; min-width: 0; }
.rate-mode { padding: 2px 5px; border-radius: 4px; background: var(--soft); color: var(--success); font-size: 12px; font-weight: 600; }
.manual-rate-controls { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 4px 8px; padding-top: 4px; border-top: 1px solid var(--line); }
.manual-rate-controls .helper { margin: 0; }
.manual-rate-controls button { min-height: var(--control-height); padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--soft); color: var(--success); font-size: 12px; font-weight: 600; }
.manual-rate-controls button:hover { border-color: var(--success); }
.refresh-button { display: grid; place-items: center; min-width: var(--control-height); min-height: var(--control-height); padding: 5px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--success); }
.refresh-button svg { width: 16px; height: 16px; }
.refresh-button:hover { background: var(--canvas); }
.market-meta { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid var(--line); }
.market-meta .helper { margin: 0; }
.market-meta a { display: inline-flex; align-items: center; flex-shrink: 0; min-height: 28px; color: var(--muted); font-size: 12px; text-underline-offset: 3px; }
.calculator-layout, .input-column, .result-column, .support-note { display: grid; gap: 8px; min-width: 0; }
.calculator-layout { align-items: start; gap: 8px; }
.surface { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); box-shadow: 0 2px 8px #11241f03; }
.amount-card, .rate-card { padding: 10px 12px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.share-button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex-shrink: 0; min-height: var(--control-height); padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--soft); color: var(--success); font-size: 12px; font-weight: 600; }
.share-button svg { width: 16px; height: 16px; }
.share-button:hover { background: var(--canvas); border-color: var(--success); }
.share-status { color: var(--success); }
.share-link-fallback { margin-top: 8px; }
.share-link-fallback label { display: block; margin-bottom: 4px; font-size: 12px; color: var(--muted); }
.share-link-fallback input { width: 100%; min-width: 0; min-height: var(--field-height); padding: 6px 10px; border: 1px solid var(--line); border-radius: 7px; background: var(--canvas); color: var(--ink); font-size: 16px; }
.step-label { font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--success); }
.currency-route { color: var(--muted); font-size: 12px; }
.amount-heading label { font-size: 14px; font-weight: 600; line-height: 1.4; letter-spacing: -.02em; }
.input-shell { display: flex; align-items: center; gap: 10px; min-width: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--canvas); transition: border-color 160ms ease, box-shadow 160ms ease; }
.input-shell:focus-within { border-color: var(--success); background: white; box-shadow: 0 0 0 3px #08735610; }
.input-shell input { width: 100%; min-width: 0; padding: 0; border: 0; outline: 0; background: transparent; color: var(--ink); }
.input-shell:has(input[aria-invalid="true"]) { border-color: var(--danger); }
.amount-shell { margin-top: 6px; min-height: var(--field-height); padding: 4px 10px; }
.amount-shell input { font-size: clamp(22px, 5.5vw, 28px); font-weight: 600; letter-spacing: -.04em; }
.currency-tag { border-left: 1px solid var(--line); padding-left: 12px; color: var(--muted); font-size: 12px; font-weight: 600; }
.helper { margin-top: 4px; font-size: 12px; line-height: 1.5; color: var(--muted); }
.error { margin-top: 10px; color: var(--danger); font-size: 13px; line-height: 1.5; }
.amount-presets { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.amount-presets button { min-height: var(--control-height); flex: 1; padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; background: white; font-size: 12px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.amount-presets button:hover, .amount-presets button[aria-pressed="true"] { border-color: #a7c3b5; color: var(--success); background: var(--soft); }
.service-note { display: flex; align-items: flex-start; gap: 12px; padding: 4px 0; }
.service-icon { width: 34px; height: 34px; flex-shrink: 0; border-radius: 8px; background: #e4efe8; color: var(--success); display: grid; place-items: center; }
.service-icon svg { width: 20px; height: 20px; }
.service-note h2 { font-size: 15px; font-weight: 600; }
.service-note p { margin-top: 4px; font-size: 13px; line-height: 1.5; color: var(--muted); }
.tip-note { display: flex; align-items: flex-start; gap: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.tip-note svg { width: 22px; height: 22px; margin: 2px 6px 0; color: var(--muted); }
.tip-note p { font-size: 13px; line-height: 1.6; color: var(--muted); }
.tip-note strong { color: var(--ink); font-weight: 500; }
.dark-panel { background: var(--forest); color: white; border-radius: var(--radius); }
.budget-card { padding: 10px 12px; }
.destination-line { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; justify-content: space-between; padding-bottom: 8px; border-bottom: 1px solid #ffffff26; font-size: 12px; color: #d2ddd7; }
.destination-line strong { color: white; font-size: 15px; font-weight: 500; }
.budget-main { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px; padding: 10px 0; }
.budget-main h2 { flex: 1 1 110px; font-size: 13px; font-weight: 400; color: #d2ddd7; }
.budget-value { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px; min-width: 0; max-width: 100%; color: var(--lime); font-size: clamp(28px, 7vw, 40px); line-height: 1.1; font-weight: 600; letter-spacing: -.045em; overflow-wrap: anywhere; }
.budget-currency { font-size: 14px; font-weight: 500; letter-spacing: -.02em; }
.budget-detail { flex-basis: 100%; font-size: 12px; line-height: 1.5; color: #c2d2ca; }
.budget-detail strong { color: white; font-weight: 500; }
.binance-instruction { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 8px; border-radius: 7px; background: #ffffff0d; padding: 8px 10px; border: 1px solid #ffffff17; }
.binance-instruction h3 { font-size: 12px; font-weight: 400; color: #d2ddd7; }
.binance-instruction p { margin-top: 2px; font-size: 21px; line-height: 1.2; letter-spacing: -.035em; font-weight: 600; overflow-wrap: anywhere; }
.copy-button { display: flex; align-items: center; justify-content: center; gap: 6px; min-width: var(--control-height); min-height: var(--control-height); border: 1px solid #ffffff40; border-radius: 6px; background: transparent; color: white; font-size: 12px; font-weight: 500; padding: 4px 8px; }
.copy-button svg { width: 16px; height: 16px; }
.copy-button:hover { background: #ffffff17; }
.copy-button:focus-visible { outline-color: var(--lime); }
.rounding-note { margin-top: 14px; color: #c2d2ca; font-size: 12px; line-height: 1.5; }
.budget-main .rounding-note { flex-basis: 100%; margin-top: 0; }
.breakdown-card { padding: 0 12px; }
.summary-list { margin: 0; }
.summary-list > div { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 8px; padding: 8px 0; }
.summary-list > div + div { border-top: 1px solid var(--line); }
.summary-list dt { font-size: 13px; color: var(--muted); }
.summary-list dt small { display: block; margin-top: 3px; font-size: 12px; }
.summary-list dd { margin: 0; font-size: 15px; font-weight: 600; overflow-wrap: anywhere; }
.summary-list .zero-fee { color: var(--success); }
.fee-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 10px 0; }
.fee-summary > div { display: grid; align-content: start; gap: 4px; padding: 0; min-width: 0; }
.fee-summary > div + div { border-top: 0; border-left: 1px solid var(--line); padding-left: 12px; }
.fee-summary dt { min-height: 34px; font-size: 12px; line-height: 1.4; }
.fee-summary dt small { margin-top: 0; }
.fee-summary dd { font-size: 16px; }
.calculation-details { border-top: 1px solid var(--line); }
.calculation-details summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: var(--control-height); padding: 6px 0; list-style: none; color: var(--ink); font-size: 12px; font-weight: 500; cursor: pointer; }
.calculation-details summary::-webkit-details-marker { display: none; }
.calculation-details summary svg { width: 16px; height: 16px; transition: transform 160ms ease; }
.calculation-details[open] summary svg { transform: rotate(180deg); }
.calculation-details > div { padding: 0 0 16px; display: grid; gap: 12px; font-size: 13px; line-height: 1.6; color: var(--muted); }
.equation { padding: 12px; border-radius: 7px; background: var(--soft); color: var(--ink); font-weight: 500; }
.conversion-summary { padding: 20px 0; border-top: 1px solid var(--line); }
.conversion-summary h3 { margin-bottom: 12px; font-size: 14px; font-weight: 500; color: var(--muted); }
.conversion-summary .equation { font-size: 18px; line-height: 1.5; font-weight: 600; overflow-wrap: anywhere; }
.binance-fee-note { padding: 8px 0; border-top: 1px solid var(--line); font-size: 12px; line-height: 1.5; color: var(--muted); }
.binance-fee-note strong { color: var(--ink); font-weight: 600; }
.momo-summary { border-top: 1px solid var(--line); padding: 2px 0 8px; }
.momo-summary dt strong { color: var(--ink); font-weight: 600; }
.momo-summary p { color: var(--muted); font-size: 12px; line-height: 1.5; }
.momo-summary a { color: var(--success); text-underline-offset: 3px; }
.rate-card > label { display: block; margin-top: 6px; font-size: 14px; font-weight: 600; }
.rate-shell { margin-top: 8px; padding: 6px 10px; min-height: var(--field-height); }
.rate-shell > span { flex-shrink: 0; color: var(--muted); font-size: 13px; }
.rate-shell input { font-size: 20px; font-weight: 600; text-align: right; }
.profit-card { padding: 12px; }
.light-label { color: #c2d2ca; }
.profit-card h2 { margin-top: 8px; color: #d2ddd7; font-size: 13px; font-weight: 400; }
.profit-value { margin-top: 6px; font-size: clamp(28px, 7vw, 38px); line-height: 1.15; letter-spacing: -.045em; color: var(--lime); font-weight: 600; overflow-wrap: anywhere; }
.profit-card.is-loss .profit-value { color: #ffc3bd; }
.profit-equivalent { margin-top: 6px; font-size: 15px; color: white; }
.profit-caption { margin-top: 10px; padding-top: 8px; border-top: 1px solid #ffffff26; font-size: 12px; line-height: 1.5; color: #c2d2ca; }
.dashboard-note { margin: 0 0 8px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 12px; line-height: 1.5; color: var(--muted); }
.back-button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--control-height); justify-self: start; padding: 4px 0; border: 0; background: transparent; color: var(--success); font-size: 12px; font-weight: 600; }
.back-button:hover { color: var(--ink); }
.back-button svg { width: 18px; height: 18px; }
.page-footer { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 4px 12px; max-width: 1060px; margin: auto; padding: 8px 12px max(8px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.page-footer p { max-width: 620px; font-size: 12px; line-height: 1.6; color: var(--muted); }
.page-footer a { display: inline-flex; align-items: center; gap: 6px; min-height: var(--control-height); font-size: 12px; font-weight: 500; color: var(--muted); text-decoration: none; }
.page-footer a:hover { color: var(--success); }
.page-footer svg { width: 14px; height: 14px; }
.noscript-note { padding: 16px; color: var(--danger); text-align: center; }
body.access-open { overflow: hidden; }
.access-dialog { width: min(420px, calc(100% - 32px)); max-height: calc(100dvh - 32px); overflow-y: auto; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); box-shadow: 0 24px 80px #11241f30; }
.access-dialog::backdrop { background: #11241f99; backdrop-filter: blur(5px); }
.access-icon { display: grid; place-items: center; width: 36px; height: 36px; margin-bottom: 10px; border-radius: 8px; background: var(--soft); color: var(--success); }
.access-icon svg { width: 24px; height: 24px; }
.access-dialog h2 { font-size: 22px; letter-spacing: -.03em; }
.access-dialog #access-description { margin-top: 8px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.access-dialog label { display: block; margin-top: 12px; font-size: 13px; font-weight: 600; }
.access-input { min-height: var(--field-height); padding: 6px 12px; margin-top: 6px; }
.access-input input { font-size: 18px; letter-spacing: .2em; }
.access-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.access-actions button { min-height: 36px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); background: white; font-size: 13px; font-weight: 600; }
.access-actions #admin-code-submit { flex: 1; background: var(--forest); border-color: var(--forest); color: white; }
.access-actions button:hover { background: var(--soft); }
.access-actions #admin-code-submit:not(:disabled):hover { background: var(--success); }
.access-classic-link { display: inline-flex; align-items: center; min-height: var(--control-height); margin-top: 6px; color: var(--muted); font-size: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-width: 360px) { .brand { font-size: 16px; gap: 6px; } .brand-icon { width: 28px; height: 28px; } .view-nav { gap: 2px; padding: 3px; } .view-nav button { padding-inline: 6px; font-size: 11px; } }
@media (min-width: 480px) { .header-inner { flex-wrap: nowrap; } .brand { font-size: 19px; } .brand-icon { width: 38px; height: 38px; } .brand small { display: block; } .view-nav button { padding-inline: 14px; font-size: 13px; } }
@media (min-width: 768px) {
  .header-inner { padding: 8px 24px; }
  .page-shell { padding: 20px 24px 16px; }
  .intro { margin-bottom: 16px; }
  .market-rates { grid-template-columns: minmax(0, 320px) var(--control-height) minmax(0, 1fr); align-items: center; gap: 4px 8px; }
  .market-meta { grid-column: 3; grid-row: 1; border-top: 0; padding-left: 12px; }
  .market-rates #simulation-rate-error, .manual-rate-controls { grid-column: 1 / -1; }
  .calculator-layout { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); grid-template-rows: min-content 1fr; gap: 8px 20px; }
  .input-column { grid-column: 1; grid-row: 1; }
  .result-column { grid-column: 2; grid-row: 1 / span 2; }
  .support-note { grid-column: 1; grid-row: 2; align-self: start; }
  .amount-card, .rate-card, .budget-card, .profit-card { padding: 14px 16px; }
  .breakdown-card { padding-inline: 16px; }
  .page-footer { padding-inline: 24px; }
}
@media (min-width: 1024px) { .calculator-layout { column-gap: 28px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
