:root {
    --portal-canvas: #f6f8fb;
    --portal-surface: #ffffff;
    --portal-ink: #13213a;
    --portal-muted: #69758a;
    --portal-line: #e6eaf0;
    --portal-blue: #2563eb;
    --portal-blue-soft: #eef4ff;
    --portal-purple: #7c3aed;
    --portal-green: #13875d;
    --portal-amber: #a85b00;
    --portal-sidebar-width: 248px;
    --portal-radius: 14px;
    --portal-shadow: 0 1px 2px rgba(20, 33, 58, .04), 0 8px 28px rgba(20, 33, 58, .045);
}

*, *::before, *::after { box-sizing: border-box; }

html { min-width: 320px; background: var(--portal-canvas); }

body.partner-portal {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    background: var(--portal-canvas);
    color: var(--portal-ink);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

body.partner-portal button,
body.partner-portal input,
body.partner-portal select,
body.partner-portal textarea { font: inherit; }

body.partner-portal a { color: inherit; }
body.partner-portal [hidden] { display: none !important; }

body.partner-portal :focus-visible {
    outline: 3px solid rgba(37, 99, 235, .3);
    outline-offset: 2px;
}

.portal-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;
}

.portal-skip-link {
    position: fixed;
    z-index: 1000;
    top: 10px;
    left: 12px;
    padding: 9px 14px;
    border-radius: 8px;
    background: var(--portal-ink);
    color: #fff;
    text-decoration: none;
    transform: translateY(-150%);
    transition: transform .15s ease;
}

.portal-skip-link:focus { transform: translateY(0); }

.portal-shell { min-height: 100vh; }

.portal-sidebar {
    position: fixed;
    z-index: 40;
    inset: 0 auto 0 0;
    display: flex;
    width: var(--portal-sidebar-width);
    flex-direction: column;
    padding: 20px 16px 16px;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--portal-surface);
    border-right: 1px solid var(--portal-line);
}

.portal-sidebar__header {
    display: flex;
    min-height: 52px;
    align-items: center;
    justify-content: space-between;
    padding: 0 6px;
}

.portal-brand {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    gap: 11px;
    text-decoration: none;
}

.portal-brand__mark {
    width: 37px;
    height: 37px;
    flex: 0 0 37px;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(19, 33, 58, .1);
}

.portal-brand__copy { display: grid; min-width: 0; line-height: 1.08; }
.portal-brand__name { font-family: "DM Sans", Inter, sans-serif; font-size: 18px; font-weight: 700; letter-spacing: -.025em; }
.portal-brand__product { margin-top: 5px; color: var(--portal-muted); font-size: 10px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }

.portal-sidebar__close {
    display: none;
    width: 38px;
    height: 38px;
    padding: 8px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--portal-muted);
    cursor: pointer;
}

.portal-sidebar__close:hover { background: var(--portal-canvas); color: var(--portal-ink); }

.portal-sidebar__close svg,
.portal-menu-button svg,
.portal-account__logout svg {
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.portal-nav { display: grid; gap: 5px; margin-top: 35px; }

.portal-nav__eyebrow {
    margin: 0 0 7px;
    padding: 0 12px;
    color: #98a2b3;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.portal-nav__link {
    position: relative;
    display: flex;
    min-height: 44px;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    color: #546078;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background-color .15s ease, color .15s ease, transform .15s ease;
}

.portal-nav__link svg {
    width: 20px;
    height: 20px;
    flex: 0 0 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.portal-nav__link:hover { background: #f4f7fc; color: var(--portal-ink); }
.portal-nav__link:active { transform: translateY(1px); }
.portal-nav__link.is-active { background: var(--portal-blue-soft); color: var(--portal-blue); }
.portal-nav__link.is-active::before {
    position: absolute;
    top: 10px;
    bottom: 10px;
    left: -16px;
    width: 3px;
    border-radius: 0 3px 3px 0;
    background: linear-gradient(180deg, var(--portal-blue), var(--portal-purple));
    content: "";
}

.portal-sidebar__footer { display: grid; gap: 13px; margin-top: auto; padding-top: 24px; }

.portal-payout-disclosure { position: relative; min-width: 0; }

.portal-payout {
    display: grid;
    width: 100%;
    grid-template-columns: 34px minmax(0, 1fr) 16px;
    align-items: center;
    gap: 9px;
    min-width: 0;
    padding: 11px;
    border: 1px solid #dfeee8;
    border-radius: 11px;
    background: #f6fbf9;
    color: var(--portal-ink);
    text-align: left;
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}

.portal-payout--attention { border-color: #f0dfc7; background: #fff9f0; }
.portal-payout:hover,
.portal-payout[aria-expanded="true"] { border-color: #bcdccd; background: #f0f9f5; box-shadow: 0 5px 18px rgba(20, 33, 58, .07); }
.portal-payout--attention:hover,
.portal-payout--attention[aria-expanded="true"] { border-color: #dfc59d; background: #fff5e5; }

.portal-payout__icon {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 9px;
    background: #e6f5ef;
    color: var(--portal-green);
}

.portal-payout--attention .portal-payout__icon { background: #ffedcf; color: var(--portal-amber); }
.portal-payout__icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.portal-payout__copy { display: grid; min-width: 0; line-height: 1.25; }
.portal-payout__label { color: var(--portal-muted); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.portal-payout__state { overflow: hidden; font-size: 12px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.portal-payout__chevron,
.portal-mobile-status__chevron { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s ease; }
.portal-payout[aria-expanded="true"] .portal-payout__chevron,
.portal-mobile-status[aria-expanded="true"] .portal-mobile-status__chevron { transform: rotate(180deg); }

.portal-payout-popover {
    position: absolute;
    z-index: 60;
    bottom: calc(100% + 8px);
    left: 0;
    width: 100%;
    max-height: min(340px, calc(100vh - 24px));
    padding: 13px;
    overflow-y: auto;
    border: 1px solid #d9e6e0;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 14px 38px rgba(20, 33, 58, .16);
    color: var(--portal-ink);
}

.portal-payout-popover--attention { border-color: #ead9bf; }
.portal-payout-popover__header strong { display: block; font-family: "DM Sans", Inter, sans-serif; font-size: 13px; letter-spacing: -.01em; }
.portal-payout-popover__header p { margin: 3px 0 0; color: var(--portal-muted); font-size: 10px; line-height: 1.45; }
.portal-payout-popover__action { display: inline-flex; margin-top: 11px; color: var(--portal-amber) !important; font-size: 10px; font-weight: 800; text-decoration: none; }
.portal-payout-popover__action:hover { text-decoration: underline; }

.portal-currency { display: grid; gap: 7px; padding: 0 2px; }
.portal-currency > label { color: var(--portal-muted); font-size: 11px; font-weight: 700; }
.portal-currency__controls { display: grid; grid-template-columns: 1fr auto; gap: 7px; }
.portal-currency select,
.portal-currency button {
    min-height: 36px;
    border: 1px solid var(--portal-line);
    border-radius: 8px;
    background: #fff;
    color: var(--portal-ink);
    font-size: 12px;
    font-weight: 600;
}
.portal-currency select { width: 100%; min-width: 0; padding: 0 27px 0 10px; }
.portal-currency button { padding: 0 9px; color: var(--portal-blue); cursor: pointer; }
.portal-currency button:hover { border-color: #bfcef1; background: var(--portal-blue-soft); }

.portal-account {
    display: grid;
    grid-template-columns: 38px 1fr 34px;
    align-items: center;
    gap: 9px;
    min-width: 0;
    padding: 13px 2px 0;
    border-top: 1px solid var(--portal-line);
}
.portal-account__avatar {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 11px;
    background: linear-gradient(135deg, #dbeafe, #eee6ff);
    color: #4c42a7;
    font-family: "DM Sans", Inter, sans-serif;
    font-weight: 700;
}
.portal-account__identity { display: grid; min-width: 0; line-height: 1.3; }
.portal-account__identity strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.portal-account__identity span { overflow: hidden; color: var(--portal-muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.portal-account__logout { display: grid; width: 34px; height: 34px; padding: 8px; place-items: center; border-radius: 9px; color: var(--portal-muted); text-decoration: none; }
.portal-account__logout:hover { background: #f2f4f8; color: var(--portal-ink); }

.portal-main { min-height: 100vh; margin-left: var(--portal-sidebar-width); }
.portal-mobile-header { display: none; }
.portal-content { width: 100%; min-width: 0; padding: 34px clamp(24px, 3vw, 40px) 48px; }
.portal-scrim { display: none; }

/* Shared primitives for pages that adopt this shell. */
.portal-page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.portal-page-header h1 { margin: 0; font-family: "DM Sans", Inter, sans-serif; font-size: clamp(26px, 2.2vw, 34px); line-height: 1.15; letter-spacing: -.035em; }
.portal-page-header p { max-width: 700px; margin: 8px 0 0; color: var(--portal-muted); }
.portal-surface { border: 1px solid var(--portal-line); border-radius: var(--portal-radius); background: var(--portal-surface); box-shadow: var(--portal-shadow); }

/* Partner overview */
.portal-page-heading { min-width: 0; }
.portal-eyebrow {
    margin: 0 0 7px !important;
    color: #718096 !important;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .13em;
    line-height: 1.3;
    text-transform: uppercase;
}
.portal-page-heading > p:last-child { margin-top: 10px; }
.portal-page-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 10px; }
.portal-button {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 15px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease, color .15s ease, transform .15s ease;
}
.portal-button:active { transform: translateY(1px); }
.portal-button--primary { border-color: #3157e1; background: #3858e9; color: #fff !important; box-shadow: 0 3px 10px rgba(56, 88, 233, .16); }
.portal-button--primary:hover { border-color: #2749cc; background: #2f50dc; }
.portal-button--primary.is-copied { border-color: #13875d; background: #13875d; }
.portal-button--secondary { border-color: #dfe4ec; background: #fff; color: #34415a !important; }
.portal-button--secondary:hover { border-color: #cdd5e1; background: #f9fafc; }

.portal-alert {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 18px;
    padding: 12px 15px;
    border: 1px solid;
    border-radius: 11px;
    font-size: 13px;
}
.portal-alert--danger { border-color: #f3cfcf; background: #fff6f6; color: #8f3434; }
.portal-alert--success { border-color: #cce9dd; background: #f3fbf7; color: #0e704d; }

.payout-callout {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
    padding: 16px 18px;
    border: 1px solid #eed9b9;
    border-radius: var(--portal-radius);
    background: #fffaf2;
}
.payout-callout__icon { display: grid; width: 44px; height: 44px; place-items: center; border-radius: 12px; background: #ffedcf; color: var(--portal-amber); }
.payout-callout__copy { min-width: 0; }
.payout-callout h2 { margin: 0; font-family: "DM Sans", Inter, sans-serif; font-size: 17px; letter-spacing: -.015em; }
.payout-callout p:not(.portal-eyebrow) { margin: 3px 0 0; color: #6f6558; font-size: 12px; }

.earnings-grid {
    display: grid;
    grid-template-columns: minmax(245px, 1.3fr) repeat(3, minmax(175px, 1fr));
    gap: 14px;
}
.metric-card {
    position: relative;
    min-width: 0;
    min-height: 166px;
    padding: 21px;
    overflow: hidden;
    border: 1px solid var(--portal-line);
    border-radius: var(--portal-radius);
    background: #fff;
    box-shadow: var(--portal-shadow);
}
.metric-card--primary { border-color: #d9e3ff; background: #f1f5ff; }
.metric-card--primary::after {
    position: absolute;
    right: -54px;
    bottom: -74px;
    width: 170px;
    height: 170px;
    border: 28px solid rgba(79, 100, 228, .075);
    border-radius: 50%;
    content: "";
}
.metric-card__topline { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.metric-label { margin: 0; color: #6c788d; font-size: 11px; font-weight: 700; letter-spacing: .025em; }
.metric-chip { padding: 4px 8px; border: 1px solid rgba(56, 88, 233, .13); border-radius: 999px; background: rgba(255, 255, 255, .72); color: #4e61ad; font-size: 9px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.metric-value { position: relative; z-index: 1; margin: 19px 0 0; color: #17233a; font-family: "DM Sans", Inter, sans-serif; font-size: clamp(25px, 2.1vw, 32px); font-weight: 700; letter-spacing: -.045em; line-height: 1; }
.metric-value--large { margin-top: 22px; font-size: clamp(31px, 2.7vw, 42px); }
.metric-caption { position: relative; z-index: 1; margin: 10px 0 0; color: #8993a5; font-size: 11px; }
.metric-context { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 5px 12px; margin-top: 12px; padding-top: 11px; border-top: 1px solid rgba(56, 88, 233, .11); color: #7a86a0; font-size: 9px; line-height: 1.35; }
.metric-context span { white-space: nowrap; }
.metric-context strong { margin-left: 3px; color: #34466f; font-size: 10px; font-variant-numeric: tabular-nums; }
.metric-icon { display: grid; width: 37px; height: 37px; place-items: center; margin-bottom: 14px; border-radius: 10px; }
.metric-icon--blue { background: #edf3ff; color: #3860d8; }
.metric-icon--green { background: #eaf8f2; color: #16815b; }
.metric-icon--amber { background: #fff4e2; color: #ad640d; }

.performance-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 14px;
    border: 1px solid var(--portal-line);
    border-radius: var(--portal-radius);
    background: #fff;
    box-shadow: 0 1px 2px rgba(20, 33, 58, .025);
}
.performance-strip--with-returning { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.performance-stat { min-width: 0; padding: 17px 20px; }
.performance-stat + .performance-stat { border-left: 1px solid var(--portal-line); }
.performance-stat__value { margin: 7px 0 0; color: #1b2941; font-family: "DM Sans", Inter, sans-serif; font-size: 23px; font-weight: 700; letter-spacing: -.035em; line-height: 1; }

.dashboard-insights {
    margin-top: 14px;
}
.portal-panel { min-width: 0; border: 1px solid var(--portal-line); border-radius: var(--portal-radius); background: #fff; box-shadow: var(--portal-shadow); }
.portal-panel__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 21px 22px 0; }
.portal-panel__header h2 { margin: 0; font-family: "DM Sans", Inter, sans-serif; font-size: 19px; letter-spacing: -.025em; line-height: 1.25; }
.portal-panel__header p:not(.portal-eyebrow) { margin: 5px 0 0; color: var(--portal-muted); font-size: 12px; }
.portal-panel--chart { min-height: 390px; }

.period-control { display: inline-flex; flex: 0 0 auto; gap: 2px; padding: 3px; border: 1px solid var(--portal-line); border-radius: 9px; background: #f7f8fa; }
.period-control button { min-width: 58px; min-height: 31px; padding: 5px 9px; border: 0; border-radius: 6px; background: transparent; color: #7d8798; font-size: 10px; font-weight: 800; cursor: pointer; }
.period-control button:hover { color: var(--portal-ink); }
.period-control button.is-active { background: #fff; color: #3858e9; box-shadow: 0 1px 4px rgba(20, 33, 58, .1); }
.chart-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 13px 22px 0; }
.chart-key { display: flex; flex: 0 0 auto; gap: 17px; color: #7c8799; font-size: 10px; font-weight: 600; }
.chart-key span { display: inline-flex; align-items: center; gap: 6px; }
.chart-key i { display: inline-block; width: 16px; }
.chart-key__bar { height: 7px; border-radius: 2px; background: rgba(56, 88, 233, .32); }
.chart-key__clicks { height: 2px; background: repeating-linear-gradient(90deg, #15947f 0 4px, transparent 4px 7px); }
.chart-history { display: grid; grid-template-columns: 32px minmax(150px, auto) 32px auto; align-items: center; gap: 6px; }
.chart-history__nav { display: grid; width: 32px; height: 32px; padding: 0; place-items: center; border: 1px solid #dfe4ec; border-radius: 8px; background: #fff; color: #5e6d84; cursor: pointer; }
.chart-history__nav:hover:not(:disabled) { border-color: #bfc9da; color: #3858e9; }
.chart-history__nav:disabled { opacity: .34; cursor: default; }
.chart-history__nav:focus-visible,
.chart-history__size select:focus-visible { outline: 3px solid rgba(56, 88, 233, .18); outline-offset: 1px; }
.chart-history__range { overflow: hidden; color: #4d5c73; font-size: 10px; font-weight: 750; text-align: center; text-overflow: ellipsis; white-space: nowrap; }
.chart-history__size { display: flex; align-items: center; gap: 7px; margin-left: 4px; }
.chart-history__size > span { color: #929bab; font-size: 8px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.chart-history__size select { min-width: 102px; height: 32px; padding: 0 27px 0 10px; border: 1px solid #dfe4ec; border-radius: 8px; background: #fff; color: #536176; font: inherit; font-size: 10px; font-weight: 750; cursor: pointer; }
.chart-stage { position: relative; height: 285px; padding: 12px 18px 18px; }
.chart-stage canvas { width: 100% !important; height: 100% !important; }
.chart-data-tooltip {
    position: absolute;
    z-index: 4;
    width: min(206px, calc(100% - 16px));
    padding: 10px 11px;
    border: 1px solid rgba(255, 255, 255, .09);
    border-radius: 10px;
    background: #172033;
    box-shadow: 0 10px 26px rgba(17, 28, 49, .2);
    color: #fff;
    pointer-events: none;
}
.chart-data-tooltip__title {
    display: block;
    overflow: hidden;
    color: #fff;
    font-size: 11px;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.chart-data-tooltip__table {
    width: 100%;
    margin: 7px 0 0;
    border-collapse: collapse;
}
.chart-data-tooltip__table th {
    padding: 2px 12px 2px 0;
    color: #aeb8ca;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.3;
    text-align: left;
    vertical-align: baseline;
}
.chart-data-tooltip__table td {
    padding: 2px 0;
    color: #fff;
    font-size: 10px;
    font-variant-numeric: tabular-nums;
    font-weight: 750;
    line-height: 1.3;
    text-align: right;
    vertical-align: baseline;
}
.chart-data-tooltip__table > tbody > .chart-data-tooltip__comparison > * {
    padding-top: 7px;
    border-top: 1px solid rgba(255, 255, 255, .12);
}
.chart-data-tooltip__comparison td { vertical-align: top; }
.chart-data-tooltip__comparison strong { display: block; color: #fff; font-size: 10px; line-height: 1.3; }
.chart-data-tooltip__comparison span { display: block; color: #aeb8ca; font-size: 9px; font-weight: 500; line-height: 1.3; }
.chart-empty { position: absolute; inset: 12px 20px 20px; display: grid; place-content: center; justify-items: center; color: #8b96a8; text-align: center; }
.chart-empty[hidden] { display: none; }
.chart-empty__icon { display: grid; width: 46px; height: 46px; margin-bottom: 12px; place-items: center; border-radius: 13px; background: #f2f5fa; color: #6d7f9d; }
.chart-empty strong { color: #41506a; font-size: 13px; }
.chart-empty span { margin-top: 4px; font-size: 11px; }

.portal-text-link { position: relative; z-index: 1; display: inline-flex; gap: 6px; margin-top: 18px; color: #5f3eb0 !important; font-size: 11px; font-weight: 800; text-decoration: none; }
.portal-text-link:hover { text-decoration: underline; }

.sales-panel { margin-top: 14px; overflow: hidden; }
.portal-panel__header--table { align-items: center; padding-bottom: 19px; }
.portal-table-wrap { width: 100%; overflow-x: auto; border-top: 1px solid var(--portal-line); }
.portal-table { width: 100%; min-width: 760px; border-collapse: collapse; color: #334159; font-size: 12px; }
.portal-table th { padding: 11px 22px; background: #f9fafc; color: #7b879a; font-size: 9px; font-weight: 800; letter-spacing: .08em; text-align: left; text-transform: uppercase; white-space: nowrap; }
.portal-table td { padding: 15px 22px; border-top: 1px solid #edf0f4; vertical-align: middle; }
.portal-table tbody tr:hover { background: #fbfcfe; }
.portal-table__money { text-align: right !important; font-variant-numeric: tabular-nums; white-space: nowrap; }
.portal-table__commission { color: #17233a; font-weight: 800; }
.sale-type { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; white-space: nowrap; }
.sale-type::before { width: 7px; height: 7px; border-radius: 50%; background: #5273dc; content: ""; }
.sale-type--returning::before { background: #8558d1; }
.status-pill { display: inline-flex; min-height: 24px; align-items: center; padding: 4px 9px; border-radius: 999px; background: #eef1f5; color: #647085; font-size: 9px; font-weight: 800; letter-spacing: .025em; white-space: nowrap; }
.status-pill--pending { background: #fff3df; color: #92530b; }
.status-pill--ready { background: #eaf7f1; color: #08714b; }
.status-pill--paid { background: #edf3ff; color: #335fca; }
.status-pill--reversed { background: #fff0f0; color: #9e3d3d; }
.sales-empty { display: grid; min-height: 260px; place-content: center; justify-items: center; padding: 35px; border-top: 1px solid var(--portal-line); text-align: center; }
.sales-empty__icon { display: grid; width: 50px; height: 50px; margin-bottom: 13px; place-items: center; border-radius: 14px; background: #f0f4fb; color: #667a9e; }
.sales-empty h3 { margin: 0; font-family: "DM Sans", Inter, sans-serif; font-size: 16px; }
.sales-empty p { margin: 6px 0 17px; color: var(--portal-muted); font-size: 12px; }

@media (max-width: 1320px) {
    .earnings-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .metric-card { min-height: 154px; }
}

@media (max-width: 960px) {
    html.portal-nav-open,
    html.portal-nav-open body { overflow: hidden; }

    .portal-sidebar {
        width: min(300px, calc(100vw - 44px));
        padding-top: 16px;
        box-shadow: 18px 0 50px rgba(19, 33, 58, .18);
        transform: translateX(-105%);
        transition: transform .22s cubic-bezier(.2, .75, .25, 1);
    }
    .portal-nav-open .portal-sidebar { transform: translateX(0); }
    .portal-sidebar__close { display: block; }
    .portal-scrim {
        position: fixed;
        z-index: 30;
        inset: 0;
        display: block;
        width: 100%;
        height: 100%;
        padding: 0;
        border: 0;
        background: rgba(19, 33, 58, .35);
        cursor: default;
        opacity: 0;
        pointer-events: none;
        transition: opacity .2s ease;
    }
    .portal-nav-open .portal-scrim { opacity: 1; pointer-events: auto; }
    .portal-main { margin-left: 0; }
    .portal-mobile-header {
        position: sticky;
        z-index: 20;
        top: 0;
        display: grid;
        grid-template-columns: 42px 1fr auto;
        min-height: 64px;
        align-items: center;
        gap: 10px;
        padding: 8px 20px;
        border-bottom: 1px solid rgba(230, 234, 240, .9);
        background: rgba(255, 255, 255, .91);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
    }
    .portal-menu-button { display: grid; width: 40px; height: 40px; padding: 9px; place-items: center; border: 1px solid var(--portal-line); border-radius: 10px; background: #fff; color: var(--portal-ink); cursor: pointer; }
    .portal-mobile-brand { display: inline-flex; width: max-content; align-items: center; gap: 8px; font-family: "DM Sans", Inter, sans-serif; font-weight: 700; text-decoration: none; }
    .portal-mobile-brand img { width: 28px; height: 28px; border-radius: 50%; }
    .portal-payout-disclosure--mobile { justify-self: end; }
    .portal-mobile-status { display: inline-flex; min-height: 36px; align-items: center; gap: 6px; padding: 7px 8px; border: 1px solid transparent; border-radius: 9px; background: transparent; color: var(--portal-green); font-size: 11px; font-weight: 700; white-space: nowrap; cursor: pointer; }
    .portal-mobile-status:hover,
    .portal-mobile-status[aria-expanded="true"] { border-color: #d9e9e2; background: #f4faf7; }
    .portal-mobile-status__dot { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px rgba(19, 135, 93, .1); }
    .portal-mobile-status__chevron { width: 14px; height: 14px; }
    .portal-mobile-status--attention { color: var(--portal-amber); }
    .portal-mobile-status--attention:hover,
    .portal-mobile-status--attention[aria-expanded="true"] { border-color: #eadbc3; background: #fff8ec; }
    .portal-payout-disclosure--mobile .portal-payout-popover { top: calc(100% + 8px); right: 0; bottom: auto; left: auto; width: min(268px, calc(100vw - 28px)); }
    .portal-content { padding-top: 26px; }
}

@media (max-width: 600px) {
    .portal-mobile-header { padding-right: 14px; padding-left: 14px; }
    .portal-mobile-brand span { font-size: 14px; }
    .portal-mobile-status { gap: 5px; padding-right: 6px; padding-left: 6px; font-size: 10px; }
    .portal-mobile-status__text > span { display: none; }
    .portal-mobile-status__dot { width: 8px; height: 8px; flex-basis: 8px; }
    .portal-content { padding: 22px 16px 36px; }
    .portal-page-header { display: block; margin-bottom: 22px; }
    .portal-page-actions { margin-top: 18px; }
    .portal-page-actions .portal-button { flex: 1 1 0; padding-right: 11px; padding-left: 11px; }
    .payout-callout { grid-template-columns: 42px minmax(0, 1fr); padding: 15px; }
    .payout-callout__icon { width: 40px; height: 40px; }
    .payout-callout .portal-button { grid-column: 1 / -1; width: 100%; }
    .earnings-grid { grid-template-columns: 1fr; gap: 10px; }
    .metric-card { min-height: 0; padding: 18px; }
    .metric-card:not(.metric-card--primary) { display: grid; grid-template-columns: 38px 1fr; align-items: center; column-gap: 12px; }
    .metric-card:not(.metric-card--primary) .metric-icon { grid-row: 1 / 4; margin: 0; }
    .metric-card:not(.metric-card--primary) .metric-value { margin-top: 4px; font-size: 25px; }
    .metric-card:not(.metric-card--primary) .metric-caption { margin-top: 5px; }
    .metric-value--large { font-size: 36px; }
    .metric-context { column-gap: 10px; }
    .performance-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .performance-stat { padding: 15px 16px; }
    .performance-stat + .performance-stat { border-left: 0; }
    .performance-stat:nth-child(even) { border-left: 1px solid var(--portal-line); }
    .performance-stat:nth-child(n + 3) { border-top: 1px solid var(--portal-line); }
    .performance-strip--without-returning .performance-stat:last-child { grid-column: 1 / -1; border-left: 0; }
    .portal-panel__header { display: block; padding: 18px 18px 0; }
    .period-control { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; margin-top: 15px; }
    .period-control button { min-width: 0; }
    .chart-toolbar { display: block; padding: 13px 18px 0; }
    .chart-key { margin-bottom: 10px; }
    .chart-history { grid-template-columns: 40px minmax(0, 1fr) 40px; row-gap: 8px; }
    .chart-history__nav { width: 40px; height: 40px; }
    .chart-history__size { grid-column: 1 / -1; grid-row: 1; justify-self: end; margin: 0; }
    .chart-history__nav:first-of-type { grid-column: 1; grid-row: 2; }
    .chart-history__range { grid-column: 2; grid-row: 2; }
    .chart-history__nav:nth-of-type(2) { grid-column: 3; grid-row: 2; }
    .chart-stage { height: 255px; padding-right: 10px; padding-left: 10px; }
    .portal-panel__header--table { display: flex; align-items: flex-start; padding-bottom: 17px; }
    .portal-panel__header--table .portal-button { display: none; }
    .portal-table th,
    .portal-table td { padding-right: 16px; padding-left: 16px; }
    .portal-table-wrap { overflow: visible; }
    .portal-table { min-width: 0; }
    .portal-table thead { display: none; }
    .portal-table tbody { display: grid; }
    .portal-table tr {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr);
        padding: 13px 16px;
        border-top: 1px solid #edf0f4;
        gap: 13px 18px;
    }
    .portal-table td {
        display: grid;
        min-width: 0;
        gap: 5px;
        padding: 0;
        border: 0;
        text-align: left !important;
    }
    .portal-table td::before {
        color: #8b95a6;
        content: attr(data-label);
        font-size: 8px;
        font-weight: 800;
        letter-spacing: .08em;
        text-transform: uppercase;
    }
    .portal-table__secondary-col { display: none !important; }
    .portal-table tbody tr:hover { background: transparent; }
    .sales-empty { min-height: 230px; padding: 28px 20px; }
}

@media (prefers-reduced-motion: reduce) {
    .portal-sidebar,
    .portal-scrim,
    .portal-nav__link,
    .portal-skip-link,
    .portal-button,
    .portal-payout,
    .portal-payout__chevron,
    .portal-mobile-status__chevron { transition: none; }
}

/* Partner tools */
.tools-page-header { margin-bottom: 24px; }

.tools-payout-callout svg,
.tools-icon-tile svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.tools-code-setup {
    display: grid;
    grid-template-columns: minmax(260px, .9fr) minmax(440px, 1.35fr);
    align-items: center;
    gap: clamp(22px, 3vw, 48px);
    margin-bottom: 16px;
    padding: 24px;
    border-color: #d9e3ff;
    background: #f3f6ff;
}

.tools-code-setup h2,
.tools-panel-header h2,
.tools-qr-copy h2,
.tools-stripe-panel h2 {
    margin: 0;
    color: #19263c;
    font-family: "DM Sans", Inter, sans-serif;
    font-size: 20px;
    letter-spacing: -.025em;
    line-height: 1.25;
}

.tools-code-setup__copy > p:not(.portal-eyebrow),
.tools-panel-header > div > p:not(.portal-eyebrow),
.tools-qr-copy > div > p:not(.portal-eyebrow),
.tools-stripe-panel > div > p:not(.portal-eyebrow) {
    margin: 6px 0 0;
    color: var(--portal-muted);
    font-size: 12px;
    line-height: 1.6;
}

.tools-code-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
}

.tools-code-input {
    display: grid;
    grid-template-columns: auto minmax(90px, 1fr);
    min-height: 46px;
    align-items: center;
    overflow: hidden;
    border: 1px solid #d4dceb;
    border-radius: 10px;
    background: #fff;
}

.tools-code-input:focus-within {
    border-color: #7795ef;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .1);
}

.tools-code-input > span {
    align-self: stretch;
    display: flex;
    align-items: center;
    padding: 0 0 0 14px;
    color: #818ca0;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px;
    white-space: nowrap;
}

.tools-code-input input {
    width: 100%;
    min-width: 0;
    height: 100%;
    padding: 0 14px 0 2px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--portal-ink);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 13px;
    font-weight: 700;
}

.tools-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) minmax(310px, .8fr);
    align-items: start;
    gap: 16px;
}

.tools-layout__main,
.tools-layout__aside {
    display: grid;
    min-width: 0;
    gap: 16px;
}

.tools-referral-panel,
.tools-discount-panel { padding: 24px; }

.tools-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
}

.tools-panel-header > div { min-width: 0; }
.tools-panel-header--stacked { display: block; }

.tools-status-badge {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 7px;
    min-height: 28px;
    padding: 5px 10px;
    border-radius: 999px;
    background: #f0f2f6;
    color: #657186;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .035em;
    white-space: nowrap;
    text-transform: uppercase;
}

.tools-status-badge > span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.tools-status-badge--success { background: #eaf7f1; color: #08714b; }
.tools-status-badge--attention { background: #fff3df; color: #92530b; }

.tools-referral-field {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    margin-top: 24px;
    padding: 8px 8px 8px 16px;
    border: 1px solid #dce3ee;
    border-radius: 12px;
    background: #f8fafc;
}

.tools-referral-field > span {
    min-width: 0;
    overflow: hidden;
    color: #34415a;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 13px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tools-link-meta {
    display: flex;
    min-height: 58px;
    align-items: center;
    gap: clamp(22px, 4vw, 48px);
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--portal-line);
}

.tools-link-meta > div { display: grid; gap: 4px; }
.tools-meta-label { color: #8a95a7; font-size: 9px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.tools-link-meta code { width: max-content; padding: 3px 8px; border-radius: 6px; background: #f0f3f8; color: #34415a; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; font-weight: 700; }
.tools-link-meta strong { color: #40506a; font-size: 11px; }

.tools-text-button {
    margin-left: auto;
    padding: 6px 0;
    border: 0;
    background: transparent;
    color: #4768d8;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
}

.tools-text-button:hover { text-decoration: underline; }

.tools-inline-form {
    margin-top: 16px;
    padding: 16px;
    border: 1px solid #dfe5ef;
    border-radius: 11px;
    background: #f8fafc;
}

.tools-inline-form[hidden],
.tools-qr-preview[hidden] { display: none !important; }

.tools-inline-form > label {
    display: block;
    margin-bottom: 7px;
    color: #58657a;
    font-size: 10px;
    font-weight: 800;
}

.tools-inline-form__controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 9px;
}

.tools-inline-form input {
    width: 100%;
    min-height: 42px;
    padding: 9px 12px;
    border: 1px solid #d7deea;
    border-radius: 9px;
    background: #fff;
    color: var(--portal-ink);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 12px;
    font-weight: 700;
}

.tools-inline-form > p { margin: 8px 0 0; color: #8a95a6; font-size: 10px; }

.tools-qr-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    padding: 24px;
}

.tools-qr-copy {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
}

.tools-icon-tile {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border-radius: 13px;
    background: #eef3ff;
    color: #4565ce;
}

.tools-icon-tile--success { background: #eaf7f1; color: #08714b; }
.tools-icon-tile--attention { background: #fff3df; color: #92530b; }

.tools-qr-preview {
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    align-items: center;
    gap: 28px;
    margin-top: 22px;
    padding-top: 22px;
    border-top: 1px solid var(--portal-line);
}

.tools-qr-image {
    display: grid;
    width: 190px;
    height: 190px;
    place-items: center;
    padding: 12px;
    border: 1px solid var(--portal-line);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 6px 20px rgba(20, 33, 58, .07);
}

.tools-qr-image img { display: block; width: 100%; height: 100%; }
.tools-qr-downloads > p { margin: 0 0 10px; color: #6f7b8f; font-size: 10px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.tools-qr-downloads > div { display: flex; flex-wrap: wrap; gap: 8px; }

.tools-discount-panel form { margin-top: 22px; }

.tools-switch-row {
    display: flex;
    min-height: 67px;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 14px;
    border: 1px solid #dfe5ee;
    border-radius: 11px;
    background: #f9fafc;
    cursor: pointer;
}

.tools-switch-row > span:first-child { display: grid; gap: 3px; }
.tools-switch-row strong { color: #2d3b53; font-size: 12px; }
.tools-switch-row small { color: #818ca0; font-size: 10px; }
.tools-switch { position: relative; display: block; width: 42px; height: 24px; flex: 0 0 42px; }
.tools-switch input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.tools-switch > span { position: absolute; inset: 0; border-radius: 999px; background: #cbd2dd; transition: background-color .15s ease; }
.tools-switch > span::after { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(20, 33, 58, .22); content: ""; transition: transform .15s ease; }
.tools-switch input:checked + span { background: #4866db; }
.tools-switch input:checked + span::after { transform: translateX(18px); }
.tools-switch input:focus-visible + span { outline: 3px solid rgba(37, 99, 235, .3); outline-offset: 2px; }

.tools-earnings-summary { display: grid; margin: 18px 0 0; }
.tools-earnings-summary > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 14px 2px; border-top: 1px solid var(--portal-line); }
.tools-earnings-summary dt { color: #68758a; font-size: 11px; font-weight: 700; }
.tools-earnings-summary dd { display: grid; justify-items: end; gap: 2px; margin: 0; }
.tools-earnings-summary dd strong { color: #223049; font-family: "DM Sans", Inter, sans-serif; font-size: 16px; }
.tools-earnings-summary dd span { color: #7e899b; font-size: 9px; font-weight: 600; }

.tools-confirm-row {
    display: grid;
    grid-template-columns: 17px minmax(0, 1fr);
    align-items: start;
    gap: 9px;
    margin-top: 4px;
    color: #707c8e;
    font-size: 10px;
    line-height: 1.5;
    cursor: pointer;
}

.tools-confirm-row input { width: 16px; height: 16px; margin: 0; accent-color: var(--portal-blue); }
.tools-save-button { width: 100%; margin-top: 18px; }

.tools-stripe-panel {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    padding: 20px;
}

.tools-stripe-panel > .portal-text-link,
.tools-stripe-panel > .portal-button { grid-column: 1 / -1; width: max-content; margin-top: 2px; }
.tools-stripe-panel > .portal-button { width: 100%; }

@media (max-width: 1200px) {
    .tools-code-setup { grid-template-columns: 1fr; }
    .tools-layout { grid-template-columns: minmax(0, 1.45fr) minmax(290px, .8fr); }
    .tools-qr-copy { grid-template-columns: 48px minmax(0, 1fr); }
    .tools-qr-copy > .portal-button { grid-column: 2; width: max-content; }
}

@media (max-width: 960px) {
    .tools-layout { grid-template-columns: 1fr; }
    .tools-layout__aside { grid-template-columns: minmax(0, 1.2fr) minmax(260px, .8fr); }
    .tools-stripe-panel { align-self: stretch; }
}

@media (max-width: 720px) {
    .tools-layout__aside { grid-template-columns: 1fr; }
    .tools-panel-header { display: grid; gap: 14px; }
    .tools-status-badge { width: max-content; }
    .tools-qr-preview { grid-template-columns: 150px minmax(0, 1fr); gap: 20px; }
    .tools-qr-image { width: 150px; height: 150px; }
}

@media (max-width: 600px) {
    .tools-code-setup,
    .tools-referral-panel,
    .tools-qr-panel,
    .tools-discount-panel { padding: 18px; }
    .tools-code-form { grid-template-columns: 1fr; }
    .tools-code-form > .portal-button { width: 100%; }
    .tools-code-input { grid-template-columns: 1fr; padding-top: 7px; }
    .tools-code-input > span { align-self: auto; padding: 0 12px; font-size: 10px; }
    .tools-code-input input { min-height: 32px; padding: 0 12px; }
    .tools-referral-field { grid-template-columns: 1fr; padding: 13px; }
    .tools-referral-field > span { overflow: visible; font-size: 11px; line-height: 1.5; text-overflow: clip; white-space: normal; word-break: break-all; }
    .tools-referral-field .portal-button { width: 100%; }
    .tools-link-meta { display: grid; gap: 14px; }
    .tools-text-button { width: max-content; margin-left: 0; }
    .tools-inline-form__controls { grid-template-columns: 1fr; }
    .tools-inline-form__controls .portal-button { width: 100%; }
    .tools-qr-copy { grid-template-columns: 42px minmax(0, 1fr); align-items: start; }
    .tools-qr-copy .tools-icon-tile { width: 42px; height: 42px; }
    .tools-qr-copy > .portal-button { grid-column: 1 / -1; width: 100%; }
    .tools-qr-preview { grid-template-columns: 1fr; justify-items: center; }
    .tools-qr-downloads { text-align: center; }
    .tools-qr-downloads > div { justify-content: center; }
    .tools-earnings-summary > div { align-items: start; }
}

/* Affiliate authentication ------------------------------------------------ */

body.partner-auth {
    min-width: 320px;
    height: 100svh;
    min-height: 0;
    margin: 0;
    overflow: hidden;
    background: var(--portal-canvas);
    color: var(--portal-ink);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

body.partner-auth button,
body.partner-auth input { font: inherit; }

body.partner-auth a { color: inherit; }

body.partner-auth :focus-visible {
    outline: 3px solid rgba(37, 99, 235, .28);
    outline-offset: 3px;
}

.partner-auth__shell {
    display: grid;
    height: 100svh;
    min-height: 0;
    grid-template-rows: auto minmax(0, 1fr) auto;
    overflow: hidden;
}

.partner-auth__header,
.partner-auth__footer {
    position: relative;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px clamp(24px, 4vw, 64px);
}

.partner-auth__header {
    min-height: 84px;
    border-bottom: 1px solid rgba(213, 220, 231, .8);
    background: rgba(255, 255, 255, .82);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.partner-auth__brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    text-decoration: none;
}

.partner-auth__brand img {
    width: 39px;
    height: 39px;
    border-radius: 50%;
    box-shadow: 0 3px 12px rgba(19, 33, 58, .11);
}

.partner-auth__brand > span {
    display: grid;
    line-height: 1.08;
}

.partner-auth__brand strong {
    font-family: "DM Sans", Inter, sans-serif;
    font-size: 18px;
    letter-spacing: -.025em;
}

.partner-auth__brand small {
    margin-top: 5px;
    color: var(--portal-muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.partner-auth__home-link {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-radius: 9px;
    color: #56647a;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: background-color .15s ease, color .15s ease;
}

.partner-auth__home-link:hover { background: #edf2f9; color: var(--portal-ink); }
.partner-auth__home-link svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.partner-auth__main {
    display: grid;
    min-height: 0;
    grid-template-columns: minmax(0, 1.05fr) minmax(440px, .95fr);
}

.partner-auth__intro {
    position: relative;
    display: grid;
    align-content: center;
    min-height: 0;
    padding: clamp(64px, 9vw, 136px);
    overflow: hidden;
    background:
        radial-gradient(circle at 13% 15%, rgba(125, 211, 252, .54), transparent 35%),
        radial-gradient(circle at 82% 84%, rgba(196, 181, 253, .42), transparent 42%),
        linear-gradient(145deg, #eef8ff 0%, #f4f5ff 52%, #f8f5ff 100%);
}

.partner-auth__intro::before,
.partner-auth__intro::after {
    position: absolute;
    border-radius: 999px;
    content: "";
    pointer-events: none;
}

.partner-auth__intro::before {
    top: -28%;
    right: -18%;
    width: min(48vw, 680px);
    aspect-ratio: 1;
    border: 1px solid rgba(92, 124, 194, .12);
    box-shadow: 0 0 0 68px rgba(255, 255, 255, .14), 0 0 0 136px rgba(255, 255, 255, .09);
}

.partner-auth__intro::after {
    bottom: -35%;
    left: -20%;
    width: min(40vw, 560px);
    aspect-ratio: 1;
    background: rgba(255, 255, 255, .3);
    filter: blur(1px);
}

.partner-auth__intro-copy {
    position: relative;
    z-index: 2;
    max-width: 610px;
}

.partner-auth__eyebrow {
    margin: 0 0 16px;
    color: #526cd1;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.partner-auth__intro h1 {
    margin: 0;
    color: #152541;
    font-family: "DM Sans", Inter, sans-serif;
    font-size: clamp(48px, 6vw, 82px);
    line-height: .98;
    letter-spacing: -.055em;
}

.partner-auth__intro-copy > p:last-child {
    max-width: 470px;
    margin: 28px 0 0;
    color: #5f6d83;
    font-size: clamp(16px, 1.5vw, 20px);
    line-height: 1.65;
}

.partner-auth__art {
    position: absolute;
    z-index: 1;
    right: clamp(36px, 7vw, 110px);
    bottom: clamp(34px, 6vw, 92px);
    display: flex;
    height: 88px;
    align-items: end;
    gap: 8px;
    opacity: .72;
    transform: rotate(-7deg);
}

.partner-auth__art span {
    width: 10px;
    border-radius: 999px;
    background: #7b8fe2;
    box-shadow: 0 7px 20px rgba(70, 91, 170, .15);
}

.partner-auth__art span:nth-child(1) { height: 34px; opacity: .42; }
.partner-auth__art span:nth-child(2) { height: 62px; opacity: .68; }
.partner-auth__art span:nth-child(3) { height: 88px; }

.partner-auth__form-region {
    display: grid;
    min-height: 0;
    place-items: center;
    padding: clamp(48px, 7vw, 104px);
    border-left: 1px solid var(--portal-line);
    background: rgba(255, 255, 255, .9);
}

.partner-auth__form-wrap { width: min(100%, 420px); }

.partner-auth__form-wrap h2 {
    margin: 0;
    color: var(--portal-ink);
    font-family: "DM Sans", Inter, sans-serif;
    font-size: 36px;
    line-height: 1.12;
    letter-spacing: -.035em;
}

.partner-auth__form-intro {
    margin: 13px 0 0;
    color: var(--portal-muted);
    font-size: 14px;
    line-height: 1.65;
}

.partner-auth__error {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    gap: 10px;
    margin-top: 24px;
    padding: 13px 0;
    border-top: 1px solid #f2c9c7;
    border-bottom: 1px solid #f2c9c7;
    color: #a33a35;
}

.partner-auth__error svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.partner-auth__error p { margin: 0; font-size: 12px; font-weight: 700; line-height: 1.6; }

.partner-auth__form { display: grid; gap: 20px; margin-top: 34px; }

.partner-auth__field {
    display: grid;
    gap: 8px;
    color: #445168;
    font-size: 12px;
    font-weight: 700;
}

.partner-auth__password-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.partner-auth__password-label a {
    color: #4b67d0;
    font-size: 11px;
    text-decoration: none;
}

.partner-auth__password-label a:hover { text-decoration: underline; text-underline-offset: 3px; }

.partner-auth__field input {
    width: 100%;
    min-height: 52px;
    padding: 13px 15px;
    border: 1px solid #d8dfeb;
    border-radius: 10px;
    outline: none;
    background: #fff;
    color: var(--portal-ink);
    font-size: 14px;
    font-weight: 500;
    box-shadow: inset 0 1px 0 rgba(19, 33, 58, .02);
    transition: border-color .15s ease, box-shadow .15s ease;
}

.partner-auth__field input::placeholder { color: #a0a9b9; }
.partner-auth__field input:focus { border-color: #7790e6; box-shadow: 0 0 0 4px rgba(74, 103, 211, .11); }

.partner-auth__submit {
    min-height: 52px;
    margin-top: 4px;
    padding: 13px 18px;
    border: 0;
    border-radius: 10px;
    background: #315dd8;
    color: #fff;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 9px 22px rgba(49, 93, 216, .18);
    transition: background-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.partner-auth__submit:hover { background: #254fc5; box-shadow: 0 12px 26px rgba(49, 93, 216, .24); }
.partner-auth__submit:active { transform: translateY(1px); }

.partner-auth__apply {
    margin: 30px 0 0;
    color: #7a8597;
    font-size: 12px;
    text-align: center;
}

.partner-auth__apply a { color: #405fca; font-weight: 800; text-decoration: none; }
.partner-auth__apply a:hover { text-decoration: underline; text-underline-offset: 3px; }

.partner-auth__footer {
    min-height: 58px;
    border-top: 1px solid rgba(213, 220, 231, .8);
    background: #fff;
    color: #8a95a7;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

@media (max-width: 900px) {
    .partner-auth__main {
        grid-template-columns: 1fr;
        grid-template-rows: clamp(132px, 23svh, 188px) minmax(0, 1fr);
    }
    .partner-auth__intro { padding: 24px clamp(24px, 8vw, 72px); }
    .partner-auth__intro h1 { font-size: clamp(38px, 9vw, 56px); }
    .partner-auth__intro-copy > p:last-child { max-width: 520px; margin-top: 12px; font-size: 14px; line-height: 1.5; }
    .partner-auth__eyebrow { margin-bottom: 9px; }
    .partner-auth__art { right: 9vw; bottom: 24px; height: 62px; opacity: .38; }
    .partner-auth__art span:nth-child(1) { height: 24px; }
    .partner-auth__art span:nth-child(2) { height: 43px; }
    .partner-auth__art span:nth-child(3) { height: 62px; }
    .partner-auth__form-region { padding: clamp(20px, 4svh, 38px) clamp(24px, 8vw, 72px); border-top: 1px solid var(--portal-line); border-left: 0; }
    .partner-auth__form-wrap h2 { font-size: 31px; }
    .partner-auth__form-intro { margin-top: 8px; line-height: 1.5; }
    .partner-auth__form { gap: 14px; margin-top: 20px; }
    .partner-auth__field { gap: 6px; }
    .partner-auth__field input { min-height: 48px; padding: 11px 14px; }
    .partner-auth__submit { min-height: 48px; }
    .partner-auth__apply { margin-top: 17px; }
}

@media (max-width: 560px) {
    .partner-auth__header { min-height: 72px; padding: 16px 20px; }
    .partner-auth__brand img { width: 36px; height: 36px; }
    .partner-auth__brand strong { font-size: 17px; }
    .partner-auth__home-link { padding: 8px; }
    .partner-auth__home-link span { display: none; }
    .partner-auth__intro { padding: 20px 24px; }
    .partner-auth__intro h1 { font-size: clamp(36px, 11vw, 46px); }
    .partner-auth__intro-copy > p:last-child { max-width: 330px; font-size: 15px; }
    .partner-auth__art { display: none; }
    .partner-auth__form-region { padding-right: 24px; padding-left: 24px; }
    .partner-auth__form-wrap h2 { font-size: 30px; }
    .partner-auth__footer { min-height: 44px; padding: 12px 20px; }
}

@media (max-height: 700px) {
    .partner-auth__header { min-height: 62px; padding-top: 12px; padding-bottom: 12px; }
    .partner-auth__footer { display: none; }
    .partner-auth__main { grid-template-rows: 112px minmax(0, 1fr); }
    .partner-auth__intro { padding-top: 15px; padding-bottom: 15px; }
    .partner-auth__intro .partner-auth__eyebrow,
    .partner-auth__intro-copy > p:last-child,
    .partner-auth__art { display: none; }
    .partner-auth__intro h1 { font-size: clamp(34px, 8vw, 48px); }
    .partner-auth__form-region { padding-top: 14px; padding-bottom: 14px; }
    .partner-auth__form-wrap > .partner-auth__eyebrow { margin-bottom: 5px; }
    .partner-auth__form-wrap h2 { font-size: 28px; }
    .partner-auth__form-intro { display: none; }
    .partner-auth__form { gap: 10px; margin-top: 14px; }
    .partner-auth__field { gap: 4px; }
    .partner-auth__field input { min-height: 44px; padding-top: 9px; padding-bottom: 9px; }
    .partner-auth__submit { min-height: 44px; margin-top: 0; padding-top: 10px; padding-bottom: 10px; }
    .partner-auth__apply { margin-top: 11px; }
}

@media (max-height: 540px) and (max-width: 900px) {
    .partner-auth__main { grid-template-rows: minmax(0, 1fr); }
    .partner-auth__intro { display: none; }
}

@media (max-height: 360px) {
    .partner-auth__shell { grid-template-rows: minmax(0, 1fr); }
    .partner-auth__header,
    .partner-auth__footer,
    .partner-auth__intro,
    .partner-auth__form-wrap > .partner-auth__eyebrow,
    .partner-auth__apply { display: none; }
    .partner-auth__main { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr); }
    .partner-auth__form-region { height: 100%; padding: 6px 24px; border: 0; }
    .partner-auth__form-wrap h2 { font-size: 24px; }
    .partner-auth__form { gap: 6px; margin-top: 8px; }
    .partner-auth__field { gap: 2px; font-size: 10px; }
    .partner-auth__password-label a { font-size: 10px; }
    .partner-auth__field input { min-height: 40px; padding-top: 7px; padding-bottom: 7px; }
    .partner-auth__submit { min-height: 40px; padding-top: 7px; padding-bottom: 7px; }
}

/* Affiliate public and account flows -------------------------------------- */

body.affiliate-public {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    background:
        radial-gradient(circle at 8% 6%, rgba(186, 230, 253, .42), transparent 30rem),
        radial-gradient(circle at 92% 16%, rgba(221, 214, 254, .38), transparent 32rem),
        var(--portal-canvas);
    color: var(--portal-ink);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

body.affiliate-public button,
body.affiliate-public input,
body.affiliate-public select,
body.affiliate-public textarea { font: inherit; }

body.affiliate-public a { color: inherit; }

body.affiliate-public :focus-visible {
    outline: 3px solid rgba(37, 99, 235, .28);
    outline-offset: 3px;
}

.affiliate-public__shell {
    display: grid;
    min-height: 100vh;
    grid-template-rows: auto minmax(0, 1fr) auto;
}

.affiliate-public__header {
    position: relative;
    z-index: 20;
    border-bottom: 1px solid rgba(218, 224, 233, .88);
    background: rgba(255, 255, 255, .82);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.affiliate-public__nav {
    display: flex;
    width: min(100%, 1200px);
    min-height: 78px;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin: 0 auto;
    padding: 14px clamp(20px, 4vw, 48px);
}

.affiliate-public__brand {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    gap: 11px;
    text-decoration: none;
}

.affiliate-public__brand img {
    width: 39px;
    height: 39px;
    flex: 0 0 39px;
    border-radius: 50%;
    box-shadow: 0 3px 12px rgba(19, 33, 58, .11);
}

.affiliate-public__brand > span { display: grid; min-width: 0; line-height: 1.08; }
.affiliate-public__brand strong { font-family: "DM Sans", Inter, sans-serif; font-size: 18px; letter-spacing: -.025em; }
.affiliate-public__brand small { margin-top: 5px; color: var(--portal-muted); font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }

.affiliate-public__links { display: flex; align-items: center; gap: 7px; }

.affiliate-public__nav-link {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    padding: 8px 11px;
    border-radius: 9px;
    color: #56647a;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.affiliate-public__nav-link:hover { background: #edf2f9; color: var(--portal-ink); }
.affiliate-public__nav-link--signin { border: 1px solid #dbe2ed; background: rgba(255, 255, 255, .68); color: #3459c3; }

.affiliate-public__languages {
    display: inline-flex;
    gap: 2px;
    margin-left: 4px;
    padding-left: 9px;
    border-left: 1px solid var(--portal-line);
}

.affiliate-public__languages a {
    padding: 5px 6px;
    border-radius: 6px;
    color: #778398;
    font-size: 9px;
    font-weight: 800;
    text-decoration: none;
}

.affiliate-public__languages a:hover,
.affiliate-public__languages a[aria-current="page"] { background: var(--portal-blue-soft); color: var(--portal-blue); }

.affiliate-public__main { min-width: 0; }

.affiliate-public__footer {
    display: flex;
    width: min(100%, 1200px);
    min-height: 64px;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin: 0 auto;
    padding: 16px clamp(20px, 4vw, 48px);
    border-top: 1px solid rgba(218, 224, 233, .88);
    color: #7d889a;
    font-size: 10px;
    font-weight: 650;
}

.affiliate-public__footer p { margin: 0; }
.affiliate-public__footer a { text-decoration: none; }
.affiliate-public__footer a:hover { color: var(--portal-ink); }

.affiliate-flow {
    display: grid;
    width: min(100%, 1040px);
    grid-template-columns: minmax(260px, .72fr) minmax(0, 1.28fr);
    gap: clamp(42px, 7vw, 86px);
    margin: 0 auto;
    padding: clamp(64px, 8vw, 112px) clamp(22px, 5vw, 56px);
}

.affiliate-flow--compact { width: min(100%, 900px); grid-template-columns: minmax(240px, .8fr) minmax(320px, 1fr); }
.affiliate-flow__intro { align-self: start; padding-top: 4px; }

.affiliate-public__eyebrow {
    margin: 0 0 12px;
    color: #526cd1;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.affiliate-flow__intro h1,
.affiliate-status h1 {
    margin: 0;
    color: #152541;
    font-family: "DM Sans", Inter, sans-serif;
    font-size: clamp(34px, 4.8vw, 54px);
    line-height: 1.04;
    letter-spacing: -.048em;
}

.affiliate-flow__intro > p:last-child,
.affiliate-status__message {
    margin: 20px 0 0;
    color: var(--portal-muted);
    font-size: 14px;
    line-height: 1.75;
}

.affiliate-flow__content {
    min-width: 0;
    padding-left: clamp(36px, 5vw, 70px);
    border-left: 1px solid #dce2eb;
}

.affiliate-public-form { display: grid; gap: 18px; }
.affiliate-public-form__row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }

.affiliate-public-field {
    display: grid;
    min-width: 0;
    gap: 7px;
    color: #445168;
    font-size: 11px;
    font-weight: 750;
}

.affiliate-public-field label { width: max-content; max-width: 100%; }
.affiliate-public-field .required { color: #b23f3a; }

.affiliate-public-field input,
.affiliate-public-field select,
.affiliate-public-field textarea {
    width: 100%;
    min-width: 0;
    min-height: 48px;
    padding: 11px 13px;
    border: 1px solid #d6dde8;
    border-radius: 9px;
    background: rgba(255, 255, 255, .88);
    color: var(--portal-ink);
    font-size: 13px;
    line-height: 1.45;
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

.affiliate-public-field textarea { min-height: 126px; resize: vertical; }
.affiliate-public-field input::placeholder,
.affiliate-public-field textarea::placeholder { color: #9ba5b4; }
.affiliate-public-field input:focus,
.affiliate-public-field select:focus,
.affiliate-public-field textarea:focus { border-color: #7790e6; background: #fff; box-shadow: 0 0 0 4px rgba(74, 103, 211, .11); outline: 0; }
.affiliate-public-field__hint { color: #8a95a7; font-size: 10px; font-weight: 500; }

.affiliate-public-form__section {
    display: grid;
    gap: 15px;
    min-width: 0;
    margin: 5px 0 0;
    padding: 20px 0 0;
    border: 0;
    border-top: 1px solid var(--portal-line);
}

.affiliate-public-form__section legend {
    padding: 0 12px 0 0;
    color: #667287;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.affiliate-public-error {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    gap: 10px;
    margin: 0 0 24px;
    padding: 12px 0;
    border-top: 1px solid #efcac7;
    border-bottom: 1px solid #efcac7;
    color: #a13a35;
}

.affiliate-public-error svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.affiliate-public-error ul { margin: 0; padding-left: 17px; }
.affiliate-public-error p { margin: 0; }
.affiliate-public-error li,
.affiliate-public-error p { font-size: 11px; font-weight: 700; line-height: 1.55; }

.affiliate-public-button {
    display: inline-flex;
    width: max-content;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    padding: 11px 18px;
    border: 1px solid transparent;
    border-radius: 9px;
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease, color .15s ease, transform .15s ease;
}

.affiliate-public-button:active { transform: translateY(1px); }
.affiliate-public-button--primary { border-color: #3157d1; background: #365bcf; color: #fff !important; box-shadow: 0 7px 18px rgba(49, 88, 205, .17); }
.affiliate-public-button--primary:hover { border-color: #2749b9; background: #2e51c2; }
.affiliate-public-button--secondary { border-color: #d6dde8; background: rgba(255, 255, 255, .75); color: #40506a !important; }
.affiliate-public-button--secondary:hover { border-color: #c1ccda; background: #fff; }
.affiliate-public-button--full { width: 100%; margin-top: 5px; }

.affiliate-public-back { margin: 20px 0 0; color: #60708a; font-size: 11px; }
.affiliate-public-back a { color: #405fca; font-weight: 750; text-decoration: none; }
.affiliate-public-back a:hover { text-decoration: underline; text-underline-offset: 3px; }

.affiliate-status {
    width: min(100%, 650px);
    margin: 0 auto;
    padding: clamp(82px, 12vw, 150px) 24px;
    text-align: center;
}

.affiliate-status__icon {
    display: grid;
    width: 50px;
    height: 50px;
    margin: 0 auto 26px;
    place-items: center;
    border-radius: 15px;
    background: #e9f6f0;
    color: var(--portal-green);
    font-size: 22px;
    font-weight: 800;
}

.affiliate-status__icon--info { background: #edf3ff; color: #3c5fc4; }
.affiliate-status__icon--error { background: #fff0f0; color: #aa3f3f; }
.affiliate-status__message { max-width: 540px; margin-right: auto; margin-left: auto; }
.affiliate-status__detail { margin: 10px auto 0; color: #8994a6; font-size: 11px; }
.affiliate-status__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 30px; }

@media (max-width: 760px) {
    .affiliate-public__nav { min-height: 70px; padding-top: 11px; padding-bottom: 11px; }
    .affiliate-public__brand img { width: 36px; height: 36px; flex-basis: 36px; }
    .affiliate-public__brand strong { font-size: 17px; }
    .affiliate-public__nav-link--program { display: none; }
    .affiliate-flow,
    .affiliate-flow--compact { display: block; width: min(100%, 620px); padding-top: 54px; padding-bottom: 64px; }
    .affiliate-flow__intro { max-width: 500px; }
    .affiliate-flow__intro h1 { font-size: clamp(34px, 9vw, 46px); }
    .affiliate-flow__intro > p:last-child { margin-top: 14px; }
    .affiliate-flow__content { margin-top: 35px; padding: 34px 0 0; border-top: 1px solid #dce2eb; border-left: 0; }
}

@media (max-width: 520px) {
    .affiliate-public__brand small { display: none; }
    .affiliate-public__links { gap: 3px; }
    .affiliate-public__nav-link { min-height: 38px; padding-right: 9px; padding-left: 9px; font-size: 11px; }
    .affiliate-public__languages { margin-left: 1px; padding-left: 5px; }
    .affiliate-public__languages a { padding-right: 4px; padding-left: 4px; }
    .affiliate-public__footer { min-height: 56px; }
    .affiliate-public__footer p { display: none; }
    .affiliate-public__footer { justify-content: center; }
    .affiliate-public-form__row { grid-template-columns: 1fr; }
    .affiliate-flow { padding-right: 18px; padding-left: 18px; }
    .affiliate-status { padding-right: 18px; padding-left: 18px; }
    .affiliate-public-button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .affiliate-public-button,
    .affiliate-public-field input,
    .affiliate-public-field select,
    .affiliate-public-field textarea { transition: none; }
}
