/* Traderbase web kit — the app's building blocks for the website.
 *
 * Colours come only from styles/tokens.css (generated from the app's
 * tokens.ts). Measurements are the app's (docs/web-parity/audit/*, design
 * sections); spacing scales up on wide screens, type does not.
 * Behaviour (charts, modals, toasts, segmented controls) is in src/kit.ts,
 * exposed as window.TbKit. The living style guide is /styleguide.html.
 */

/* ── Type ──────────────────────────────────────────────────────────────── */
@font-face {
    font-family: 'Inter';
    src: url('/assets/announce/inter.woff2') format('woff2');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

:root {
    --tb-font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --tb-fs-display: clamp(36px, 6vw, 64px);
    --tb-fs-title: 28px;
    --tb-fs-section: 17px;
    --tb-fs-eyebrow: 11px;
    --tb-fs-body: 15px;
    --tb-fs-hero: 40px;
    --tb-fs-stat: 20px;
    --tb-fs-small: 13px;
    --tb-fs-meta: 12px;

    --tb-gutter: 32px;
    --tb-content-max: 1200px;
    --tb-sidebar-w: 240px;
    --tb-rail-w: 76px;
    --tb-topbar-h: 56px;
    --tb-tabbar-h: 64px;

    --tb-r-card: 18px;
    --tb-r-row: 14px;
    --tb-r-tile: 12px;
    --tb-r-btn: 10px;
    --tb-r-chip: 8px;
    --tb-r-pill: 999px;

    --tb-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
    --tb-dur: 200ms;
}

@media (max-width: 767px) {
    :root {
        --tb-fs-title: 24px;
        --tb-fs-hero: 30px;
        --tb-gutter: 16px;
    }
}

.tb-display { font-size: var(--tb-fs-display); font-weight: 800; letter-spacing: -0.04em; line-height: 1.02; text-wrap: balance; color: var(--tb-text); margin: 0; }
.tb-page-title { font-size: var(--tb-fs-title); font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; color: var(--tb-text); margin: 0; }
.tb-section-title { font-size: var(--tb-fs-section); font-weight: 800; letter-spacing: -0.01em; line-height: 1.25; color: var(--tb-text); margin: 0; }
.tb-eyebrow { font-size: var(--tb-fs-eyebrow); font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--tb-primary-light); line-height: 1.3; margin: 0; }
.tb-body { font-size: var(--tb-fs-body); font-weight: 450; line-height: 1.55; color: var(--tb-text); margin: 0; }
.tb-body-2 { font-size: var(--tb-fs-body); font-weight: 450; line-height: 1.55; color: var(--tb-text2); margin: 0; }
.tb-hero-num { font-size: var(--tb-fs-hero); font-weight: 900; letter-spacing: -0.03em; line-height: 1.05; font-variant-numeric: tabular-nums; margin: 0; }
.tb-stat-value { font-size: var(--tb-fs-stat); font-weight: 800; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; color: var(--tb-text); }
.tb-small { font-size: var(--tb-fs-small); font-weight: 500; color: var(--tb-muted); }
.tb-meta { font-size: var(--tb-fs-meta); font-weight: 600; color: var(--tb-muted); }
.tb-num { font-variant-numeric: tabular-nums; }
.tb-up { color: var(--tb-success); }
.tb-down { color: var(--tb-error); }
.tb-muted { color: var(--tb-muted); }
.tb-text2 { color: var(--tb-text2); }
.tb-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Focus: one visible ring, in the accent, everywhere. */
:where(a, button, input, select, textarea, [tabindex], summary):focus-visible {
    outline: 2px solid var(--tb-accent);
    outline-offset: 2px;
}

/* ── Icons ─────────────────────────────────────────────────────────────── */
.tb-icon { display: inline-block; flex-shrink: 0; width: 1em; height: 1em; fill: currentColor; vertical-align: -0.125em; }

/* ── Layout helpers ────────────────────────────────────────────────────── */
.tb-page { max-width: var(--tb-content-max); margin: 0 auto; padding: 24px var(--tb-gutter) 48px; }
.tb-stack { display: flex; flex-direction: column; gap: 14px; }
.tb-row { display: flex; align-items: center; gap: 10px; }
.tb-grid-12 { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 14px; }
.tb-span-12 { grid-column: span 12; }
.tb-span-8 { grid-column: span 8; }
.tb-span-6 { grid-column: span 6; }
.tb-span-4 { grid-column: span 4; }
@media (max-width: 1023px) {
    .tb-span-8, .tb-span-6, .tb-span-4 { grid-column: span 12; }
}

/* ── Card / section ────────────────────────────────────────────────────── */
.tb-card {
    background: var(--tb-bg2);
    border: 1px solid var(--tb-border);
    border-radius: var(--tb-r-card);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}
@media (min-width: 1024px) { .tb-card { padding: 20px; } }

.tb-section-head { display: flex; align-items: flex-start; gap: 8px; }
.tb-section-head__icon { color: var(--tb-primary-light); font-size: 13px; margin-top: 2px; }
.tb-section-head__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.tb-section-head__text .tb-eyebrow { font-size: 10px; letter-spacing: 0.12em; }
.tb-section-head__title { font-size: 15px; font-weight: 800; letter-spacing: -0.01em; color: var(--tb-text); margin: 0; line-height: 1.3; }
.tb-section-head__action {
    font-size: 12.5px; font-weight: 800; color: var(--tb-primary-light);
    background: none; border: 0; padding: 4px 0; cursor: pointer; text-decoration: none;
    display: inline-flex; align-items: center; gap: 2px; white-space: nowrap;
}
.tb-section-head__action:hover { color: var(--tb-accent); }

.tb-divider { height: 1px; background: var(--tb-border); border: 0; margin: 4px 0; }

/* ── Gradient hero ─────────────────────────────────────────────────────── */
.tb-hero {
    --tb-hero-trend: var(--tb-success-rgb);
    position: relative;
    border-radius: var(--tb-r-card);
    border: 1px solid var(--tb-border);
    padding: 18px;
    background:
        linear-gradient(135deg, rgba(var(--tb-primary-rgb), 0.19), rgba(var(--tb-hero-trend), 0.12)),
        var(--tb-bg);
    display: flex;
    flex-direction: column;
    gap: 14px;
    overflow: hidden;
}
.tb-hero--down { --tb-hero-trend: var(--tb-error-rgb); }
.tb-hero__top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.tb-hero__value { color: var(--tb-text); }
.tb-hero__caption { font-size: 11px; font-weight: 600; color: var(--tb-text2); margin-top: 4px; }
.tb-hero__stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding-top: 16px; border-top: 1px solid var(--tb-border); }
@media (min-width: 1024px) { .tb-hero { padding: 24px; } }

.tb-alpha-badge {
    padding: 8px 12px; border-radius: 12px; border: 1px solid; text-align: right; flex-shrink: 0;
    background: rgba(var(--tb-success-rgb), 0.18); border-color: rgba(var(--tb-success-rgb), 0.55); color: var(--tb-gain-text);
}
.tb-alpha-badge--down { background: rgba(var(--tb-error-rgb), 0.18); border-color: rgba(var(--tb-error-rgb), 0.55); color: var(--tb-loss-text); }
.tb-alpha-badge__label { display: block; font-size: 9.5px; font-weight: 800; letter-spacing: 0.04em; }
.tb-alpha-badge__value { display: block; font-size: 15px; font-weight: 900; font-variant-numeric: tabular-nums; }

/* ── Stat tile ─────────────────────────────────────────────────────────── */
.tb-stat { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tb-stat__label { font-size: 9.5px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--tb-muted); }
.tb-stat__value { font-size: 14px; font-weight: 800; color: var(--tb-text); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-stat__sub { font-size: 10px; font-weight: 600; color: var(--tb-muted); }
.tb-stat--tile {
    background: var(--tb-card); border: 1px solid var(--tb-border); border-radius: var(--tb-r-btn);
    padding: 10px 12px;
}
.tb-stat--lg .tb-stat__value { font-size: var(--tb-fs-stat); }
.tb-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; }

/* ── Change pill (▲/▼) ─────────────────────────────────────────────────── */
.tb-change {
    --c: var(--tb-success-rgb);
    display: inline-flex; align-items: center; gap: 3px;
    padding: 3px 7px; border-radius: var(--tb-r-pill);
    border: 1px solid rgba(var(--c), 0.45); background: rgba(var(--c), 0.15);
    color: rgb(var(--c));
    font-size: 11px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; line-height: 1.3;
}
.tb-change--down { --c: var(--tb-error-rgb); }
.tb-change--flat { --c: var(--tb-muted-rgb); background: rgba(var(--c), 0.1); }
.tb-change__caret { font-size: 0.75em; }
.tb-change--sm { padding: 2px 5px; font-size: 9px; gap: 2px; }
.tb-change--lg { padding: 4px 9px; font-size: 12px; }

/* ── Trend pill (UP / FLAT / DOWN) ─────────────────────────────────────── */
.tb-trend {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 5px 10px; border-radius: var(--tb-r-pill);
    font-size: 12px; font-weight: 900; letter-spacing: 0.01em; white-space: nowrap;
}
.tb-trend .tb-icon { font-size: 13px; }
.tb-trend--up { background: linear-gradient(135deg, var(--tb-trend-up-from), var(--tb-trend-up-to)); color: var(--tb-trend-up-fg); }
.tb-trend--flat { background: linear-gradient(135deg, var(--tb-trend-flat-from), var(--tb-trend-flat-to)); color: var(--tb-trend-flat-fg); }
.tb-trend--down { background: linear-gradient(135deg, var(--tb-trend-down-from), var(--tb-trend-down-to)); color: var(--tb-trend-down-fg); }

/* ── Change chips (equal-flex row, set analytics) ──────────────────────── */
.tb-chiprow { display: flex; gap: 8px; }
.tb-chiprow > * { flex: 1; min-width: 0; }
.tb-change-chip { background: var(--tb-card); border: 1px solid var(--tb-border); border-radius: var(--tb-r-btn); padding: 8px 10px; }
.tb-change-chip__label { font-size: 9px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--tb-muted); }
.tb-change-chip__value { font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; }

/* ── Segmented control ─────────────────────────────────────────────────── */
/* Pill: full width, gradient active segment (set page tabs). */
.tb-seg {
    display: flex; gap: 2px; padding: 4px;
    border-radius: var(--tb-r-pill);
    border: 1px solid var(--tb-border);
    background: var(--tb-surface);
}
.tb-seg__item {
    flex: 1; min-width: 0; height: 34px; padding: 0 12px;
    border: 0; border-radius: var(--tb-r-pill); background: transparent;
    color: var(--tb-text2); font: inherit; font-size: 12px; font-weight: 800; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap;
    transition: color var(--tb-dur) var(--tb-ease), background var(--tb-dur) var(--tb-ease);
}
.tb-seg__item:hover { color: var(--tb-text); }
.tb-seg__item.is-active { background: linear-gradient(135deg, var(--tb-primary), var(--tb-accent)); color: var(--tb-on-primary); }
.tb-seg__badge { padding: 1px 4px; border-radius: 4px; background: var(--tb-accent); color: var(--tb-bg); font-size: 9px; font-weight: 900; letter-spacing: 0.05em; text-transform: uppercase; }
.tb-seg__item.is-active .tb-seg__badge { background: var(--tb-bg); color: var(--tb-accent); }

/* Tabs: compact period toggles (analytics, collection range). */
.tb-seg--tabs { display: inline-flex; padding: 3px; border-radius: var(--tb-r-btn); background: transparent; }
.tb-seg--tabs .tb-seg__item { flex: 0 0 auto; height: auto; padding: 5px 10px; border-radius: 8px; font-size: 11px; letter-spacing: 0.04em; }
.tb-seg--tabs .tb-seg__item.is-active { background: rgba(var(--tb-primary-rgb), 0.22); color: var(--tb-primary-light); }

/* Range: chart range toggle (1M / 3M / 1Y / All). */
.tb-seg--range { display: inline-flex; padding: 0; gap: 4px; border: 0; background: transparent; border-radius: 0; }
.tb-seg--range .tb-seg__item { flex: 0 0 auto; height: 26px; padding: 0 9px; border-radius: 8px; font-size: 11px; color: var(--tb-muted); }
.tb-seg--range .tb-seg__item.is-active { background: var(--tb-primary); color: var(--tb-on-primary); }

/* Language toggle: four equal segments, solid primary. */
.tb-seg--solid { border-radius: 12px; padding: 0; height: 36px; overflow: hidden; gap: 0; border-color: rgba(var(--tb-primary-rgb), 0.2); }
.tb-seg--solid .tb-seg__item { height: 100%; border-radius: 0; font-weight: 500; font-size: 13px; }
.tb-seg--solid .tb-seg__item.is-active { background: var(--tb-primary); color: var(--tb-on-primary); }

/* ── Chips ─────────────────────────────────────────────────────────────── */
.tb-chip {
    display: inline-flex; align-items: center; gap: 6px;
    height: 30px; padding: 0 12px; border-radius: var(--tb-r-pill);
    border: 1px solid var(--tb-border); background: var(--tb-surface);
    color: var(--tb-text2); font: inherit; font-size: 12px; font-weight: 700; white-space: nowrap; cursor: pointer;
    transition: background var(--tb-dur) var(--tb-ease), color var(--tb-dur) var(--tb-ease), border-color var(--tb-dur) var(--tb-ease);
}
.tb-chip:hover { color: var(--tb-text); border-color: var(--tb-border-strong); }
.tb-chip.is-active { background: var(--tb-primary-tint); border-color: var(--tb-border-strong); color: var(--tb-text); }
.tb-chip .tb-icon { font-size: 14px; }
.tb-tag {
    display: inline-flex; align-items: center; padding: 1px 5px; border-radius: 5px;
    border: 1px solid var(--tb-border); background: var(--tb-bg3); color: var(--tb-text2);
    font-size: 9px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap;
}
.tb-pro-badge {
    display: inline-flex; align-items: center; padding: 1px 5px; border-radius: 4px;
    background: var(--tb-accent); color: var(--tb-bg);
    font-size: 9px; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase;
}
.tb-count {
    min-width: 17px; height: 17px; padding: 0 5px; border-radius: var(--tb-r-pill);
    background: var(--tb-error); color: var(--tb-on-primary);
    font-size: 9.5px; font-weight: 800; line-height: 17px; text-align: center; font-variant-numeric: tabular-nums;
    box-shadow: 0 0 0 2px var(--tb-bg);
}
.tb-count--cart { background: var(--tb-success); color: var(--tb-bg); }

/* ── Buttons ───────────────────────────────────────────────────────────── */
.tb-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    height: 40px; padding: 0 16px; border-radius: var(--tb-r-btn);
    border: 1px solid transparent; font: inherit; font-size: 14px; font-weight: 700; letter-spacing: -0.005em;
    cursor: pointer; text-decoration: none; white-space: nowrap; user-select: none;
    transition: transform var(--tb-dur) var(--tb-ease), background var(--tb-dur) var(--tb-ease), border-color var(--tb-dur) var(--tb-ease), color var(--tb-dur) var(--tb-ease), opacity var(--tb-dur);
}
.tb-btn .tb-icon { font-size: 17px; }
.tb-btn:active { transform: scale(0.98); }
.tb-btn:disabled, .tb-btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; transform: none; }
.tb-btn--primary { background: var(--tb-primary); color: var(--tb-on-primary); }
.tb-btn--primary:hover { background: var(--tb-primary-dark); }
.tb-btn--gradient { background: linear-gradient(135deg, var(--tb-grad-to), var(--tb-grad-from)); color: var(--tb-on-primary); }
.tb-btn--gradient:hover { filter: brightness(1.08); }
.tb-btn--secondary { background: var(--tb-surface); border-color: var(--tb-border); color: var(--tb-text); }
.tb-btn--secondary:hover { border-color: var(--tb-border-strong); background: var(--tb-primary-tint-weak); }
.tb-btn--ghost { background: transparent; color: var(--tb-primary-light); }
.tb-btn--ghost:hover { background: var(--tb-primary-tint-weak); }
.tb-btn--danger { background: rgba(var(--tb-error-rgb), 0.08); border-color: rgba(var(--tb-error-rgb), 0.28); color: var(--tb-error); }
.tb-btn--danger:hover { background: rgba(var(--tb-error-rgb), 0.14); }
.tb-btn--success { background: var(--tb-success); color: var(--tb-bg); }
.tb-btn--sm { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: 8px; }
.tb-btn--lg { height: 46px; padding: 0 20px; font-size: 14px; border-radius: 12px; }
.tb-btn--block { width: 100%; }

.tb-icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0; position: relative;
    border: 1px solid var(--tb-border); background: var(--tb-surface); color: var(--tb-text2);
    font-size: 18px; cursor: pointer; padding: 0; text-decoration: none;
    transition: color var(--tb-dur) var(--tb-ease), border-color var(--tb-dur) var(--tb-ease), background var(--tb-dur) var(--tb-ease);
}
.tb-icon-btn:hover { color: var(--tb-text); border-color: var(--tb-border-strong); }
.tb-icon-btn--sm { width: 28px; height: 28px; font-size: 14px; border-color: var(--tb-surface-strong); }
.tb-icon-btn > .tb-count { position: absolute; top: -4px; right: -4px; }

/* ── Inputs ────────────────────────────────────────────────────────────── */
.tb-field { display: flex; flex-direction: column; gap: 6px; }
.tb-label { font-size: 12px; font-weight: 700; color: var(--tb-text2); }
.tb-input, .tb-select {
    width: 100%; min-height: 40px; padding: 8px 12px;
    border: 2px solid rgba(var(--tb-primary-rgb), 0.3); border-radius: var(--tb-r-btn);
    background: var(--tb-card); color: var(--tb-text);
    font: inherit; font-size: 15px; font-weight: 500;
    transition: border-color var(--tb-dur) var(--tb-ease), box-shadow var(--tb-dur) var(--tb-ease);
    box-shadow: none; position: static; z-index: auto;
}
.tb-input::placeholder { color: var(--tb-muted); }
.tb-input:focus, .tb-select:focus { outline: none; border-color: var(--tb-primary); box-shadow: 0 0 0 3px var(--tb-primary-tint); }
.tb-select {
    appearance: none; -webkit-appearance: none; padding-right: 36px; cursor: pointer;
    background-image: linear-gradient(45deg, transparent 50%, var(--tb-primary-light) 50%), linear-gradient(135deg, var(--tb-primary-light) 50%, transparent 50%);
    background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
}
.tb-search {
    display: flex; align-items: center; gap: 10px;
    height: 44px; padding: 0 12px 0 14px; border-radius: 12px;
    border: 1px solid var(--tb-border-strong); background: var(--tb-card); color: var(--tb-muted);
}
.tb-search:focus-within { border-color: var(--tb-primary); box-shadow: 0 0 0 3px var(--tb-primary-tint); }
.tb-search .tb-icon { font-size: 16px; }
.tb-search input {
    flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; color: var(--tb-text);
    font: inherit; font-size: 14px; padding: 0; outline: none; box-shadow: none; position: static;
}
.tb-search input::placeholder { color: var(--tb-muted); }

.tb-switch { position: relative; width: 44px; height: 26px; flex-shrink: 0; display: inline-block; }
.tb-switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.tb-switch span { position: absolute; inset: 0; border-radius: var(--tb-r-pill); background: var(--tb-border-strong); transition: background var(--tb-dur) var(--tb-ease); cursor: pointer; }
.tb-switch span::after { content: ''; position: absolute; left: 3px; top: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--tb-on-primary); transition: transform var(--tb-dur) var(--tb-ease); }
.tb-switch input:checked + span { background: var(--tb-primary); }
.tb-switch input:checked + span::after { transform: translateX(18px); }
.tb-switch input:focus-visible + span { outline: 2px solid var(--tb-accent); outline-offset: 2px; }

/* ── Card tile ─────────────────────────────────────────────────────────── */
.tb-tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
@media (max-width: 767px) { .tb-tile-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; } }
@media (max-width: 359px) { .tb-tile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.tb-tile {
    position: relative; display: flex; flex-direction: column; min-width: 0;
    border-radius: var(--tb-r-tile); border: 1px solid var(--tb-border);
    background: var(--tb-card); overflow: hidden; color: inherit; text-decoration: none; cursor: pointer;
    transition: transform var(--tb-dur) var(--tb-ease), border-color var(--tb-dur) var(--tb-ease);
}
.tb-tile:hover { transform: translateY(-2px); border-color: var(--tb-border-strong); }
.tb-tile:active { transform: scale(0.98); }
.tb-tile.is-owned { border-color: rgba(var(--tb-success-rgb), 0.4); }
.tb-tile__art {
    position: relative; aspect-ratio: 245 / 342;
    background: linear-gradient(180deg, var(--tb-bg3), var(--tb-card2));
    display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.tb-tile__art img { width: 100%; height: 100%; object-fit: cover; border-radius: 4.5% / 3.2%; }
.tb-tile__art--sealed img { object-fit: contain; border-radius: 0; padding: 6%; }
.tb-tile__art-fallback { color: var(--tb-muted); font-size: 28px; }
.tb-tile__rail { position: absolute; top: 6px; right: 6px; display: flex; flex-direction: column; gap: 5px; z-index: 2; }
.tb-tile__rail button {
    width: 26px; height: 26px; border-radius: 50%; padding: 0;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--tb-surface-strong); background: var(--tb-on-image); color: var(--tb-on-image-text);
    font-size: 14px; cursor: pointer; transition: transform var(--tb-dur) var(--tb-ease), color var(--tb-dur);
}
.tb-tile__rail button:hover { transform: scale(1.08); color: var(--tb-text); }
.tb-tile__rail button.is-on { color: var(--tb-error); }
.tb-tile__owned {
    position: absolute; left: 6px; bottom: 6px; z-index: 2;
    min-width: 22px; height: 20px; padding: 0 6px; border-radius: var(--tb-r-pill);
    border: 1px solid rgba(var(--tb-success-rgb), 0.4); background: var(--tb-on-image); color: var(--tb-success);
    font-size: 10px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; gap: 2px; font-variant-numeric: tabular-nums;
}
.tb-tile__cond {
    position: absolute; left: 6px; top: 6px; z-index: 2;
    padding: 2px 5px; border-radius: 5px; border: 1px solid var(--c, var(--tb-cond-lp));
    background: var(--tb-on-image); color: var(--c, var(--tb-cond-lp));
    font-size: 9px; font-weight: 800; letter-spacing: 0.04em;
}
.tb-tile__cond--lp { --c: var(--tb-cond-lp); }
.tb-tile__cond--mp { --c: var(--tb-cond-mp); }
.tb-tile__cond--hp { --c: var(--tb-cond-hp); }
.tb-tile__cond--dmg { --c: var(--tb-cond-dmg); }
.tb-tile__body { display: flex; flex-direction: column; gap: 1px; padding: 6px 8px 8px; min-width: 0; }
.tb-tile__name { font-size: 11px; font-weight: 700; line-height: 14px; color: var(--tb-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-tile__meta, .tb-tile__set { font-size: 9px; font-weight: 500; line-height: 13px; color: var(--tb-text2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 13px; }
.tb-tile__variant { color: var(--tb-primary-light); font-weight: 700; }
.tb-tile__price { font-size: 11px; font-weight: 700; color: var(--tb-primary-light); font-variant-numeric: tabular-nums; margin-top: 2px; min-height: 15px; }
.tb-tile__price.is-empty { color: var(--tb-muted); }
.tb-tile__price .tb-est { color: var(--tb-muted); margin-right: 1px; }
.tb-tile__change { min-height: 16px; margin-top: 2px; display: flex; }
/* The collection tile leads with the holding's value. */
.tb-tile--holding .tb-tile__name { font-weight: 800; }
.tb-tile--holding .tb-tile__price { font-size: 13px; color: var(--tb-text); }

/* ── Set tile ──────────────────────────────────────────────────────────── */
.tb-set-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
@media (max-width: 767px) { .tb-set-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; } }
@media (max-width: 479px) { .tb-set-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tb-set-tile {
    display: flex; flex-direction: column; min-width: 0; overflow: hidden;
    border-radius: var(--tb-r-tile); border: 1px solid var(--tb-border); background: var(--tb-card);
    color: inherit; text-decoration: none; cursor: pointer;
    transition: transform var(--tb-dur) var(--tb-ease), border-color var(--tb-dur) var(--tb-ease);
}
.tb-set-tile:hover { transform: translateY(-2px); border-color: var(--tb-border-strong); }
.tb-set-tile__media {
    position: relative; height: 100px; overflow: hidden;
    background: linear-gradient(135deg, var(--tb-bg2), var(--tb-bg3));
    display: flex; align-items: center; justify-content: center;
}
.tb-set-tile__logo { width: 92%; height: 70px; object-fit: contain; }
.tb-set-tile__blur { position: absolute; inset: -20px; background-size: cover; background-position: center; filter: blur(18px); }
.tb-set-tile__scrim { position: absolute; inset: 0; background: var(--tb-on-image); opacity: 0.62; }
.tb-set-tile__art { position: relative; height: 86%; aspect-ratio: 0.716; object-fit: contain; border-radius: 4px; box-shadow: var(--tb-shadow-art); }
.tb-set-tile__letter {
    width: 56px; height: 56px; border-radius: 50%; background: var(--tb-primary); color: var(--tb-on-primary);
    display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 20px; letter-spacing: -0.02em;
}
.tb-set-tile__letter[hidden] { display: none; }
.tb-set-tile__letter[data-len="3"] { font-size: 16px; }
.tb-set-tile__letter[data-len="4"] { font-size: 14px; }
.tb-set-tile__body { padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.tb-set-tile__name {
    font-size: 15px; font-weight: 600; line-height: 19px; min-height: 38px; color: var(--tb-text);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.tb-set-tile__meta { display: flex; align-items: center; gap: 6px; min-width: 0; }
.tb-set-tile__series { font-size: 12px; color: var(--tb-primary-light); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-set-tile__date { font-size: 11px; color: var(--tb-muted); }
@media (max-width: 767px) {
    .tb-set-tile__media { height: 78px; }
    .tb-set-tile__logo { height: 54px; }
    .tb-set-tile__body { padding: 8px; gap: 4px; }
    .tb-set-tile__name { font-size: 12px; line-height: 15px; min-height: 30px; }
    .tb-set-tile__series { font-size: 10.5px; }
}

/* ── Ranking row ───────────────────────────────────────────────────────── */
.tb-rank-list { display: flex; flex-direction: column; gap: 8px; }
.tb-rank-row {
    display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 0 14px;
    border-radius: var(--tb-r-row); border: 1px solid var(--tb-border); background: var(--tb-bg2);
    color: inherit; text-decoration: none; cursor: pointer;
    transition: border-color var(--tb-dur) var(--tb-ease);
}
.tb-rank-row:hover { border-color: var(--tb-border-strong); }
.tb-rank-row.is-current { border-color: var(--tb-primary); background: rgba(var(--tb-primary-rgb), 0.1); }
.tb-rank-row__rank {
    --m: var(--tb-text-rgb);
    width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid transparent; color: var(--tb-text2);
    font-size: 13px; font-weight: 900; font-variant-numeric: tabular-nums;
}
.tb-rank-row__rank[data-medal] { background: rgba(var(--m), 0.13); border-color: rgba(var(--m), 0.47); color: rgb(var(--m)); }
.tb-rank-row__rank[data-medal="1"] { --m: var(--tb-medal-1-rgb); }
.tb-rank-row__rank[data-medal="2"] { --m: var(--tb-medal-2-rgb); }
.tb-rank-row__rank[data-medal="3"] { --m: var(--tb-medal-3-rgb); }
.tb-rank-row__logo { width: 40px; height: 30px; object-fit: contain; flex-shrink: 0; }
.tb-rank-row__main { flex: 1; min-width: 0; }
.tb-rank-row__name { font-size: 14px; font-weight: 700; color: var(--tb-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-rank-row__sub { font-size: 11.5px; color: var(--tb-muted); font-variant-numeric: tabular-nums; }
.tb-rank-row__end { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex-shrink: 0; }
.tb-rank-row__pct { font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ── List row ──────────────────────────────────────────────────────────── */
.tb-list { display: flex; flex-direction: column; }
.tb-list-row {
    display: flex; align-items: center; gap: 12px; padding: 10px 0;
    border-bottom: 1px solid var(--tb-border); color: inherit; text-decoration: none; min-width: 0;
}
.tb-list-row:last-child { border-bottom: 0; }
a.tb-list-row:hover .tb-list-row__title, button.tb-list-row:hover .tb-list-row__title { color: var(--tb-primary-light); }
button.tb-list-row { width: 100%; background: none; border-left: 0; border-right: 0; border-top: 0; font: inherit; text-align: left; cursor: pointer; }
.tb-list-row__rank { width: 22px; flex-shrink: 0; font-size: 12px; font-weight: 800; color: var(--tb-muted); font-variant-numeric: tabular-nums; text-align: center; }
.tb-list-row__thumb { width: 36px; height: 50px; border-radius: 4px; object-fit: cover; flex-shrink: 0; background: var(--tb-bg3); }
.tb-list-row__main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tb-list-row__title { font-size: 12.5px; font-weight: 800; color: var(--tb-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color var(--tb-dur); }
.tb-list-row__sub { font-size: 10.5px; font-weight: 600; color: var(--tb-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb-list-row__end { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex-shrink: 0; text-align: right; }
.tb-list-row__value { font-size: 13px; font-weight: 800; color: var(--tb-text); font-variant-numeric: tabular-nums; }
.tb-list-row__chev { color: var(--tb-muted); font-size: 16px; flex-shrink: 0; }

/* Settings-style row card */
.tb-row-card {
    display: flex; align-items: center; gap: 12px; padding: 14px;
    background: var(--tb-bg2); border: 1px solid var(--tb-border); border-radius: var(--tb-r-row);
    color: inherit; text-decoration: none;
}
.tb-row-card__title { font-size: 13.5px; font-weight: 700; color: var(--tb-text); }
.tb-row-card__sub { font-size: 11px; color: var(--tb-muted); margin-top: 2px; }

/* ── Grade ladder ──────────────────────────────────────────────────────── */
.tb-ladder { display: flex; flex-direction: column; gap: 10px; }
.tb-ladder__tabs { display: flex; gap: 4px; }
.tb-ladder__tab {
    flex: 1; padding: 7px 4px; border-radius: 2px; border: 0; border-bottom: 3px solid transparent;
    background: var(--tb-surface); color: var(--tb-muted);
    font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer;
}
.tb-ladder__tab.is-active { background: var(--tb-primary-tint); border-bottom-color: var(--tb-primary); color: var(--tb-primary-light); }
.tb-ladder__rows { position: relative; display: flex; flex-direction: column; }
.tb-ladder__marker-label {
    position: relative; height: 18px; margin-left: 54px; margin-right: 104px;
    font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--tb-text2);
}
.tb-ladder__marker-label span { position: absolute; bottom: 4px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tb-ladder__marker-label span::after { content: ''; position: absolute; top: 50%; width: 14px; border-top: 1px dashed var(--tb-text2); }
.tb-ladder__marker-label.is-right span { transform: translateX(8px); }
.tb-ladder__marker-label.is-right span::after { right: calc(100% + 4px); }
.tb-ladder__marker-label.is-left span { transform: translateX(calc(-100% - 8px)); }
.tb-ladder__marker-label.is-left span::after { left: calc(100% + 4px); }
.tb-ladder__row { display: flex; align-items: center; gap: 8px; padding: 7px 0; }
.tb-ladder__label { width: 46px; flex-shrink: 0; font-size: 11px; font-weight: 700; line-height: 1.15; color: var(--tb-text2); }
.tb-ladder__track { position: relative; flex: 1; height: 22px; border-radius: 2px; background: var(--tb-surface); }
.tb-ladder__fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 2px; background: var(--fill, var(--tb-primary-light)); }
.tb-ladder__fill.is-below { opacity: var(--tb-ladder-below-alpha); }
.tb-ladder__raw { position: absolute; top: -3px; bottom: -3px; width: 0; border-left: 1px dashed var(--tb-text2); pointer-events: none; }
.tb-ladder__value { width: 96px; flex-shrink: 0; text-align: right; display: flex; flex-direction: column; align-items: flex-end; }
.tb-ladder__price { font-size: 13px; font-weight: 600; color: var(--tb-text); font-variant-numeric: tabular-nums; }
.tb-ladder__chg { font-size: 10.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tb-ladder--wide .tb-ladder__label { width: 64px; }
.tb-ladder--wide .tb-ladder__marker-label { margin-left: 72px; }
.tb-ladder__row.is-missing .tb-ladder__price { color: var(--tb-muted); }

/* ── Population tiles ──────────────────────────────────────────────────── */
.tb-pop { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tb-pop__tile {
    --c: var(--tb-primary-light-rgb);
    border-radius: 8px; padding: 11px 10px 12px;
    background: rgba(var(--c), var(--tb-tint-alpha));
    display: flex; flex-direction: column; gap: 4px; min-width: 0;
}
.tb-pop__tile--accent { --c: var(--tb-accent-rgb); }
.tb-pop__tile--warning { --c: var(--tb-warning-rgb); }
.tb-pop__glyph { font-size: 15px; color: rgb(var(--c)); }
.tb-pop__value { font-size: 18px; font-weight: 700; color: var(--tb-text); font-variant-numeric: tabular-nums; }
.tb-pop__label { font-size: 11px; color: var(--tb-text2); }

/* ── Line / area chart ─────────────────────────────────────────────────── */
.tb-chart { position: relative; user-select: none; -webkit-user-select: none; touch-action: pan-y; }
.tb-chart__head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; min-height: 26px; }
.tb-chart__legend { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.tb-chart__legend button {
    display: inline-flex; align-items: center; gap: 6px; padding: 2px 0; border: 0; background: none;
    font: inherit; font-size: 11.5px; font-weight: 700; color: var(--tb-text2); cursor: pointer;
}
.tb-chart__legend button.is-off { text-decoration: line-through; opacity: 0.45; }
.tb-chart__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); flex-shrink: 0; }
.tb-chart__svg { display: block; width: 100%; overflow: visible; }
.tb-chart__grid { stroke: var(--tb-grid-line); stroke-width: 1; }
.tb-chart__tick { fill: var(--tb-muted); font-size: 10px; font-weight: 600; font-family: var(--tb-font); font-variant-numeric: tabular-nums; }
.tb-chart__line { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.tb-chart--multi .tb-chart__line { stroke-width: 2; }
.tb-chart__scrub { stroke: var(--tb-muted); stroke-width: 1; opacity: 0.5; }
.tb-chart__scrub-dot { fill: var(--tb-bg); stroke-width: 2.5; }
.tb-chart__draw { stroke-dasharray: var(--len) var(--len); stroke-dashoffset: var(--len); animation: tb-chart-draw 700ms var(--tb-ease) forwards; }
@keyframes tb-chart-draw { to { stroke-dashoffset: 0; } }
.tb-chart__tip {
    position: absolute; top: 0; z-index: 3; pointer-events: none; min-width: 120px; max-width: 180px;
    padding: 8px 10px; border-radius: 10px; border: 1px solid var(--tb-border); background: var(--tb-card);
    box-shadow: var(--tb-shadow-menu); opacity: 0; transition: opacity 120ms;
}
.tb-chart__tip.is-on { opacity: 1; }
.tb-chart__tip-date { font-size: 10px; font-weight: 800; color: var(--tb-muted); margin-bottom: 3px; }
.tb-chart__tip-row { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 800; color: var(--tb-text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tb-chart__tip-row span:last-child { margin-left: auto; }
.tb-chart__foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 6px; }
.tb-chart__xlabels { display: flex; justify-content: space-between; flex: 1; font-size: 10px; font-weight: 600; color: var(--tb-muted); font-variant-numeric: tabular-nums; }
.tb-chart__empty { display: flex; align-items: center; justify-content: center; color: var(--tb-muted); font-size: 13px; font-weight: 700; border-radius: 12px; background: var(--tb-surface); }

/* ── Donut ─────────────────────────────────────────────────────────────── */
.tb-donut { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.tb-donut__chart { position: relative; flex-shrink: 0; }
.tb-donut__chart svg { display: block; transform: rotate(-90deg); }
.tb-donut__seg { fill: none; transition: opacity var(--tb-dur); }
.tb-donut__center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.tb-donut__center-label { font-size: 9.5px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--tb-muted); }
.tb-donut__center-value { font-size: 16px; font-weight: 900; color: var(--tb-text); font-variant-numeric: tabular-nums; }
.tb-donut__legend { flex: 1; min-width: 160px; display: flex; flex-direction: column; gap: 8px; }
.tb-donut__item { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; color: var(--tb-text2); }
.tb-donut__item b { margin-left: auto; color: var(--tb-text); font-weight: 800; font-variant-numeric: tabular-nums; }
.tb-donut__item i { font-style: normal; color: var(--tb-muted); font-weight: 600; font-size: 11px; width: 42px; text-align: right; font-variant-numeric: tabular-nums; }

/* ── Empty state ───────────────────────────────────────────────────────── */
.tb-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 32px 16px; }
.tb-empty__icon { font-size: 36px; color: var(--tb-muted); margin-bottom: 4px; }
.tb-empty__title { font-size: 16px; font-weight: 800; color: var(--tb-text); margin: 0; }
.tb-empty__body { font-size: 13px; color: var(--tb-text2); max-width: 42ch; line-height: 1.5; margin: 0; }
.tb-empty__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 8px; }
.tb-empty--inline { padding: 18px 8px; }
.tb-empty--inline .tb-empty__body { color: var(--tb-muted); font-size: 12.5px; }

/* ── Skeleton ──────────────────────────────────────────────────────────── */
.tb-skel {
    display: block; border-radius: 6px;
    background: linear-gradient(90deg, var(--tb-surface) 0%, var(--tb-surface-strong) 50%, var(--tb-surface) 100%);
    background-size: 200% 100%;
    animation: tb-skel 1.4s ease-in-out infinite;
}
.tb-skel--line { height: 12px; }
.tb-skel--title { height: 20px; width: 50%; }
.tb-skel--block { height: 120px; border-radius: 12px; }
.tb-skel--tile { aspect-ratio: 245 / 342; border-radius: var(--tb-r-tile); }
.tb-skel--circle { border-radius: 50%; }
@keyframes tb-skel { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* ── Modal / sheet ─────────────────────────────────────────────────────── */
.tb-modal-scrim {
    position: fixed; inset: 0; z-index: 1100; background: var(--tb-scrim);
    display: flex; align-items: center; justify-content: center; padding: 16px;
    animation: tb-fade 180ms var(--tb-ease);
}
.tb-modal {
    width: 100%; max-width: 440px; max-height: calc(100vh - 32px); overflow: auto;
    background: linear-gradient(180deg, var(--tb-bg3), var(--tb-bg2));
    border: 1px solid var(--tb-border-strong); border-radius: 20px; padding: 20px;
    box-shadow: var(--tb-shadow-menu); display: flex; flex-direction: column; gap: 14px;
    animation: tb-rise 220ms var(--tb-ease);
}
.tb-modal--wide { max-width: 640px; }
.tb-modal__head { display: flex; align-items: flex-start; gap: 12px; }
.tb-modal__head > div { flex: 1; min-width: 0; }
.tb-modal__title { font-size: 17px; font-weight: 800; color: var(--tb-text); margin: 2px 0 0; }
.tb-modal__actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.tb-modal__grabber { display: none; width: 38px; height: 4px; border-radius: var(--tb-r-pill); background: var(--tb-surface-strong); margin: -8px auto 2px; }
@media (max-width: 767px) {
    .tb-modal-scrim--sheet { align-items: flex-end; padding: 0; }
    .tb-modal-scrim--sheet .tb-modal {
        max-width: none; border-radius: 20px 20px 0 0; border-bottom: 0;
        padding: 16px 16px calc(24px + env(safe-area-inset-bottom, 0px));
        max-height: 88vh; animation-name: tb-sheet-up;
    }
    .tb-modal-scrim--sheet .tb-modal__grabber { display: block; }
    .tb-modal-scrim--sheet .tb-modal__actions .tb-btn { flex: 1; }
}
@keyframes tb-fade { from { opacity: 0; } }
@keyframes tb-rise { from { opacity: 0; transform: translateY(10px); } }
@keyframes tb-sheet-up { from { transform: translateY(100%); } }

/* Menus (sort, portfolio) */
.tb-menu {
    min-width: 190px; padding: 6px; border-radius: 12px;
    background: var(--tb-bg3); border: 1px solid var(--tb-border-strong); box-shadow: var(--tb-shadow-menu);
    display: flex; flex-direction: column; gap: 2px;
}
.tb-menu__item {
    display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 8px; border: 0; background: none;
    color: var(--tb-text); font: inherit; font-size: 12.5px; font-weight: 600; text-align: left; cursor: pointer; text-decoration: none;
}
.tb-menu__item:hover { background: var(--tb-surface); }
.tb-menu__item.is-active { background: var(--tb-primary-tint); }
.tb-menu__item.is-active .tb-icon { color: var(--tb-primary-light); margin-left: auto; }
.tb-menu__item--danger { color: var(--tb-error); }
.tb-menu__sep { height: 1px; background: var(--tb-border); margin: 4px 6px; }

/* ── Toast ─────────────────────────────────────────────────────────────── */
.tb-toasts {
    position: fixed; z-index: 1200; right: 20px; bottom: 20px;
    display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none;
}
@media (max-width: 767px) {
    .tb-toasts { left: 16px; right: 16px; bottom: calc(var(--tb-tabbar-h) + 28px + env(safe-area-inset-bottom, 0px)); align-items: stretch; }
}
.tb-toast {
    pointer-events: auto; display: flex; align-items: center; gap: 10px;
    max-width: 420px; padding: 12px 14px; border-radius: 12px;
    background: var(--tb-bg3); border: 1px solid var(--tb-border-strong); color: var(--tb-text);
    box-shadow: var(--tb-shadow-float); font-size: 13.5px; font-weight: 600; line-height: 1.4;
    animation: tb-rise 200ms var(--tb-ease);
}
.tb-toast .tb-icon { font-size: 18px; color: var(--tb-primary-light); }
.tb-toast--success { border-color: rgba(var(--tb-success-rgb), 0.45); }
.tb-toast--success .tb-icon { color: var(--tb-success); }
.tb-toast--error { border-color: rgba(var(--tb-error-rgb), 0.45); }
.tb-toast--error .tb-icon { color: var(--tb-error); }
.tb-toast.is-leaving { opacity: 0; transform: translateY(6px); transition: opacity 200ms, transform 200ms; }
.tb-toast__action { margin-left: auto; background: none; border: 0; color: var(--tb-primary-light); font: inherit; font-weight: 800; cursor: pointer; padding: 0 0 0 8px; }

/* ── Pro lock ──────────────────────────────────────────────────────────── */
.tb-pro-lock { position: relative; border-radius: var(--tb-r-card); overflow: hidden; isolation: isolate; }
.tb-pro-lock__preview { filter: blur(7px) saturate(0.9); opacity: 0.55; pointer-events: none; user-select: none; }
.tb-pro-lock__veil {
    position: absolute; inset: 0; z-index: 2; display: flex; align-items: center; justify-content: center; padding: 16px;
    background: linear-gradient(180deg, rgba(var(--tb-bg-rgb), 0.2), rgba(var(--tb-bg-rgb), 0.75));
}
.tb-pro-lock__card {
    max-width: 380px; width: 100%; text-align: center; padding: 20px; border-radius: var(--tb-r-card);
    border: 1px solid rgba(var(--tb-primary-rgb), 0.45);
    background:
        radial-gradient(120% 80% at 100% 0%, rgba(var(--tb-gold-rgb), 0.14), transparent 60%),
        linear-gradient(160deg, rgba(var(--tb-primary-rgb), 0.32), rgba(var(--tb-primary-rgb), 0.1)),
        var(--tb-bg2);
    display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.tb-pro-lock__chip { padding: 3px 8px; border-radius: 6px; background: var(--tb-gold); color: var(--tb-gold-ink); font-size: 10px; font-weight: 900; letter-spacing: 0.15em; }
.tb-pro-lock__title { font-size: 19px; font-weight: 800; color: var(--tb-text); margin: 0; letter-spacing: -0.01em; }
.tb-pro-lock__body { font-size: 12.5px; line-height: 1.5; color: var(--tb-text2); margin: 0; }
.tb-pro-lock__signin { margin: 2px 0 0; font-size: 13px; color: var(--tb-text2); }
.tb-pro-lock__signin a { color: var(--tb-primary-light); font-weight: 700; text-decoration: none; }
.tb-pro-lock__signin a:hover { text-decoration: underline; }
.tb-store-badges { display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; margin-top: 4px; }
.tb-store-badges a { display: flex; align-items: center; height: 40px; border-radius: 8px; }
.tb-store-badges .apple img { height: 40px; width: auto; }
/* Google's badge PNG carries transparent padding; oversize it to match Apple's. */
.tb-store-badges .play img { height: 59px; width: auto; margin: -10px -6px; }

/* ── Avatar ────────────────────────────────────────────────────────────── */
.tb-avatar {
    width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
    background: var(--tb-primary); color: var(--tb-on-primary); border: 1px solid var(--tb-border-strong);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 800; letter-spacing: 0.02em; overflow: hidden;
}
.tb-avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ── Wordmark ──────────────────────────────────────────────────────────── */
.tb-wordmark { display: inline-flex; align-items: center; gap: 9px; color: var(--tb-text); text-decoration: none; }
.tb-wordmark__mark { width: 28px; height: 28px; flex-shrink: 0; filter: drop-shadow(0 0 8px rgba(var(--tb-accent-rgb), 0.45)); }
.tb-wordmark__text { font-size: 19px; font-weight: 900; letter-spacing: -0.04em; color: var(--tb-text); line-height: 1; }
.tb-wordmark__text b {
    font-weight: 900; background: linear-gradient(180deg, var(--tb-grad-to), var(--tb-grad-from));
    -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ── Motion ────────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .tb-tile, .tb-set-tile, .tb-btn, .tb-chip, .tb-seg__item, .tb-toast, .tb-modal, .tb-modal-scrim { transition: none !important; animation: none !important; }
    .tb-tile:hover, .tb-set-tile:hover { transform: none; }
    .tb-chart__draw { animation: none; stroke-dashoffset: 0; }
    .tb-skel { animation: none; }
}
