@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 700; font-display: swap; src: url("fonts/inter-latin.woff2") format("woff2"); }
@font-face { font-family: "Material Icons Outlined"; font-style: normal; font-weight: 400; font-display: block; src: url("fonts/material-icons-outlined.woff2") format("woff2"); }

:root {
  --bg: #121215;
  --surface: rgba(208, 217, 251, 0.08);
  --surface-strong: rgba(208, 217, 251, 0.12);
  --outline: rgba(208, 217, 251, 0.12);
  --outline-strong: rgba(208, 217, 251, 0.24);
  --text: #f7f7f8;
  --text-nav: #e5e5e6;
  --text-muted: #bbbcbe;
  --text-dim: #8a8c93;
  --btn: #2b2d33;
  --btn-text: #bcbec8;
  --link: #528bff;
  --primary: #335fff;
  --info: rgba(51, 95, 255, 0.16);
  --danger: #f7656d;
  --danger-bg: rgba(247, 101, 109, 0.14);
  --premium: #528bff;
  --standard: #3fbb8f;
  --rest: rgba(208, 217, 251, 0.16);
  --radius: 8px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: #fff;
  font: 400 14px/1.4 "Inter", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
.mi {
  font-family: "Material Icons Outlined";
  font-weight: normal; font-style: normal;
  font-size: 20px; line-height: 1; letter-spacing: normal;
  text-transform: none; white-space: nowrap; direction: ltr;
  display: inline-block; font-feature-settings: "liga"; -webkit-font-feature-settings: "liga";
  user-select: none;
}

.shell { display: flex; min-height: 100vh; }

/* Sidebar */
.sidebar {
  position: sticky; top: 0; height: 100vh;
  width: 224px; flex: none;
  display: flex; flex-direction: column;
  padding: 16px;
  border-right: 1px solid var(--outline);
  background: var(--bg);
}
.brand { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 8px; margin-bottom: 16px; }
.brand .mi { font-size: 22px; }
.brand-name { font-weight: 800; font-size: 20px; letter-spacing: 0.02em; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-bottom { margin-top: auto; display: flex; flex-direction: column; gap: 4px; padding-top: 16px; border-top: 1px solid var(--outline); }
.nav-item {
  display: flex; align-items: center; gap: 14px;
  height: 40px; padding: 0 10px;
  border: 0; border-radius: var(--radius);
  background: transparent; color: var(--text-nav);
  font: 700 14px/1 inherit; font-family: inherit;
  cursor: pointer; text-decoration: none; text-align: left;
}
.nav-item:hover { background: var(--surface); text-decoration: none; }
.nav-item.active { background: var(--surface); color: var(--text); }

/* Main column */
.main { flex: 1; min-width: 0; padding: 0 40px 24px; }
.topbar { display: flex; align-items: center; gap: 12px; height: 72px; }
.topbar h1 { margin: 0; font-size: 28px; font-weight: 700; color: #fff; }
.icon-btn { display: none; width: 40px; height: 40px; border: 0; border-radius: var(--radius); background: transparent; color: var(--text-nav); cursor: pointer; }
.icon-btn:hover { background: var(--surface); }

/* Banner, as the DevEx eligibility strip */
.banner {
  display: flex; align-items: center; gap: 16px;
  padding: 14px 16px;
  border-radius: 5px;
  background: var(--surface-strong);
}
.ring {
  --p: 0;
  width: 52px; height: 52px; flex: none; border-radius: 50%;
  display: grid; place-items: center;
  background: conic-gradient(var(--premium) calc(var(--p) * 1%), rgba(0, 0, 0, 0.35) 0);
  font-size: 12px; font-weight: 600;
  position: relative;
}
.ring::before { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: #1d1e23; }
.ring span { position: relative; }
.banner-body { flex: 1; min-width: 0; }
.banner-kicker { color: #fff; }
.banner-amount { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; font-size: 22px; font-weight: 700; margin: 2px 0; }
.banner-sub { font-size: 16px; font-weight: 600; color: var(--text-muted); }
.banner-note { color: var(--text-muted); }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 16px;
  border: 0; border-radius: var(--radius);
  background: var(--btn); color: var(--btn-text);
  font: 700 16px/1 inherit; font-family: inherit; cursor: pointer; flex: none;
}
.btn:hover { background: #363941; color: #e5e5e6; }
.btn .mi { font-size: 18px; }
.footnote { margin: 6px 0 24px; font-size: 12px; color: var(--text-muted); }

.alert { display: flex; gap: 10px; align-items: center; padding: 10px 16px; margin-bottom: 16px; border-radius: var(--radius); background: var(--danger-bg); color: var(--text); }
.alert .mi { color: var(--danger); }

/* Form */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.card { padding: 20px; border: 1px solid var(--outline); border-radius: var(--radius); background: transparent; min-width: 0; }
.card.wide { margin-top: 16px; }
.card h2 { margin: 0 0 16px; font-size: 16px; font-weight: 700; color: var(--text); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { margin-bottom: 14px; min-width: 0; }
.field label { display: block; margin-bottom: 6px; color: var(--text-muted); font-size: 14px; }
.field input, .field select {
  width: 100%; height: 44px; padding: 0 12px;
  border: 1px solid var(--outline-strong); border-radius: var(--radius);
  background: transparent; color: #fff;
  font: 400 16px/1 inherit; font-family: inherit;
  outline: none; appearance: none; -moz-appearance: textfield;
}
.field select {
  background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%), linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 19px, calc(100% - 13px) 19px;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
  padding-right: 32px;
}
.field select option { background: #1d1e23; color: #fff; }
.field input::-webkit-outer-spin-button, .field input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.field input:hover, .field select:hover { border-color: rgba(208, 217, 251, 0.4); }
.field input:focus, .field select:focus { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.field input[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger); }
.help { margin: 6px 0 0; font-size: 14px; color: var(--text-muted); }
.field .label { display: block; margin-bottom: 6px; color: var(--text-muted); font-size: 14px; }
.field .segmented { margin-bottom: 0; height: 44px; }
.field .segmented label { margin: 0; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.field input[readonly] { color: var(--text-muted); border-style: dashed; }
.readout { display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 12px; border-radius: var(--radius); background: var(--info); color: var(--text); font-weight: 600; }
.readout .mi { color: var(--link); font-size: 18px; }
.field input[type="range"] { height: 44px; padding: 0; border: 0; box-shadow: none; accent-color: var(--primary); appearance: auto; -webkit-appearance: auto; }
.card.wide-card { grid-column: 1 / -1; }

.segmented { display: flex; gap: 4px; padding: 4px; margin-bottom: 14px; border-radius: var(--radius); background: var(--surface); }
.segmented input, .field .segmented input { position: absolute; width: 1px; height: 1px; padding: 0; margin: 0; border: 0; opacity: 0; pointer-events: none; overflow: hidden; }
.segmented label { flex: 1; text-align: center; padding: 8px 10px; border-radius: 6px; color: var(--text-muted); font-weight: 600; cursor: pointer; }
.segmented input:checked + label { background: var(--btn); color: #fff; }
.segmented input:focus-visible + label { box-shadow: 0 0 0 2px var(--primary); }

.check { display: flex; gap: 10px; align-items: center; margin: 2px 0 14px; color: var(--text-nav); cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }

/* Breakdown */
.pools { display: flex; height: 12px; border-radius: 6px; overflow: hidden; background: var(--rest); }
.pool { height: 100%; transition: width 0.2s ease; }
.pool.premium, .dot.premium { background: var(--premium); }
.pool.standard, .dot.standard { background: var(--standard); }
.pool.rest, .dot.rest { background: var(--rest); }
.legend { display: flex; flex-wrap: wrap; gap: 18px; margin: 10px 0 14px; color: var(--text-muted); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 8px; }
.table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.table th { text-align: left; font-weight: 600; color: var(--text-muted); padding: 10px 0; border-bottom: 1px solid var(--outline); }
.table td { padding: 11px 0; border-bottom: 1px solid var(--outline); color: var(--text); }
.table tr.total td { font-weight: 700; border-bottom: 0; }
.table .num { text-align: right; padding-left: 16px; white-space: nowrap; }
.table td.neg { color: var(--danger); }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 16px; }
.stat { padding: 16px; border-radius: var(--radius); background: var(--surface); min-width: 0; }
.stat .k { display: flex; align-items: center; gap: 8px; color: var(--text-muted); }
.stat .k .mi { font-size: 18px; }
.stat .v { margin-top: 8px; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; }
.stat .s { margin-top: 2px; color: var(--text-dim); font-size: 12px; }

.about p { margin: 0 0 10px; color: var(--text-nav); line-height: 1.55; max-width: 80ch; }
.footer { margin-top: 32px; padding-top: 16px; border-top: 1px solid var(--outline); color: var(--text-muted); font-size: 12px; }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); padding: 10px 16px; border-radius: var(--radius); background: #2b2d33; color: #fff; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4); }

@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .grid { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 10; transform: translateX(-100%); transition: transform 0.2s ease; }
  .sidebar.open { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, 0.6); }
  .icon-btn { display: inline-grid; place-items: center; }
  .main { padding: 0 16px 24px; }
}
@media (max-width: 560px) {
  .row, .row.three { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; }
  .banner { flex-wrap: wrap; }
  .banner .btn { width: 100%; justify-content: center; }
  .topbar h1 { font-size: 22px; }
}

/* Interactive additions */
.notice { display: flex; gap: 10px; align-items: center; padding: 10px 16px; margin-bottom: 16px; border-radius: var(--radius); background: var(--info); color: var(--text); }
.notice .mi { color: var(--link); }
.notice.warn { background: rgba(247, 196, 85, 0.14); }
.notice.warn .mi { color: #f7c455; }

.slider { width: 100%; margin: 12px 0 4px; accent-color: var(--primary); height: 20px; padding: 0; border: 0; background: transparent; box-shadow: none !important; appearance: auto !important; -webkit-appearance: auto !important; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.chip { height: 30px; padding: 0 12px; border: 1px solid var(--outline-strong); border-radius: 15px; background: transparent; color: var(--text-nav); font: 600 13px/1 inherit; font-family: inherit; cursor: pointer; }
.chip:hover { background: var(--surface); }
.chip.on { background: var(--primary); border-color: var(--primary); color: #fff; }

.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.card-head h2 { margin: 0; }
.help.tight { margin: -8px 0 8px; }
.card-head .help.tight { margin: 0; }

.insights { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 16px; margin-top: 16px; }
.donut-wrap { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.donut { width: 200px; height: 200px; flex: none; }
.donut-arc { cursor: pointer; transition: stroke-width 0.15s ease; outline: none; }
.donut-arc:hover, .donut-arc:focus { stroke-width: 32; }
.donut-k { fill: var(--text-muted); font-size: 12px; }
.donut-v { fill: #fff; font-size: 18px; font-weight: 700; }
.legend-list { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 160px; }
.legend-list li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--outline); font-variant-numeric: tabular-nums; }
.legend-list li:last-child { border-bottom: 0; }
.legend-list .amt { margin-left: auto; color: var(--text); }
.legend-list .share { color: var(--text-dim); width: 48px; text-align: right; }

.curve { width: 100%; height: auto; display: block; cursor: crosshair; touch-action: none; }
.curve .grid { stroke: rgba(208, 217, 251, 0.08); }
.curve .axis { fill: var(--text-dim); font-size: 11px; }
.curve .line { fill: none; stroke: var(--premium); stroke-width: 2.5; }
.curve .area { fill: rgba(82, 139, 255, 0.12); }
.curve .kink { stroke: var(--standard); stroke-dasharray: 4 4; }
.curve .mark { fill: var(--premium); stroke: #fff; stroke-width: 2; }
.curve .guide { stroke: rgba(255, 255, 255, 0.35); }
.curve .hover { fill: #fff; }
.curve .tip { fill: #fff; font-size: 12px; font-weight: 600; }

.methods { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.method { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 14px; border: 1px solid var(--outline); border-radius: var(--radius); background: transparent; color: var(--text); text-align: left; font-family: inherit; cursor: pointer; }
.method:hover:not(:disabled) { background: var(--surface); }
.method.on { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.method:disabled { opacity: 0.45; cursor: not-allowed; }
.method .name { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.method .amount { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.method .meta { color: var(--text-muted); font-size: 12px; }
.method .badge { align-self: flex-start; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 700; }
.badge.best { background: rgba(63, 187, 143, 0.18); color: #6fe0b5; }
.badge.unknown { background: rgba(247, 196, 85, 0.14); color: #f7c455; }
.badge.official { background: var(--info); color: #9bbcff; }

.save-row { display: flex; gap: 12px; align-items: flex-end; }
.save-row .grow { flex: 1; margin-bottom: 0; }
.btn.primary { background: var(--primary); color: #fff; height: 44px; }
.btn.primary:hover { background: #4a72ff; color: #fff; }
.btn.small { height: 34px; padding: 0 12px; font-size: 14px; }
.saved { list-style: none; margin: 14px 0 0; padding: 0; }
.saved li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--outline); }
.saved li .what { flex: 1; min-width: 0; }
.saved li .what strong { display: block; }
.saved li .what span { color: var(--text-muted); font-size: 12px; }
.saved li button { height: 32px; padding: 0 10px; border: 0; border-radius: var(--radius); background: transparent; color: var(--text-nav); cursor: pointer; font-family: inherit; }
.saved li button:hover { background: var(--surface); }

.flash { animation: flash 0.6s ease; }
@keyframes flash { from { color: #9bbcff; } to { color: inherit; } }

@media (max-width: 1300px) { .methods { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1100px) { .insights { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .methods { grid-template-columns: 1fr; } .save-row { flex-direction: column; align-items: stretch; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } html { scroll-behavior: auto; } }

.dot.c-received { background: #3fbb8f; }
.dot.c-tax { background: #f7656d; }
.dot.c-fee { background: #f7c455; }
.dot.c-fx { background: #b28dff; }
.dot.c-other { background: #8a8c93; }
