/* SMS Backup admin — design tokens + Bootstrap 5.3 overrides.
   Light/dark follow <html data-bs-theme>, set before paint by the inline script in index.html. */

:root,
[data-bs-theme="light"] {
    --app-bg: #f4f5f8;
    --surface: #ffffff;
    --surface-2: #f7f8fa;
    --surface-3: #eef0f4;
    --border: #e4e7ec;
    --border-strong: #d3d8e0;
    --text: #111827;
    --text-2: #414a5a;
    --text-3: #6b7280;

    --accent: #4f46e5;
    --accent-hover: #4338ca;
    --accent-rgb: 79, 70, 229;
    --accent-soft: #eef0ff;
    --accent-ink: #3730a3;
    --on-accent: #ffffff;

    --good: #15803d;
    --good-soft: #e8f7ee;
    --warn: #b45309;
    --warn-soft: #fdf3e2;
    --bad: #dc2626;
    --bad-soft: #fdecec;

    --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
    --shadow-md: 0 4px 16px -4px rgba(16, 24, 40, .10), 0 2px 4px -2px rgba(16, 24, 40, .06);
    --shadow-lg: 0 24px 48px -12px rgba(16, 24, 40, .22);
    --topbar-bg: rgba(244, 245, 248, .82);

    --bs-body-bg: var(--app-bg);
    --bs-body-color: var(--text);
    --bs-emphasis-color: var(--text);
    --bs-secondary-color: var(--text-3);
    --bs-tertiary-bg: var(--surface-2);
    --bs-secondary-bg: var(--surface-3);
    --bs-border-color: var(--border);
    --bs-border-color-translucent: var(--border);
    --bs-heading-color: var(--text);
    --bs-primary: var(--accent);
    --bs-primary-rgb: var(--accent-rgb);
    --bs-primary-bg-subtle: var(--accent-soft);
    --bs-primary-text-emphasis: var(--accent-ink);
    --bs-primary-border-subtle: #c7cbfb;
    --bs-link-color: var(--accent);
    --bs-link-color-rgb: var(--accent-rgb);
    --bs-link-hover-color: var(--accent-hover);
    --bs-link-hover-color-rgb: 67, 56, 202;
    --bs-code-color: #b4235a;
    --bs-focus-ring-color: rgba(var(--accent-rgb), .25);
}

[data-bs-theme="dark"] {
    --app-bg: #0c0e13;
    --surface: #14171e;
    --surface-2: #1a1e27;
    --surface-3: #222734;
    --border: #262b37;
    --border-strong: #343b4b;
    --text: #e8eaef;
    --text-2: #b7bdc9;
    --text-3: #8b92a1;

    --accent: #8b93ff;
    --accent-hover: #a5abff;
    --accent-rgb: 139, 147, 255;
    --accent-soft: rgba(139, 147, 255, .14);
    --accent-ink: #c9ccff;
    --on-accent: #ffffff;

    --good: #4ade80;
    --good-soft: rgba(74, 222, 128, .12);
    --warn: #fbbf24;
    --warn-soft: rgba(251, 191, 36, .12);
    --bad: #f87171;
    --bad-soft: rgba(248, 113, 113, .12);

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-md: 0 6px 20px -6px rgba(0, 0, 0, .6);
    --shadow-lg: 0 24px 48px -12px rgba(0, 0, 0, .7);
    --topbar-bg: rgba(12, 14, 19, .8);

    --bs-primary-border-subtle: rgba(139, 147, 255, .35);
    --bs-code-color: #f38bb5;
    color-scheme: dark;
}

/* ---------- Base ---------- */

body {
    --bs-body-font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --bs-body-font-size: .9375rem;
    font-family: var(--bs-body-font-family);
    background: var(--app-bg);
    color: var(--text);
    -webkit-font-smoothing: antialiased;
    font-feature-settings: "cv11", "ss01";
}

h1, h2, h3, h4, h5, h6 { letter-spacing: -.015em; }

.main-content h2 {
    font-size: 1.5rem;
    font-weight: 650;
    letter-spacing: -.025em;
}

code { font-size: .85em; }

::selection { background: rgba(var(--accent-rgb), .22); }

#app { display: none; }
#login-page { display: none; }

.text-muted { color: var(--text-3) !important; }
.bg-light { background-color: var(--surface-2) !important; }
.bg-light.text-dark, .bg-light .text-dark { color: var(--text) !important; }
.bg-white { background-color: var(--surface) !important; }
.border { border-color: var(--border) !important; }
hr { border-color: var(--border); opacity: 1; }

/* ---------- App shell ---------- */

.app-shell {
    --sidebar-width: 256px;
    min-height: 100vh;
}

.sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border-right: 1px solid var(--border);
    z-index: 1040;
    transition: transform .22s ease;
}

.brand {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 1.25rem 1.25rem 1rem;
}

.brand-mark {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 1.05rem;
    background: linear-gradient(140deg, #6366f1 0%, #4f46e5 55%, #7c3aed 100%);
    box-shadow: 0 4px 12px -2px rgba(79, 70, 229, .45), inset 0 1px 0 rgba(255, 255, 255, .25);
}

.brand-name {
    font-weight: 650;
    font-size: .975rem;
    letter-spacing: -.01em;
    line-height: 1.2;
}

.brand-sub {
    font-size: .75rem;
    color: var(--text-3);
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: .25rem .75rem 1rem;
}

.nav-section {
    font-size: .6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--text-3);
    padding: 1rem .75rem .375rem;
}

.sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: .7rem;
    color: var(--text-2);
    font-size: .875rem;
    font-weight: 500;
    padding: .5rem .75rem;
    border-radius: 8px;
    margin-bottom: 2px;
    transition: background-color .15s, color .15s;
}

.sidebar .nav-link i {
    font-size: 1.05rem;
    color: var(--text-3);
    transition: color .15s;
}

.sidebar .nav-link:hover {
    background: var(--surface-2);
    color: var(--text);
}

.sidebar .nav-link:hover i { color: var(--text-2); }

.sidebar .nav-link.active {
    background: var(--accent-soft);
    color: var(--accent-ink);
}

.sidebar .nav-link.active i { color: var(--accent); }

.nav-count {
    margin-left: auto;
    min-width: 20px;
    padding: 0 6px;
    height: 20px;
    border-radius: 999px;
    font-size: .6875rem;
    font-weight: 600;
    display: inline-grid;
    place-items: center;
    background: var(--warn-soft);
    color: var(--warn);
}

.sidebar-footer {
    border-top: 1px solid var(--border);
    padding: .875rem 1rem;
    display: flex;
    align-items: center;
    gap: .75rem;
}

.avatar {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: .02em;
    color: var(--accent-ink);
    background: var(--accent-soft);
    border: 1px solid var(--bs-primary-border-subtle);
}

.user-meta { min-width: 0; flex: 1; line-height: 1.25; }
.user-name { font-size: .8125rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role { font-size: .75rem; color: var(--text-3); text-transform: capitalize; }

.icon-btn {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    border-radius: 8px;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-3);
    display: inline-grid;
    place-items: center;
    font-size: 1.05rem;
    transition: background-color .15s, color .15s, border-color .15s;
}

.icon-btn:hover {
    background: var(--surface-2);
    border-color: var(--border);
    color: var(--text);
}

.icon-btn.is-danger:hover {
    background: var(--bad-soft);
    border-color: transparent;
    color: var(--bad);
}

.icon-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.main-wrap {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
    height: 60px;
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 0 2rem;
    background: var(--topbar-bg);
    backdrop-filter: saturate(160%) blur(12px);
    -webkit-backdrop-filter: saturate(160%) blur(12px);
    border-bottom: 1px solid var(--border);
}

.crumbs {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-size: .875rem;
    color: var(--text-3);
    min-width: 0;
}

.crumbs .current {
    color: var(--text);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.crumbs i { font-size: .7rem; }

.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: .5rem; }

.main-content {
    flex: 1;
    width: 100%;
    max-width: 1440px;
    padding: 2rem;
}

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1035;
    background: rgba(9, 11, 16, .45);
}

@media (max-width: 991.98px) {
    .sidebar { transform: translateX(-100%); box-shadow: none; }
    .app-shell.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
    .app-shell.nav-open .sidebar-backdrop { display: block; }
    .main-wrap { margin-left: 0; }
    .topbar { padding: 0 1rem; }
    .main-content { padding: 1.25rem 1rem 2rem; }
}

/* ---------- Page header ---------- */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.page-header h2 { margin: 0; }

.page-subtitle {
    margin-top: .25rem;
    color: var(--text-3);
    font-size: .9rem;
}

.page-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .5rem;
}

.page { animation: page-in .2s ease-out; }

@keyframes page-in {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .page { animation: none; }
    .sidebar { transition: none; }
}

/* ---------- Cards ---------- */

.card {
    --bs-card-bg: var(--surface);
    --bs-card-border-color: var(--border);
    --bs-card-border-radius: 14px;
    --bs-card-inner-border-radius: 13px;
    --bs-card-cap-bg: transparent;
    --bs-card-cap-padding-y: .875rem;
    --bs-card-cap-padding-x: 1.25rem;
    --bs-card-spacer-x: 1.25rem;
    --bs-card-spacer-y: 1.25rem;
    color: var(--text);
    box-shadow: var(--shadow-sm);
}

.card-header {
    border-bottom: 1px solid var(--border);
    min-height: 56px;
    display: flex;
    align-items: center;
}

.card-header:not(.d-flex) > :only-child { width: 100%; }

.card-header h5,
.card-header h6 {
    font-size: .9375rem;
    font-weight: 600;
    letter-spacing: -.01em;
}

.card-header h5 i,
.card-header h6 i { color: var(--text-3); }

.card-footer {
    background: transparent;
    border-top: 1px solid var(--border);
}

/* ---------- Stat tiles ---------- */

.stat-tile {
    padding: 1.125rem 1.25rem;
    height: 100%;
}

.stat-tile-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    margin-bottom: .625rem;
}

.stat-label {
    font-size: .8125rem;
    font-weight: 500;
    color: var(--text-3);
}

.stat-icon {
    width: 32px;
    height: 32px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    font-size: 1rem;
    background: var(--accent-soft);
    color: var(--accent);
}

.stat-icon.is-warn { background: var(--warn-soft); color: var(--warn); }

@media (max-width: 575.98px) {
    .stat-tile .stat-icon { display: none; }
    .stat-value { font-size: 1.5rem; }
}

.stat-value {
    font-size: 1.875rem;
    font-weight: 650;
    letter-spacing: -.03em;
    line-height: 1.1;
}

.stat-value.is-small {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: -.01em;
    padding-top: .5rem;
}

.stat-foot {
    margin-top: .5rem;
    font-size: .8125rem;
    color: var(--text-3);
}

.stat-foot a { text-decoration: none; font-weight: 500; }

/* ---------- Dashboard ---------- */

.review-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.review-item {
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    background: var(--surface);
    display: flex;
    flex-direction: column;
}

.review-item img {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    background: var(--surface-3);
    display: block;
}

.review-item-body { padding: .625rem .75rem .75rem; }

.review-item-title {
    font-size: .8125rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.review-item-sub {
    font-size: .75rem;
    color: var(--text-3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: .5rem;
}

.review-item-actions { display: flex; gap: .375rem; }
.review-item-actions .btn { flex: 1; padding: .25rem .5rem; font-size: .8125rem; }

.list-row {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .625rem 0;
}

.list-row + .list-row { border-top: 1px solid var(--border); }

.list-thumb {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
    border-radius: 9px;
    object-fit: cover;
    background: var(--surface-3);
    border: 1px solid var(--border);
}

.list-rank {
    width: 20px;
    font-size: .8125rem;
    font-weight: 600;
    color: var(--text-3);
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.list-main { flex: 1; min-width: 0; }
.list-title { font-size: .875rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-sub { font-size: .75rem; color: var(--text-3); }
.list-value { font-size: .875rem; font-weight: 600; font-variant-numeric: tabular-nums; }

.release-row {
    display: flex;
    align-items: center;
    gap: .875rem;
    padding: .75rem 0;
}

.release-row + .release-row { border-top: 1px solid var(--border); }

.release-icon {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text-2);
    font-size: 1.1rem;
}

.release-version {
    font-size: 1.05rem;
    font-weight: 650;
    letter-spacing: -.01em;
}

.empty-state {
    text-align: center;
    padding: 2.25rem 1rem;
    color: var(--text-3);
}

.empty-state .empty-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto .75rem;
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-size: 1.35rem;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--text-3);
}

.empty-state .empty-icon.is-good { background: var(--good-soft); color: var(--good); border-color: transparent; }
.empty-state .empty-title { color: var(--text); font-weight: 600; margin-bottom: .125rem; }

/* ---------- Buttons ---------- */

.btn {
    --bs-btn-font-weight: 500;
    --bs-btn-font-size: .875rem;
    --bs-btn-padding-x: .875rem;
    --bs-btn-padding-y: .45rem;
    --bs-btn-border-radius: 9px;
    --bs-btn-focus-box-shadow: 0 0 0 .2rem rgba(var(--accent-rgb), .25);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
}

.btn-sm {
    --bs-btn-padding-x: .625rem;
    --bs-btn-padding-y: .3rem;
    --bs-btn-font-size: .8125rem;
    --bs-btn-border-radius: 8px;
}

.btn-link { --bs-btn-font-weight: 500; text-decoration: none; }

.btn-primary {
    --bs-btn-bg: #4f46e5;
    --bs-btn-border-color: #4f46e5;
    --bs-btn-hover-bg: #4338ca;
    --bs-btn-hover-border-color: #4338ca;
    --bs-btn-active-bg: #3730a3;
    --bs-btn-active-border-color: #3730a3;
    --bs-btn-disabled-bg: #4f46e5;
    --bs-btn-disabled-border-color: #4f46e5;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .1), inset 0 1px 0 rgba(255, 255, 255, .12);
}

[data-bs-theme="dark"] .btn-primary {
    --bs-btn-bg: #5b55f0;
    --bs-btn-border-color: #5b55f0;
    --bs-btn-hover-bg: #6d68f5;
    --bs-btn-hover-border-color: #6d68f5;
    --bs-btn-disabled-bg: #5b55f0;
    --bs-btn-disabled-border-color: #5b55f0;
}

.btn-outline-primary {
    --bs-btn-color: var(--accent);
    --bs-btn-border-color: var(--bs-primary-border-subtle);
    --bs-btn-hover-color: var(--accent-ink);
    --bs-btn-hover-bg: var(--accent-soft);
    --bs-btn-hover-border-color: var(--bs-primary-border-subtle);
    --bs-btn-active-color: var(--accent-ink);
    --bs-btn-active-bg: var(--accent-soft);
    --bs-btn-active-border-color: var(--accent);
}

.btn-secondary,
.btn-outline-secondary,
.btn-light {
    --bs-btn-color: var(--text-2);
    --bs-btn-bg: var(--surface);
    --bs-btn-border-color: var(--border-strong);
    --bs-btn-hover-color: var(--text);
    --bs-btn-hover-bg: var(--surface-2);
    --bs-btn-hover-border-color: var(--border-strong);
    --bs-btn-active-color: var(--text);
    --bs-btn-active-bg: var(--surface-3);
    --bs-btn-active-border-color: var(--border-strong);
    --bs-btn-disabled-color: var(--text-3);
    --bs-btn-disabled-bg: var(--surface);
    --bs-btn-disabled-border-color: var(--border);
    box-shadow: var(--shadow-sm);
}

.btn-success {
    --bs-btn-bg: #16a34a;
    --bs-btn-border-color: #16a34a;
    --bs-btn-hover-bg: #15803d;
    --bs-btn-hover-border-color: #15803d;
    --bs-btn-active-bg: #166534;
    --bs-btn-active-border-color: #166534;
}

.btn-danger {
    --bs-btn-bg: #dc2626;
    --bs-btn-border-color: #dc2626;
    --bs-btn-hover-bg: #b91c1c;
    --bs-btn-hover-border-color: #b91c1c;
    --bs-btn-active-bg: #991b1b;
    --bs-btn-active-border-color: #991b1b;
}

.btn-outline-danger {
    --bs-btn-color: var(--bad);
    --bs-btn-border-color: var(--border-strong);
    --bs-btn-bg: var(--surface);
    --bs-btn-hover-color: var(--bad);
    --bs-btn-hover-bg: var(--bad-soft);
    --bs-btn-hover-border-color: var(--bad);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #dc2626;
    --bs-btn-active-border-color: #dc2626;
}

.btn-outline-warning {
    --bs-btn-color: var(--warn);
    --bs-btn-border-color: var(--border-strong);
    --bs-btn-hover-color: var(--warn);
    --bs-btn-hover-bg: var(--warn-soft);
    --bs-btn-hover-border-color: var(--warn);
}

.btn-soft-success {
    --bs-btn-color: var(--good);
    --bs-btn-bg: var(--good-soft);
    --bs-btn-border-color: transparent;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #16a34a;
    --bs-btn-hover-border-color: #16a34a;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #15803d;
}

.btn-soft-danger {
    --bs-btn-color: var(--bad);
    --bs-btn-bg: var(--bad-soft);
    --bs-btn-border-color: transparent;
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: #dc2626;
    --bs-btn-hover-border-color: #dc2626;
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: #b91c1c;
}

.btn-icon { --bs-btn-padding-x: .5rem; }

/* ---------- Badges (soft) ---------- */

.badge {
    --bs-badge-font-weight: 600;
    --bs-badge-font-size: .72rem;
    --bs-badge-padding-x: .55em;
    --bs-badge-padding-y: .38em;
    --bs-badge-border-radius: 6px;
    letter-spacing: .01em;
}

.badge.bg-primary { background-color: var(--accent-soft) !important; color: var(--accent-ink) !important; }
.badge.bg-success { background-color: var(--good-soft) !important; color: var(--good) !important; }
.badge.bg-warning,
.badge.bg-warning.text-dark { background-color: var(--warn-soft) !important; color: var(--warn) !important; }
.badge.bg-danger { background-color: var(--bad-soft) !important; color: var(--bad) !important; }
.badge.bg-info,
.badge.bg-info.text-dark { background-color: rgba(14, 165, 233, .12) !important; color: #0369a1 !important; }
.badge.bg-secondary,
.badge.bg-light,
.badge.bg-light.text-dark,
.badge.bg-light.text-muted { background-color: var(--surface-3) !important; color: var(--text-2) !important; }
.badge.bg-dark { background-color: var(--text) !important; color: var(--surface) !important; }

[data-bs-theme="dark"] .badge.bg-info,
[data-bs-theme="dark"] .badge.bg-info.text-dark { color: #7dd3fc !important; }

.badge-approved { background: var(--good-soft); color: var(--good); }
.badge-pending { background: var(--warn-soft); color: var(--warn); }

.badge-dot::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    margin-right: .4em;
    vertical-align: .1em;
}

/* ---------- Forms ---------- */

.form-label { font-size: .8125rem; font-weight: 500; color: var(--text-2); margin-bottom: .375rem; }
.form-label.fw-semibold { font-weight: 600 !important; color: var(--text); }

.form-control,
.form-select {
    background-color: var(--surface);
    border-color: var(--border-strong);
    border-radius: 9px;
    font-size: .875rem;
    padding: .5rem .75rem;
    color: var(--text);
}

.form-select { padding-right: 2.25rem; }

.form-control-sm,
.form-select-sm {
    border-radius: 8px;
    font-size: .8125rem;
    padding: .3rem .625rem;
}

.form-control::placeholder { color: var(--text-3); opacity: .8; }

.form-control:focus,
.form-select:focus {
    background-color: var(--surface);
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .18);
    color: var(--text);
}

.form-check-input {
    background-color: var(--surface);
    border-color: var(--border-strong);
}

.form-check-input:checked {
    background-color: #4f46e5;
    border-color: #4f46e5;
}

.form-check-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .18);
}

.form-switch .form-check-input { width: 2.25em; height: 1.25em; margin-top: .15em; cursor: pointer; }
.form-switch .form-check-input:focus:not(:checked) {
    --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23a5acf5'/%3e%3c/svg%3e");
}

.form-check-label { cursor: pointer; }

.input-group-text {
    background: var(--surface-2);
    border-color: var(--border-strong);
    color: var(--text-3);
    font-size: .875rem;
}

.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: .875rem 0;
}

.setting-row + .setting-row { border-top: 1px solid var(--border); }
.setting-title { font-weight: 600; font-size: .875rem; }
.setting-desc { font-size: .8125rem; color: var(--text-3); margin-top: .125rem; }
.setting-row .form-switch { padding-left: 0; margin: 0; flex: 0 0 auto; }
.setting-row .form-switch .form-check-input { margin-left: 0; float: none; }

/* ---------- Tables ---------- */

.table {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text);
    --bs-table-border-color: var(--border);
    --bs-table-hover-bg: var(--surface-2);
    --bs-table-hover-color: var(--text);
    --bs-table-striped-bg: var(--surface-2);
    font-size: .875rem;
}

.table > thead > tr > th,
.table-light > tr > th,
.table > thead th {
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-3);
    background: var(--surface-2);
    border-bottom-color: var(--border);
    padding-top: .625rem;
    padding-bottom: .625rem;
    white-space: nowrap;
}

.table > :not(caption) > * > * { padding-left: .875rem; padding-right: .875rem; }
.table > tbody > tr > td { padding-top: .75rem; padding-bottom: .75rem; vertical-align: middle; }
.table-sm { font-size: .8125rem; }
.table-sm > :not(caption) > * > * { padding-left: .625rem; padding-right: .625rem; }
.table-sm > tbody > tr > td { padding-top: .45rem; padding-bottom: .45rem; }
.table > tbody > tr:last-child > td { border-bottom: 0; }
.table td { font-variant-numeric: tabular-nums; }

.table-light {
    --bs-table-bg: var(--surface-2);
    --bs-table-color: var(--text-3);
    --bs-table-border-color: var(--border);
}

.table-secondary {
    --bs-table-bg: var(--surface-2);
    --bs-table-color: var(--text-3);
    --bs-table-border-color: var(--border);
    --bs-table-hover-bg: var(--surface-3);
    --bs-table-hover-color: var(--text-2);
}

.card > .table-responsive:first-child > .table > thead > tr:first-child > th:first-child { border-top-left-radius: 13px; }
.card > .table-responsive:first-child > .table > thead > tr:first-child > th:last-child { border-top-right-radius: 13px; }

.person {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.person .avatar { width: 32px; height: 32px; flex-basis: 32px; }
.person-name { font-weight: 600; }
.person-email { font-size: .8125rem; color: var(--text-3); }

.table-actions { white-space: nowrap; text-align: right; }
.table-actions .btn + .btn { margin-left: .25rem; }

/* ---------- Pagination ---------- */

.pagination {
    --bs-pagination-color: var(--text-2);
    --bs-pagination-bg: var(--surface);
    --bs-pagination-border-color: var(--border);
    --bs-pagination-hover-color: var(--text);
    --bs-pagination-hover-bg: var(--surface-2);
    --bs-pagination-hover-border-color: var(--border);
    --bs-pagination-focus-color: var(--text);
    --bs-pagination-focus-bg: var(--surface-2);
    --bs-pagination-focus-box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .18);
    --bs-pagination-active-color: #fff;
    --bs-pagination-active-bg: #4f46e5;
    --bs-pagination-active-border-color: #4f46e5;
    --bs-pagination-disabled-color: var(--text-3);
    --bs-pagination-disabled-bg: var(--surface);
    --bs-pagination-disabled-border-color: var(--border);
    --bs-pagination-font-size: .875rem;
    gap: .25rem;
}

.pagination .page-link { border-radius: 8px !important; min-width: 36px; text-align: center; margin-left: 0 !important; }

/* ---------- Modals ---------- */

.modal {
    --bs-modal-bg: var(--surface);
    --bs-modal-border-color: var(--border);
    --bs-modal-border-radius: 16px;
    --bs-modal-inner-border-radius: 15px;
    --bs-modal-header-border-color: var(--border);
    --bs-modal-footer-border-color: var(--border);
    --bs-modal-padding: 1.5rem;
    --bs-modal-header-padding: 1.125rem 1.5rem;
    --bs-modal-box-shadow: var(--shadow-lg);
}

.modal-content { box-shadow: var(--shadow-lg); }
.modal-title { font-size: 1.05rem; font-weight: 650; letter-spacing: -.015em; }
.modal-footer { background: var(--surface-2); border-bottom-left-radius: 15px; border-bottom-right-radius: 15px; }
.modal-backdrop { --bs-backdrop-bg: #0b0d12; --bs-backdrop-opacity: .45; }

/* ---------- Alerts / progress / misc ---------- */

.alert { --bs-alert-border-radius: 10px; font-size: .875rem; }
.alert-light { --bs-alert-bg: var(--surface-2); --bs-alert-color: var(--text-2); --bs-alert-border-color: var(--border); }
.progress { --bs-progress-bg: var(--surface-3); --bs-progress-bar-bg: #4f46e5; border-radius: 999px; }
.spinner-border.text-primary { color: var(--accent) !important; }
.text-primary { color: var(--accent) !important; }

details > summary { cursor: pointer; color: var(--text-2); font-weight: 500; }

.info-list { margin: 0; padding-left: 1.1rem; color: var(--text-2); font-size: .8125rem; }
.info-list li + li { margin-top: .4rem; }

.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
}

.skeleton {
    border-radius: 8px;
    background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.3s ease-in-out infinite;
}

@keyframes shimmer {
    from { background-position: 200% 0; }
    to { background-position: -200% 0; }
}

/* ---------- Themes & patterns ---------- */

.toolbar {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 1rem;
    padding: .625rem 1rem;
    margin-bottom: 1.25rem;
    min-height: 52px;
}

.toolbar .form-check { margin: 0; }

.theme-card {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.theme-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.theme-card .theme-media {
    position: relative;
    background: var(--surface-3);
}

.theme-card .theme-preview {
    width: 100%;
    height: 280px;
    object-fit: cover;
    display: block;
    background-color: var(--surface-3);
}

.theme-card .theme-status {
    position: absolute;
    top: .75rem;
    right: .75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .15);
}

.theme-card .theme-status.badge-approved { background: #ecfdf3; color: #067647; }
.theme-card .theme-status.badge-pending { background: #fffaeb; color: #b54708; }

.theme-card .card-body { padding: .875rem 1rem 1rem; }

.theme-card .theme-title {
    font-weight: 600;
    font-size: .9375rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.theme-card .theme-author {
    color: var(--text-3);
    font-size: .8125rem;
    margin-bottom: .5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.theme-card .theme-stats {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: .78rem;
    color: var(--text-3);
}

.theme-card .theme-stats i { margin-right: .25rem; }

.theme-card .theme-actions {
    display: flex;
    gap: .5rem;
    margin-top: .875rem;
}

.theme-card .theme-checkbox {
    position: absolute;
    top: .75rem;
    left: .75rem;
    z-index: 10;
}

.theme-card .theme-checkbox .form-check { margin: 0; padding: 0; min-height: 0; }

.theme-card .theme-checkbox .form-check-input {
    width: 1.35rem;
    height: 1.35rem;
    margin: 0;
    float: none;
    cursor: pointer;
    background-color: rgba(255, 255, 255, .92);
    border: 1.5px solid rgba(17, 24, 39, .25);
    box-shadow: 0 1px 3px rgba(0, 0, 0, .15);
}

.theme-card .theme-checkbox .form-check-input:checked {
    background-color: #4f46e5;
    border-color: #4f46e5;
}

.theme-card.selected {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent), var(--shadow-md);
}

.pattern-card {
    overflow: hidden;
    transition: box-shadow .18s ease, transform .18s ease;
}

.pattern-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.pattern-card img {
    width: 100%;
    aspect-ratio: 3 / 2;
    height: auto;
    object-fit: cover;
    display: block;
    background: var(--surface-3);
}

.pattern-card .card-body { padding: .625rem .75rem; }
.pattern-card .pattern-name { font-size: .8125rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pattern-card .pattern-sub { font-size: .75rem; color: var(--text-3); }

/* ---------- App versions ---------- */

.store-card .store-version {
    font-size: 2rem;
    font-weight: 650;
    letter-spacing: -.03em;
    line-height: 1.15;
}

.store-card .store-logo {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    background: var(--surface-2);
    border: 1px solid var(--border);
    font-size: 1.05rem;
    color: var(--text-2);
}

/* ---------- RCS ---------- */

.chip {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    padding: .3rem .375rem .3rem .625rem;
    margin: 0 .375rem .375rem 0;
    border-radius: 8px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    font-size: .8125rem;
}

.chip code { color: var(--text); }
.chip .btn-close { width: .6em; height: .6em; padding: .25em; }

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .5rem;
}

.clickable-row td[data-row-filter] { cursor: pointer; }

/* ---------- Price experiments (rendered by price-experiments.js) ---------- */

.pe-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
    box-shadow: 0 0 0 2px var(--surface);
}

.pe-step {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-3);
    font-weight: 500;
}

.pe-step-num {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--border-strong);
    font-size: .85rem;
}

.pe-step.active { color: var(--accent); }
.pe-step.active .pe-step-num { border-color: #4f46e5; background: #4f46e5; color: #fff; }
.pe-step.done .pe-step-num { border-color: #16a34a; background: #16a34a; color: #fff; }
.pe-step-line { flex: 0 0 40px; height: 2px; background: var(--border); align-self: center; }

/* ---------- Toasts ---------- */

#toast-container {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    width: min(380px, calc(100vw - 2rem));
}

.app-toast {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    padding: .75rem .75rem .75rem 1rem;
    border-radius: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    font-size: .875rem;
    color: var(--text);
    animation: toast-in .2s ease-out;
}

.app-toast.is-leaving { opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .2s; }
.app-toast .toast-icon { font-size: 1.1rem; line-height: 1.25rem; }
.app-toast .toast-msg { flex: 1; min-width: 0; padding-top: .05rem; word-break: break-word; }
.app-toast .btn-close { font-size: .65rem; margin-top: .3rem; }
.app-toast.t-success .toast-icon { color: var(--good); }
.app-toast.t-danger .toast-icon { color: var(--bad); }
.app-toast.t-warning .toast-icon { color: var(--warn); }
.app-toast.t-info .toast-icon { color: var(--accent); }

@keyframes toast-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

/* ---------- Login ---------- */

.login-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 2rem 1rem;
    background:
        radial-gradient(900px 480px at 15% -10%, rgba(99, 102, 241, .16), transparent 60%),
        radial-gradient(700px 420px at 100% 110%, rgba(124, 58, 237, .12), transparent 60%),
        var(--app-bg);
}

.login-card {
    width: 100%;
    max-width: 400px;
}

.login-card .card { box-shadow: var(--shadow-md); }
.login-card .card-body { padding: 2rem; }

.login-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 1.75rem;
}

.login-brand .brand-mark {
    width: 48px;
    height: 48px;
    flex-basis: 48px;
    border-radius: 14px;
    font-size: 1.35rem;
    margin-bottom: 1rem;
}

.login-brand h1 { font-size: 1.35rem; font-weight: 650; margin-bottom: .25rem; }
.login-foot { text-align: center; font-size: .75rem; color: var(--text-3); margin-top: 1.25rem; }

/* ------------------------------------------------------------------ Statistics */
/* Chart palette: validated categorical slots + sequential blue (dataviz reference
   palette), stepped separately for the dark surface. */
:root,
[data-bs-theme="light"] {
    --st-s1: #2a78d6; --st-s2: #eb6834; --st-s3: #1baf7a; --st-s4: #eda100;
    --st-s5: #e87ba4; --st-s6: #008300; --st-s7: #4a3aa7; --st-s8: #e34948;
    --st-seq-100: #cde2fb; --st-seq-200: #9ec5f4; --st-seq-300: #6da7ec; --st-seq-400: #3987e5;
    --st-seq-500: #256abf; --st-seq-600: #184f95; --st-seq-700: #0d366b;
    --st-grid: #e9eaee; --st-axis: #c3c2b7; --st-muted: #7b8190; --st-surface: #ffffff;
    --st-prev: #9aa0ab; --st-flow: #9fb4d9; --st-flow-hover: #2a78d6;
    --st-good: #15803d; --st-bad: #c02626;
}
[data-bs-theme="dark"] {
    --st-s1: #3987e5; --st-s2: #d95926; --st-s3: #199e70; --st-s4: #c98500;
    --st-s5: #d55181; --st-s6: #008300; --st-s7: #9085e9; --st-s8: #e66767;
    --st-seq-100: #0d366b; --st-seq-200: #104281; --st-seq-300: #184f95; --st-seq-400: #1c5cab;
    --st-seq-500: #256abf; --st-seq-600: #3987e5; --st-seq-700: #6da7ec;
    --st-grid: #242a36; --st-axis: #383d49; --st-muted: #8b92a1; --st-surface: #14171e;
    --st-prev: #6b7280; --st-flow: #34507c; --st-flow-hover: #5598e7;
    --st-good: #4ade80; --st-bad: #f87171;
}

#st-root .card-header:not(.d-flex) { flex-direction: column; align-items: flex-start; justify-content: center; }
.st-fresh { font-size: .8125rem; color: var(--text-3); }
.st-fresh b { color: var(--text-2); font-weight: 600; }
.st-select { width: auto; min-width: 150px; }
.st-range { color: var(--text-2); }
.st-toolbar .card-body input[type="date"] { width: 150px; }

.st-tabs { gap: 4px; border-bottom: 1px solid var(--border); flex-wrap: nowrap; overflow-x: auto; }
.st-tabs .nav-link {
    border: 0; background: none; color: var(--text-3); font-weight: 500; font-size: .875rem;
    padding: .6rem .9rem; border-bottom: 2px solid transparent; border-radius: 0; white-space: nowrap;
}
.st-tabs .nav-link:hover { color: var(--text); }
.st-tabs .nav-link.active { color: var(--accent); border-bottom-color: var(--accent); }

/* Stat tiles */
.st-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.st-tile {
    text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
    padding: 14px 16px; box-shadow: var(--shadow-sm); color: var(--text); transition: border-color .15s, box-shadow .15s;
}
button.st-tile:hover, .st-tile.selected { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .12); }
.st-tile-label { font-size: .75rem; color: var(--text-3); font-weight: 500; display: flex; gap: 6px; align-items: center; }
.st-tile-value { font-size: 1.6rem; font-weight: 650; letter-spacing: -.01em; margin: 4px 0 2px; }
.st-tile-foot { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-height: 20px; }
.st-prev { font-size: .75rem; color: var(--text-3); }

/* Delta chip: icon + text, never color alone */
.st-delta { display: inline-flex; align-items: center; font-size: .75rem; font-weight: 600; white-space: nowrap; color: var(--text-3); font-variant-numeric: tabular-nums; }
.st-delta i { font-size: 1rem; line-height: 1; margin-right: -1px; }
.st-delta.good { color: var(--st-good); }
.st-delta.bad { color: var(--st-bad); }

/* Funnel diagram */
.st-funnel-scroll { overflow-x: auto; overflow-y: hidden; }
.st-funnel {
    position: relative; display: grid; grid-template-columns: repeat(5, minmax(150px, 1fr));
    grid-template-rows: auto 1fr; column-gap: 78px; row-gap: 10px; min-width: 1100px; padding: 18px 20px 24px;
}
.st-funnel.st-funnel-ads { column-gap: 104px; }
.st-col-title { font-size: .6875rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); font-weight: 600; }
.st-col { display: flex; flex-direction: column; justify-content: center; gap: 16px; position: relative; z-index: 1; }
.st-links { position: absolute; inset: 0; pointer-events: none; overflow: visible; z-index: 0; }
.st-link { fill: none; stroke: var(--st-flow); stroke-opacity: .55; pointer-events: stroke; cursor: pointer; transition: stroke .15s, stroke-opacity .15s; }
.st-link:hover { stroke: var(--st-flow-hover); stroke-opacity: .8; }
.st-link-tip { stroke: none; fill: none; }
.st-arrow-head { fill: var(--st-flow); }
.st-edge-layer { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.st-edge {
    position: absolute; transform: translate(-50%, -50%); pointer-events: auto;
    display: flex; flex-direction: column; align-items: center; gap: 0; line-height: 1.15;
    background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px;
    padding: 4px 9px 3px; box-shadow: var(--shadow-sm); color: var(--text); cursor: pointer; min-width: 64px;
}
.st-edge:hover, .st-edge.selected { border-color: var(--accent); }
.st-edge.static, .st-node.static { cursor: default; }
.st-edge.static:hover { border-color: var(--border-strong); }
.st-node.static:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.st-edge-pct { font-weight: 700; font-size: .9375rem; font-variant-numeric: tabular-nums; }
.st-edge-label { font-size: .625rem; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; }
.st-node {
    background: var(--surface); border: 1px solid var(--border-strong); border-radius: 14px; padding: 12px 14px;
    box-shadow: var(--shadow-sm); cursor: pointer; transition: border-color .15s, box-shadow .15s; outline: none;
}
.st-node:hover, .st-node:focus-visible, .st-node.selected { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb), .12); }
.st-node.st-ghost { visibility: hidden; pointer-events: none; }
.st-node-label { display: flex; align-items: center; gap: 6px; font-size: .8125rem; font-weight: 600; color: var(--text-2); }
.st-node-label i:first-child { color: var(--accent); }
.st-node-label .st-warn { color: var(--warn); margin-left: auto; }
.st-node-value { font-size: 1.5rem; font-weight: 650; letter-spacing: -.01em; margin-top: 2px; }
.st-node-sub { font-size: .75rem; color: var(--text-3); }
.st-node-delta { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 2px; min-height: 18px; }
.st-node-line { font-size: .75rem; color: var(--text-2); border-top: 1px dashed var(--border); margin-top: 6px; padding-top: 5px; }
.st-node-line + .st-node-line { border-top: 0; margin-top: 0; padding-top: 1px; }

/* Charts */
.st-chart { position: relative; height: 260px; }
.st-chart-lg { position: relative; height: 320px; }
.st-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; font-size: .75rem; color: var(--text-2); }
.st-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.st-key { width: 14px; height: 0; border-top: 2px solid var(--k); display: inline-block; }
.st-key.dashed { border-top-style: dashed; }

/* Bar lists */
.st-barlist { display: flex; flex-direction: column; gap: 9px; }
.st-barrow { display: grid; grid-template-columns: minmax(90px, 40%) minmax(40px, 1fr) auto; gap: 10px; align-items: center; font-size: .8125rem; }
.st-bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.st-bar-track { height: 8px; background: var(--surface-3); border-radius: 4px; overflow: hidden; }
.st-bar-fill { height: 100%; background: var(--st-s1); border-radius: 0 4px 4px 0; }
.st-bar-value { white-space: nowrap; color: var(--text); font-variant-numeric: tabular-nums; display: flex; gap: 6px; align-items: center; justify-content: flex-end; }

/* New-user journey */
.st-journey { display: flex; flex-direction: column; gap: 14px; }
.st-journey-row { display: grid; grid-template-columns: 1fr; gap: 4px; }
.st-journey-label { font-size: .8125rem; color: var(--text-2); font-weight: 500; }
.st-journey .st-bar-track { height: 12px; border-radius: 6px; }
.st-journey .st-bar-fill { border-radius: 0 6px 6px 0; }
.st-journey-val { font-size: .8125rem; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.st-step { font-size: .6875rem; color: var(--text-3); background: var(--surface-3); border-radius: 6px; padding: 1px 6px; }

/* Tables */
.st-table { font-size: .8125rem; --bs-table-bg: transparent; }
.st-table th { font-size: .6875rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); font-weight: 600; white-space: nowrap; }
.st-table td, .st-table th { padding: .5rem .75rem; vertical-align: top; font-variant-numeric: tabular-nums; }
.st-table tr.st-strong td { font-weight: 650; }
.st-cell-delta { min-height: 14px; line-height: 1; }
.st-cell-delta .st-delta { font-size: .6875rem; }
.st-hist-table { max-height: 640px; overflow-y: auto; }
.st-hist-table thead th { position: sticky; top: 0; background: var(--surface); z-index: 1; }
.st-badge { font-size: .625rem; font-weight: 500; }
.st-heat-table td.st-heat { text-align: center; font-weight: 600; border: 2px solid var(--surface); border-radius: 6px; }

/* History metric chips */
.st-chips { display: flex; flex-direction: column; gap: 8px; }
.st-chip-group { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.st-chip-title { font-size: .6875rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); font-weight: 600; width: 84px; }
.st-chip {
    border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); border-radius: 999px;
    font-size: .75rem; padding: 3px 10px; cursor: pointer;
}
.st-chip:hover:not(:disabled) { border-color: var(--accent); color: var(--text); }
.st-chip.active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.st-chip:disabled { opacity: .45; cursor: not-allowed; }

.st-dl { display: grid; grid-template-columns: 110px 1fr; gap: 4px 10px; }
.st-dl dt { font-weight: 500; color: var(--text-3); }
.st-dl dd { margin: 0; word-break: break-all; }
.st-pre { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; font-size: .75rem; }

/* Revenue tab */
.st-seg .btn { font-weight: 500; }
.st-rev-hero .card-body { display: grid; grid-template-columns: minmax(260px, 1fr) 1.6fr; gap: 28px; align-items: center; }
.st-rev-total { font-size: 3rem; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; margin: 6px 0 4px; font-variant-numeric: tabular-nums; }
.st-rev-total.neg, .st-rev-cell-total.neg { color: var(--st-bad); }
.st-rev-sub { font-size: .75rem; color: var(--text-3); margin-top: 6px; }
.st-rev-alt { font-size: 1.05rem; font-weight: 600; color: var(--text-2); margin: -2px 0 4px; font-variant-numeric: tabular-nums; }
.st-rev-eq { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin-top: 16px; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; font-weight: 600; font-variant-numeric: tabular-nums; }
.st-rev-eq > span:not(.st-rev-eq-op) { display: flex; flex-direction: column; }
.st-rev-eq-label { font-size: .625rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); font-weight: 600; }
.st-rev-eq-op { color: var(--text-3); font-weight: 400; font-size: 1.1rem; }
.st-rev-eq-total { color: var(--accent); }
.st-rev-statement { border-left: 1px solid var(--border); padding-left: 28px; min-width: 0; }
.st-rev-lines td { vertical-align: middle; }
.st-rev-lines thead th { padding-top: .9rem; border-bottom-width: 1px; }
.st-rev-lines thead:first-child th { padding-top: .25rem; }
.st-rev-amt { font-weight: 600; font-size: .875rem; }
.st-rev-cmp { width: 1%; }
.st-rev-line-sub { font-size: .6875rem; color: var(--text-3); }
.st-rev-lines tr.st-rev-line-sum td { border-top: 2px solid var(--border-strong); font-weight: 650; }
.st-rev-lines tr.st-rev-line-sum .st-rev-amt { font-size: .9375rem; }
.st-rev-in { color: var(--st-good); }
.st-rev-out { color: var(--st-bad); }
.st-rev-now { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; font-size: .8125rem; padding: 10px 14px; border: 1px dashed var(--border-strong); border-radius: 10px; background: var(--surface); }
.st-rev-cell-total { font-weight: 650; font-size: .875rem; }
.st-table tr.st-rev-sum td { border-top: 2px solid var(--border-strong); font-weight: 600; }
.st-table tr.st-rev-row-now td { color: var(--text-3); font-style: italic; }
@media (max-width: 991.98px) {
    .st-rev-hero .card-body { grid-template-columns: 1fr; }
    .st-rev-statement { border-left: 0; padding-left: 0; border-top: 1px solid var(--border); padding-top: 12px; }
}
@media (max-width: 575.98px) {
    .st-rev-total { font-size: 2.25rem; }
    .st-rev-cmp .st-prev { display: none; }
}

@media (max-width: 575.98px) {
    .st-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .st-tile-value { font-size: 1.3rem; }
    .st-range { margin-left: 0 !important; width: 100%; }
    .st-chip-title { width: 100%; }
}
.st-now { white-space: nowrap; }
.st-legend-btn { border: 1px solid transparent; background: none; border-radius: 8px; padding: 2px 6px; color: var(--text-2); font-size: .75rem; cursor: pointer; }
.st-legend-btn:hover { border-color: var(--border-strong); }
.st-legend-btn.off { opacity: .45; text-decoration: line-through; }
.st-swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
