/*
 * 247 Connect Gateway — design system
 *
 * Plain CSS on purpose. The portal deploys to shared hosting, and a build step
 * that has to run on the server is the most common reason a deploy fails at
 * 2am. Everything here is served as-is.
 *
 * Tokens first, then primitives, then components. Colours are defined once in
 * :root for light and overridden wholesale for dark, so no component needs to
 * know which theme it is in.
 */

/* ── Tokens ──────────────────────────────────────────────────────────────── */

:root {
    --brand-h: 174;
    --brand: hsl(var(--brand-h) 72% 34%);
    --brand-strong: hsl(var(--brand-h) 74% 27%);
    --brand-soft: hsl(var(--brand-h) 60% 96%);
    --brand-border: hsl(var(--brand-h) 45% 84%);

    --bg: #f6f8fa;
    --surface: #ffffff;
    --surface-2: #fbfcfd;
    --sidebar: #10211f;
    --sidebar-text: #a9c2be;
    --sidebar-active: #ffffff;

    --text: #16211f;
    --text-muted: #61736f;
    --text-heading: #0c1614;

    --border: #e3e8e9;
    --border-strong: #cfd7d8;

    --ok: #0a7d55;
    --ok-bg: #e7f6ef;
    --warn: #8a6100;
    --warn-bg: #fdf3e0;
    --danger: #b3261e;
    --danger-bg: #fdecea;
    --info: #1c5fa8;
    --info-bg: #e9f2fc;

    --radius: 10px;
    --radius-sm: 6px;
    --radius-lg: 16px;

    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
    --space-7: 48px;

    --shadow-sm: 0 1px 2px rgba(16, 33, 31, .06);
    --shadow: 0 2px 8px rgba(16, 33, 31, .07), 0 1px 2px rgba(16, 33, 31, .04);
    --shadow-lg: 0 12px 32px rgba(16, 33, 31, .12);

    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

    --sidebar-w: 248px;
    --topbar-h: 60px;

    color-scheme: light;
}

[data-theme="dark"] {
    --brand: hsl(var(--brand-h) 60% 52%);
    --brand-strong: hsl(var(--brand-h) 62% 62%);
    --brand-soft: hsl(var(--brand-h) 40% 15%);
    --brand-border: hsl(var(--brand-h) 30% 28%);

    --bg: #0d1413;
    --surface: #151f1e;
    --surface-2: #1a2524;
    --sidebar: #0a1110;
    --sidebar-text: #7e9b96;

    --text: #dbe5e3;
    --text-muted: #8b9e9a;
    --text-heading: #f2f7f6;

    --border: #24322f;
    --border-strong: #32423f;

    --ok: #4ec08c;
    --ok-bg: #10291f;
    --warn: #d9a23a;
    --warn-bg: #2a2110;
    --danger: #f2837a;
    --danger-bg: #2c1614;
    --info: #6aa9e8;
    --info-bg: #10202f;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow: 0 2px 8px rgba(0, 0, 0, .35);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, .5);

    color-scheme: dark;
}

/* ── Reset ───────────────────────────────────────────────────────────────── */

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

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.55;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; color: var(--text-heading); font-weight: 650; line-height: 1.25; }
p { margin: 0 0 var(--space-3); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }
[hidden] { display: none !important; }

code, pre, .mono { font-family: var(--mono); font-size: .86em; }

/* ── Layout ──────────────────────────────────────────────────────────────── */

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

.sidebar {
    width: var(--sidebar-w);
    flex: 0 0 var(--sidebar-w);
    background: var(--sidebar);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    transition: transform .22s ease;
    overflow-y: auto;
}

.sidebar__brand {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    color: #fff;
    font-weight: 700;
    letter-spacing: -.01em;
    border-bottom: 1px solid rgba(255, 255, 255, .07);
    min-height: var(--topbar-h);
}
.sidebar__brand:hover { text-decoration: none; }

.sidebar__mark {
    width: 30px; height: 30px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--brand), hsl(var(--brand-h) 70% 44%));
    display: grid; place-items: center;
    color: #fff; font-size: 12px; font-weight: 800;
    flex: 0 0 auto;
}

.sidebar__nav { padding: var(--space-4) var(--space-3); flex: 1; }
.sidebar__section {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: .09em;
    color: rgba(255, 255, 255, .34);
    padding: var(--space-4) var(--space-3) var(--space-2);
    font-weight: 700;
}

.sidebar__link {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: 9px var(--space-3);
    border-radius: var(--radius-sm);
    color: var(--sidebar-text);
    font-weight: 500;
    margin-bottom: 2px;
}
.sidebar__link:hover { background: rgba(255, 255, 255, .06); color: #fff; text-decoration: none; }
.sidebar__link.is-active { background: var(--brand); color: #fff; font-weight: 600; }
.sidebar__link svg { width: 17px; height: 17px; flex: 0 0 auto; opacity: .9; }
.sidebar__badge {
    margin-left: auto;
    background: rgba(255, 255, 255, .14);
    border-radius: 99px;
    padding: 1px 7px;
    font-size: 11px;
    font-weight: 600;
}
.sidebar__link.is-active .sidebar__badge { background: rgba(0, 0, 0, .22); }

.main {
    flex: 1;
    min-width: 0;
    margin-left: var(--sidebar-w);
    display: flex;
    flex-direction: column;
}

.topbar {
    height: var(--topbar-h);
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: 0 var(--space-5);
    position: sticky;
    top: 0;
    z-index: 30;
}

.topbar__title { font-size: 15px; font-weight: 650; color: var(--text-heading); }
.topbar__spacer { flex: 1; }

.icon-btn {
    width: 34px; height: 34px;
    display: grid; place-items: center;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-muted);
    border-radius: var(--radius-sm);
    cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn svg { width: 17px; height: 17px; }

.sidebar-toggle { display: none; }

.content { padding: var(--space-5); max-width: 1320px; width: 100%; }

.page-head {
    display: flex;
    align-items: flex-start;
    gap: var(--space-4);
    flex-wrap: wrap;
    margin-bottom: var(--space-5);
}
.page-head__title { font-size: 21px; }
.page-head__sub { color: var(--text-muted); margin: var(--space-1) 0 0; font-size: 13px; }
.page-head__actions { margin-left: auto; display: flex; gap: var(--space-2); flex-wrap: wrap; }

/* ── Cards ───────────────────────────────────────────────────────────────── */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin-bottom: var(--space-5);
    overflow: hidden;
}
.card__head {
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    flex-wrap: wrap;
}
.card__title { font-size: 14.5px; font-weight: 650; }
.card__sub { color: var(--text-muted); font-size: 12.5px; margin: 2px 0 0; }
.card__actions { margin-left: auto; display: flex; gap: var(--space-2); }
.card__body { padding: var(--space-5); }
.card__body--flush { padding: 0; }

/* ── Stat tiles ──────────────────────────────────────────────────────────── */

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: var(--space-4);
    margin-bottom: var(--space-5);
}
.stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-4) var(--space-5);
    box-shadow: var(--shadow-sm);
}
.stat__label {
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
    font-weight: 650;
}
.stat__value {
    font-size: 26px;
    font-weight: 700;
    color: var(--text-heading);
    line-height: 1.15;
    margin-top: var(--space-2);
    font-variant-numeric: tabular-nums;
}
.stat__meta { font-size: 12px; color: var(--text-muted); margin-top: var(--space-1); }

/* ── Tables ──────────────────────────────────────────────────────────────── */

.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th {
    text-align: left;
    padding: var(--space-3) var(--space-4);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
    font-weight: 700;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
table.data td {
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data .num { text-align: right; font-variant-numeric: tabular-nums; }

.empty { padding: var(--space-7) var(--space-5); text-align: center; color: var(--text-muted); }
.empty__title { color: var(--text-heading); font-weight: 650; margin-bottom: var(--space-1); }

/* ── Badges & pills ──────────────────────────────────────────────────────── */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 9px;
    border-radius: 99px;
    font-size: 11.5px;
    font-weight: 650;
    white-space: nowrap;
}
.badge--ok { background: var(--ok-bg); color: var(--ok); }
.badge--warn { background: var(--warn-bg); color: var(--warn); }
.badge--danger { background: var(--danger-bg); color: var(--danger); }
.badge--info { background: var(--info-bg); color: var(--info); }
.badge--muted { background: var(--surface-2); color: var(--text-muted); border: 1px solid var(--border); }

.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: 0 0 auto; }

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border: 1px solid var(--border);
    border-radius: 99px;
    background: var(--surface-2);
    font-size: 12px;
    color: var(--text-muted);
}

/* ── Forms ───────────────────────────────────────────────────────────────── */

.field { margin-bottom: var(--space-4); }
.field__label {
    display: block;
    font-weight: 600;
    font-size: 12.5px;
    color: var(--text-heading);
    margin-bottom: var(--space-2);
}
.field__hint { font-size: 12px; color: var(--text-muted); margin-top: var(--space-2); }
.field__error { font-size: 12px; color: var(--danger); margin-top: var(--space-2); font-weight: 500; }

.input, .select, .textarea {
    width: 100%;
    padding: 10px var(--space-3);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-soft);
}
.input::placeholder { color: var(--text-muted); opacity: .75; }
.input--mono { font-family: var(--mono); font-size: 13px; letter-spacing: .01em; }
.textarea { min-height: 96px; resize: vertical; }
.input:disabled, .select:disabled { background: var(--surface-2); color: var(--text-muted); cursor: not-allowed; }

.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: var(--space-4); }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--space-4); }

/* ── Buttons ─────────────────────────────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 9px var(--space-4);
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s, border-color .15s, opacity .15s;
}
.btn:hover { text-decoration: none; }
.btn svg { width: 16px; height: 16px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.btn--primary { background: var(--brand); color: #fff; }
.btn--primary:hover:not(:disabled) { background: var(--brand-strong); }
.btn--ghost { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.btn--ghost:hover:not(:disabled) { background: var(--surface-2); }
.btn--danger { background: var(--danger); color: #fff; }
.btn--subtle { background: transparent; color: var(--text-muted); padding: 6px var(--space-3); }
.btn--subtle:hover:not(:disabled) { background: var(--surface-2); color: var(--text); }
.btn--sm { padding: 6px var(--space-3); font-size: 12.5px; }
.btn--block { width: 100%; }

/* ── Switch ──────────────────────────────────────────────────────────────── */

.switch { position: relative; display: inline-block; width: 40px; height: 22px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch__track {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: var(--border-strong);
    border-radius: 99px;
    transition: background .18s;
}
.switch__track::before {
    content: "";
    position: absolute;
    height: 16px; width: 16px;
    left: 3px; top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform .18s;
    box-shadow: var(--shadow-sm);
}
.switch input:checked + .switch__track { background: var(--brand); }
.switch input:checked + .switch__track::before { transform: translateX(18px); }
.switch input:disabled + .switch__track { opacity: .5; cursor: not-allowed; }
.switch input:focus-visible + .switch__track { box-shadow: 0 0 0 3px var(--brand-soft); }

/* ── Alerts ──────────────────────────────────────────────────────────────── */

.alert {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-4);
    font-size: 13px;
    border: 1px solid transparent;
    display: flex;
    gap: var(--space-3);
    align-items: flex-start;
}
.alert--ok { background: var(--ok-bg); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 22%, transparent); }
.alert--danger { background: var(--danger-bg); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 22%, transparent); }
.alert--warn { background: var(--warn-bg); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 25%, transparent); }
.alert--info { background: var(--info-bg); color: var(--info); border-color: color-mix(in srgb, var(--info) 22%, transparent); }

/* ── Code blocks ─────────────────────────────────────────────────────────── */

.code {
    background: var(--sidebar);
    color: #d6e5e2;
    border-radius: var(--radius-sm);
    padding: var(--space-4);
    overflow-x: auto;
    font-family: var(--mono);
    font-size: 12.5px;
    line-height: 1.6;
    margin: 0;
    white-space: pre;
    tab-size: 2;
}
.code--inline {
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 1px 6px;
    border-radius: 4px;
    white-space: nowrap;
}

/* ── Tester ──────────────────────────────────────────────────────────────── */

.tester { display: grid; grid-template-columns: minmax(300px, 400px) 1fr; gap: var(--space-5); align-items: start; }

.service-picker { display: flex; flex-direction: column; gap: var(--space-1); max-height: 340px; overflow-y: auto; }
.service-pick {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    width: 100%;
    padding: 9px var(--space-3);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    background: transparent;
    cursor: pointer;
    text-align: left;
    font: inherit;
    color: var(--text);
}
.service-pick:hover { background: var(--surface-2); }
.service-pick.is-active { background: var(--brand-soft); border-color: var(--brand-border); color: var(--brand-strong); font-weight: 600; }
.service-pick__key { font-family: var(--mono); font-size: 11.5px; color: var(--text-muted); margin-left: auto; }
.service-pick.is-active .service-pick__key { color: var(--brand-strong); }

.result-meta { display: flex; gap: var(--space-2); flex-wrap: wrap; margin-bottom: var(--space-4); }

.tabs { display: flex; gap: var(--space-1); border-bottom: 1px solid var(--border); margin-bottom: var(--space-4); }
.tab {
    padding: var(--space-2) var(--space-4);
    border: 0;
    background: transparent;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
}
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--brand); border-bottom-color: var(--brand); }

.trace { display: flex; flex-direction: column; gap: var(--space-2); }
.trace__row {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    font-size: 12.5px;
}
.trace__provider { font-weight: 650; min-width: 110px; }
.trace__msg { color: var(--text-muted); flex: 1; min-width: 0; }

/* ── Utilities ───────────────────────────────────────────────────────────── */

.muted { color: var(--text-muted); }
.small { font-size: 12.5px; }
.strong { font-weight: 650; }
.row { display: flex; align-items: center; gap: var(--space-3); }
.row--wrap { flex-wrap: wrap; }
.spacer { flex: 1; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.mt-4 { margin-top: var(--space-4); } .mb-4 { margin-bottom: var(--space-4); }
.mb-5 { margin-bottom: var(--space-5); }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.spin { animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.scrim {
    position: fixed; inset: 0;
    background: rgba(8, 18, 17, .45);
    z-index: 35;
    display: none;
}
.scrim.is-open { display: block; }

/* ── Auth ────────────────────────────────────────────────────────────────── */

.auth {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: var(--space-5);
    background:
        radial-gradient(1000px 500px at 50% -10%, var(--brand-soft), transparent 70%),
        var(--bg);
}
.auth__card {
    width: 100%;
    max-width: 400px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: var(--space-6);
}
.auth__brand { display: flex; align-items: center; gap: var(--space-3); justify-content: center; margin-bottom: var(--space-5); }
.auth__brand-text { font-weight: 750; font-size: 16px; color: var(--text-heading); }

/* ── Responsive ──────────────────────────────────────────────────────────── */

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

@media (max-width: 860px) {
    .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
    .sidebar.is-open { transform: translateX(0); }
    .main { margin-left: 0; }
    .sidebar-toggle { display: grid; }
    .content { padding: var(--space-4); }
    .page-head__actions { margin-left: 0; width: 100%; }
    .stat__value { font-size: 22px; }
    .topbar { padding: 0 var(--space-4); }
}

@media (max-width: 520px) {
    .page-head__title { font-size: 18px; }
    .card__body { padding: var(--space-4); }
    .btn { padding: 9px var(--space-3); }
    table.data th, table.data td { padding: var(--space-3); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ── Sidebar profile ─────────────────────────────────────────────────────── */

.sidebar-profile {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-5);
    border-top: 1px solid rgba(255, 255, 255, .07);
    min-width: 0;
}
.sidebar-profile__meta { display: flex; flex-direction: column; min-width: 0; }
.sidebar-profile__name {
    color: #fff;
    font-weight: 600;
    font-size: 13px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sidebar-profile__role {
    font-size: 11.5px;
    color: var(--sidebar-text);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.avatar {
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    font-weight: 700;
    flex: 0 0 auto;
}
.avatar-sm { width: 32px; height: 32px; font-size: 12px; }
.avatar-lg { width: 48px; height: 48px; font-size: 16px; }

/* ── Wallet chip ─────────────────────────────────────────────────────────── */

.wallet-chip {
    display: inline-flex;
    align-items: baseline;
    gap: var(--space-2);
    padding: 6px var(--space-3);
    border: 1px solid var(--border);
    border-radius: 99px;
    background: var(--surface-2);
    color: var(--text);
    white-space: nowrap;
}
.wallet-chip:hover { text-decoration: none; border-color: var(--brand-border); background: var(--brand-soft); }
.wallet-chip__label {
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
    font-weight: 700;
}
.wallet-chip__value { font-weight: 700; font-variant-numeric: tabular-nums; }

/* ── Bank account cards (wallet funding) ─────────────────────────────────── */

.bank-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: var(--space-4);
}
.bank-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-5);
    background: var(--surface-2);
}
.bank-card__bank {
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--text-muted);
    font-weight: 700;
}
.bank-card__number {
    font-family: var(--mono);
    font-size: 22px;
    font-weight: 700;
    color: var(--text-heading);
    letter-spacing: .04em;
    margin: var(--space-2) 0;
    word-break: break-all;
}
.bank-card__name { font-size: 12.5px; color: var(--text-muted); margin-bottom: var(--space-3); }

/* ── Ledger amounts ─────────────────────────────────────────────────────── */

.amount { font-variant-numeric: tabular-nums; font-weight: 650; white-space: nowrap; }
.amount--credit { color: var(--ok); }
.amount--debit { color: var(--text); }

/* ── Key reveal ─────────────────────────────────────────────────────────── */

.key-reveal {
    background: var(--sidebar);
    color: #d6e5e2;
    border-radius: var(--radius-sm);
    padding: var(--space-4);
    font-family: var(--mono);
    font-size: 13px;
    word-break: break-all;
    line-height: 1.6;
}

/* ── Marketing / sign-in split ──────────────────────────────────────────── */

.auth-wide {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--bg);
}
.auth-wide__pitch {
    background: linear-gradient(160deg, var(--sidebar), hsl(var(--brand-h) 55% 18%));
    color: #cfe3df;
    padding: var(--space-7) var(--space-6);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: var(--space-5);
}
.auth-wide__pitch h1 { color: #fff; font-size: 27px; line-height: 1.2; }
.auth-wide__form {
    display: grid;
    place-items: center;
    padding: var(--space-6) var(--space-5);
}
.auth-wide__inner { width: 100%; max-width: 400px; }

.pitch-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-4); }
.pitch-list li { display: flex; gap: var(--space-3); align-items: flex-start; font-size: 13.5px; }
.pitch-list svg { width: 18px; height: 18px; flex: 0 0 auto; margin-top: 2px; color: var(--brand-strong); }

@media (max-width: 900px) {
    .auth-wide { grid-template-columns: 1fr; }
    .auth-wide__pitch { display: none; }
}

/* ── Brand mark ──────────────────────────────────────────────────────────── */

.brand-mark {
    width: 32px;
    height: 32px;
    flex: 0 0 auto;
    display: block;
}
.auth__brand .brand-mark { width: 36px; height: 36px; }

/* The old CSS tile is kept as a fallback for any view that still renders it,
   but the SVG mark is now the brand everywhere. */

/* ── Code samples with language tabs ─────────────────────────────────────── */

.lang-tabs { margin-top: var(--space-4); }
.lang-tabs .tabs { margin-bottom: var(--space-3); flex-wrap: wrap; }

.lang-panel { position: relative; }

/* Without JavaScript every panel stays visible, so the page still documents
   all four languages. The script adds is-ready and hides the inactive ones. */
.lang-tabs.is-ready .lang-panel { display: none; }
.lang-tabs.is-ready .lang-panel.is-active { display: block; }

.code-copy {
    position: absolute;
    top: var(--space-3);
    right: var(--space-3);
    z-index: 2;
    padding: 4px 10px;
    font: inherit;
    font-size: 11.5px;
    font-weight: 650;
    color: #cfe3df;
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: var(--radius-sm);
    cursor: pointer;
}
.code-copy:hover { background: rgba(255, 255, 255, .2); color: #fff; }
.lang-panel .code { padding-right: 72px; }

/* ── Toast ───────────────────────────────────────────────────────────────── */

.toast {
    position: fixed;
    left: 50%;
    bottom: calc(var(--space-5) + env(safe-area-inset-bottom, 0px));
    transform: translateX(-50%);
    z-index: 60;
    background: var(--sidebar);
    color: #e6f1ef;
    padding: 10px var(--space-4);
    border-radius: 99px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    animation: toast-in .18s ease;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateX(-50%) translateY(6px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ── Tester attachments ────────────────────────────────────────
   A photo and a slip the operator can actually look at, beside the JSON that
   only reports their length. */
.attachment {
    display: flex;
    gap: var(--space-3);
    align-items: flex-start;
    padding: var(--space-3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface-2);
}

.attachment__preview {
    width: 92px;
    height: 110px;
    object-fit: cover;
    border-radius: calc(var(--radius) - 2px);
    background: var(--surface);
    border: 1px solid var(--border);
}

.attachment__preview--file {
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    color: var(--text-muted);
    letter-spacing: .04em;
}

.attachment__meta { min-width: 0; }

.danger { color: var(--danger); }

/* ── Floating WhatsApp button ─────────────────────────────────────────────────
   Fixed bottom-right on every customer page. Stacked below the scrim (35), so
   an open mobile drawer covers it rather than leaving a green circle floating
   over the dimmed overlay, and well below the toast (60), so a "Copied"
   confirmation is never hidden behind it. */
.wa-float {
    position: fixed;
    right: calc(var(--space-5) + env(safe-area-inset-right, 0px));
    bottom: calc(var(--space-5) + env(safe-area-inset-bottom, 0px));
    z-index: 34;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    /* WhatsApp's own green, in both themes: a recoloured version of a logo
       people recognise at a glance is a worse button. */
    background: #25d366;
    color: #fff;
    box-shadow: 0 6px 18px rgba(18, 140, 70, .36);
    transition: transform .16s ease, box-shadow .16s ease, background .16s ease;
}

.wa-float svg {
    width: 30px;
    height: 30px;
}

.wa-float:hover,
.wa-float:focus-visible {
    background: #1fb857;
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(18, 140, 70, .44);
}

.wa-float:focus-visible {
    outline: 2px solid #0f8a44;
    outline-offset: 3px;
}

@media (max-width: 640px) {
    .wa-float {
        right: calc(var(--space-4) + env(safe-area-inset-right, 0px));
        bottom: calc(var(--space-4) + env(safe-area-inset-bottom, 0px));
        width: 50px;
        height: 50px;
    }

    .wa-float svg { width: 27px; height: 27px; }
}

/* A hover transform is wrong for anyone who has asked for less motion. */
@media (prefers-reduced-motion: reduce) {
    .wa-float { transition: none; }
    .wa-float:hover,
    .wa-float:focus-visible { transform: none; }
}


/* ── Mobile topbar ───────────────────────────────────────────────────────── */

@media (max-width: 560px) {
    /* The "Balance" caption pushes the topbar wider than the viewport, which
       makes the whole page scroll sideways against a blank strip. The figure
       alone is unambiguous next to a wallet link, so the caption goes. */
    .wallet-chip__label { display: none; }
    .wallet-chip { padding: 6px 10px; }
    .topbar { padding: 0 var(--space-3); gap: var(--space-2); }
    .topbar__title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* Nothing in the chrome may widen the page. A single overflowing element
   produces exactly the symptom above, and it is easier to forbid than to find. */
body { overflow-x: hidden; }
.topbar { min-width: 0; }
