/* ==========================================================================
   SlipConverter design system
   One stylesheet on top of Bootstrap 5.3 (grid, utilities, modal/collapse JS).
   Tokens first, then base, layout, components, page modules.

   Scale
   - Spacing: 4px base  (--s1 4 · --s2 8 · --s3 12 · --s4 16 · --s5 20 · --s6 24 · --s8 32 · --s10 40)
   - Type:    12 / 13 / 14 (base) / 16 / 18 / 22 / 28
   - Controls: 32 (sm) · 36 (md) · 44 (lg, primary mobile actions)
   - Radius:  4 (sm) · 6 (controls) · 8 (panels)
   ========================================================================== */

:root {
    --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;

    --bg: #ffffff;
    --bg-subtle: #f7f8f9;
    --bg-muted: #eff1f3;
    --border: #e4e7eb;
    --border-strong: #cdd2d8;

    --text: #16191d;
    --text-2: #444b54;
    --text-3: #5f6770;

    --primary: #15803d;
    --primary-hover: #106832;
    --primary-soft: #ebf6ef;
    --primary-text: #0f5c2c;
    --focus: rgba(21, 128, 61, .32);

    --success: #15803d;
    --success-soft: #ebf6ef;
    --warning: #a85b07;
    --warning-soft: #fdf3e3;
    --danger: #c42b2b;
    --danger-soft: #fdeeee;
    --info-soft: #eef3f8;

    --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px; --s10: 40px;
    --r-sm: 4px; --r: 6px; --r-lg: 8px;
    --h-sm: 32px; --h: 36px; --h-lg: 44px;
    --header-h: 56px;
    --shadow-pop: 0 6px 24px rgba(16, 24, 40, .10), 0 1px 3px rgba(16, 24, 40, .06);

    /* Aliases for the previous design-system variables, still referenced by
       the admin portal's own styles. Map them onto the current tokens. */
    --bg-base: var(--bg-subtle); --bg-input: var(--bg); --surface-1: var(--bg); --surface-2: var(--bg-subtle);
    --divider: var(--border); --text-primary: var(--text); --text-secondary: var(--text-3); --text-on-primary: #fff;
    --primary-pressed: var(--primary-hover); --primary-tint: var(--primary-soft);
    --secondary: var(--text-2); --secondary-tint: var(--bg-muted);
    --error: var(--danger); --error-tint: var(--danger-soft); --overlay-press: rgba(16, 24, 40, .06);
    --radius-sm: var(--r-sm); --radius-md: var(--r-lg); --radius-lg: var(--r-lg); --radius-pill: var(--r);

    /* Bootstrap bridge */
    --bs-body-font-family: var(--font);
    --bs-body-font-size: 14px;
    --bs-body-color: var(--text);
    --bs-body-bg: var(--bg);
    --bs-border-color: var(--border);
    --bs-border-radius: var(--r);
    --bs-link-color: var(--primary);
    --bs-link-color-rgb: 21, 128, 61;
    --bs-link-hover-color: var(--primary-hover);
    --bs-primary: var(--primary);
    --bs-primary-rgb: 21, 128, 61;
    --bs-success: var(--success);
    --bs-success-rgb: 21, 128, 61;
    --bs-secondary-color: var(--text-3);
    --bs-emphasis-color: var(--text);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 8px); }
body {
    margin: 0; font-family: var(--font); font-size: 14px; line-height: 1.5;
    color: var(--text); background: var(--bg-subtle);
    -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, h5, h6 { color: var(--text); font-weight: 600; line-height: 1.25; margin: 0 0 var(--s2); letter-spacing: -.01em; }
h1, .h1 { font-size: 22px; }
h2, .h2 { font-size: 18px; }
h3, .h3 { font-size: 16px; }
h4, .h4, h5, .h5 { font-size: 14px; }
h6, .h6 { font-size: 13px; }
p { margin: 0 0 var(--s3); color: var(--text-2); }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); text-decoration: underline; }
small, .small { font-size: 12px; }
code, kbd, .mono { font-family: var(--mono); }
code { color: var(--text); background: var(--bg-muted); padding: 1px 5px; border-radius: var(--r-sm); font-size: .92em; }
hr { border: 0; border-top: 1px solid var(--border); opacity: 1; margin: var(--s4) 0; }
img { max-width: 100%; }
::selection { background: var(--primary-soft); }

:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.btn:focus-visible, .form-control:focus, .form-select:focus { box-shadow: 0 0 0 3px var(--focus); outline: none; }

.text-muted, .text-secondary { color: var(--text-3) !important; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.text-primary { color: var(--primary) !important; }
.bg-light { background: var(--bg-subtle) !important; }
.fw-semibold { font-weight: 600 !important; }
.tnum { font-variant-numeric: tabular-nums; }
.sr-only, .visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 8px; top: -40px; z-index: 2000; background: var(--text); color: #fff; padding: 6px 10px; border-radius: var(--r); }
.skip-link:focus { top: 8px; color: #fff; }

.container, .container-lg, .container-xl { max-width: 1160px; padding-left: 16px; padding-right: 16px; }
.container-narrow { max-width: 760px; margin: 0 auto; padding: 0 16px; }
.container-form { max-width: 400px; margin: 0 auto; padding: 0 16px; }

/* ---------- Header ---------- */
.site-header {
    position: sticky; top: 0; z-index: 1030; height: var(--header-h);
    background: var(--bg); border-bottom: 1px solid var(--border);
}
.site-header .container { display: flex; align-items: center; height: 100%; gap: var(--s4); }
.brand { display: inline-flex; align-items: center; flex-shrink: 0; }
.brand img { height: 28px; width: auto; display: block; }
.nav-main { display: flex; align-items: center; gap: 2px; margin: 0; padding: 0; list-style: none; }
.nav-main a {
    display: inline-flex; align-items: center; height: 32px; padding: 0 10px; border-radius: var(--r);
    color: var(--text-2); font-weight: 500; font-size: 14px; text-decoration: none; white-space: nowrap;
}
.nav-main a:hover { background: var(--bg-muted); color: var(--text); }
.nav-main a[aria-current="page"] { color: var(--text); background: var(--bg-muted); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: var(--s2); }
.balance-chip {
    display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px;
    border: 1px solid var(--border); border-radius: var(--r); font-size: 13px; color: var(--text-2);
    text-decoration: none; font-variant-numeric: tabular-nums;
}
.balance-chip strong { color: var(--text); font-weight: 600; }
.balance-chip:hover { border-color: var(--border-strong); text-decoration: none; color: var(--text); }
.balance-chip.is-empty strong { color: var(--danger); }
.avatar {
    width: 28px; height: 28px; border-radius: 50%; background: var(--bg-muted); color: var(--text-2);
    display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: 12px;
    overflow: hidden; flex-shrink: 0;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-menu-btn {
    display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 6px 0 4px;
    background: none; border: 1px solid transparent; border-radius: var(--r); color: var(--text); font: inherit; cursor: pointer;
}
.user-menu-btn:hover { background: var(--bg-muted); }
.user-menu-btn .name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.menu-toggle {
    display: none; width: 36px; height: 36px; align-items: center; justify-content: center;
    border: 1px solid var(--border); background: var(--bg); border-radius: var(--r); color: var(--text); font-size: 18px; cursor: pointer;
}
.mobile-nav, .nav-scrim { display: none; }

/* ---------- Mobile nav: a drawer off the left edge ----------
   Open it with the menu button or by dragging in from the left edge; close it
   with the X, the scrim, Escape, or by dragging it back. app.js follows the
   finger by writing a transform and adding .is-dragging to drop the
   transition, so the panel tracks the gesture rather than snapping. */
@media (max-width: 991.98px) {
    .nav-main, .header-actions .hide-md { display: none; }
    .menu-toggle { display: inline-flex; }

    .mobile-nav {
        display: flex; flex-direction: column;
        position: fixed; z-index: 1035; top: 0; bottom: 0; left: 0;
        width: min(300px, 84vw);
        background: var(--bg); border-right: 1px solid var(--border);
        box-shadow: 0 0 40px rgba(16, 24, 40, .18);
        padding-bottom: calc(var(--s4) + env(safe-area-inset-bottom));
        overflow-y: auto; overscroll-behavior: contain;
        transform: translate3d(-100%, 0, 0); visibility: hidden;
        transition: transform .28s cubic-bezier(.2, .8, .3, 1), visibility 0s .28s;
    }
    .mobile-nav.open {
        transform: none; visibility: visible;
        transition: transform .28s cubic-bezier(.2, .8, .3, 1), visibility 0s;
    }
    .mobile-nav.is-dragging { transition: none; visibility: visible; }

    .mobile-nav-head {
        flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between;
        height: var(--header-h); padding: 0 10px 0 16px; border-bottom: 1px solid var(--border);
    }
    .mobile-nav-head img { height: 24px; width: auto; }
    .mobile-nav-x {
        width: 36px; height: 36px; border: 0; border-radius: 50%; background: none; cursor: pointer;
        color: var(--text-2); font-size: 22px; line-height: 1;
        display: flex; align-items: center; justify-content: center;
    }
    .mobile-nav-x:hover { background: var(--bg-muted); color: var(--text); }

    .mobile-nav a {
        display: flex; align-items: center; gap: 10px; height: 44px; padding: 0 16px; color: var(--text);
        font-weight: 500; text-decoration: none;
    }
    .mobile-nav > a:first-of-type { margin-top: var(--s2); }
    .mobile-nav a:hover, .mobile-nav a[aria-current="page"] { background: var(--bg-subtle); }
    .mobile-nav a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--primary); }
    .mobile-nav a i { color: var(--text-3); font-size: 16px; width: 18px; }
    .mobile-nav a[aria-current="page"] i { color: var(--primary); }
    .mobile-nav .sep { height: 1px; background: var(--border); margin: var(--s2) 16px; }

    .nav-scrim {
        display: block; position: fixed; inset: 0; z-index: 1034;
        background: rgba(12, 16, 20, .45);
        opacity: 0; visibility: hidden;
        transition: opacity .28s ease, visibility 0s .28s;
    }
    .nav-scrim.open { opacity: 1; visibility: visible; transition: opacity .28s ease, visibility 0s; }
    .nav-scrim.is-dragging { transition: none; visibility: visible; }
    body.nav-open { overflow: hidden; }
}
@media (prefers-reduced-motion: reduce) {
    .mobile-nav, .nav-scrim { transition: none; }
}

/* ---------- Mobile tab bar ---------- */
.tabbar { display: none; }
@media (max-width: 767.98px) {
    body.has-tabbar { padding-bottom: calc(56px + env(safe-area-inset-bottom)); }
    .tabbar {
        display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030;
        background: var(--bg); border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom);
    }
    .tabbar a {
        display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: 56px;
        color: var(--text-3); font-size: 11px; font-weight: 500; text-decoration: none;
    }
    .tabbar a i { font-size: 18px; }
    .tabbar a[aria-current="page"] { color: var(--primary); }
}

/* ---------- Footer ---------- */
.site-footer { background: var(--bg); border-top: 1px solid var(--border); margin-top: var(--s10); font-size: 13px; }
.site-footer .container { padding-top: var(--s6); padding-bottom: var(--s6); }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: var(--s6); }
.footer-grid h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); margin-bottom: var(--s2); }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: 6px; }
.footer-grid a { color: var(--text-2); }
.footer-grid p { font-size: 13px; color: var(--text-3); max-width: 300px; }
.footer-legal { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s2); border-top: 1px solid var(--border); margin-top: var(--s5); padding-top: var(--s4); color: var(--text-3); font-size: 12px; }
.footer-legal p { margin: 0; color: var(--text-3); font-size: 12px; }
@media (max-width: 767.98px) {
    .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--s4); }
    .footer-grid > :first-child { grid-column: 1 / -1; }
}

/* ---------- Page scaffolding ---------- */
main { display: block; }
.page { padding: var(--s6) 0 var(--s8); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; margin-bottom: var(--s4); }
.page-head h1 { margin: 0; }
.page-head p { margin: 2px 0 0; color: var(--text-3); font-size: 13px; }
.section { padding: var(--s8) 0; }
.section + .section { padding-top: 0; }
.section-head { margin-bottom: var(--s4); }
.section-head h2 { margin-bottom: 4px; }
.section-head p { margin: 0; color: var(--text-3); }
.eyebrow { display: block; font-size: 12px; font-weight: 600; color: var(--primary); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }

/* ---------- Panels ---------- */
.panel { background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-lg); }
.panel + .panel { margin-top: var(--s4); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s3) var(--s4); border-bottom: 1px solid var(--border); min-height: 48px; }
.panel-head h2, .panel-head h3 { margin: 0; font-size: 14px; }
.panel-head .meta { font-size: 12px; color: var(--text-3); }
.panel-body { padding: var(--s4); }
.panel-foot { padding: var(--s3) var(--s4); border-top: 1px solid var(--border); background: var(--bg-subtle); border-radius: 0 0 var(--r-lg) var(--r-lg); font-size: 13px; }
.panel.danger { border-color: #f1c5c5; }

/* Legacy wrappers used by older partials render as panels. */
.stats-card, .card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: none; padding: var(--s4); color: var(--text); }
.card { padding: 0; }
.card-body { padding: var(--s4); }
.card-header, .card-footer { background: var(--bg-subtle); border-color: var(--border); padding: var(--s3) var(--s4); }
.card-title { font-size: 14px; font-weight: 600; }
.shadow, .shadow-sm, .shadow-lg { box-shadow: none !important; }

/* ---------- Key/value + metrics ---------- */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px var(--s4); margin: 0; font-size: 13px; }
.kv dt { color: var(--text-3); font-weight: 400; }
.kv dd { margin: 0; color: var(--text); min-width: 0; overflow-wrap: anywhere; }

.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-lg); }
.metric { padding: var(--s3) var(--s4); min-width: 0; }
.metric + .metric { border-left: 1px solid var(--border); }
.metric .label { font-size: 12px; color: var(--text-3); display: flex; align-items: center; gap: 6px; }
.metric .value { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; line-height: 1.3; color: var(--text); }
.metric .value small { font-size: 12px; font-weight: 500; color: var(--text-3); }
.metric .sub { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.metrics.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 767.98px) {
    .metrics, .metrics.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .metrics.cols-3 > :first-child { grid-column: 1 / -1; }
    .metrics.cols-3 > :nth-child(2) { border-left: 0; border-top: 1px solid var(--border); }
    .metrics.cols-3 > :nth-child(3) { border-left: 1px solid var(--border) !important; }
    .metric:nth-child(3) { border-left: 0; }
    .metric:nth-child(n+3) { border-top: 1px solid var(--border); }
    .metric .value { font-size: 18px; }
}

/* ---------- Buttons ---------- */
.btn {
    --bs-btn-padding-x: 14px; --bs-btn-padding-y: 0; --bs-btn-font-size: 14px; --bs-btn-font-weight: 500;
    --bs-btn-border-radius: var(--r); --bs-btn-line-height: 1;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: var(--h);
    white-space: nowrap; transition: background-color .12s, border-color .12s, color .12s; box-shadow: none;
}
.btn i { font-size: 15px; line-height: 1; }
.btn-sm { --bs-btn-padding-x: 10px; --bs-btn-font-size: 13px; height: var(--h-sm); }
.btn-lg { --bs-btn-padding-x: 18px; --bs-btn-font-size: 15px; height: var(--h-lg); }
.btn-block, .w-100.btn { width: 100%; }
.btn-primary, .btn-success {
    --bs-btn-color: #fff; --bs-btn-bg: var(--primary); --bs-btn-border-color: var(--primary);
    --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--primary-hover); --bs-btn-hover-border-color: var(--primary-hover);
    --bs-btn-active-color: #fff; --bs-btn-active-bg: var(--primary-hover); --bs-btn-active-border-color: var(--primary-hover);
    --bs-btn-disabled-color: #fff; --bs-btn-disabled-bg: #7fb796; --bs-btn-disabled-border-color: #7fb796;
}
.btn-secondary, .btn-outline-secondary, .btn-light, .btn-outline, .btn-outline-primary, .btn-outline-success, .btn-outline-dark, .btn-default {
    --bs-btn-color: var(--text); --bs-btn-bg: var(--bg); --bs-btn-border-color: var(--border-strong);
    --bs-btn-hover-color: var(--text); --bs-btn-hover-bg: var(--bg-muted); --bs-btn-hover-border-color: var(--border-strong);
    --bs-btn-active-color: var(--text); --bs-btn-active-bg: var(--bg-muted); --bs-btn-active-border-color: var(--border-strong);
    --bs-btn-disabled-color: var(--text-3); --bs-btn-disabled-bg: var(--bg); --bs-btn-disabled-border-color: var(--border);
}
.btn-ghost {
    --bs-btn-color: var(--text-2); --bs-btn-bg: transparent; --bs-btn-border-color: transparent;
    --bs-btn-hover-color: var(--text); --bs-btn-hover-bg: var(--bg-muted); --bs-btn-hover-border-color: transparent;
    --bs-btn-active-bg: var(--bg-muted); --bs-btn-active-border-color: transparent;
}
.btn-danger, .btn-outline-danger {
    --bs-btn-color: var(--danger); --bs-btn-bg: var(--bg); --bs-btn-border-color: #ecbcbc;
    --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--danger); --bs-btn-hover-border-color: var(--danger);
    --bs-btn-active-color: #fff; --bs-btn-active-bg: var(--danger); --bs-btn-active-border-color: var(--danger);
}
.btn-warning, .btn-outline-warning, .btn-info, .btn-outline-info, .btn-dark {
    --bs-btn-color: var(--text); --bs-btn-bg: var(--bg); --bs-btn-border-color: var(--border-strong);
    --bs-btn-hover-color: var(--text); --bs-btn-hover-bg: var(--bg-muted); --bs-btn-hover-border-color: var(--border-strong);
}
.btn-link { --bs-btn-color: var(--primary); --bs-btn-hover-color: var(--primary-hover); height: auto; padding: 0; }
.btn-icon { width: var(--h); padding: 0 !important; }
.btn-icon.btn-sm { width: var(--h-sm); }
.btn.is-loading { pointer-events: none; }
.btn.is-loading::before {
    content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent;
    animation: spin .7s linear infinite;
}
.btn.is-loading > i { display: none; }
.btn-close { width: 32px; height: 32px; padding: 0; background-size: 10px; opacity: .55; }
.btn-close:hover { opacity: .9; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { * { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ---------- Forms ---------- */
.field { margin-bottom: var(--s3); }
.field:last-child { margin-bottom: 0; }
.form-label, .field > label, label.label {
    display: block; font-size: 13px; font-weight: 500; color: var(--text); margin-bottom: 6px;
}
.label-row { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s2); margin-bottom: 6px; }
.label-row label { font-size: 13px; font-weight: 500; color: var(--text); margin: 0; }
.label-row a { font-size: 12px; }
.hint, .form-text { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.form-control, .form-select {
    height: var(--h); padding: 0 10px; font-size: 14px; color: var(--text); background-color: var(--bg);
    border: 1px solid var(--border-strong); border-radius: var(--r); box-shadow: none; transition: border-color .12s, box-shadow .12s;
}
.form-select { padding-right: 32px; background-position: right 10px center; }
textarea.form-control { height: auto; min-height: 88px; padding: 8px 10px; }
.form-control::placeholder { color: #858c95; }
.form-control:hover, .form-select:hover { border-color: #b7bec6; }
.form-control:focus, .form-select:focus { border-color: var(--primary); }
.form-control:disabled, .form-control[readonly] { background: var(--bg-subtle); color: var(--text-2); }
.form-control-sm, .form-select-sm { height: var(--h-sm); font-size: 13px; }
.form-control-lg, .form-select-lg { height: var(--h-lg); font-size: 15px; }
.form-control.is-invalid, .is-invalid > .picker-btn { border-color: var(--danger) !important; background-image: none; }
.form-control.is-invalid:focus { box-shadow: 0 0 0 3px rgba(196, 43, 43, .2); }
.field-error, .invalid-feedback { display: block; font-size: 12px; color: var(--danger); margin-top: 4px; }
.field-error:empty { display: none; }
.form-check-input { width: 16px; height: 16px; margin-top: 2px; border-color: var(--border-strong); }
.form-check-input:checked { background-color: var(--primary); border-color: var(--primary); }
.form-check-input:focus { box-shadow: 0 0 0 3px var(--focus); border-color: var(--primary); }
.form-check-label { font-size: 13px; color: var(--text-2); }
.input-group-text { background: var(--bg-subtle); border-color: var(--border-strong); color: var(--text-2); font-size: 13px; }
.input-group > .form-control, .input-group > .btn { height: var(--h); }
.password-wrap { position: relative; }
.password-wrap .form-control { padding-right: 40px; }
.password-wrap .reveal { position: absolute; right: 2px; top: 2px; height: calc(var(--h) - 4px); width: 34px; border: 0; background: none; color: var(--text-3); cursor: pointer; border-radius: var(--r); }
.password-wrap .reveal:hover { color: var(--text); }

@media (max-width: 767.98px) {
    /* 16px stops iOS zooming into focused inputs. */
    .form-control, .form-select, .picker-btn, .picker-search { font-size: 16px; }
    .form-control, .form-select { height: 40px; }
}

/* ---------- Tables ---------- */
.table { --bs-table-bg: transparent; --bs-table-hover-bg: var(--bg-subtle); margin: 0; font-size: 13px; color: var(--text); border-color: var(--border); }
.table > :not(caption) > * > * { padding: 9px 12px; border-bottom-color: var(--border); vertical-align: middle; }
.table thead th {
    font-size: 12px; font-weight: 500; color: var(--text-3); background: var(--bg-subtle); white-space: nowrap;
    border-bottom: 1px solid var(--border);
}
.table tbody tr:last-child > * { border-bottom: 0; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table .muted { color: var(--text-3); }
.table-responsive { border-radius: inherit; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* Phones: rows collapse to two compact lines (add .table-stack).
   .primary-cell = line 1 left · .lead = line 1 right · everything else is
   inline muted meta on line 2; .show-label prefixes the column name. */
@media (max-width: 639.98px) {
    .table-stack thead { display: none; }
    .table-stack, .table-stack tbody { display: block; width: 100%; }
    .table-stack tr { display: flex; flex-wrap: wrap; align-items: center; gap: 3px 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
    .table-stack tbody tr:last-child { border-bottom: 0; }
    .table-stack > :not(caption) > * > * { padding: 0; border: 0; display: block; font-size: 12px; color: var(--text-3); white-space: nowrap; }
    .table-stack td.primary-cell { order: -2; flex: 1 1 calc(100% - 100px); min-width: 0; font-size: 13.5px; color: var(--text); font-weight: 500; white-space: normal; }
    .table-stack td.lead { order: -1; margin-left: auto; font-size: 13.5px; text-align: right; }
    .table-stack td.lead.amount-neg { color: var(--text); }
    .table-stack td.break { flex-basis: 100%; height: 0; }
    .table-stack td.actions { flex-basis: 100%; display: flex; gap: 6px; margin-top: 6px; }
    .table-stack td.actions .btn { flex: 1; }
    .table-stack td.actions .btn-icon { flex: 0 0 var(--h-sm); }
    .table-stack td.show-label::before { content: attr(data-label) " "; }
    .table-stack td.hide-xs { display: none; }
    .table-stack .code-chip { font-size: 12px; }
}

/* ---------- Badges ---------- */
.badge {
    display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: var(--r-sm);
    font-size: 11.5px; font-weight: 500; line-height: 1; letter-spacing: 0; white-space: nowrap;
    background: var(--bg-muted); color: var(--text-2);
}
.badge.bg-success, .badge-success, .badge.text-bg-success { background: var(--success-soft) !important; color: var(--primary-text) !important; }
.badge.bg-warning, .badge-warning, .badge.text-bg-warning { background: var(--warning-soft) !important; color: var(--warning) !important; }
.badge.bg-danger, .badge-danger, .badge.text-bg-danger { background: var(--danger-soft) !important; color: var(--danger) !important; }
.badge.bg-info, .badge-info, .badge.bg-primary, .badge.bg-secondary, .badge.bg-dark, .badge.bg-light, .badge-neutral { background: var(--bg-muted) !important; color: var(--text-2) !important; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; display: inline-block; }

/* ---------- Alerts & notices ---------- */
.alert, .notice {
    display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--r);
    border: 1px solid var(--border); background: var(--info-soft); color: var(--text); font-size: 13px; margin-bottom: var(--s3);
}
.alert > i, .notice > i { font-size: 16px; line-height: 20px; flex-shrink: 0; }
.alert p, .notice p { margin: 0; color: inherit; }
.alert .btn-close { margin-left: auto; height: 20px; width: 20px; }
.alert-success, .notice-success { background: var(--success-soft); border-color: #c5e3d0; color: var(--primary-text); }
.alert-danger, .alert-error, .notice-danger { background: var(--danger-soft); border-color: #f2c9c9; color: #8f1d1d; }
.alert-warning, .notice-warning { background: var(--warning-soft); border-color: #f1d9b0; color: #7a4205; }
.alert-info, .alert-primary, .alert-secondary, .alert-light { background: var(--info-soft); border-color: #d9e3ee; color: var(--text); }
.alert-dismissible { padding-right: 12px; }
.alert-dismissible .btn-close { position: static; padding: 0; }

/* ---------- Empty / loading ---------- */
.empty { text-align: center; padding: var(--s8) var(--s4); color: var(--text-3); font-size: 13px; }
.empty i { font-size: 22px; color: var(--border-strong); display: block; margin-bottom: 6px; }
.empty p { margin: 0 0 var(--s3); color: var(--text-3); }
.spinner { width: 16px; height: 16px; border: 2px solid var(--border-strong); border-top-color: var(--primary); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; vertical-align: middle; }
.spinner-border { --bs-spinner-width: 18px; --bs-spinner-height: 18px; --bs-spinner-border-width: 2px; color: var(--primary); }
.skeleton { background: var(--bg-muted); border-radius: var(--r-sm); min-height: 12px; }

/* ---------- Tabs / segmented ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a, .tabs button {
    display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px; margin-bottom: -1px;
    border: 0; border-bottom: 2px solid transparent; background: none; color: var(--text-3); font: inherit; font-weight: 500;
    white-space: nowrap; text-decoration: none; cursor: pointer;
}
.tabs a:hover, .tabs button:hover { color: var(--text); text-decoration: none; }
.tabs [aria-current="page"], .tabs [aria-selected="true"] { color: var(--text); border-bottom-color: var(--primary); }
.nav-tabs { border-bottom-color: var(--border); gap: 2px; }
.nav-tabs .nav-link { border: 0; border-bottom: 2px solid transparent; color: var(--text-3); font-weight: 500; padding: 9px 12px; border-radius: 0; }
.nav-tabs .nav-link.active, .nav-tabs .nav-item.show .nav-link { color: var(--text); background: none; border-bottom-color: var(--primary); }
.nav-pills .nav-link { color: var(--text-2); border-radius: var(--r); padding: 6px 12px; font-weight: 500; }
.nav-pills .nav-link.active { background: var(--bg-muted); color: var(--text); }
.segmented { display: inline-flex; padding: 2px; background: var(--bg-muted); border-radius: var(--r); gap: 2px; }
.segmented a, .segmented button { height: 28px; padding: 0 10px; border: 0; border-radius: var(--r-sm); background: none; color: var(--text-2); font: inherit; font-size: 13px; font-weight: 500; display: inline-flex; align-items: center; text-decoration: none; cursor: pointer; }
.segmented [aria-current="true"], .segmented [aria-pressed="true"] { background: var(--bg); color: var(--text); box-shadow: 0 1px 2px rgba(16, 24, 40, .08); }

/* ---------- Pagination ---------- */
.pager { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); font-size: 13px; color: var(--text-3); }
.pager .btns { display: flex; gap: 6px; }
.pagination { --bs-pagination-color: var(--text-2); --bs-pagination-border-color: var(--border); --bs-pagination-active-bg: var(--primary); --bs-pagination-active-border-color: var(--primary); --bs-pagination-hover-bg: var(--bg-muted); --bs-pagination-font-size: 13px; --bs-pagination-focus-box-shadow: 0 0 0 3px var(--focus); margin: 0; }

/* ---------- Dropdown / modal / accordion / tooltip ---------- */
.dropdown-menu {
    --bs-dropdown-font-size: 14px; --bs-dropdown-border-color: var(--border); --bs-dropdown-border-radius: var(--r-lg);
    --bs-dropdown-link-hover-bg: var(--bg-subtle); --bs-dropdown-link-active-bg: var(--bg-muted); --bs-dropdown-link-active-color: var(--text);
    --bs-dropdown-padding-y: 4px; --bs-dropdown-item-padding-y: 7px; --bs-dropdown-item-padding-x: 12px; --bs-dropdown-divider-margin-y: 4px;
    box-shadow: var(--shadow-pop); min-width: 200px;
}
.dropdown-item { display: flex; align-items: center; gap: 8px; color: var(--text); }
.dropdown-item i { color: var(--text-3); width: 16px; }
.dropdown-header { font-size: 12px; color: var(--text-3); }
.modal { --bs-modal-border-radius: var(--r-lg); --bs-modal-border-color: var(--border); --bs-modal-padding: 16px; --bs-modal-header-padding: 12px 16px; --bs-modal-footer-gap: 8px; }
.modal-content { box-shadow: var(--shadow-pop); border: 1px solid var(--border); }
.modal-header { border-bottom: 1px solid var(--border); }
.modal-title { font-size: 15px; font-weight: 600; }
.modal-footer { border-top: 1px solid var(--border); padding: 10px 16px; }
.modal-backdrop.show { opacity: .35; }
.accordion { --bs-accordion-border-color: var(--border); --bs-accordion-border-radius: var(--r-lg); --bs-accordion-inner-border-radius: var(--r-lg); --bs-accordion-btn-padding-y: 12px; --bs-accordion-btn-padding-x: 16px; --bs-accordion-body-padding-x: 16px; --bs-accordion-body-padding-y: 0; --bs-accordion-active-bg: var(--bg); --bs-accordion-active-color: var(--text); --bs-accordion-btn-focus-box-shadow: inset 0 0 0 2px var(--focus); --bs-accordion-btn-color: var(--text); --bs-accordion-color: var(--text-2); }
.accordion-button { font-size: 14px; font-weight: 500; }
.accordion-body { padding-bottom: 14px !important; font-size: 13px; }
.tooltip { --bs-tooltip-font-size: 12px; --bs-tooltip-bg: var(--text); --bs-tooltip-border-radius: var(--r-sm); }
.list-group { --bs-list-group-border-color: var(--border); --bs-list-group-item-padding-y: 10px; --bs-list-group-item-padding-x: 14px; font-size: 13px; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; z-index: 2000; left: 50%; transform: translateX(-50%); bottom: 20px; display: flex; flex-direction: column; gap: 8px; width: min(420px, calc(100% - 32px)); pointer-events: none; }
@media (max-width: 767.98px) { .toasts { bottom: calc(68px + env(safe-area-inset-bottom)); } }
.toast-msg {
    pointer-events: auto; display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: var(--r);
    background: var(--text); color: #fff; font-size: 13px; box-shadow: var(--shadow-pop); animation: toast-in .16s ease-out;
}
.toast-msg i { font-size: 16px; line-height: 20px; }
.toast-msg.success i { color: #6fd39a; }
.toast-msg.error i { color: #ff8f8f; }
.toast-msg.warning i { color: #ffc46b; }
.toast-msg button { margin-left: auto; background: none; border: 0; color: #c7ccd1; font-size: 16px; line-height: 20px; cursor: pointer; padding: 0 2px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- SweetAlert2 (still used by account/settings/admin) ---------- */
.swal2-popup { font-family: var(--font) !important; border-radius: var(--r-lg) !important; padding: 20px !important; width: 26em !important; font-size: 14px !important; }
.swal2-title { font-size: 17px !important; font-weight: 600 !important; color: var(--text) !important; padding: 0 0 4px !important; }
.swal2-html-container { font-size: 14px !important; color: var(--text-2) !important; margin: 8px 0 0 !important; }
.swal2-icon { transform: scale(.65); margin: 0 auto -8px !important; }
.swal2-actions { margin-top: 16px !important; gap: 8px; }
.swal2-styled { border-radius: var(--r) !important; height: 36px; padding: 0 16px !important; font-size: 14px !important; font-weight: 500 !important; margin: 0 !important; box-shadow: none !important; }
.swal2-styled.swal2-confirm { background: var(--primary) !important; }
.swal2-styled.swal2-cancel { background: var(--bg) !important; color: var(--text) !important; border: 1px solid var(--border-strong) !important; }
.swal2-styled.swal2-deny { background: var(--danger) !important; }
.swal2-input, .swal2-textarea, .swal2-select { font-size: 14px !important; border-radius: var(--r) !important; border: 1px solid var(--border-strong) !important; box-shadow: none !important; height: 36px !important; margin: 10px 0 0 !important; width: 100% !important; }

/* ==========================================================================
   Converter (homepage / core product)
   ========================================================================== */
.convert-hero { background: var(--bg); border-bottom: 1px solid var(--border); }
.convert-hero .container { padding-top: var(--s6); padding-bottom: var(--s6); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 560px); gap: var(--s8); align-items: start; }
.convert-intro h1 { font-size: 28px; letter-spacing: -.02em; margin-bottom: var(--s2); }
.convert-intro .lede { font-size: 15px; color: var(--text-2); max-width: 440px; margin-bottom: var(--s4); }
.facts { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; font-size: 13px; color: var(--text-2); }
.facts li { display: flex; gap: 8px; align-items: flex-start; }
.facts i { color: var(--primary); font-size: 15px; line-height: 20px; }
.logo-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--s5); align-items: center; }
.logo-row img { width: 28px; height: 28px; object-fit: contain; border: 1px solid var(--border); border-radius: var(--r); padding: 3px; background: #fff; }
.logo-row span { font-size: 12px; color: var(--text-3); margin-left: 4px; }

.converter { background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-lg); }
.converter-body { padding: var(--s4); }
.converter-head { display: flex; align-items: center; justify-content: space-between; padding: 10px var(--s4); border-bottom: 1px solid var(--border); font-size: 13px; }
.converter-head h2 { font-size: 14px; margin: 0; }
.converter-head .cost { color: var(--text-3); }
.pair { display: grid; grid-template-columns: minmax(0, 1fr) 36px minmax(0, 1fr); gap: var(--s2); align-items: end; margin-bottom: var(--s3); }
.pair .field { margin-bottom: 0; }
.pair > .swap-btn { margin-bottom: 0; align-self: start; margin-top: 25px; }
.swap-btn { width: 36px; height: var(--h); border: 1px solid var(--border-strong); background: var(--bg); color: var(--text-2); border-radius: var(--r); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; font-size: 15px; }
.swap-btn:hover { background: var(--bg-muted); color: var(--text); }
.code-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s2); align-items: start; }
.code-input { font-family: var(--mono); letter-spacing: .04em; text-transform: uppercase; font-size: 15px !important; }
.code-input::placeholder { text-transform: none; letter-spacing: 0; font-family: var(--font); }
.converter-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: 10px var(--s4); border-top: 1px solid var(--border); background: var(--bg-subtle); border-radius: 0 0 var(--r-lg) var(--r-lg); font-size: 12.5px; color: var(--text-3); }
.converter-foot a { font-weight: 500; white-space: nowrap; }
.converter-foot.is-empty { background: var(--warning-soft); color: #7a4205; }

@media (max-width: 991.98px) {
    .convert-hero .container { grid-template-columns: 1fr; gap: var(--s4); padding-top: var(--s4); padding-bottom: var(--s5); }
    .convert-intro h1 { font-size: 22px; margin-bottom: 4px; }
    .convert-intro .lede { font-size: 14px; margin-bottom: 0; }
    .convert-intro .facts, .convert-intro .logo-row, .convert-intro .panel { display: none; }
}
@media (max-width: 479.98px) {
    .pair { grid-template-columns: 1fr; gap: 6px; }
    .pair > .swap-btn { justify-self: center; width: 40px; height: 28px; margin-top: 0; }
    .pair > .swap-btn i { transform: rotate(90deg); }
    .code-row { grid-template-columns: 1fr; }
    .code-row .btn { width: 100%; height: var(--h-lg); }
    .converter-body { padding: var(--s3); }
}

/* Bookmaker picker (accessible combobox; progressive enhancement of <select>) */
.picker { position: relative; }
.picker select.picker-native { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.picker-btn {
    width: 100%; height: var(--h); display: flex; align-items: center; gap: 8px; padding: 0 30px 0 10px; text-align: left;
    background: var(--bg); border: 1px solid var(--border-strong); border-radius: var(--r); font: inherit; font-size: 14px; color: var(--text);
    cursor: pointer; position: relative;
}
.picker-btn:hover { border-color: #b7bec6; }
.picker-btn:focus-visible, .picker.open .picker-btn { border-color: var(--primary); box-shadow: 0 0 0 3px var(--focus); outline: none; }
.picker-btn::after { content: ""; position: absolute; right: 12px; top: 50%; width: 7px; height: 7px; border-right: 1.5px solid var(--text-3); border-bottom: 1.5px solid var(--text-3); transform: translateY(-70%) rotate(45deg); }
.picker-btn .ph { color: #858c95; }
.picker-btn .txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bk-logo { width: 20px; height: 20px; border-radius: 4px; object-fit: contain; flex-shrink: 0; background: #fff; }
.bk-mono { width: 20px; height: 20px; border-radius: 4px; flex-shrink: 0; background: var(--bg-muted); color: var(--text-2); font-size: 10px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.picker-pop {
    position: absolute; z-index: 1040; top: calc(100% + 4px); left: 0; width: max(100%, 260px); background: var(--bg);
    border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-pop); display: none;
}
.picker.open .picker-pop { display: block; }
.picker.align-right .picker-pop { left: auto; right: 0; }
.picker-search { width: 100%; height: 38px; border: 0; border-bottom: 1px solid var(--border); padding: 0 12px; font: inherit; font-size: 14px; outline: none; border-radius: var(--r-lg) var(--r-lg) 0 0; }
.picker-list { list-style: none; margin: 0; padding: 4px; max-height: 280px; overflow-y: auto; }
.picker-list li { display: flex; align-items: center; gap: 8px; padding: 0 8px; height: 34px; border-radius: var(--r-sm); cursor: pointer; font-size: 14px; }
.picker-list li .region { margin-left: auto; font-size: 12px; color: var(--text-3); }
.picker-list li[aria-selected="true"] { font-weight: 600; }
.picker-list li.active { background: var(--bg-muted); }
.picker-list li[aria-disabled="true"] { opacity: .4; cursor: not-allowed; }
.picker-list .group { height: 26px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); cursor: default; font-weight: 600; }
.picker-empty { padding: 12px; font-size: 13px; color: var(--text-3); }
@media (max-width: 479.98px) {
    .picker-pop { position: fixed; left: 8px !important; right: 8px !important; top: auto; bottom: 8px; width: auto; }
    .picker-list { max-height: 50vh; }
    .picker-list li { height: 40px; }
}

/* Progress + result */
.convert-status { display: none; margin-top: var(--s3); padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r); background: var(--bg-subtle); font-size: 13px; }
.convert-status.show { display: block; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.steps li { display: flex; align-items: center; gap: 8px; color: var(--text-3); }
.steps li .ic { width: 16px; height: 16px; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; }
.steps li.done { color: var(--text-2); }
.steps li.done .ic { color: var(--primary); }
.steps li.now { color: var(--text); font-weight: 500; }
.steps .elapsed { margin-left: auto; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }

.result { margin-top: var(--s3); border: 1px solid #c5e3d0; border-radius: var(--r-lg); background: var(--bg); overflow: hidden; }
.result.partial { border-color: #f1d9b0; }
.result.failed { border-color: #f2c9c9; }
.result-head { display: flex; align-items: center; gap: 8px; padding: 8px 12px; font-size: 13px; font-weight: 600; background: var(--success-soft); color: var(--primary-text); }
.result.partial .result-head { background: var(--warning-soft); color: #7a4205; }
.result.failed .result-head { background: var(--danger-soft); color: #8f1d1d; }
.result-head .when { margin-left: auto; font-weight: 400; font-size: 12px; opacity: .8; }
.result-body { padding: 12px; }
.code-out { display: flex; align-items: center; gap: var(--s2); }
.code-out .code-box {
    flex: 1; min-width: 0; height: var(--h-lg); display: flex; align-items: center; padding: 0 12px; border: 1px dashed var(--border-strong);
    border-radius: var(--r); background: var(--bg-subtle); font-family: var(--mono); font-size: 20px; font-weight: 600; letter-spacing: .06em;
    overflow-x: auto; white-space: nowrap; user-select: all;
}
.code-out .btn { height: var(--h-lg); min-width: 96px; }
.code-out .btn.copied { --bs-btn-bg: var(--primary-hover); }
.route { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); margin-bottom: 8px; flex-wrap: wrap; }
.route i { color: var(--text-3); }
.route strong { color: var(--text); font-weight: 500; }
.result-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 10px; border: 1px solid var(--border); border-radius: var(--r); }
.result-stats > div { padding: 6px 10px; min-width: 0; }
.result-stats > div + div { border-left: 1px solid var(--border); }
.result-stats dt { font-size: 11.5px; color: var(--text-3); font-weight: 400; }
.result-stats dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.skipped { margin-top: 10px; font-size: 13px; }
.skipped summary { cursor: pointer; color: #7a4205; font-weight: 500; list-style: none; display: flex; gap: 6px; align-items: center; }
.skipped summary::-webkit-details-marker { display: none; }
.skipped summary::after { content: "Show"; margin-left: auto; font-size: 12px; color: var(--text-3); font-weight: 400; }
.skipped[open] summary::after { content: "Hide"; }
.skipped ul { margin: 8px 0 0; padding: 0; list-style: none; border: 1px solid var(--border); border-radius: var(--r); max-height: 220px; overflow-y: auto; }
.skipped li { padding: 6px 10px; display: grid; gap: 1px; }
.skipped li + li { border-top: 1px solid var(--border); }
.skipped li span { color: var(--text-3); font-size: 12px; }
.result-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
@media (max-width: 479.98px) {
    .result-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .result-stats > div:nth-child(3) { border-left: 0; }
    .result-stats > div:nth-child(n+3) { border-top: 1px solid var(--border); }
    .code-out .code-box { font-size: 18px; }
    .result-actions .btn { flex: 1; }
}

/* Marketing sections (kept short) */
.steps-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s4); counter-reset: step; }
.step { padding: var(--s4); background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-lg); }
.step h3 { font-size: 14px; display: flex; gap: 8px; align-items: center; }
.step h3::before { counter-increment: step; content: counter(step); width: 20px; height: 20px; border-radius: 50%; background: var(--primary-soft); color: var(--primary-text); font-size: 12px; display: inline-flex; align-items: center; justify-content: center; }
.step p { margin: 0; font-size: 13px; }
.bk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 6px; }
.bk-grid li { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--border); border-radius: var(--r); background: var(--bg); font-size: 13px; min-width: 0; }
.bk-grid li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bk-grid li em { margin-left: auto; font-style: normal; font-size: 10.5px; color: var(--text-3); white-space: nowrap; flex-shrink: 0; }
.split { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: var(--s8); }
.split > :first-child p { font-size: 13px; }
@media (max-width: 767.98px) {
    .steps-row { grid-template-columns: 1fr; gap: var(--s2); }
    .split { grid-template-columns: 1fr; gap: var(--s3); }
    .section { padding: var(--s6) 0; }
}

/* Pricing */
.plan { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s4); align-items: center; padding: var(--s4); }
.plan-name { font-size: 15px; font-weight: 600; margin-bottom: 2px; }
.plan-price { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.plan-price small { font-size: 13px; color: var(--text-3); font-weight: 500; }
.plan-feats { display: flex; flex-wrap: wrap; gap: 6px 16px; list-style: none; margin: 8px 0 0; padding: 0; font-size: 13px; color: var(--text-2); }
.plan-feats li { display: flex; gap: 6px; align-items: center; }
.plan-feats i { color: var(--primary); }
.plan-side { display: grid; gap: 6px; justify-items: end; }
@media (max-width: 575.98px) {
    .plan { grid-template-columns: 1fr; }
    .plan-side { justify-items: stretch; }
}

/* ==========================================================================
   Auth pages
   ========================================================================== */
.auth { padding: var(--s10) 0; }
.auth-card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--s6); }
.auth-card h1 { font-size: 20px; margin-bottom: 4px; }
.auth-card .sub { color: var(--text-3); font-size: 13px; margin-bottom: var(--s5); }
.auth-alt { text-align: center; font-size: 13px; color: var(--text-3); margin-top: var(--s4); }
.divider { display: flex; align-items: center; gap: var(--s3); color: var(--text-3); font-size: 12px; margin: var(--s4) 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.tg-slot { min-height: 40px; display: flex; justify-content: center; }
@media (max-width: 479.98px) {
    .auth { padding: var(--s4) 0; }
    .auth-card { padding: var(--s4); border: 0; background: transparent; }
}

/* ==========================================================================
   App shell (dashboard)
   ========================================================================== */
.app { display: grid; grid-template-columns: 208px minmax(0, 1fr); gap: var(--s6); padding: var(--s5) 0 var(--s8); }
.side-nav { position: sticky; top: calc(var(--header-h) + var(--s5)); align-self: start; }
.side-nav nav { display: grid; gap: 1px; }
.side-nav a {
    display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 10px; border-radius: var(--r);
    color: var(--text-2); font-weight: 500; text-decoration: none;
}
.side-nav a i { font-size: 15px; color: var(--text-3); width: 16px; }
.side-nav a:hover { background: var(--bg-muted); color: var(--text); }
.side-nav a[aria-current="page"] { background: var(--bg); color: var(--text); box-shadow: inset 0 0 0 1px var(--border); }
.side-nav a[aria-current="page"] i { color: var(--primary); }
.side-nav .who { display: flex; gap: 10px; align-items: center; padding: 0 4px var(--s3); margin-bottom: var(--s2); border-bottom: 1px solid var(--border); min-width: 0; }
.side-nav .who .avatar { width: 32px; height: 32px; }
.side-nav .who div { min-width: 0; }
.side-nav .who strong { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-nav .who span { font-size: 12px; color: var(--text-3); }
.side-nav .sep { height: 1px; background: var(--border); margin: var(--s2) 4px; }
.app-main { min-width: 0; }
.app-main > * + * { margin-top: var(--s4); }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s4); }
.grid-main.side-300 { grid-template-columns: minmax(0, 1fr) 300px; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--s4); align-items: start; }
.grid-main > * + *, .grid-2 > * + * { margin-top: 0 !important; }
.stack > * + * { margin-top: var(--s4); }

@media (max-width: 991.98px) {
    .app { grid-template-columns: minmax(0, 1fr); gap: var(--s3); padding-top: 0; }
    .side-nav { position: sticky; top: var(--header-h); z-index: 1020; background: var(--bg-subtle); margin: 0 -16px; padding: 0 16px; border-bottom: 1px solid var(--border); }
    .side-nav .who, .side-nav .sep, .side-nav .hide-mobile { display: none; }
    .side-nav nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
    .side-nav nav::-webkit-scrollbar { display: none; }
    .side-nav a { height: 42px; border-radius: 0; border-bottom: 2px solid transparent; flex-shrink: 0; padding: 0 10px; }
    .side-nav a i { display: none; }
    .side-nav a[aria-current="page"] { box-shadow: none; background: none; border-bottom-color: var(--primary); }
    .grid-main, .grid-main.side-300, .grid-2 { grid-template-columns: minmax(0, 1fr); }
}

.filters { display: flex; gap: var(--s2); flex-wrap: wrap; align-items: center; }
.filters .form-control, .filters .form-select { width: auto; min-width: 0; }
.filters .search { flex: 1 1 220px; position: relative; }
.filters .search .form-control { width: 100%; padding-left: 32px; }
.filters .search i { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-3); }
@media (max-width: 575.98px) {
    .filters > * { flex: 1 1 calc(50% - 4px); }
    .filters .search { flex-basis: 100%; }
    .filters .form-select { width: 100%; }
}

.list-row { display: flex; align-items: center; gap: var(--s3); padding: 10px var(--s4); border-bottom: 1px solid var(--border); min-width: 0; }
.list-row:last-child { border-bottom: 0; }
.list-row .main { min-width: 0; flex: 1; }
.list-row .main .t { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row .main .s { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row .end { text-align: right; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.amount-pos { color: var(--success); font-weight: 600; }
.amount-neg { color: var(--text); font-weight: 600; }
.code-chip { font-family: var(--mono); font-size: 12.5px; background: var(--bg-muted); padding: 1px 6px; border-radius: var(--r-sm); white-space: nowrap; }
.copy-inline { border: 0; background: none; color: var(--text-3); padding: 2px 4px; border-radius: var(--r-sm); cursor: pointer; }
.copy-inline:hover { color: var(--text); background: var(--bg-muted); }

/* Settings rows */
.setting { display: flex; gap: var(--s4); align-items: center; justify-content: space-between; padding: 12px var(--s4); border-bottom: 1px solid var(--border); }
.setting:last-child { border-bottom: 0; }
.setting .txt { min-width: 0; }
.setting .txt strong { display: block; font-weight: 500; }
.setting .txt span { font-size: 12px; color: var(--text-3); }
@media (max-width: 575.98px) {
    .setting { flex-wrap: wrap; }
    .setting > .btn, .setting > .actions { width: 100%; }
    .setting > .actions .btn { flex: 1; }
}

/* ==========================================================================
   Long-form / legal / docs
   ========================================================================== */
.prose { font-size: 14px; color: var(--text-2); line-height: 1.65; }
.prose h2 { font-size: 16px; margin: var(--s6) 0 var(--s2); color: var(--text); }
.prose h3 { font-size: 14px; margin: var(--s4) 0 var(--s2); color: var(--text); }
.prose ul, .prose ol { padding-left: 20px; margin-bottom: var(--s3); }
.prose li { margin-bottom: 4px; }
.prose table { width: 100%; font-size: 13px; border-collapse: collapse; margin-bottom: var(--s3); }
.prose th, .prose td { border: 1px solid var(--border); padding: 6px 10px; text-align: left; }
.prose th { background: var(--bg-subtle); font-weight: 500; }
.toc { position: sticky; top: calc(var(--header-h) + 16px); font-size: 13px; }
.toc a { display: block; padding: 4px 0; color: var(--text-2); }
.toc a:hover { color: var(--text); }
.doc-grid { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: var(--s8); }
@media (max-width: 991.98px) { .doc-grid { grid-template-columns: 1fr; } .toc { display: none; } }

/* ==========================================================================
   Utility bits used across pages
   ========================================================================== */
.row-gap { row-gap: var(--s3); }
.text-mono { font-family: var(--mono); }
.divide-y > * + * { border-top: 1px solid var(--border); }
.inline-list { display: flex; flex-wrap: wrap; gap: 4px 12px; list-style: none; padding: 0; margin: 0; font-size: 13px; color: var(--text-2); }
.kbd { font-family: var(--mono); font-size: 11px; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: var(--r-sm); padding: 0 4px; color: var(--text-3); }
[hidden] { display: none !important; }
@media (max-width: 575.98px) { .hide-sm { display: none !important; } }

/* ==========================================================================
   News (home/news.php, home/news-article.php)
   ========================================================================== */
.news-wrap, .article-wrap { max-width: 1160px; margin: 0 auto; padding: var(--s6) 16px var(--s8); }
.article-wrap { max-width: 760px; }
.news-head { display: flex; justify-content: space-between; align-items: flex-end; gap: var(--s3); flex-wrap: wrap; margin-bottom: var(--s4); }
.news-head h1 { margin: 0 0 2px; }
.news-head p { margin: 0; color: var(--text-3); font-size: 13px; }
.news-kicker { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--primary); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; }
.news-viewmore { display: inline-flex; align-items: center; gap: 6px; height: var(--h-sm); padding: 0 10px; border: 1px solid var(--border-strong); border-radius: var(--r); background: var(--bg); color: var(--text); font-size: 13px; font-weight: 500; }
.news-viewmore:hover { background: var(--bg-muted); text-decoration: none; color: var(--text); }
.news-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); overflow-x: auto; scrollbar-width: none; margin-bottom: var(--s4); }
.news-tabs::-webkit-scrollbar { display: none; }
.news-tab { height: 38px; display: inline-flex; align-items: center; padding: 0 12px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--text-3); font-weight: 500; white-space: nowrap; }
.news-tab:hover { color: var(--text); text-decoration: none; }
.news-tab.active { color: var(--text); border-bottom-color: var(--primary); }
.news-empty { text-align: center; padding: var(--s10) var(--s4); background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-lg); color: var(--text-3); }
.news-empty i { font-size: 22px; color: var(--border-strong); }
.news-empty h4 { margin: 6px 0 4px; }
.news-lead { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; color: var(--text); margin-bottom: var(--s4); }
.news-lead:hover, .news-card:hover { text-decoration: none; color: var(--text); border-color: var(--border-strong); }
.news-lead-media, .news-card-media { position: relative; background: var(--bg-muted); aspect-ratio: 16 / 9; overflow: hidden; }
.news-lead-media { aspect-ratio: 2 / 1; }
.news-lead-media img, .news-card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.news-lead-body { padding: var(--s5); display: flex; flex-direction: column; justify-content: center; }
.news-lead-body h2 { font-size: 20px; margin-bottom: var(--s2); }
.news-lead-body p { font-size: 14px; }
.news-badge { position: absolute; left: 8px; top: 8px; background: rgba(22, 25, 29, .78); color: #fff; font-size: 11px; font-weight: 500; padding: 2px 7px; border-radius: var(--r-sm); }
.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--s4); }
.news-card { display: flex; flex-direction: column; background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; color: var(--text); }
.news-card-body { padding: var(--s3) var(--s4) var(--s4); display: flex; flex-direction: column; flex: 1; }
.news-card-body h3 { font-size: 14px; line-height: 1.35; margin-bottom: 6px; }
.news-card-body p { font-size: 13px; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.news-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--text-3); margin-top: auto; }
.news-meta span { display: inline-flex; align-items: center; gap: 4px; }
.news-pager { display: flex; justify-content: center; gap: 4px; margin-top: var(--s6); }
.news-pager a, .news-pager span { min-width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--border); border-radius: var(--r); background: var(--bg); color: var(--text-2); font-size: 13px; }
.news-pager .current { background: var(--text); color: #fff; border-color: var(--text); }
.news-pager .disabled { opacity: .4; pointer-events: none; }
.article-back { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-3); margin-bottom: var(--s3); }
.article-title { font-size: 26px; letter-spacing: -.02em; margin-bottom: var(--s2); }
.article-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; color: var(--text-3); margin-bottom: var(--s4); }
.article-meta span { display: inline-flex; gap: 4px; align-items: center; }
.article-hero { border-radius: var(--r-lg); overflow: hidden; background: var(--bg-muted); margin-bottom: var(--s4); aspect-ratio: 16 / 9; }
.article-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.article-snippet, .news-snippet { font-size: 15px; line-height: 1.7; color: var(--text-2); }
.article-readmore { display: flex; gap: var(--s3); align-items: center; justify-content: space-between; flex-wrap: wrap; padding: var(--s4); margin: var(--s5) 0; background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-lg); }
.article-readmore-copy { font-size: 13px; color: var(--text-2); }
.article-readmore-btn { display: inline-flex; align-items: center; gap: 6px; height: var(--h); padding: 0 14px; background: var(--primary); color: #fff; border-radius: var(--r); font-weight: 500; }
.article-readmore-btn:hover { background: var(--primary-hover); color: #fff; text-decoration: none; }
.article-source { font-size: 12px; color: var(--text-3); }
@media (max-width: 767.98px) {
    .news-lead { grid-template-columns: 1fr; }
    .news-lead-body { padding: var(--s4); }
    .news-lead-body h2 { font-size: 17px; }
    .news-grid { grid-template-columns: 1fr; gap: var(--s3); }
    .news-card { flex-direction: row; }
    .news-card-media { width: 112px; flex-shrink: 0; aspect-ratio: auto; }
    .news-card-body p { display: none; }
    .article-title { font-size: 21px; }
}

/* ==========================================================================
   Legal pages (terms.php, privacy-policy.php) — existing markup as a document
   ========================================================================== */
.legal { max-width: 820px; margin: 0 auto; padding: var(--s6) 16px var(--s8); }
.terms-header h1, .privacy-header h1 { font-size: 24px; margin-bottom: 4px; }
.terms-header p, .privacy-header p { color: var(--text-3); margin-bottom: 4px; }
.last-updated { font-size: 12px; color: var(--text-3); margin-bottom: var(--s4); }
.privacy-summary-bar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: var(--s4); }
.summary-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 3px 8px; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--bg); color: var(--text-2); }
.summary-chip i { color: var(--primary); }
.terms-navigation, .privacy-nav { background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--s3) var(--s4); margin-bottom: var(--s5); }
.terms-nav-title, .privacy-nav-title { font-size: 12px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; }
.terms-nav-links, .privacy-nav-links { display: flex; flex-wrap: wrap; gap: 2px 14px; }
.terms-nav-links .nav-link, .privacy-nav-links .nav-link { padding: 2px 0; font-size: 13px; color: var(--primary); display: inline-flex; gap: 6px; align-items: center; }
.terms-nav-links .nav-link i, .privacy-nav-links .nav-link i { display: none; }
.terms-section, .privacy-section { background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--s5); margin-bottom: var(--s4); scroll-margin-top: calc(var(--header-h) + 12px); }
.legal .section-header { display: block; margin-bottom: var(--s3); padding-bottom: var(--s3); border-bottom: 1px solid var(--border); }
.legal .section-icon { display: none; }
.legal .section-title { font-size: 17px; margin: 0; }
.legal .section-subtitle { font-size: 12px; color: var(--text-3); margin: 2px 0 0; }
.terms-content, .privacy-content { font-size: 14px; line-height: 1.65; color: var(--text-2); }
.terms-content h3, .privacy-content h3 { font-size: 14px; margin: var(--s4) 0 6px; }
.terms-content h4, .privacy-content h4 { font-size: 13px; margin: var(--s3) 0 4px; }
.terms-content ul, .privacy-content ul, .terms-content ol, .privacy-content ol { padding-left: 20px; margin-bottom: var(--s3); }
.terms-content li, .privacy-content li { margin-bottom: 3px; }
.important-note, .highlight-box, .warning-box, .contact-box { border: 1px solid var(--border); background: var(--bg-subtle); border-radius: var(--r); padding: 10px 12px; margin: var(--s3) 0; font-size: 13px; }
.warning-box, .important-note { background: var(--warning-soft); border-color: #f1d9b0; }
.note-header, .warn-head { display: flex; gap: 6px; align-items: center; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.note-header h4, .warn-head h4 { margin: 0; font-size: 13px; }
.important-note p, .warning-box p, .highlight-box p { margin: 0; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; margin: var(--s3) 0; display: block; overflow-x: auto; }
.data-table th, .data-table td { border: 1px solid var(--border); padding: 6px 10px; text-align: left; vertical-align: top; }
.data-table th { background: var(--bg-subtle); font-weight: 500; color: var(--text); }
.rights-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; margin: var(--s3) 0; }
.right-card { border: 1px solid var(--border); border-radius: var(--r); padding: 10px 12px; font-size: 13px; }
.right-card i { color: var(--primary); }
.right-card h4 { margin: 4px 0 2px; }
.right-card p { margin: 0; font-size: 12.5px; }
@media (max-width: 575.98px) { .terms-section, .privacy-section { padding: var(--s4); } }

/* ==========================================================================
   Checkout (home/subscribe.php) — styles the preserved payment form markup
   ========================================================================== */
.checkout #paymentForm > .row { --bs-gutter-x: 8px; margin-bottom: 0; }
.checkout .payment-option { padding: 0; margin: 0; position: relative; cursor: pointer; }
.checkout .payment-option .form-check-input { position: absolute; top: 14px; right: 14px; margin: 0; }
.checkout .payment-option .card { padding: 12px 14px !important; border: 1px solid var(--border-strong); border-radius: var(--r-lg); transition: border-color .12s, box-shadow .12s; }
.checkout .payment-option:hover .card { border-color: #b7bec6; }
.checkout .payment-option.active .card { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.checkout .payment-option .card > .d-flex { margin-bottom: 6px !important; }
.checkout .payment-option .bg-light { background: none !important; padding: 0 !important; margin-right: 10px !important; }
.checkout .payment-option img { height: 24px !important; width: auto; }
.checkout .payment-option .fa-2x { font-size: 20px; color: var(--primary) !important; }
.checkout .payment-option h5 { font-size: 14px !important; margin: 0 !important; }
.checkout .payment-option ul { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: 12px; color: var(--text-3); }
.checkout .payment-option ul li { margin: 0 !important; }
.checkout .payment-option ul i { display: none; }
.checkout #mpesaFields .card, .checkout #eversendFields .card { border: 0; padding: 0; }
.checkout #mpesaFields .card-body, .checkout #eversendFields .card-body { padding: 0; }
.checkout #mpesaFields .alert { display: none; }
.checkout #mpesaFields .col-md-8 { width: 100%; max-width: 360px; }
.checkout .payment-action-buttons { gap: 12px; }
.checkout .payment-action-buttons .btn-lg { width: 100%; }
.checkout .payment-action-buttons > div:first-child { display: none; }
.checkout .payment-action-buttons > div:last-child { width: 100%; text-align: left !important; }
.checkout .mt-4.mt-md-5.pt-3.pt-md-4.border-top { margin-top: 16px !important; padding-top: 16px !important; border-color: var(--border) !important; }
.payment-modal .modal-body { text-align: center; }
.payment-status-icon { width: 48px; height: 48px; border-radius: 50%; margin: 0 auto 12px; display: flex; align-items: center; justify-content: center; font-size: 20px; background: var(--bg-muted); color: var(--text-2); }
.countdown-display { font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; }
.mpesa-phone-input { font-family: var(--mono); background: var(--bg-subtle); border-radius: var(--r); padding: 6px 10px; display: inline-block; margin-bottom: 10px; }
.payment-instructions { text-align: left; background: var(--bg-subtle); border-radius: var(--r); padding: 10px 12px; margin-top: 12px; }
.payment-instructions ol { margin: 4px 0 0; padding-left: 18px; }

/* Admin portal: its tab panes are also named .panel — keep them unboxed. */
.admin-shell .panel { border: 0; background: none; border-radius: 0; }
.admin-shell .panel + .panel { margin-top: 0; }

/* ---------- App promo popup ----------
   Built and inserted by assets/js/app-popup.js after the page has loaded;
   nothing here applies until that happens. */
.appcta {
    position: fixed; inset: 0; z-index: 1080;
    display: flex; align-items: center; justify-content: center;
    padding: 16px; background: rgba(12, 16, 20, .62);
    opacity: 0; transition: opacity .2s ease;
    overscroll-behavior: contain;
}
.appcta.is-open { opacity: 1; }
.appcta-box {
    width: min(380px, 92vw); max-height: calc(100dvh - 32px);
    display: flex; flex-direction: column; overflow: auto;
    position: relative; background: var(--bg); border-radius: var(--r-lg);
    box-shadow: 0 18px 50px rgba(12, 16, 20, .32);
    transform: translateY(10px) scale(.98); transition: transform .22s cubic-bezier(.2, .9, .3, 1);
}
.appcta.is-open .appcta-box { transform: none; }
.appcta-x {
    position: absolute; z-index: 2; top: 8px; right: 8px;
    width: 30px; height: 30px; border-radius: 50%; border: 0; cursor: pointer;
    background: rgba(12, 16, 20, .55); color: #fff; font-size: 20px; line-height: 1;
    display: flex; align-items: center; justify-content: center;
}
.appcta-x:hover { background: rgba(12, 16, 20, .78); }
.appcta-x:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.appcta-art { display: block; background: #0b1410; border-radius: var(--r-lg) var(--r-lg) 0 0; overflow: hidden; }
.appcta-art img { display: block; width: 100%; height: auto; }
.appcta-actions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); padding: var(--s3) var(--s3) var(--s2); }
.appcta-actions .btn { height: var(--h-lg); display: inline-flex; align-items: center; justify-content: center; gap: 6px; font-size: 13px; }
/* The app icon is dark, and so is the button under it — a white tile keeps the
   edge of the icon visible instead of letting it sink into the green. */
.appcta-icon { width: 22px; height: 22px; border-radius: 6px; flex: 0 0 auto;
    background: #fff; padding: 1px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .55); }
.appcta-later {
    border: 0; background: none; cursor: pointer; padding: 0 0 var(--s3);
    font: inherit; font-size: 12.5px; color: var(--text-3); text-decoration: underline;
}
.appcta-later:hover { color: var(--text-2); }
body.appcta-open { overflow: hidden; }

@media (max-width: 359.98px) {
    .appcta-actions { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
    .appcta, .appcta-box { transition: none; }
}

/* Breadcrumbs on the landing pages. */
.crumbs { font-size: 12px; color: var(--text-3); margin-bottom: var(--s2); }
.crumbs a { color: var(--text-3); }
.crumbs a:hover { color: var(--text-2); }
.bk-grid em { margin-left: auto; font-style: normal; font-size: 11px; color: var(--text-3); font-variant-numeric: tabular-nums; }

/* ---------- Guides ---------- */
.guide { max-width: 720px; }
.guide-head { margin-bottom: var(--s6); }
.guide-head h1 { font-size: 30px; letter-spacing: -.02em; margin-bottom: var(--s3); }
.guide-head .lede { font-size: 16px; color: var(--text-2); margin-bottom: var(--s3); }
.guide-meta { font-size: 12.5px; color: var(--text-3); margin: 0; }
.guide-section { margin-bottom: var(--s6); }
.guide-section h2 { font-size: 19px; letter-spacing: -.01em; margin-bottom: var(--s3); }
.guide-section p { font-size: 15.5px; line-height: 1.65; color: var(--text-2); margin-bottom: var(--s3); }
.guide-section p:last-child { margin-bottom: 0; }
.guide-section strong { color: var(--text); }
.guide-cta { margin: var(--s8) 0; }
.guide-cta .btn + .btn { margin-left: var(--s2); }
.guide-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s3); }
.guide-list li {
    display: grid; gap: 2px; padding: var(--s3) var(--s4);
    border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--bg);
}
.guide-list a { font-weight: 600; font-size: 15px; }
.guide-list span { font-size: 13.5px; color: var(--text-3); line-height: 1.5; }
.guide-list em { font-style: normal; font-size: 12px; color: var(--text-3); margin-top: 4px; }
.guide-index { max-width: 720px; }
@media (max-width: 575.98px) {
    .guide-head h1 { font-size: 24px; }
    .guide-section h2 { font-size: 17px; }
    .guide-section p { font-size: 15px; }
    .guide-cta .btn { width: 100%; }
    .guide-cta .btn + .btn { margin: var(--s2) 0 0; }
}

/* "Out of units" tag — see home/partials/units-tag.php. */
.units-tag {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    margin: var(--s3) 0 0; padding: 9px 12px;
    background: var(--primary-soft); border: 1px solid #cfe6d8; border-radius: var(--r);
    font-size: 12.5px; color: var(--primary-text);
}
.units-tag i { font-size: 14px; flex: 0 0 auto; }
/* The app's own icon rather than a generic store glyph — it is the thing the
   sentence is pointing at, and people recognise it on their home screen. */
.units-tag-icon { flex: 0 0 auto; width: 24px; height: 24px; border-radius: 6px; }
.units-tag span { flex: 1; min-width: 0; }
.units-tag a { font-weight: 600; white-space: nowrap; color: var(--primary-text); text-decoration: underline; }
.units-tag a:hover { color: var(--primary-hover); }
.converter .units-tag { margin: 0 var(--s4) var(--s4); }

/* ---------- In-content app banner (services/AppBanner.php) ---------- */
.app-banner { margin: var(--s6) auto; max-width: 1100px; }
.app-banner a { display: block; border-radius: var(--r-lg); overflow: hidden; line-height: 0; }
.app-banner a:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus); }
.app-banner img { display: block; width: 100%; height: auto; }
.site-footer + .app-banner, .container > .app-banner:last-child { margin-bottom: var(--s6); }

/* ---------- Slip optimizer ---------- */
.opt-slip { border: 1px solid var(--border); border-radius: var(--r-lg); margin-top: var(--s3); overflow: hidden; }
.opt-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap;
    padding: 10px 12px; border-bottom: 1px solid var(--border); background: var(--bg-subtle); font-size: 13px; }
.opt-legs { max-height: 360px; overflow-y: auto; }
.leg { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-bottom: 1px solid var(--border);
    cursor: pointer; margin: 0; }
.leg:last-child { border-bottom: 0; }
.leg:hover { background: var(--bg-subtle); }
.leg input { flex: 0 0 auto; width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }
.leg-main { flex: 1; min-width: 0; display: grid; gap: 1px; }
.leg-ev { font-size: 13px; font-weight: 500; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leg-sub { font-size: 11.5px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leg-odds { flex: 0 0 auto; font-family: var(--mono); font-size: 13px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.leg input:not(:checked) ~ .leg-main .leg-ev,
.leg input:not(:checked) ~ .leg-odds { color: var(--text-3); text-decoration: line-through; }
.leg.is-expired .leg-sub strong { color: var(--danger); }
.opt-tools { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap;
    padding: 10px 12px; border-top: 1px solid var(--border); background: var(--bg-subtle); font-size: 13px; }
.opt-tools label { margin: 0; font-size: 12.5px; color: var(--text-2); }
.opt-tools input { width: 96px; }
.opt-total { margin-left: auto; font-size: 13px; color: var(--text-2); }
.opt-total strong { color: var(--text); font-variant-numeric: tabular-nums; }
.opt-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap;
    padding: 12px; border-top: 1px solid var(--border); }
.opt-done { border: 1px solid #bfe0cb; border-radius: var(--r-lg); margin-top: var(--s3); overflow: hidden; }
.opt-done-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap;
    padding: 10px 12px; background: var(--success-soft); border-bottom: 1px solid #cfe6d8; }
.opt-code { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: 12px; }
.opt-code .lbl { display: block; font-size: 9.5px; font-weight: 600; letter-spacing: .07em;
    text-transform: uppercase; color: var(--text-3); margin-bottom: 2px; }
.opt-code .code { font-family: var(--mono); font-size: 20px; letter-spacing: .08em; color: var(--text); }
.opt-removed { padding: 0 12px 12px; }
.opt-removed .lbl { display: block; font-size: 9.5px; font-weight: 600; letter-spacing: .07em;
    text-transform: uppercase; color: var(--text-3); margin-bottom: 4px; }
.opt-removed ul { margin: 0; padding-left: 18px; font-size: 12.5px; color: var(--text-2); }
.opt-done > .meta { display: block; padding: 0 12px 12px; font-size: 12px; color: var(--text-3); }
@media (max-width: 575.98px) {
    .opt-tools { gap: 6px; }
    .opt-total { margin-left: 0; width: 100%; }
    .opt-foot .btn { width: 100%; }
}

/* Market risk, per selection (SlipOptimizer::marketSafety). */
.tier { font-size: 9.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
    padding: 1px 6px; border-radius: 999px; vertical-align: 1px; }
.tier-safe { background: var(--success-soft); color: var(--primary-text); }
.tier-medium { background: var(--warning-soft); color: var(--warning); }
.tier-risky { background: var(--danger-soft); color: var(--danger); }
.leg-why { font-size: 11px; color: var(--text-3); line-height: 1.4; }
.leg[data-tier="risky"] { background: linear-gradient(90deg, var(--danger-soft) 0 3px, transparent 3px); }
.leg input:not(:checked) ~ .leg-main .leg-why { opacity: .55; }
.leg-swap { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px;
    padding: 6px 8px; border-radius: var(--r-sm); background: var(--success-soft); font-size: 11.5px; color: var(--primary-text); }
.leg-swap strong { font-weight: 600; }
.leg-swap .btn { margin-left: auto; }
.leg.is-swapped { background: linear-gradient(90deg, var(--success-soft) 0 3px, transparent 3px); }
.leg.is-swapped .leg-ev { color: var(--primary-text); }
