/* Nextrader Affiliates
   Palette and type lifted from the trading app so the two feel like one
   product: #019af6 primary, slate neutrals, #16a34a / #dc2626 for money,
   tabular mono for every figure. No framework, no build step. */

:root {
    --bg: #f8fafc;
    --surface: #ffffff;
    --surface-2: #f1f5f9;
    --border: #e2e8f0;
    --border-strong: #cbd5e1;

    --text: #0f172a;
    --text-2: #334155;
    --muted: #64748b;
    --faint: #94a3b8;

    --brand: #019af6;
    --brand-dark: #0180cf;
    --brand-soft: #e8f5fe;

    --good: #16a34a;
    --good-dark: #15803d;
    --good-soft: #dcfce7;
    --bad: #dc2626;
    --bad-dark: #b91c1c;
    --bad-soft: #fee2e2;
    --warn: #b45309;
    --warn-soft: #fef3c7;

    --r: 10px;
    --r-lg: 14px;
    --shadow: 0 1px 2px rgba(15,23,42,.04), 0 1px 3px rgba(15,23,42,.06);
    --shadow-lg: 0 4px 6px -1px rgba(15,23,42,.07), 0 2px 4px -2px rgba(15,23,42,.05);

    --mono: 'Roboto Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.55 var(--sans);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Every figure is tabular so columns line up and digits don't jitter on update */
.mono, .num, .value, td.num, th.num { font-variant-numeric: tabular-nums; }

/* ================================================================== chrome */

.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 30;
}
.topbar-inner {
    max-width: 1240px; margin: 0 auto; padding: 0 24px;
    height: 62px; display: flex; align-items: center; gap: 18px;
}
.brand {
    font-weight: 700; font-size: 17px; color: var(--text);
    letter-spacing: -.01em; text-decoration: none; white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand .brand-sub { color: var(--brand); }
.spacer { flex: 1; }

.who { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.25; }
.who b { font-size: 13px; font-weight: 600; }
.who small { font-size: 12px; color: var(--muted); font-family: var(--mono); }

.wrap { max-width: 1240px; margin: 0 auto; padding: 26px 24px 72px; }
.narrow { max-width: 460px; margin: 0 auto; padding: 56px 24px 72px; }

h1 { font-size: 26px; line-height: 1.25; margin: 0 0 8px; letter-spacing: -.02em; }
.lede { color: var(--muted); margin: 0 0 28px; font-size: 15px; }

/* ================================================================== cards */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow);
    padding: 22px 24px;
    margin-bottom: 20px;
}
.card-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.card-head .spacer { flex: 1; }
.card h2 { margin: 0; font-size: 15px; font-weight: 650; letter-spacing: -.01em; }
.card .sub { color: var(--muted); font-size: 13px; margin: 4px 0 0; }
.card > .sub:last-child { margin-bottom: 0; }

/* ============================================================== stat tiles */

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    box-shadow: var(--shadow);
    padding: 18px 20px;
    position: relative;
    overflow: hidden;
}
.stat .label {
    font-size: 11px; font-weight: 650; letter-spacing: .06em;
    text-transform: uppercase; color: var(--faint);
}
.stat .value {
    font-size: 27px; font-weight: 700; margin-top: 6px;
    letter-spacing: -.025em; font-variant-numeric: tabular-nums;
    line-height: 1.15;
}
.stat .note { font-size: 12px; color: var(--muted); margin-top: 4px; }
/* A coloured 3px rail is enough to mark the headline tile without shouting */
.stat.accent::before,
.stat.good::before {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
}
.stat.accent::before { background: var(--brand); }
.stat.good::before { background: var(--good); }
.stat.accent .value { color: var(--brand); }
.stat.good .value { color: var(--good); }

/* ================================================================== charts */

.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
@media (max-width: 900px) { .chart-grid { grid-template-columns: 1fr; } }

.chart { width: 100%; height: 220px; display: block; overflow: visible; }
.chart-legend { display: flex; gap: 18px; font-size: 12px; color: var(--muted); margin-top: 10px; }
.chart-legend i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; margin-right: 6px; }

.chart-empty {
    height: 220px; display: flex; align-items: center; justify-content: center;
    color: var(--faint); font-size: 13px; text-align: center; padding: 0 24px;
}

/* Hover readout, positioned by JS */
.chart-tip {
    position: absolute; pointer-events: none; z-index: 40;
    background: #0f172a; color: #fff; border-radius: 8px;
    padding: 8px 11px; font-size: 12px; line-height: 1.45;
    box-shadow: var(--shadow-lg); white-space: nowrap; opacity: 0;
    transition: opacity .12s;
}
.chart-tip.on { opacity: 1; }
.chart-tip b { font-family: var(--mono); font-size: 13px; }
.chart-wrap { position: relative; }

/* =================================================================== forms */

label { display: block; font-size: 13px; font-weight: 600; margin: 0 0 6px; color: var(--text-2); }
.hint { font-weight: 400; color: var(--muted); font-size: 12.5px; }

input, select, textarea {
    width: 100%; padding: 10px 12px;
    border: 1px solid var(--border-strong); border-radius: var(--r);
    font: inherit; background: #fff; color: var(--text);
    transition: border-color .12s, box-shadow .12s;
}
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(1,154,246,.16);
}
input::placeholder { color: var(--faint); }
textarea { resize: vertical; min-height: 88px; }
.field { margin-bottom: 18px; }
.field:last-child { margin-bottom: 0; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

button, .btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px;
    padding: 11px 18px; background: var(--brand); color: #fff;
    border: 1px solid transparent; border-radius: var(--r);
    font: inherit; font-weight: 600; line-height: 1.2; letter-spacing: -.005em;
    cursor: pointer; text-decoration: none; white-space: nowrap;
    box-shadow: 0 1px 2px rgba(15,23,42,.08);
    transition: background .12s, box-shadow .12s, transform .06s;
}
button:hover, .btn:hover {
    background: var(--brand-dark); text-decoration: none;
    box-shadow: 0 2px 8px rgba(1,154,246,.3);
}
/* A pressed button should feel pressed -- 1px is enough to read as a click. */
button:active, .btn:active { transform: translateY(1px); box-shadow: none; }
button:focus-visible, .btn:focus-visible {
    outline: none; box-shadow: 0 0 0 3px rgba(1,154,246,.35);
}
button:disabled { opacity: .5; cursor: not-allowed; box-shadow: none; transform: none; }
.btn-ghost { background: transparent; color: var(--text-2); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn-good { background: var(--good); } .btn-good:hover { background: var(--good-dark); }
.btn-bad { background: var(--bad); } .btn-bad:hover { background: var(--bad-dark); }
.btn-block { width: 100%; }

/* Payment method chooser — radio cards rather than a select, so the three
   options and their warnings are all visible at once. */
.methods { display: grid; gap: 10px; margin-bottom: 18px; }
.method {
    display: flex; gap: 12px; align-items: flex-start;
    border: 1px solid var(--border-strong); border-radius: var(--r);
    padding: 13px 15px; cursor: pointer; transition: border-color .12s, background .12s;
}
.method:hover { border-color: var(--faint); }
.method input { width: auto; margin: 3px 0 0; accent-color: var(--brand); flex: none; }
.method.on { border-color: var(--brand); background: var(--brand-soft); }
.method b { display: block; font-size: 14px; font-weight: 600; }
.method small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }

/* ================================================================ notices */

.notice { padding: 12px 15px; border-radius: var(--r); font-size: 14px; margin-bottom: 18px; border: 1px solid transparent; }
.notice.ok { background: var(--good-soft); color: var(--good-dark); border-color: #bbf7d0; }
.notice.err { background: var(--bad-soft); color: var(--bad-dark); border-color: #fecaca; }
.notice.warn { background: var(--warn-soft); color: var(--warn); border-color: #fde68a; }
.notice:empty { display: none; }

/* ================================================================== tables */

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -24px; padding: 0 24px; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
th {
    font-size: 11px; text-transform: uppercase; letter-spacing: .05em;
    color: var(--faint); font-weight: 650; background: var(--surface);
    position: sticky; top: 0;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--surface-2); }
td.num, th.num { text-align: right; }
td:first-child, th:first-child { padding-left: 4px; }
td:last-child, th:last-child { padding-right: 4px; }
.pos { color: var(--good); font-weight: 600; }
.neg { color: var(--bad); font-weight: 600; }
code, .code { font-family: var(--mono); font-size: 12.5px; background: var(--surface-2); padding: 2px 6px; border-radius: 5px; }

.pill { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 650; letter-spacing: .01em; }
.pill.PENDING, .pill.REQUESTED { background: var(--warn-soft); color: var(--warn); }
.pill.ACTIVE, .pill.APPROVED, .pill.PAID { background: var(--good-soft); color: var(--good-dark); }
.pill.REJECTED, .pill.SUSPENDED, .pill.VOID { background: var(--bad-soft); color: var(--bad-dark); }

.empty { padding: 44px 20px; text-align: center; color: var(--faint); font-size: 13.5px; }
.empty b { display: block; color: var(--muted); font-size: 14px; margin-bottom: 4px; font-weight: 600; }

/* ============================================================ referral link */

.linkbox { display: flex; gap: 10px; }
.linkbox input {
    font-family: var(--mono); font-size: 13px;
    background: var(--surface-2); border-color: var(--border);
}

/* =================================================================== tabs */

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin-bottom: 22px; overflow-x: auto; }
.tab {
    padding: 10px 16px; border: 0; background: none; color: var(--muted);
    font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap;
    border-bottom: 2px solid transparent; border-radius: 0;
}
.tab:hover { background: none; color: var(--text); }
.tab.active { color: var(--brand); border-bottom-color: var(--brand); }
.panel { display: none; } .panel.active { display: block; }

/* ================================================================ skeleton */

/* Shown until the first fetch resolves, so the page never flashes zeros that
   then jump to real numbers. */
.sk { color: transparent !important; position: relative; }
.sk::after {
    content: ''; position: absolute; inset: 2px 0;
    background: linear-gradient(90deg, var(--surface-2) 25%, #e9eef5 37%, var(--surface-2) 63%);
    background-size: 400% 100%; border-radius: 6px;
    animation: sk 1.3s ease infinite;
}
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

@media (max-width: 720px) {
    .topbar-inner, .wrap { padding-left: 16px; padding-right: 16px; }
    .table-scroll { margin: 0 -16px; padding: 0 16px; }
    .card { padding: 18px 16px; }
    .row { grid-template-columns: 1fr; }
    h1 { font-size: 22px; }
    .stat .value { font-size: 23px; }
    .who b { display: none; }
}

/* ============================================================ brand mark */

.brand { display: inline-flex; align-items: center; gap: 9px; }
.brand-mark { width: 22px; height: 22px; display: block; border-radius: 4px; }

/* ============================================================== signup */

.wrap-signup { max-width: 1120px; padding-top: 44px; }
.signup { display: grid; grid-template-columns: 1fr 1.05fr; gap: 56px; align-items: start; }
@media (max-width: 940px) {
    .signup { grid-template-columns: 1fr; gap: 30px; }
    .wrap-signup { padding-top: 26px; }
}

.pitch h1 { font-size: 32px; line-height: 1.2; margin: 0 0 12px; }
.pitch .lede { margin-bottom: 26px; font-size: 16px; }
@media (max-width: 940px) { .pitch h1 { font-size: 25px; } }

.ticks { list-style: none; margin: 0 0 26px; padding: 0; }
.ticks li { position: relative; padding: 0 0 16px 30px; font-size: 13.5px; color: var(--muted); }
.ticks li b { display: block; color: var(--text); font-size: 14.5px; font-weight: 600; margin-bottom: 1px; }
.ticks li::before {
    content: '✓'; position: absolute; left: 0; top: 1px;
    width: 19px; height: 19px; border-radius: 50%;
    background: var(--good-soft); color: var(--good-dark);
    font-size: 11px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}

.pitch-note {
    background: var(--brand-soft); border: 1px solid #c3e6fd;
    border-radius: var(--r-lg); padding: 15px 17px;
    font-size: 13.5px; color: var(--text-2); line-height: 1.6;
}
.pitch-note b { display: block; color: var(--brand-dark); margin-bottom: 5px; font-size: 13px; }
.pitch-note b:last-of-type { display: inline; }

.signup-card { margin: 0; padding: 26px 28px; }
.form-head { margin-bottom: 20px; }
.form-head h2 { font-size: 17px; }
.signup-card .field { margin-bottom: 15px; }
.signup-card .row { gap: 14px; }

/* /aff/ prefix glued to the code input, so the link shape is obvious */
.prefixed { display: flex; align-items: stretch; }
.prefixed .prefix {
    display: flex; align-items: center; padding: 0 11px;
    background: var(--surface-2); border: 1px solid var(--border-strong); border-right: 0;
    border-radius: var(--r) 0 0 var(--r);
    font-family: var(--mono); font-size: 13px; color: var(--muted); white-space: nowrap;
}
.prefixed input { border-radius: 0 var(--r) var(--r) 0; font-family: var(--mono); }

.done-mark {
    width: 46px; height: 46px; border-radius: 50%;
    background: var(--good-soft); color: var(--good-dark);
    font-size: 22px; font-weight: 700;
    display: flex; align-items: center; justify-content: center; margin-bottom: 14px;
}

/* ====================================================== method: coming soon */

.method.soon { opacity: .58; cursor: not-allowed; background: var(--surface-2); }
.method.soon:hover { border-color: var(--border-strong); }
.method.soon input { cursor: not-allowed; }

/* Helper link inside a method card (e.g. where to get a USDT wallet).
   Inline-flex so it sits on its own line and only the text is clickable --
   a full-width target here would be easy to hit while aiming for the card. */
.method-help {
    display: inline-flex; align-items: center; gap: 3px; margin-top: 6px;
    font-size: 12.5px; font-weight: 600; color: var(--brand);
    text-decoration: none; border-radius: 5px;
}
.method-help:hover { color: var(--brand-dark); text-decoration: underline; }
.method-help:focus-visible {
    outline: none; box-shadow: 0 0 0 3px rgba(1,154,246,.3);
}
.methods.slim .method-help { margin-top: 5px; font-size: 12px; }
.soon-tag {
    display: inline-block; margin-left: 8px; padding: 1px 7px;
    background: var(--warn-soft); color: var(--warn);
    border-radius: 999px; font-size: 10.5px; font-weight: 700;
    font-style: normal; letter-spacing: .02em; vertical-align: 1px;
}

/* ========================================================= payout schedule */

.schedule { display: flex; align-items: center; gap: 15px; flex-wrap: wrap; }
.schedule-date {
    background: var(--brand-soft); border: 1px solid #c3e6fd; border-radius: var(--r);
    padding: 11px 16px; text-align: center; min-width: 110px;
}
.schedule-date .d { font-size: 18px; font-weight: 700; color: var(--brand-dark); letter-spacing: -.02em; }
.schedule-date .m { font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--brand); }
.schedule-body { flex: 1; min-width: 240px; font-size: 13.5px; color: var(--muted); }
.schedule-body b { color: var(--text); }

/* ==================================================== admin live leaderboard */

.live-dot {
    display: inline-block; width: 7px; height: 7px; border-radius: 50%;
    background: var(--good); margin-right: 7px; vertical-align: 1px;
    animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

.rank { color: var(--faint); font-variant-numeric: tabular-nums; font-size: 12.5px; }
tbody tr.top td { background: linear-gradient(90deg, var(--brand-soft), transparent 60%); }

/* The old arrow was two rotated gradient corners -- crisp only at one zoom
   level. An SVG chevron scales, and matches the one on the country field. */
select {
    appearance: none; -webkit-appearance: none; cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.75 6 6.25 11 1.75' fill='none' stroke='%2364748b' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 13px center;
    background-size: 11px 7px; padding-right: 36px;
}
select:hover { border-color: var(--faint); }

/* ==================================================== loading progress bar */

/* A thin bar pinned under the topbar. Requests here are short, so a spinner
   in the middle of the page would flash more than it informs -- this reads as
   "working" without moving any layout. */
#nsbar {
    position: fixed; top: 0; left: 0; height: 3px; width: 0;
    background: linear-gradient(90deg, var(--brand), #5cc2fa);
    z-index: 100; opacity: 0;
    transition: width .22s ease, opacity .25s ease;
    box-shadow: 0 0 8px rgba(1,154,246,.5);
}
#nsbar.on { opacity: 1; }

/* ================================================================== modal */

.modal {
    position: fixed; inset: 0; z-index: 60;
    background: rgba(15,23,42,.45);
    display: flex; align-items: flex-start; justify-content: center;
    padding: 40px 16px; overflow-y: auto;
    opacity: 0; pointer-events: none; transition: opacity .16s;
}
.modal.on { opacity: 1; pointer-events: auto; }
.modal-box {
    background: var(--surface); border-radius: var(--r-lg);
    box-shadow: 0 20px 45px rgba(15,23,42,.22);
    width: 100%; max-width: 520px;
    transform: translateY(-8px); transition: transform .16s;
}
.modal.on .modal-box { transform: none; }
.modal-head {
    display: flex; align-items: center; gap: 14px;
    padding: 18px 22px; border-bottom: 1px solid var(--border);
}
.modal-head h2 { margin: 0; font-size: 16px; font-weight: 650; }
.modal-head .sub { margin: 3px 0 0; font-size: 12.5px; color: var(--muted); }
.modal-body { padding: 22px; }
.modal-foot {
    padding: 15px 22px; border-top: 1px solid var(--border);
    background: var(--surface-2); border-radius: 0 0 var(--r-lg) var(--r-lg);
    display: flex; gap: 10px; justify-content: flex-end;
}
.modal-x {
    margin-left: auto; background: none; border: 0; color: var(--faint);
    font-size: 22px; line-height: 1; cursor: pointer; padding: 0 2px;
}
.modal-x:hover { background: none; color: var(--text); }

/* ============================================================= compactness */

.wrap { padding-top: 20px; }
.card { padding: 18px 20px; margin-bottom: 16px; }
.card-head { margin-bottom: 14px; }
.stats { gap: 12px; margin-bottom: 16px; }
.stat { padding: 14px 16px; }
.stat .value { font-size: 23px; margin-top: 4px; }
.chart-grid { gap: 16px; margin-bottom: 16px; }
.chart, .chart-empty { height: 190px; }
th, td { padding: 9px 12px; }

/* ============================================================== share note */

.share-badge {
    display: inline-flex; align-items: baseline; gap: 6px;
    background: var(--good-soft); color: var(--good-dark);
    border-radius: 999px; padding: 3px 11px;
    font-size: 12px; font-weight: 650;
}
.share-badge b { font-size: 13px; }

/* ========================================================= landing page */

.hero { padding: 68px 24px 56px; text-align: center; }
.hero-inner { max-width: 760px; margin: 0 auto; }
.hero h1 { font-size: 42px; line-height: 1.15; margin: 18px 0 16px; letter-spacing: -.03em; }
.hero .lede { font-size: 17px; max-width: 620px; margin: 0 auto 26px; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-cta .btn { padding: 12px 26px; font-size: 15px; }
@media (max-width: 720px) { .hero { padding: 40px 16px 36px; } .hero h1 { font-size: 29px; } }

.band { background: var(--surface); border-block: 1px solid var(--border); padding: 40px 24px; }
.band-inner { max-width: 1000px; margin: 0 auto; }
.band-inner h2 { font-size: 22px; margin: 0 0 6px; letter-spacing: -.02em; }

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 20px; text-align: center; }
.facts b { display: block; font-size: 26px; font-weight: 700; color: var(--brand); letter-spacing: -.02em; }
.facts span { display: block; font-size: 13px; color: var(--muted); margin-top: 3px; }

.section { padding: 56px 24px; }
.section-inner { max-width: 1000px; margin: 0 auto; }
.section-inner h2 { font-size: 24px; margin: 0 0 26px; letter-spacing: -.02em; }
.narrow-section { max-width: 720px; }
@media (max-width: 720px) { .section { padding: 38px 16px; } .section-inner h2 { font-size: 20px; } }

.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 26px; }
.steps article { position: relative; padding-left: 44px; }
.steps h3 { font-size: 15px; margin: 0 0 5px; }
.steps p { font-size: 13.5px; color: var(--muted); margin: 0; line-height: 1.6; }
.step-n {
    position: absolute; left: 0; top: -2px;
    width: 30px; height: 30px; border-radius: 50%;
    background: var(--brand-soft); color: var(--brand);
    font-size: 14px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}

.calc { display: flex; align-items: stretch; gap: 16px; flex-wrap: wrap; }
.calc > div { flex: 1; min-width: 190px; background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 18px 20px; }
.calc span { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--faint); font-weight: 650; }
.calc b { display: block; font-size: 28px; font-weight: 700; letter-spacing: -.02em; margin-top: 5px; font-variant-numeric: tabular-nums; }
.calc small { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.calc .arrow { flex: 0 0 auto; min-width: 0; border: 0; background: none; display: flex; align-items: center; color: var(--faint); font-size: 20px; padding: 0; }
.calc-you { border-color: #bbf7d0 !important; background: var(--good-soft) !important; }
.calc-you b { color: var(--good-dark); }
@media (max-width: 640px) { .calc .arrow { display: none; } }

.cards3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px; }
.cards3 article { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow); }
.cards3 h3 { font-size: 15px; margin: 0 0 7px; }
.cards3 p { font-size: 13.5px; color: var(--muted); margin: 0; line-height: 1.6; }

details {
    border-bottom: 1px solid var(--border); padding: 15px 0;
}
details summary {
    cursor: pointer; font-weight: 600; font-size: 15px; list-style: none;
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
}
details summary::-webkit-details-marker { display: none; }
details summary::after { content: '+'; color: var(--faint); font-size: 19px; font-weight: 400; flex: none; }
details[open] summary::after { content: '−'; }
details p { margin: 11px 0 0; color: var(--muted); font-size: 14px; line-height: 1.65; }

.cta { background: var(--brand); color: #fff; padding: 52px 24px; text-align: center; }
.cta-inner { max-width: 620px; margin: 0 auto; }
.cta h2 { font-size: 25px; margin: 0 0 8px; letter-spacing: -.02em; }
.cta p { color: rgba(255,255,255,.85); margin: 0 0 22px; }
.cta .btn { background: #fff; color: var(--brand); padding: 12px 28px; font-size: 15px; }
.cta .btn:hover { background: #f1f5f9; }
@media (max-width: 720px) { .cta h2 { font-size: 20px; } }

.foot { background: var(--surface); border-top: 1px solid var(--border); padding: 22px 24px; }
.foot-inner { max-width: 1000px; margin: 0 auto; display: flex; align-items: center; gap: 20px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }

/* ======================================================= country combobox */

.cc { position: relative; }
.cc input { padding-right: 34px; }
.cc::after {
    content: ''; position: absolute; right: 13px; top: 50%;
    width: 11px; height: 7px; margin-top: -3.5px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.75 6 6.25 11 1.75' fill='none' stroke='%2364748b' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / 11px 7px;
    pointer-events: none; transition: transform .12s;
}
.cc:focus-within::after { transform: rotate(180deg); }
.cc-list {
    position: absolute; z-index: 50; left: 0; right: 0; top: calc(100% + 4px);
    background: var(--surface); border: 1px solid var(--border-strong);
    border-radius: var(--r); box-shadow: var(--shadow-lg);
    max-height: 260px; overflow-y: auto; display: none;
}
.cc-list.on { display: block; }
.cc-opt {
    padding: 9px 13px; font-size: 14px; cursor: pointer;
    display: flex; align-items: center; gap: 9px;
}
/* NS.flag() returns '' where the platform has no flag glyphs, and the span is
   omitted entirely -- so the gap above never becomes a stray indent. */
.cc-opt:first-child { border-radius: var(--r) var(--r) 0 0; }
.cc-opt:last-child { border-radius: 0 0 var(--r) var(--r); }
.cc-opt:hover, .cc-opt.on { background: var(--brand-soft); }
.cc-flag { font-size: 16px; line-height: 1; }
.cc-empty { padding: 14px; text-align: center; color: var(--faint); font-size: 13px; }

/* ============================================ slim payment method options */

.methods.slim { gap: 7px; }
.methods.slim .method { padding: 9px 12px; align-items: center; gap: 10px; border-radius: 9px; }
.methods.slim .method b { font-size: 13.5px; display: flex; align-items: center; gap: 7px; }
.methods.slim .method small { font-size: 12px; margin-top: 1px; line-height: 1.4; }
.methods.slim .method input { margin: 0; }

/* Collapsed-by-default optional section */
.optional-block {
    border: 1px dashed var(--border-strong); border-radius: var(--r);
    padding: 13px 15px; background: var(--surface-2);
}
/* This is a disclosure control, not an action -- it must not inherit any of
   the filled-button styling above, shadow and press-shift included. */
.optional-toggle {
    display: flex; align-items: center; gap: 9px; width: 100%;
    background: none; border: 0; padding: 0; cursor: pointer;
    font: inherit; font-weight: 600; font-size: 13.5px; color: var(--text-2);
    text-align: left; box-shadow: none;
}
.optional-toggle:hover { background: none; color: var(--text); box-shadow: none; }
.optional-toggle:active { transform: none; box-shadow: none; }
.optional-toggle:focus-visible {
    outline: none; box-shadow: 0 0 0 3px rgba(1,154,246,.3); border-radius: 6px;
}
.optional-toggle .chev {
    margin-left: auto; flex: none; width: 11px; height: 7px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.75 6 6.25 11 1.75' fill='none' stroke='%2394a3b8' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / 11px 7px;
    font-size: 0; color: transparent; transition: transform .15s;
}
.optional-toggle[aria-expanded="true"] .chev { transform: rotate(180deg); }
.optional-body { margin-top: 14px; }
/* Block, not inline -- otherwise the note runs on from the label as one
   sentence and the control reads as a very long button. */
.optional-note {
    display: block; font-size: 12.5px; color: var(--muted);
    font-weight: 400; margin-top: 3px; line-height: 1.4;
}

/* ===================================================== earnings calculator */

.calcbox {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 16px; box-shadow: var(--shadow); overflow: hidden;
    display: grid; grid-template-columns: 1fr 300px;
}
@media (max-width: 800px) { .calcbox { grid-template-columns: 1fr; } }

.calc-inputs { padding: 26px 28px; }
.calc-row { margin-bottom: 22px; }
.calc-row:last-child { margin-bottom: 0; }
.calc-row label { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 9px; font-size: 13.5px; }
.calc-row .val { font-family: var(--mono); font-weight: 600; color: var(--brand); font-size: 15px; }

input[type=range] {
    -webkit-appearance: none; appearance: none;
    width: 100%; height: 26px; padding: 0; border: 0;
    background: transparent; border-radius: 0; cursor: pointer;
    touch-action: pan-y;   /* let a vertical swipe scroll the page past it */
}
input[type=range]:focus { box-shadow: none; outline: none; }
input[type=range]::-webkit-slider-runnable-track {
    height: 5px; background: var(--border); border-radius: 999px;
}
input[type=range]::-moz-range-track {
    height: 5px; background: var(--border); border-radius: 999px;
}
input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 20px; height: 20px; border-radius: 50%; margin-top: -7.5px;
    background: var(--brand); border: 3px solid #fff;
    box-shadow: 0 1px 4px rgba(15,23,42,.28); cursor: grab;
}
input[type=range]::-moz-range-thumb {
    width: 20px; height: 20px; border-radius: 50%; box-sizing: border-box;
    background: var(--brand); border: 3px solid #fff;
    box-shadow: 0 1px 4px rgba(15,23,42,.28); cursor: grab; border-color: #fff;
}
input[type=range]:focus-visible::-webkit-slider-thumb {
    box-shadow: 0 0 0 4px rgba(1,154,246,.32);
}

.calc-out {
    background: linear-gradient(160deg, var(--brand), #0180cf);
    color: #fff; padding: 26px 28px;
    display: flex; flex-direction: column; justify-content: center;
}
.calc-out .lab { font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; opacity: .85; font-weight: 650; }
.calc-out .big {
    font-size: 40px; font-weight: 700; letter-spacing: -.03em;
    font-variant-numeric: tabular-nums; line-height: 1.1; margin: 7px 0 3px;
}
.calc-out .sm { font-size: 13px; opacity: .9; }
.calc-out hr { border: 0; border-top: 1px solid rgba(255,255,255,.25); margin: 17px 0; }
.calc-out .yr { font-size: 19px; font-weight: 650; font-variant-numeric: tabular-nums; }
@media (max-width: 800px) { .calc-out .big { font-size: 33px; } }

/* ==================================================================== mobile

   The top bar was a single non-wrapping flex row, so on a phone the action
   buttons ran past the right edge. That is worse than it looks: the overflow
   widens the layout viewport, and anything sized against it -- the settings
   modal in particular -- is dragged out of the screen with it. So the bar is
   fixed first, and most of the rest follows.
   ------------------------------------------------------------------------ */

.hide-xs { display: inline; }

@media (max-width: 720px) {
    .topbar-inner { height: 58px; padding: 0 14px; gap: 9px; }
    .brand { font-size: 15.5px; min-width: 0; }
    /* The account name is repeated inside the page; the bar is not the place
       to spend 90px on it when two controls need to fit. */
    .who { display: none; }
    .topbar-inner .btn-sm { padding: 9px 12px; font-size: 12.5px; }
}

@media (max-width: 470px) {
    /* Drop the wordmark, keep the mark and the suffix -- "Admin" still has to
       be distinguishable from "Affiliates" at a glance. */
    .brand-name { display: none; }
    .hide-xs { display: none; }
    .topbar-inner { gap: 7px; padding: 0 12px; }
    .topbar-inner .btn-sm { padding: 9px 10px; font-size: 12px; }
}

/* ------------------------------------------------------------ modal on a phone */

@media (max-width: 640px) {
    .modal { padding: 12px 12px 28px; }
    .modal-head { padding: 15px 16px; gap: 10px; }
    .modal-body { padding: 17px 16px; }
    .modal-foot { padding: 13px 16px; flex-direction: column-reverse; gap: 8px; }
    /* Stacked, full-width and reversed: the primary action ends up at the
       bottom, nearest the thumb. */
    .modal-foot button, .modal-foot .btn { width: 100%; }
    .modal-x { width: 40px; height: 40px; margin-right: -8px; font-size: 24px; }
}

/* ------------------------------------------------------------------ content */

@media (max-width: 560px) {
    /* One tile per row below this: at 190px minimum two columns leave the
       numbers cramped against their labels. */
    .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat { padding: 13px 14px; }
    .stat .value { font-size: 21px; }
    .stat .label { font-size: 10.5px; }
    .stat .note { font-size: 11.5px; }
}

@media (max-width: 420px) {
    .stats { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
    .narrow { padding: 28px 16px 56px; }
    .wrap { padding-bottom: 56px; }
    .modal-head h2, .card h2 { font-size: 14.5px; }
    /* Long, unbreakable strings -- referral links, wallet addresses, emails --
       must wrap rather than push the page wide. */
    .card, .stat, td, .sub, .hint { overflow-wrap: anywhere; }
    .tabs { margin-left: -16px; margin-right: -16px; padding: 0 16px; }
}

/* --------------------------------------------------------------- touch targets */

@media (pointer: coarse) {
    /* 40px is the smallest comfortable target; .btn-sm was 30px. */
    .btn-sm, button.btn-sm, .topbar-inner .btn-sm { min-height: 40px; }
    .tab { padding-top: 13px; padding-bottom: 13px; }
    .cc-opt { padding: 12px 13px; }
    .method { padding: 13px 14px; }
    .methods.slim .method { padding: 12px 13px; }
    .modal-x { width: 42px; height: 42px; }
}

/* An action group in a card header -- a period picker beside its button.
   Side by side on a wide screen, full width and stacked on a narrow one,
   where a card header cannot hold a heading and two controls on one line. */
.card-actions { display: flex; gap: 10px; align-items: center; }

@media (max-width: 720px) {
    .card-head { flex-wrap: wrap; gap: 12px; }
    .card-head .spacer { display: none; }
    .card-actions { width: 100%; }
    .card-actions select { flex: 1; width: auto; min-width: 0; }
    .card-actions button, .card-actions .btn { flex: none; }
}

@media (max-width: 420px) {
    .card-actions { flex-direction: column; align-items: stretch; }
    .card-actions button, .card-actions .btn { width: 100%; }
}

/* Touch targets missed by the first pass. */
@media (pointer: coarse) {
    input[type=range] { height: 34px; }
    input[type=range]::-webkit-slider-thumb { margin-top: -11.5px; }
    .method-help { padding: 4px 0; }
}

/* Row action buttons in a table cell: on one line, wrapping only when the
   screen is genuinely too narrow for them. */
.row-acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.row-acts button { white-space: nowrap; }
