/* components.css — TrackBounty primitive component library (redesign A1) */

/* === Base reset (scoped — does NOT replace base.html's existing reset) === */

.tb-r * { box-sizing: border-box; }

/* === Accessibility utility — visually hidden but accessible to screen readers ===
 * Added by A2.5 stabilisation pass for the marketplace h1 fix.
 * Pattern source: standard sr-only / visually-hidden CSS recipe. */
.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;
}

/* Button (§2.2) — variants: --primary / --secondary / --ghost / --danger */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0 var(--space-4);
  height: 36px;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  line-height: 1;
  letter-spacing: 0.1px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: background var(--motion-fast) var(--ease-out-expo),
              border-color var(--motion-fast) var(--ease-out-expo),
              color var(--motion-fast) var(--ease-out-expo),
              transform var(--motion-fast) var(--ease-out-expo);
}
.btn:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}
.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}
.btn:active:not(:disabled) { transform: translateY(1px); }

.btn--sm { height: 28px; padding: 0 var(--space-3); font-size: var(--text-sm); }
.btn--md { height: 36px; padding: 0 var(--space-4); }
.btn--lg { height: 44px; padding: 0 var(--space-5); font-size: var(--text-md); }

.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn--primary:hover:not(:disabled) {
  background: var(--accent-bright);
  border-color: var(--accent-bright);
}

.btn--secondary {
  background: var(--surface-2);
  border-color: var(--border-default);
  color: var(--text-primary);
}
.btn--secondary:hover:not(:disabled) {
  background: var(--surface-3);
  border-color: var(--border-strong);
}

.btn--ghost {
  background: transparent;
  border-color: transparent;
  color: var(--text-secondary);
}
.btn--ghost:hover:not(:disabled) {
  background: var(--surface-2);
  color: var(--text-primary);
}

.btn--danger {
  background: var(--state-error-bg);
  border-color: var(--state-error);
  color: var(--state-error);
}
.btn--danger:hover:not(:disabled) {
  background: var(--state-error);
  color: #fff;
}

.btn--icon-only {
  width: 36px;
  padding: 0;
}
.btn--icon-only.btn--sm { width: 28px; }
.btn--icon-only.btn--lg { width: 44px; }

/* ============================================================================
 * Tier badge (§2.3) — most-rendered primitive
 * ========================================================================== */

.tier-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 22px;
  min-width: 22px;
  padding: 0 var(--space-2);
  border-radius: var(--radius-xs);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: var(--weight-black);
  font-feature-settings: "tnum" 1;     /* tabular numerals */
  letter-spacing: 0.4px;
  white-space: nowrap;
}

/* v1.1 — glow tokens are full box-shadow expressions; consume directly */
.tier-badge--splus { background: var(--tier-splus-bg); color: var(--tier-splus-text); box-shadow: var(--tier-splus-glow); }
.tier-badge--s     { background: var(--tier-s-bg);     color: var(--tier-s-text);     box-shadow: var(--tier-s-glow); }
.tier-badge--a     { background: var(--tier-a-bg);     color: var(--tier-a-text);     box-shadow: var(--tier-a-glow); }
.tier-badge--b     { background: var(--tier-b-bg);     color: var(--tier-b-text);     box-shadow: var(--tier-b-glow); }
.tier-badge--c     { background: var(--tier-c-bg);     color: var(--tier-c-text);     box-shadow: var(--tier-c-glow); }

/* D-tier intentional ghost (v1.1) — surface tint + dashed border + dim text + no glow.
   Reads as "intentional bottom rung," NOT as "broken/missing-data card." */
.tier-badge--d {
  background: var(--tier-d-bg);
  color: var(--tier-d-text);
  border: 1px dashed var(--tier-d-border);
  box-shadow: none;
}

/* Gamification slot — DORMANT in A1. Renders only when data-level > 0.
   A1 ships with no data-level attribute on any badge. Future ship sets
   data-level="N" → visual lights up automatically. */
.tier-badge[data-level]:not([data-level="0"])::after {
  content: attr(data-level);
  font-feature-settings: "subs" 1;     /* OpenType subscript */
  font-family: var(--font-mono);
  margin-left: 1px;
}

/* ============================================================================
 * Pill (§2.6) — multi-select chip, removable
 * ========================================================================== */

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 0 var(--space-3);
  height: 28px;
  background: var(--surface-2);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--motion-fast) var(--ease-out-expo),
              color var(--motion-fast) var(--ease-out-expo),
              border-color var(--motion-fast) var(--ease-out-expo);
}
.chip:hover:not(:disabled) {
  background: var(--surface-3);
  color: var(--text-primary);
}
.chip:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

.chip[data-active="true"] {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent-bright);
}
.chip--success {
  background: var(--state-success-bg);
  border-color: var(--state-success);
  color: var(--state-success);
}

.chip-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin-left: var(--space-1);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.10);
  color: inherit;
  font-size: 12px;
  line-height: 1;
}
.chip-x:hover { background: rgba(255, 255, 255, 0.18); }

/* ============================================================================
 * Card (§2.2) — base + --editor / --scanner / --showcase
 * ========================================================================== */

.card {
  display: block;
  padding: var(--density-card-padding);
  background: var(--surface-1);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  text-decoration: none;
}
.card--editor { /* density-aware via tokens; no override needed */ }
.card--scanner {
  background: var(--surface-2);
  border-color: var(--border-strong);
}
.card--showcase {
  position: relative;
  overflow: hidden;
}

/* ============================================================================
 * Input (§2.2) — text / search / with-icon. Error state.
 * ========================================================================== */

.input-wrap {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0 var(--space-3);
  height: 36px;
  background: var(--surface-1);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  transition: border-color var(--motion-fast) var(--ease-out-expo);
}
.input-wrap:focus-within { border-color: var(--border-focus); }
.input-wrap[data-error="true"] { border-color: var(--state-error); }

.input {
  flex: 1 1 auto;
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1;
}
.input::placeholder { color: var(--text-muted); }

.input-icon {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

/* ============================================================================
 * Select (§2.2) — dropdown with custom indicator
 * ========================================================================== */

.select {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 var(--space-8) 0 var(--space-3);
  background: var(--surface-1) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'><path fill='%239b9eaf' d='M6 8 0 0h12z'/></svg>")
              right var(--space-3) center / 10px 6px no-repeat;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  cursor: pointer;
}
.select:focus-visible { border-color: var(--border-focus); outline: none; }

/* ============================================================================
 * Density toggle (§2.5) — segmented control of 3 buttons. Hidden <768px.
 * ========================================================================== */

.density-toggle {
  display: inline-flex;
  align-items: center;
  background: var(--surface-1);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 2px;
  gap: 2px;
}
.density-toggle button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 28px;
  background: transparent;
  border: none;
  border-radius: var(--radius-xs);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: var(--text-base);
  cursor: pointer;
  transition: background var(--motion-fast) var(--ease-out-expo),
              color var(--motion-fast) var(--ease-out-expo);
}
.density-toggle button:hover { color: var(--text-primary); }
.density-toggle button[aria-checked="true"] {
  background: var(--accent-dim);
  color: var(--accent-bright);
}
.density-toggle button:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

@media (max-width: 768px) {
  .density-toggle { display: none; }
}

/* ============================================================================
 * Avatar (§2.2) — with status ring, tier ring (data-tier), fallback initial
 * ========================================================================== */

.avatar {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-weight: var(--weight-bold);
  font-size: var(--text-md);
  overflow: hidden;
  flex-shrink: 0;
}
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.avatar--lg { width: 64px; height: 64px; }
.avatar--sm { width: 32px; height: 32px; font-size: var(--text-sm); }

/* Tier ring per DNA — colored ring matching --tier-{X}-glow */
.avatar[data-tier="S+"] { box-shadow: 0 0 0 2px var(--surface-1), 0 0 0 4px #ff7a30; }
.avatar[data-tier="S"]  { box-shadow: 0 0 0 2px var(--surface-1), 0 0 0 4px #fbbf24; }
.avatar[data-tier="A"]  { box-shadow: 0 0 0 2px var(--surface-1), 0 0 0 4px #a855f7; }
.avatar[data-tier="B"]  { box-shadow: 0 0 0 2px var(--surface-1), 0 0 0 4px #3b82f6; }
.avatar[data-tier="C"]  { box-shadow: 0 0 0 2px var(--surface-1), 0 0 0 4px #64748b; }

/* Bottom sheet (§2.4) — used in 2 places: mobile filter overlay + niche-pill picker */

.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: var(--z-sheet);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--motion-base) var(--ease-out-expo);
}
.sheet-backdrop[data-open="true"] {
  opacity: 1;
  pointer-events: auto;
}

.sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface-3);
  border-top-left-radius: var(--radius-xl);
  border-top-right-radius: var(--radius-xl);
  box-shadow: var(--shadow-4);
  z-index: calc(var(--z-sheet) + 1);
  max-height: 85vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform var(--motion-base) var(--ease-out-expo);
}
.sheet[data-open="true"] { transform: translateY(0); }

.sheet-handle {
  display: block;
  width: 40px;
  height: 4px;
  margin: var(--space-3) auto;
  background: var(--border-strong);
  border-radius: var(--radius-pill);
}

.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-5);
  border-bottom: 1px solid var(--border-subtle);
}
.sheet-body { padding: var(--space-5); }

body[data-sheet-open="true"] {
  overflow: hidden;
}

/* ============================================================================
 * Empty state (§2.2) — icon + title + body + optional CTA, Discord-warm copy
 * ========================================================================== */

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-10) var(--space-5);
  text-align: center;
  color: var(--text-secondary);
  gap: var(--space-3);
}
.empty-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  margin-bottom: var(--space-2);
}
.empty-title {
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  margin: 0;
}
.empty-body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  color: var(--text-secondary);
  max-width: 42ch;
  line-height: var(--leading-normal);
  margin: 0;
}

/* Loading skeleton (§2.2) — matches actual card layout, shimmer at --motion-slow */

.skeleton {
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  position: relative;
  overflow: hidden;
}
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--border-default) 50%,
    transparent 100%
  );
  animation: shimmer var(--motion-slow) linear infinite;
}
@keyframes shimmer {
  from { transform: translateX(-100%); }
  to   { transform: translateX(100%); }
}

.skeleton-card {
  padding: var(--density-card-padding);
  background: var(--surface-1);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.skeleton-avatar { width: 44px; height: 44px; border-radius: var(--radius-pill); }
.skeleton-bar { height: 12px; border-radius: var(--radius-xs); }
.skeleton-bar--name { width: 70%; }
.skeleton-bar--handle { width: 50%; }

/* ============================================================================
 * Error state (§2.2) — same shape as empty but with red accent border
 * ========================================================================== */

.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: var(--space-8) var(--space-5);
  background: var(--state-error-bg);
  border: 1px solid var(--state-error);
  border-radius: var(--radius-md);
  text-align: center;
  gap: var(--space-3);
  color: var(--text-primary);
}
.error-state .empty-icon {
  background: var(--state-error-bg);
  color: var(--state-error);
}

/* ============================================================================
 * Tooltip (§2.2) — popover with arrow
 * ========================================================================== */

.tooltip {
  position: absolute;
  z-index: var(--z-popover);
  padding: var(--space-2) var(--space-3);
  background: var(--surface-4);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  white-space: nowrap;
  box-shadow: var(--shadow-3);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--motion-fast) var(--ease-out-expo);
}
.tooltip[data-visible="true"] {
  opacity: 1;
  pointer-events: auto;
}
.tooltip::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 8px;
  height: 8px;
  background: var(--surface-4);
  border-right: 1px solid var(--border-strong);
  border-bottom: 1px solid var(--border-strong);
}

/* ============================================================================
 * Active filters bar — composition primitive used by /marketplace
 * ========================================================================== */

.active-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) 0;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
}
.active-filters[data-empty="true"] { display: none; }
.active-filters-helper {
  flex: 1 1 100%;
  margin-top: var(--space-2);
  color: var(--text-muted);
  font-size: var(--text-sm);
}
.active-filters-clear {
  margin-left: auto;
  background: transparent;
  border: none;
  color: var(--accent-bright);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  cursor: pointer;
  padding: 0;
}
.active-filters-clear:hover { color: var(--accent); }

/* Sticky CTA bar — generic mobile-bottom CTA primitive (Redesign A2 extract). */

.sticky-cta-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: var(--z-sticky);
  display: none;
  gap: var(--space-2);
  padding: var(--space-3);
  background: var(--surface-3);
  border-top: 1px solid var(--border-default);
  transform: translateY(100%);
  transition: transform var(--motion-base) var(--ease-out-expo);
}

@media (max-width: 768px) {
  .sticky-cta-bar { display: flex; }
  .sticky-cta-bar[data-visible="true"] { transform: translateY(0); }
  /* Suppress while a sheet is open to avoid double-modal stacking */
  body[data-sheet-open="true"] .sticky-cta-bar { transform: translateY(100%); }
}

.sticky-cta-bar > .btn { flex: 1 1 0; }


/* ════════════════════════════════════════════════════════════════ */
@keyframes cardFadeIn { 0% { opacity:0; transform:translateY(12px); } 100% { opacity:1; transform:translateY(0); } }
@keyframes livePulse { 0%,100% { box-shadow:0 0 0 0 rgba(16,185,129,0.5); } 50% { box-shadow:0 0 0 5px rgba(16,185,129,0); } }

.kpi-grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(186px,1fr)); gap:16px; margin-bottom:28px; }
.kpi-card {
    display:flex; gap:15px; align-items:flex-start;
    background:var(--bg-card); border:1px solid var(--border); border-radius:var(--radius-lg);
    padding:20px; position:relative; overflow:hidden;
    transition:transform var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal);
    animation:cardFadeIn 0.4s ease-out both;
}
.kpi-card:hover { transform:translateY(-2px); border-color:var(--border-hover); box-shadow:var(--shadow-md); }
.kpi-card:nth-child(1){animation-delay:0s}.kpi-card:nth-child(2){animation-delay:.05s}.kpi-card:nth-child(3){animation-delay:.10s}
.kpi-card:nth-child(4){animation-delay:.15s}.kpi-card:nth-child(5){animation-delay:.20s}.kpi-card:nth-child(6){animation-delay:.25s}
.kpi-icon { width:44px; height:44px; flex-shrink:0; border-radius:var(--radius-md); display:flex; align-items:center; justify-content:center; font-size:20px; background:var(--accent-dim); color:var(--accent-hover); }
.kpi-body { flex:1; min-width:0; }
.kpi-label { font-size:11px; font-weight:600; text-transform:uppercase; letter-spacing:0.06em; color:var(--text-muted); margin-bottom:7px; }
.kpi-value { font-size:28px; font-weight:800; letter-spacing:-0.03em; line-height:1.05; color:var(--text); font-variant-numeric:tabular-nums; }
.kpi-sub { font-size:12px; color:var(--text-muted); margin-top:7px; line-height:1.4; }
.kpi-delta { display:inline-flex; align-items:center; gap:4px; margin-top:10px; padding:3px 9px; border-radius:20px; font-size:11px; font-weight:600; background:rgba(148,163,184,0.12); color:var(--text-secondary); }
.kpi-delta.up { background:rgba(16,185,129,0.12); color:#34d399; }
.kpi-delta.warn { background:rgba(245,158,11,0.12); color:#fbbf24; }
.kpi-delta.down { background:rgba(239,68,68,0.12); color:#f87171; }
.kpi-card.is-accent { border-color:var(--accent); box-shadow:0 0 0 1px var(--accent-dim), 0 0 28px var(--accent-dim); }

.live-indicator { display:inline-flex; align-items:center; gap:8px; padding:6px 12px; border-radius:20px; background:rgba(16,185,129,0.10); border:1px solid rgba(16,185,129,0.25); font-size:12px; font-weight:600; color:#34d399; }
.live-dot { width:7px; height:7px; border-radius:50%; background:#10b981; animation:livePulse 2s ease-in-out infinite; }
.live-updated { color:var(--text-muted); font-weight:500; }

.panel { background:var(--bg-card); border:1px solid var(--border); border-radius:var(--radius-lg); padding:20px 22px; transition:border-color var(--transition-normal), box-shadow var(--transition-normal); }
.panel:hover { border-color:var(--border-hover); box-shadow:var(--shadow-sm); }
.panel-head { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:18px; }
.panel-title { font-size:14px; font-weight:700; color:var(--text); display:flex; align-items:center; gap:8px; }
.panel-title .dot-accent { width:7px; height:7px; border-radius:50%; background:var(--accent); box-shadow:0 0 8px var(--accent-glow); }
.panel-sub { font-size:12px; color:var(--text-muted); font-weight:500; }
.panel-actions { display:flex; align-items:center; gap:8px; }

.chart-wrap { position:relative; width:100%; height:220px; }
.chart-wrap.tall { height:280px; }
.chart-wrap.short { height:150px; }

.scope-tag { display:inline-flex; align-items:center; gap:5px; font-size:10px; font-weight:600; text-transform:uppercase; letter-spacing:0.05em; color:var(--text-muted); border:1px solid var(--border); border-radius:20px; padding:2px 8px; }

.section-head { display:flex; align-items:baseline; gap:10px; margin:28px 0 16px; }
.section-head .section-title { margin-bottom:0; }
.section-head .count { font-size:12px; color:var(--text-muted); font-weight:600; background:var(--bg-elevated); border:1px solid var(--border); border-radius:20px; padding:1px 9px; }

@media (max-width:768px) { .kpi-grid { grid-template-columns:1fr; } }
@media (prefers-reduced-motion:reduce) { .kpi-card { animation:none!important; } .kpi-card:hover { transform:none; } .live-dot { animation:none!important; } }

/* EDITOR UX FOUNDATION — editor-portals-program M8 */

/* Skip link (EP-018) */
.tb-skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  padding: 10px 16px;
  background: var(--surface-3, #1d1d2a);
  color: var(--text-primary, #ecedf2);
  border: 1px solid var(--border-strong, rgba(255,255,255,0.16));
  border-radius: 0 0 8px 0;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}
.tb-skip-link:focus {
  left: 0;
}

/* P-06 mobile bottom navigation */
.tb-bottom-nav {
  display: none;                     /* desktop: the sidebar is the navigation */
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 120;
  /* 5 equal columns. `minmax(0, 1fr)` NOT `1fr`: a grid track's default minimum */
  grid-template-columns: repeat(5, minmax(0, 1fr));
  background: var(--surface-1, #0f0f17);
  border-top: 1px solid var(--border-default, rgba(255,255,255,0.08));
  /* Keep the bar clear of the iOS home indicator. */
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.tb-bottom-nav a,
.tb-bottom-nav button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  /* 56px + the label keeps every target above the 44px touch minimum. */
  min-height: 56px;
  padding: 8px 2px;
  background: none;
  border: 0;
  color: var(--text-muted, #8b90a6);
  font-family: inherit;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  /* A label that cannot shrink is the other half of the overflow trap. */
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tb-bottom-nav .tb-bn-icon {
  font-size: 17px;
  line-height: 1;
}
.tb-bottom-nav a.active {
  color: var(--accent-bright, #818cf8);
}
/* The active item is also marked with aria-current in the markup; this is the
   visible half of the same statement. */
.tb-bottom-nav a.active .tb-bn-icon {
  transform: translateY(-1px);
}

@media (max-width: 768px) {
  .tb-bottom-nav { display: grid; }
  /* Reserve the bar's height so the last row of content and the footer are not
     trapped underneath it. */
  .tb-has-bottom-nav {
    padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
  }
  /* The support chat bubble is `position: fixed; bottom: 16px; right: 16px` and */
  body .tb-chat-bubble {
    bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  }
}

/* P-02 submission status timeline */
.tb-timeline {
  list-style: none;
  margin: 10px 0 0;
  padding: 0 0 0 18px;
  position: relative;
}
/* The spine. `inset-block` keeps it inside the first and last dot rather than
   running past them. */
.tb-timeline::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--border-default, rgba(255,255,255,0.08));
}
.tb-timeline li {
  position: relative;
  padding: 0 0 12px 14px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-secondary, #9b9eaf);
}
.tb-timeline li:last-child { padding-bottom: 0; }
.tb-timeline li::before {
  content: '';
  position: absolute;
  left: -18px;
  top: 5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--surface-3, #1d1d2a);
  border: 2px solid var(--border-strong, rgba(255,255,255,0.16));
}
.tb-timeline li.is-done::before {
  background: var(--accent-bright, #818cf8);
  border-color: var(--accent-bright, #818cf8);
}
.tb-timeline li.is-rejected::before {
  background: var(--state-error, #ef4444);
  border-color: var(--state-error, #ef4444);
}
/* The step that has not happened yet stays hollow and is marked in the text as
   well, so the state is never carried by colour alone (EP-017/EP-018). */
.tb-timeline li.is-pending {
  color: var(--text-muted, #8b90a6);
}
.tb-timeline .tb-tl-label {
  color: var(--text-primary, #ecedf2);
  font-weight: 600;
}
.tb-timeline .tb-tl-when {
  display: block;
  font-size: 12px;
  color: var(--text-muted, #8b90a6);
}

/* EP-023 "last updated" stamp */
.tb-stamp {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-muted, #8b90a6);
}

/* P-01 the Money page */
.tb-money-grid {
  display: grid;
  /* auto-fit + minmax(0,...) so four cards reflow to two, then one, without any
     track ever refusing to shrink. */
  grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr));
  gap: 12px;
  margin: 0 0 20px;
}
.tb-money-card {
  background: var(--surface-1, #0f0f17);
  border: 1px solid var(--border-default, rgba(255,255,255,0.08));
  border-radius: 12px;
  padding: 16px;
  min-width: 0;
}
.tb-money-value {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--text-primary, #ecedf2);
  overflow-wrap: anywhere;
}
.tb-money-label {
  margin-top: 2px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary, #ecedf2);
}
.tb-money-def {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-secondary, #9b9eaf);
}
/* "Available" is the only one an editor can act on, so it is the only one that
   carries the accent. The others must not compete with it. */
.tb-money-card.is-primary {
  border-color: var(--accent, #6366f1);
}
.tb-money-card.is-primary .tb-money-value {
  color: var(--accent-bright, #818cf8);
}

/* --- P-05 notification centre --------------------------------------------- */
.tb-notif-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.tb-notif-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-subtle, rgba(255,255,255,0.04));
  min-width: 0;
}
.tb-notif-item:last-child { border-bottom: 0; }
.tb-notif-item.is-unread {
  background: var(--surface-2, #15151f);
}
/* The unread marker is a dot AND the word "New" in the markup: colour alone
   never carries the state. */
.tb-notif-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--accent-bright, #818cf8);
}
.tb-notif-body { min-width: 0; flex: 1; }
.tb-notif-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary, #ecedf2);
  overflow-wrap: anywhere;
}
.tb-notif-text {
  margin-top: 2px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary, #9b9eaf);
  overflow-wrap: anywhere;
}

/* P-08 tier / rank explainer + P-07 help */
.tb-explainer {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary, #9b9eaf);
}
.tb-explainer > summary {
  display: inline-block;
  width: max-content;
  max-width: 100%;
  cursor: pointer;
  color: var(--text-primary, #ecedf2);
  font-weight: 600;
}
.tb-explainer > div {
  margin-top: 8px;
  padding: 12px 14px;
  background: var(--surface-1, #0f0f17);
  border: 1px solid var(--border-default, rgba(255,255,255,0.08));
  border-radius: 10px;
}
.tb-explainer dl { margin: 0; }
.tb-explainer dt {
  font-weight: 600;
  color: var(--text-primary, #ecedf2);
  margin-top: 8px;
}
.tb-explainer dt:first-child { margin-top: 0; }
.tb-explainer dd { margin: 2px 0 0; }

/* --- EP-019 empty states that carry their next action --------------------
 * `.empty` already centres an icon, a title and a body. M8 adds the ACTIONS
 * row, because an empty state without a way out is the finding. */
.tb-empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 16px;
}

/* EP-014 overflow containment vocabulary */
.tb-table-wrap {
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
/* A scrollable region must be reachable by keyboard; browsers only focus it
   automatically in some engines, so the markup sets tabindex="0" and this keeps
   the ring visible. */
.tb-table-wrap:focus-visible {
  outline: 2px solid var(--accent-bright, #818cf8);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .tb-bottom-nav a.active .tb-bn-icon { transform: none; }
}

/* The M3' /sounds pager contrast rule (`nav.si-pager a`) retired with M5a: the
   songs index is rebuilt in the white system and its pager is the catalogue's
   outline buttons (spec v4 §4.5), so the `.si-pager` class no longer exists. */

/* PUBLIC PAGES — public-website-redesign M4' */

/* A Latin subset of the self-hosted Inter Variable (both axes, every default */
@font-face {
  font-family: 'TB Inter';
  src: url('/static/fonts/Inter-Variable-latin.woff2') format('woff2-variations'),
       url('/static/fonts/Inter-Variable-latin.woff2') format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
                 U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2190-2193,
                 U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Metric-matched local fallback for TB Inter (map v4.1 A1, 2026-10-11): while the subset is still loading, Latin
   text renders in Arial / Liberation Sans / Helvetica scaled to Inter's metrics, so the swap to TB Inter moves
   nothing (the live layout-shift experiment measured 0.0522 on the homepage from that swap). Same unicode-range
   as TB Inter, so it never answers for other scripts; the stacks name it right after 'TB Inter'. Ascent, descent
   and line gap are the Inter-to-Arial values (90.49 %, 22.56 %, 0); size-adjust 110.5 % was chosen by measuring
   the swap shift on the public pages (sweep 100-114.5 %, 2026-10-11: homepage 0.052 to 0.012, login 0.026 to
   0.000, bounties 0.013 to 0, trends 0.014 to 0). Android has no Arial: there the face resolves to nothing and
   the stack continues as before. */
@font-face {
  font-family: 'TB Inter Fallback';
  src: local('Arial'), local('Liberation Sans'), local('Helvetica Neue'), local('Helvetica');
  size-adjust: 110.50%;
  ascent-override: 90.49%;
  descent-override: 22.56%;
  line-gap-override: 0%;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
                 U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2190-2193,
                 U+2212, U+2215, U+FEFF, U+FFFD;
}

/* The same local fallback scaled for running text (map v4.1 A1, 2026-10-11): the legal documents are long lowercase
   paragraphs, where Inter runs about 6 percent wider than Arial (length-weighted 1.058-1.064 on the six documents),
   not the 10-16 percent of the homepage hero's short bold words that set TB Inter Fallback's scale; the legal shell
   names this face instead (legal_base.html), so its swap re-wraps nothing on a slow connection either. */
@font-face {
  font-family: 'TB Inter Fallback Text';
  src: local('Arial'), local('Liberation Sans'), local('Helvetica Neue'), local('Helvetica');
  size-adjust: 106.40%;
  ascent-override: 90.49%;
  descent-override: 22.56%;
  line-gap-override: 0%;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
                 U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2190-2193,
                 U+2212, U+2215, U+FEFF, U+FFFD;
}

/* --- Page root and element defaults --------------------------------------- */
.tbp { display: block; background: var(--tb-paper); color: var(--tb-ink); font-size: 18px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
@media (max-width: 767px) { .tbp { font-size: 17px; } }
:where(.tbp) img, :where(.tbp) svg { display: block; max-width: 100%; height: auto; }
/* h1-h3 only, as in v4: its h4s (the demo's and the phone's panel titles) keep the
   browser's bold weight, inherited line height and default margins - the accepted look. */
:where(.tbp) h1, :where(.tbp) h2, :where(.tbp) h3 { margin: 0; color: var(--tb-ink); font-weight: 800; line-height: 1.02; letter-spacing: -0.035em; text-wrap: balance; }
:where(.tbp) h1 { font-size: 72px; font-weight: 900; letter-spacing: -0.045em; }
:where(.tbp) h2 { font-size: 46px; }
:where(.tbp) h3 { font-size: 26px; line-height: 1.15; letter-spacing: -0.02em; }
@media (max-width: 1023px) { :where(.tbp) h1 { font-size: 56px; } :where(.tbp) h2 { font-size: 38px; } }
@media (max-width: 767px) { :where(.tbp) h1 { font-size: 44px; } :where(.tbp) h2 { font-size: 32px; } :where(.tbp) h3 { font-size: 22px; } }
:where(.tbp) p, :where(.tbp) dl, :where(.tbp) dd, :where(.tbp) ol, :where(.tbp) ul { margin: 0; }
/* base.html colours every link indigo and removes underlines (`a`, 0,0,1):
   text links on these pages are ink and underlined; the buttons keep theirs. */
.tbp a:not(.tb-btn), .tbp a:not(.tb-btn):hover { color: inherit; }
.tbp a:not(.tb-btn) { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1.5px; }
/* 3 px ink ring on white, yellow on black; outranks tokens.css's indigo ring. */
.tbp :focus-visible { outline: 3px solid var(--tb-ink); outline-offset: 3px; border-radius: 4px; }
.tbp-on-black :focus-visible { outline-color: var(--tb-bolt); }
.tbp [id] { scroll-margin-top: calc(var(--tb-header-h) + 16px); }

.tbp-wrap { max-width: var(--tb-container); margin: 0 auto; padding-left: var(--tb-gutter); padding-right: var(--tb-gutter); }
.tbp-section { padding: 112px 0; }
@media (max-width: 767px) { .tbp-section { padding: 72px 0; } }
.tbp-section.tbp-after-hero { padding-top: 40px; }
.tbp-section.tbp-rely-band { padding: 64px 0; }
.tbp-tint { background: var(--tb-tint); }
.tbp-lede { max-width: 46ch; color: var(--tb-ink-2); font-size: 20px; line-height: 1.45; }
@media (max-width: 767px) { .tbp-lede { font-size: 18px; } }
.tbp-meta { color: var(--tb-ink-3); font-size: 14px; line-height: 1.45; }
.tbp-eyebrow { display: inline-flex; align-items: center; gap: 8px; color: var(--tb-ink); font-size: 14px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.tbp-bolt { flex: none; width: 14px; height: 14px; }
.tbp-avail { display: flex; align-items: flex-start; gap: 8px; max-width: 60ch; color: var(--tb-ink-3); font-size: 14px; }
.tbp-avail::before { content: ''; flex: none; width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: var(--tb-bolt); border: 1px solid rgba(11, 11, 11, .25); }
.tbp-avail b { color: var(--tb-ink-2); font-weight: 600; }
.tbp-trust { display: flex; flex-wrap: wrap; gap: 8px 22px; color: var(--tb-ink-2); font-size: 15px; }
.tbp-trust span { display: inline-flex; align-items: center; gap: 8px; }
.tbp-trust span::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--tb-bolt); border: 1px solid rgba(11, 11, 11, .25); }

/* --- Hero: copy left, the mark with a phone right ------------------------- */
.tbp-hero { position: relative; overflow: hidden; padding: 64px 0 40px; }
@media (min-width: 1024px) { .tbp-hero { padding: 96px 0 72px; } }
.tbp-hero-grid { display: grid; gap: 40px; }
@media (min-width: 1024px) { .tbp-hero-grid { grid-template-columns: minmax(0, 6.5fr) minmax(0, 5.5fr); align-items: center; } }
.tbp-hero-grid > div, .tbp-proof > div { min-width: 0; }
.tbp-hero-copy { display: grid; gap: 26px; }
.tbp-hero h1 { max-width: 13ch; }
.tbp-ctas { display: flex; flex-wrap: wrap; gap: 12px; }
@media (max-width: 479px) { .tbp-ctas .tb-btn { flex: 1 1 100%; } }

/* The strike: the bolt's zigzag flattened under the key phrase, drawn once. */
.tbp-strike-word { position: relative; display: inline-block; white-space: nowrap; }
.tbp-strike { position: absolute; left: -2%; bottom: -0.08em; width: 104%; height: 0.26em; overflow: visible; pointer-events: none; }
.tbp-strike path { fill: none; stroke: var(--tb-bolt); stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
html.js.motion-ok .tbp-strike path { stroke-dasharray: 1000; stroke-dashoffset: 1000; }
html.js.motion-ok .tbp-strike.tbp-go path { animation: tbp-draw 420ms var(--tb-ease) forwards; }
@keyframes tbp-draw { to { stroke-dashoffset: 0; } }

/* The headline word: an inline grid stacks an invisible copy of the widest word
   and the visible word in one cell, so a change never moves the layout. */
.tbp-slot { display: inline-grid; grid-template-areas: "w"; align-items: baseline; vertical-align: baseline; text-align: left; }
.tbp-slot > span { grid-area: w; white-space: nowrap; }
.tbp-slot .tbp-ghost { visibility: hidden; }
.tbp-slot .tbp-word { transition: opacity 320ms var(--tb-ease), transform 320ms var(--tb-ease); }
.tbp-slot .tbp-word.tbp-out { opacity: 0; transform: translateY(-0.35em); }
.tbp-slot .tbp-word.tbp-in { opacity: 0; transform: translateY(0.35em); }
html:not(.motion-ok) .tbp-slot .tbp-word { transition: none; transform: none; }
.tbp-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
html:not(.js) .tbp-chips { display: none; }
.tbp-chips .tbp-chips-lbl { align-self: center; margin-right: 4px; color: var(--tb-ink-3); font-size: 13px; }
.tbp-chips button { padding: 9px 14px; border: 1.5px solid var(--tb-line-2); border-radius: 999px; background: #fff; color: var(--tb-ink-2); font: 600 15px/1 var(--font-sans); cursor: pointer; transition: border-color 150ms var(--tb-ease), color 150ms var(--tb-ease), background-color 150ms var(--tb-ease); }
.tbp-chips button:hover { border-color: var(--tb-ink); color: var(--tb-ink); }
.tbp-chips button[aria-pressed="true"] { background: var(--tb-bolt); border-color: var(--tb-bolt); color: var(--tb-ink); }

/* The composition: the mark whole, the black phone tucked into its corner. */
.tbp-compo { position: relative; height: 560px; }
@media (max-width: 1023px) { .tbp-compo { height: 440px; } }
@media (max-width: 767px) { .tbp-compo { height: 380px; } }
.tbp-compo .tbp-mark { position: absolute; left: 0; top: 0; width: auto; height: 100%; }
.tbp-compo .tbp-phone-wrap { position: absolute; inset: 0; pointer-events: none; }
.tbp-compo .tbp-phone { position: absolute; right: 0; bottom: -6%; width: 218px; aspect-ratio: 9 / 19.2; padding: 8px; border-radius: 32px; background: var(--tb-ink); box-shadow: 0 24px 50px rgba(11, 11, 11, .22); pointer-events: auto; }
.tbp-compo .tbp-shadow { position: absolute; right: 0; bottom: -6%; width: 218px; height: 20px; border-radius: 50%; background: radial-gradient(ellipse at center, rgba(11, 11, 11, .26), rgba(11, 11, 11, 0) 70%); transform: translateY(14px); pointer-events: none; }
@media (max-width: 1023px) { .tbp-compo .tbp-phone, .tbp-compo .tbp-shadow { width: 190px; right: 4%; } }
@media (max-width: 767px) {
  .tbp-compo .tbp-phone { right: 0; bottom: -4%; width: 156px; padding: 7px; border-radius: 26px; }
  .tbp-compo .tbp-shadow { right: 0; bottom: -4%; width: 156px; }
}
.tbp-compo .tbp-screen { display: grid; align-content: start; height: 100%; overflow: hidden; border-radius: 26px; background: #fff; }
html.js.motion-ok .tbp-compo .tbp-mark { animation: tbp-rise 500ms var(--tb-ease) both; }
html.js.motion-ok .tbp-compo .tbp-phone-wrap { animation: tbp-rise 500ms var(--tb-ease) 80ms both; }
@keyframes tbp-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
/* The float: perceptible and calm, with the shadow in step; paused off screen,
   in a hidden tab and while the phone is being used (site.js). */
html.js.motion-ok .tbp-compo.tbp-floating .tbp-phone { animation: tbp-float 5.5s cubic-bezier(0.45, 0, 0.55, 1) 700ms infinite; }
html.js.motion-ok .tbp-compo.tbp-floating .tbp-shadow { animation: tbp-shadow 5.5s cubic-bezier(0.45, 0, 0.55, 1) 700ms infinite; }
html.js.motion-ok .tbp-compo.tbp-floating.tbp-paused .tbp-phone,
html.js.motion-ok .tbp-compo.tbp-floating.tbp-paused .tbp-shadow { animation-play-state: paused; }
@keyframes tbp-float { 0%, 100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-14px) rotate(-0.8deg); } }
@keyframes tbp-shadow { 0%, 100% { transform: translateY(14px) scale(1); opacity: 1; } 50% { transform: translateY(14px) scale(.86); opacity: .6; } }
.tbp-cap { margin-top: 12px; color: var(--tb-ink-3); font-size: 13px; }
.tbp-compo + .tbp-cap { margin-top: 40px; }
@media (min-width: 1024px) { .tbp-compo + .tbp-cap { max-width: 56%; } }

/* --- The editor portal on a phone (design preview) ------------------------ */
.tbp-pt { display: grid; align-content: start; gap: 10px; height: 100%; padding: 14px 13px 16px; color: var(--tb-ink-2); font: 500 11px/1.35 var(--font-sans); }
.tbp-pt h4 { margin: 2px 0 0; color: var(--tb-ink); font-size: 15px; letter-spacing: -0.02em; }
.tbp-pt-bar { display: flex; align-items: center; justify-content: space-between; }
.tbp-pt-bar img { width: auto; height: 18px; }
.tbp-chip { padding: 5px 8px; border: 1px solid var(--tb-line-2); border-radius: 999px; color: var(--tb-ink); font: 600 9.5px/1 var(--font-sans); letter-spacing: .04em; text-transform: uppercase; }
.tbp-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tbp-tile { display: grid; gap: 1px; padding: 8px 0; border-top: 1px solid var(--tb-line); }
.tbp-tile b { color: var(--tb-ink); font-size: 15px; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.tbp-tile span, .tbp-pt-row span { color: var(--tb-ink-3); font-size: 10px; }
.tbp-pt-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--tb-line); }
.tbp-pt-row:first-child { border-top: 0; }
.tbp-pt-row b { display: block; color: var(--tb-ink); font-size: 11.5px; letter-spacing: -0.01em; }
.tbp-opp { display: grid; gap: 3px; padding: 9px 10px; border: 1.5px solid var(--tb-ink); border-radius: 10px; }
.tbp-opp b { color: var(--tb-ink); font-size: 11.5px; }
.tbp-opp span { color: var(--tb-ink-2); font-size: 10px; }
.tbp-opp-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 2px; }
.tbp-pill { padding: 4px 6px; border-radius: 6px; font: 700 10px/1 var(--font-sans); letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.tbp-pill.tbp-ok { background: #EEF8F0; color: #1B7F3B; }
.tbp-pill.tbp-hold { background: #FFF8DC; color: #7A5C00; }
.tbp-pill.tbp-paid { background: #F0F0ED; color: var(--tb-ink-2); }
.tbp-pill.tbp-open { background: var(--tb-bolt); color: var(--tb-ink); }
.tbp-pill.tbp-no { background: #FDF0EE; color: #B42318; }
/* Preview actions: real buttons that say what the portal would do. */
.tbp-pv { padding: 9px 12px; border: 1.5px solid transparent; border-radius: 8px; font: 700 11px/1 var(--font-sans); cursor: pointer; }
.tbp-pt .tbp-pv { display: block; width: 100%; padding: 11px 10px; font-size: 11.5px; text-align: center; }
.tbp-pv.tbp-y { background: var(--tb-bolt); color: var(--tb-ink); }
.tbp-pv.tbp-k { background: var(--tb-ink); color: #fff; }
.tbp-pv.tbp-o { background: #fff; border-color: var(--tb-ink); color: var(--tb-ink); }
.tbp-toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 70; max-width: min(92vw, 520px); padding: 12px 16px; border-radius: 12px; background: #0B0B0B; color: #fff; font: 500 14px/1.45 var(--font-sans); box-shadow: 0 12px 32px rgba(0, 0, 0, .3); opacity: 0; transform: translateX(-50%); transition: opacity 150ms; pointer-events: none; }
.tbp-toast.tbp-show { opacity: 1; }

/* --- Statistics strip and "How we count these numbers" ------------------- */
.tbp-stats { display: grid; gap: 40px; padding-top: 32px; border-top: 3px solid var(--tb-bolt); }
@media (min-width: 768px) { .tbp-stats { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 767px) { .tbp-stats { gap: 28px; } }
.tbp-stat { display: flex; flex-direction: column; gap: 4px; }
/* DOM order is label then value (what a <dl> requires); the value is drawn first. */
.tbp-stat-num { order: -1; font-size: 64px; font-weight: 800; letter-spacing: -0.05em; line-height: 1; font-variant-numeric: tabular-nums; }
@media (max-width: 1023px) { .tbp-stat-num { font-size: 52px; } }
@media (max-width: 767px) { .tbp-stat-num { font-size: 44px; } }
.tbp-stat-lbl { margin-top: 8px; font-size: 18px; font-weight: 600; }
.tbp-stat-scope { color: var(--tb-ink-3); font-size: 13px; }
.tbp-stats-foot { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px 24px; margin-top: 22px; color: var(--tb-ink-3); font-size: 14px; }
.tbp-how > summary { display: inline-block; margin: -4px 0; padding: 4px 0; color: var(--tb-ink); font: 600 14px/1.4 var(--font-sans); text-decoration: underline; text-underline-offset: 3px; list-style: none; cursor: pointer; }
.tbp-how > summary::-webkit-details-marker { display: none; }
.tbp-how[open] { flex-basis: 100%; }
.tbp-how .tbp-how-h, .tbp-how .tbp-close { display: none; }
.tbp-how-in { display: grid; gap: 16px; padding: 28px; color: var(--tb-ink-2); font-size: 15px; line-height: 1.55; }
.tbp-how[open] .tbp-how-in { margin-top: 14px; border: 1px solid var(--tb-line); border-radius: 16px; background: #fff; }
.tbp-how-in dt { margin-top: 8px; color: var(--tb-ink); font-weight: 700; }
.tbp-how-in dt span { color: var(--tb-ink-3); font-weight: 400; }
.tbp-how-in dd { margin: 4px 0 0; }
.tbp-fresh { padding-top: 12px; border-top: 1px solid var(--tb-line); color: var(--tb-ink-3); font-size: 14px; }
/* base.html zeroes every margin, which also removes the browser's margin: auto that
   centres a modal dialog (it opened at the top-left); the height stays inside the viewport. */
.tbp-sheet, .tbp-chart-dlg { width: 100%; max-height: calc(100% - 32px); margin: auto; padding: 0; overflow: auto; border: 0; border-radius: 16px; background: #fff; color: var(--tb-ink); box-shadow: 0 30px 80px rgba(11, 11, 11, .3); }
.tbp-sheet { max-width: min(92vw, 680px); }
.tbp-chart-dlg { width: min(96vw, 900px); max-width: none; }
.tbp-sheet::backdrop, .tbp-chart-dlg::backdrop { background: rgba(11, 11, 11, .45); }
.tbp-sheet .tbp-how-in { max-height: 80vh; overflow: auto; }
.tbp-sheet h3, .tbp-chart-dlg h3 { margin: 0; color: var(--tb-ink); font-size: 26px; font-weight: 800; line-height: 1.15; letter-spacing: -0.02em; }
.tbp-sheet .tbp-close, .tbp-chart-dlg .tbp-close { justify-self: end; }
.tbp-sheet :focus-visible, .tbp-chart-dlg :focus-visible { outline: 3px solid var(--tb-ink); outline-offset: 3px; border-radius: 4px; }
.tbp-chart-dlg .tbp-dlg-in { display: grid; gap: 16px; padding: 24px; }

/* --- Proof block: the browser frame beside the steps ---------------------- */
.tbp-proof { display: grid; gap: 40px; }
@media (min-width: 1024px) { .tbp-proof { grid-template-columns: 1.15fr 1fr; align-items: center; gap: 64px; } }
.tbp-browser { padding: 8px; overflow: hidden; border-radius: 14px; background: var(--tb-ink); box-shadow: 0 20px 50px rgba(11, 11, 11, .18); }
.tbp-browser-bar { display: flex; gap: 6px; padding: 4px 6px 10px; }
.tbp-browser-bar i { display: block; width: 9px; height: 9px; border-radius: 50%; background: #3a3a3a; }
/* At least v4's 16:13, taller when a pane needs it: the spacer and the demo share one grid
   cell, so the frame never clips its content (the client chart was cut at 1363 x 936). */
.tbp-browser-screen { display: grid; grid-template-columns: minmax(0, 1fr); overflow: hidden; border-radius: 8px; background: #fff; }
.tbp-browser-screen::before { content: ''; grid-area: 1 / 1; padding-top: 81.25%; }
.tbp-browser-screen > * { grid-area: 1 / 1; }
@media (max-width: 767px) { .tbp-browser-screen::before { content: none; } }
.tbp-steps { display: grid; padding: 0; list-style: none; counter-reset: tbp-s; }
.tbp-proof .tbp-steps { margin-top: 26px; }
.tbp-steps li { display: grid; grid-template-columns: 44px 1fr; gap: 16px; padding: 18px 0; border-top: 1px solid var(--tb-line); counter-increment: tbp-s; }
.tbp-steps li:last-child { border-bottom: 1px solid var(--tb-line); }
.tbp-steps li::before { content: counter(tbp-s); font-size: 26px; font-weight: 800; line-height: 1.1; letter-spacing: -0.03em; }
.tbp-steps b { display: block; font-size: 19px; letter-spacing: -0.01em; }
.tbp-steps p { margin-top: 2px; color: var(--tb-ink-2); font-size: 16px; }

/* --- Two ways in, two ways to get paid, what you can rely on -------------- */
.tbp-h-gap { margin-bottom: 44px; }
.tbp-h-gap-sm { margin-bottom: 36px; }
.tbp-ways { display: grid; gap: 40px; }
@media (min-width: 900px) {
  .tbp-ways { grid-template-columns: 1fr 1fr; gap: 0; }
  .tbp-ways > div:first-child { padding-right: 56px; }
  .tbp-ways > div + div { padding-left: 56px; border-left: 1px solid var(--tb-line); }
}
.tbp-way { display: grid; align-content: start; gap: 18px; }
.tbp-lines { display: grid; gap: 10px; padding: 0; list-style: none; color: var(--tb-ink-2); font-size: 17px; }
.tbp-way .tbp-lines li { display: grid; grid-template-columns: 22px 1fr; gap: 10px; }
.tbp-way .tbp-lines li::before { content: ''; width: 14px; height: 14px; margin-top: 6px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M9.5 1.5 3.5 9h4l-1 5.5L12.5 7h-4l1-5.5z' fill='%23FBD700' stroke='%230B0B0B' stroke-width='1.2' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / contain; }
.tbp-lines b { color: var(--tb-ink); }
.tbp-lines.tbp-plain { max-width: 72ch; margin-top: 36px; }
.tbp-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.tbp-alt { color: var(--tb-ink-2); font-size: 15px; }
/* Standalone text links keep a 24px-tall target (WCAG 2.5.8); the equal negative */
.tbp a.tbp-alt, .tbp-alt a, .tbp-company a, .tbp-trust a, .tbp-a a { display: inline-block; margin: -3px 0; padding: 3px 0; }
.tbp-pay { display: grid; gap: 20px; }
@media (min-width: 768px) { .tbp-pay { grid-template-columns: 1fr 1fr; gap: 40px; } }
.tbp-pay > div { display: grid; gap: 8px; padding-top: 16px; border-top: 3px solid var(--tb-ink); }
.tbp-pay > div.tbp-y { border-top-color: var(--tb-bolt); }
.tbp-pay p { color: var(--tb-ink-2); font-size: 17px; }
.tbp-rely { display: grid; gap: 22px; }
@media (min-width: 768px) { .tbp-rely { grid-template-columns: repeat(3, 1fr); gap: 40px; } }
.tbp-rely > div { display: grid; gap: 6px; }
.tbp-rely b { font-size: 19px; letter-spacing: -0.01em; }
.tbp-rely p { color: var(--tb-ink-2); font-size: 16px; }
.tbp-company { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--tb-line); color: var(--tb-ink-2); font-size: 15px; }
.tbp-company b { color: var(--tb-ink); }
.tbp-split { display: grid; gap: 40px; }
@media (min-width: 1024px) { .tbp-split { grid-template-columns: 5fr 7fr; align-items: start; gap: 72px; } }

/* --- The black band: the dark lockup and the last call to action ---------- */
.tbp-band { padding: 88px 0; background: var(--tb-ink); color: #fff; }
@media (max-width: 767px) { .tbp-band { padding: 64px 0; } }
.tbp-band-grid { display: grid; align-items: center; gap: 28px; }
@media (min-width: 900px) { .tbp-band-grid { grid-template-columns: 1fr auto; gap: 48px; } }
.tbp-band img { width: auto; height: 44px; margin-bottom: 26px; }
.tbp-band h2 { color: #fff; }
.tbp-band p { max-width: 44ch; margin-top: 14px; color: rgba(255, 255, 255, .72); font-size: 20px; }
.tbp-band .tb-btn-outline, .tbp-band .tb-btn-outline:hover { color: #fff; }
.tbp-band .tb-btn-outline { border-color: rgba(255, 255, 255, .6); }
.tbp-band .tb-btn-outline:hover { border-color: #fff; background: rgba(255, 255, 255, .08); }

/* --- Joining: the steps and the /join page -------------------------------- */
.tbp-join-steps { display: grid; padding: 0; list-style: none; counter-reset: tbp-j; }
.tbp-join-steps li { display: grid; grid-template-columns: 52px 1fr; gap: 16px; padding: 20px 0; border-top: 1px solid var(--tb-line); counter-increment: tbp-j; }
.tbp-join-steps li:last-child { border-bottom: 1px solid var(--tb-line); }
.tbp-join-steps li::before { content: counter(tbp-j, decimal-leading-zero); padding-top: 6px; color: var(--tb-ink-3); font-size: 15px; font-weight: 700; letter-spacing: .04em; }
.tbp-join-steps b { display: block; font-size: 20px; letter-spacing: -0.015em; }
.tbp-join-steps p { max-width: 62ch; margin-top: 4px; color: var(--tb-ink-2); font-size: 16px; }
.tbp-join-wrap { display: grid; gap: 24px; max-width: 560px; margin: 0 auto; padding: 56px var(--tb-gutter) 80px; }
.tbp-join-wrap h1 { font-size: 44px; }
.tbp-join-opts { display: grid; gap: 12px; }
.tbp-join-opts .tb-btn { justify-content: flex-start; gap: 14px; }
.tbp-join-opts .tb-btn svg { width: 22px; height: 22px; }
.tbp-join-sm { display: grid; gap: 10px; padding: 0; list-style: none; color: var(--tb-ink-2); font-size: 16px; counter-reset: tbp-n; }
.tbp-join-sm li { display: grid; grid-template-columns: 24px 1fr; gap: 10px; }
.tbp-join-sm li::before { content: counter(tbp-n); color: var(--tb-ink); font-weight: 800; counter-increment: tbp-n; }
.tbp-join-alt { display: grid; gap: 8px; padding-top: 16px; border-top: 1px solid var(--tb-line); color: var(--tb-ink-2); font-size: 15px; }
.tbp-join-alt a:not(.tb-btn) { color: var(--tb-ink); }
/* A link standing alone in the row keeps a 24px target (WCAG 2.5.8); the equal negative margin moves nothing. */
.tbp-join-alt a:not(.tb-btn) { display: inline-block; margin: -3px 0; padding: 3px 0; }

/* --- FAQ ------------------------------------------------------------------ */
.tbp-faq { display: grid; border-top: 1px solid var(--tb-line); }
.tbp-faq details { border-bottom: 1px solid var(--tb-line); }
.tbp-faq summary { position: relative; padding: 20px 44px 20px 0; color: var(--tb-ink); font-size: 19px; font-weight: 700; letter-spacing: -0.01em; list-style: none; cursor: pointer; }
.tbp-faq summary::-webkit-details-marker { display: none; }
.tbp-faq summary::after { content: '+'; position: absolute; right: 2px; top: 14px; color: var(--tb-ink); font: 400 30px/1 var(--font-sans); transition: transform 150ms var(--tb-ease); }
.tbp-faq details[open] summary::after { transform: rotate(45deg); }
.tbp-faq .tbp-a { max-width: 68ch; padding: 0 0 22px; color: var(--tb-ink-2); font-size: 17px; }

/* --- The enquiry form ----------------------------------------------------- */
.tbp-contact { display: grid; gap: 40px; }
@media (min-width: 1024px) { .tbp-contact { grid-template-columns: 5fr 7fr; align-items: start; gap: 72px; } }
.tbp-aside { display: grid; align-content: start; gap: 22px; }
.tbp-aside .tbp-note { display: grid; gap: 6px; padding-top: 14px; border-top: 1px solid var(--tb-line); color: var(--tb-ink-2); font-size: 16px; }
.tbp-aside .tbp-note b { color: var(--tb-ink); }
.tbp-form, .tbp-fields { display: grid; gap: 18px; }
.tbp-field { display: grid; gap: 6px; }
.tbp-field label { color: var(--tb-ink); font-size: 15px; font-weight: 700; }
.tbp-field .tbp-opt { color: var(--tb-ink-3); font-weight: 400; }
.tbp-field input, .tbp-field select, .tbp-field textarea { width: 100%; min-height: 54px; padding: 12px 16px; border: 1.5px solid var(--tb-line-2); border-radius: 10px; background: #fff; color: var(--tb-ink); font: 400 17px/1.4 var(--font-sans); transition: border-color 150ms var(--tb-ease); }
.tbp-field textarea { min-height: 136px; resize: vertical; }
.tbp-field select { padding-right: 44px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%230B0B0B' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 16px center; background-size: 16px; -webkit-appearance: none; appearance: none; }
.tbp-field input:hover, .tbp-field select:hover, .tbp-field textarea:hover { border-color: var(--tb-ink-3); }
.tbp-field input:focus, .tbp-field select:focus, .tbp-field textarea:focus { border-color: var(--tb-ink); outline: 3px solid var(--tb-bolt); outline-offset: 1px; }
.tbp-hint { color: var(--tb-ink-3); font-size: 14px; }
.tbp-hint.tbp-avail-note { font-size: 13px; }
.tbp-hint b { color: var(--tb-ink-2); }
.tbp-field.is-error input, .tbp-field.is-error select, .tbp-field.is-error textarea { border-color: #B42318; }
.tbp-err { display: none; color: #B42318; font-size: 14px; }
.tbp-field.is-error .tbp-err { display: block; }
.tbp-form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
.tbp-form-alt { color: var(--tb-ink-2); font-size: 15px; }
.tbp-status { display: none; gap: 8px; padding: 18px 20px; border: 1.5px solid var(--tb-line-2); border-radius: 12px; font-size: 16px; }
.tbp-status.tbp-show { display: grid; }
.tbp-status.tbp-ok { border-color: #1B7F3B; background: #EEF8F0; }
.tbp-status.tbp-warn { border-color: #B58A00; background: #FFF8DC; }
.tbp-status.tbp-bad { border-color: #B42318; background: #FDF0EE; }
.tbp-status b { display: block; color: var(--tb-ink); font-size: 18px; }
.tbp-status .tbp-what { color: var(--tb-ink-2); font-size: 15px; }
.tbp-status .tb-btn { justify-self: start; }
.tbp-form[data-state="success"] .tbp-fields, .tbp-form[data-state="success"] .tbp-form-actions { display: none; }
.tbp-spinner { display: none; width: 16px; height: 16px; border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff; border-radius: 50%; animation: tbp-spin 800ms linear infinite; }
.tbp-form[data-state="sending"] .tbp-spinner { display: inline-block; }
@keyframes tbp-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .tbp-spinner { animation: none; border-style: dotted; } }

/* --- The interactive Views / Earnings chart ------------------------------- */
.tbp-chart { display: grid; gap: 10px; }
.tbp-ctl { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.tbp-seg { display: inline-flex; overflow: hidden; border: 1.5px solid var(--tb-line-2); border-radius: 8px; }
.tbp-seg button { padding: 7px 9px; border: 0; border-right: 1.5px solid var(--tb-line-2); background: #fff; color: var(--tb-ink-2); font: 700 11px/1 var(--font-sans); cursor: pointer; }
.tbp-seg button:last-child { border-right: 0; }
.tbp-seg button[aria-pressed="true"] { background: var(--tb-ink); color: #fff; }
.tbp-seg.tbp-y button[aria-pressed="true"] { background: var(--tb-bolt); color: var(--tb-ink); }
.tbp-cmp { display: inline-flex; align-items: center; gap: 6px; min-height: 24px; color: var(--tb-ink-2); font: 600 11px/1 var(--font-sans); cursor: pointer; }
.tbp-cmp input { position: relative; width: 24px; height: 24px; margin: 0; border: 0; border-radius: 6px; background: none; font-size: 16px; cursor: pointer; -webkit-appearance: none; appearance: none; }
.tbp-cmp input::before { content: ''; position: absolute; inset: 4px; border: 1.5px solid var(--tb-ink); border-radius: 4px; background: #fff; }
.tbp-cmp input:checked::before { background: var(--tb-ink); }
.tbp-cmp input:checked::after { content: ''; position: absolute; left: 9px; top: 6px; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.tbp-cmp input:focus-visible { outline: 3px solid var(--tb-ink); outline-offset: 0; }
.tbp-sum { display: grid; gap: 2px; }
.tbp-sum b { color: var(--tb-ink); font-size: 22px; font-weight: 800; line-height: 1; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.tbp-sum span { color: var(--tb-ink-3); font-size: 11px; }
.tbp-delta { font-weight: 700; }
.tbp-delta.tbp-up { color: #1B7F3B; }
.tbp-delta.tbp-down { color: #B42318; }
.tbp-plot { position: relative; border-radius: 8px; outline: none; cursor: crosshair; touch-action: pan-y; }
.tbp-plot:focus-visible { outline: 3px solid var(--tb-ink); outline-offset: 2px; }
.tbp-chart svg { display: block; width: 100%; height: auto; }
.tbp-tip { position: absolute; z-index: 2; display: none; padding: 6px 8px; border-radius: 6px; background: var(--tb-ink); color: #fff; font: 600 11px/1.35 var(--font-sans); white-space: nowrap; pointer-events: none; transform: translate(-50%, -110%); }
.tbp-tip.tbp-show { display: block; }
.tbp-tip small { display: block; color: rgba(255, 255, 255, .75); font-weight: 500; }
.tbp-foot { display: flex; justify-content: space-between; color: var(--tb-ink-3); font-size: 10.5px; }
.tbp-tag-ill { justify-self: start; padding: 4px 6px; border-radius: 5px; background: #FFF8DC; color: #7A5C00; font: 700 10px/1 var(--font-sans); letter-spacing: .05em; text-transform: uppercase; }
.tbp-link { padding: 0; border: 0; background: none; color: var(--tb-ink); font: 600 11px/1 var(--font-sans); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.tbp-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* No script: the default view stays as text (total, dates, label). */
html:not(.js) .tbp-ctl, html:not(.js) .tbp-plot { display: none; }
.tbp-chart.tbp-sm { gap: 5px; }
.tbp-chart.tbp-sm .tbp-sum b { font-size: 20px; }
.tbp-chart.tbp-sm .tbp-sum span, .tbp-chart.tbp-sm .tbp-foot { font-size: 10px; }
.tbp-chart.tbp-lg .tbp-sum b { font-size: 34px; }
.tbp-chart.tbp-lg .tbp-seg button { padding: 10px 13px; font-size: 13px; }
.tbp-chart.tbp-lg .tbp-cmp, .tbp-chart.tbp-lg .tbp-foot { font-size: 13px; }
.tbp-chart.tbp-lg .tbp-sum span { font-size: 14px; }
/* In the phone: must fit a 156–218 px screen without widening it. */
.tbp-pt .tbp-ctl { gap: 4px 5px; }
.tbp-pt .tbp-seg button { min-height: 24px; padding: 7px 6px; font-size: 9.5px; }
.tbp-pt .tbp-chart svg { height: 50px; }
.tbp-pt .tbp-tag-ill { padding: 3px 5px; font-size: 8.5px; letter-spacing: .03em; }
.tbp-pt .tbp-link { display: inline-flex; align-items: center; min-height: 24px; padding: 0 2px; font-size: 10px; }
.tbp-pt .tbp-foot { font-size: 9.5px; }

/* --- The Editor / Client demo in the browser frame ------------------------ */
.tbp-demo { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; min-width: 0; max-width: 100%; height: 100%; color: var(--tb-ink-2); font: 500 12px/1.35 var(--font-sans); }
.tbp-demo [data-mode-pane] { min-width: 0; max-width: 100%; }
.tbp-demo-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--tb-line); }
.tbp-demo-top img { width: auto; height: 18px; }
.tbp-modes { display: inline-flex; overflow: hidden; border: 1.5px solid var(--tb-line-2); border-radius: 8px; }
.tbp-modes button { padding: 7px 10px; border: 0; background: #fff; color: var(--tb-ink-2); font: 700 11px/1 var(--font-sans); cursor: pointer; }
.tbp-modes button + button { border-left: 1.5px solid var(--tb-line-2); }
.tbp-modes button[aria-pressed="true"] { background: var(--tb-ink); color: #fff; }
.tbp-tabs { display: flex; gap: 2px; min-width: 0; max-width: 100%; padding: 0 16px; border-bottom: 1px solid var(--tb-line); }
.tbp-tabs button { flex: none; margin-bottom: -1px; padding: 10px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--tb-ink-3); font: 700 11.5px/1 var(--font-sans); white-space: nowrap; cursor: pointer; }
.tbp-tabs button[aria-selected="true"] { border-bottom-color: var(--tb-bolt); color: var(--tb-ink); }
.tbp-pane { display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 12px; padding: 14px 16px; overflow: auto; }
.tbp-pane[hidden] { display: none; }
/* 1.33em is the browser default v4's h4s keep; base.html zeroes every margin, so it is set here. */
.tbp-demo h4 { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 1.33em 0; color: var(--tb-ink); font-size: 15px; letter-spacing: -0.02em; }
.tbp-demo h4 span { padding: 5px 8px; border: 1px solid var(--tb-line-2); border-radius: 999px; color: var(--tb-ink); font: 600 9.5px/1 var(--font-sans); letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.tbp-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding-top: 8px; border-top: 2px solid var(--tb-bolt); }
.tbp-tiles.tbp-k { border-top-color: var(--tb-ink); }
.tbp-tiles > div { display: grid; gap: 2px; }
.tbp-tiles b { color: var(--tb-ink); font-size: 19px; font-weight: 800; line-height: 1; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.tbp-tiles span { color: var(--tb-ink-3); font-size: 10px; }
.tbp-prog { display: grid; gap: 8px; }
.tbp-prog > div { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; font-size: 11px; }
.tbp-prog i, .tbp-budget i { position: relative; display: block; overflow: hidden; height: 8px; border-radius: 5px; background: var(--tb-tint); }
.tbp-prog i { grid-column: 1 / -1; }
.tbp-prog i::after, .tbp-budget i::after { content: ''; position: absolute; inset: 0; width: var(--w, 40%); border-radius: 5px; background: var(--tb-ink); }
.tbp-prog i.tbp-y::after { background: var(--tb-bolt); }
.tbp-budget { display: grid; align-content: start; gap: 6px; }
.tbp-budget i { height: 10px; border-radius: 6px; }
.tbp-list { display: grid; }
.tbp-list > div, .tbp-list > button { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 10px; width: 100%; padding: 7px 0; border: 0; border-top: 1px solid var(--tb-line); background: none; color: inherit; font: inherit; font-size: 11px; text-align: left; }
.tbp-list > button { cursor: pointer; }
.tbp-list > button[aria-pressed="true"] { margin: 0 -8px; padding-left: 8px; padding-right: 8px; border-radius: 6px; background: var(--tb-tint); }
.tbp-list > [hidden] { display: none; }
.tbp-list b { color: var(--tb-ink); font-weight: 600; }
.tbp-list small { display: block; color: var(--tb-ink-3); font-size: 10px; }
.tbp-list .tbp-n { color: var(--tb-ink); font-variant-numeric: tabular-nums; }
.tbp-demo .tbp-pill { font-size: 9.5px; }
.tbp-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.tbp-filters button { padding: 6px 9px; border: 1.5px solid var(--tb-line-2); border-radius: 999px; background: #fff; color: var(--tb-ink-2); font: 700 10px/1 var(--font-sans); cursor: pointer; }
.tbp-filters button[aria-pressed="true"] { border-color: var(--tb-ink); background: var(--tb-ink); color: #fff; }
.tbp-detail { display: grid; gap: 4px; padding: 10px 12px; border: 1.5px solid var(--tb-ink); border-radius: 10px; font-size: 11px; }
.tbp-detail[hidden] { display: none; }
.tbp-detail b { color: var(--tb-ink); font-size: 12px; }
.tbp-dact { display: flex; flex-wrap: wrap; gap: 8px; }
.tbp-dnote { color: var(--tb-ink-3); font-size: 10.5px; }
.tbp-status-row { display: inline-flex; align-items: center; gap: 6px; color: var(--tb-ink-2); font-size: 11px; }
.tbp-status-row i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: #1B7F3B; }
.tbp-demo .tbp-chart svg { height: 100px; }
@media (max-width: 767px) {
  .tbp-tiles { grid-template-columns: repeat(2, 1fr); }
  .tbp-demo-top { flex-wrap: wrap; }
  .tbp-tabs { overflow-x: auto; }
}

/* PUBLIC CHROME — public-website-redesign M3' */

/* --- Skip link: the first focusable element on every public page ---------- */
.tb-skip {
  position: fixed;
  left: 16px;
  top: -80px;
  z-index: 200;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--tb-ink);
  color: #fff;
  font: 700 15px/1.2 var(--font-sans);
  text-decoration: none;
}
.tb-skip:hover { color: #fff; }
.tb-skip:focus { top: 12px; }
.tb-skip:focus-visible { outline: 3px solid var(--tb-bolt); outline-offset: 2px; }

/* Header */
.tb-site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--tb-paper);
  border-bottom: 1px solid transparent;
  color: var(--tb-ink);
  font-family: var(--font-sans);
  transition: border-color var(--motion-base) var(--tb-ease);
}
.tb-site-header.is-scrolled { border-bottom-color: var(--tb-line); }
.tb-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: var(--tb-container);
  height: var(--tb-header-h);
  margin: 0 auto;
  padding: 0 var(--tb-gutter);
}

/* The lockup's file carries the logo's clear space in its viewBox, so a 40 px */
.tb-logo {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
  border-radius: 4px;
}
.tb-logo img { display: block; height: 40px; width: auto; max-width: none; }
.tb-logo .tb-logo-mark { display: none; }

.tb-nav { display: none; align-items: center; gap: 20px; }
.tb-nav a,
.tb-nav a:hover { color: var(--tb-ink); }
.tb-nav a {
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color var(--motion-fast) var(--tb-ease);
}
.tb-nav a:hover,
.tb-nav a[aria-current="page"] { border-bottom-color: var(--tb-bolt); }

.tb-header-actions { display: flex; align-items: center; gap: 12px; }

/* The notification bell partial is shared with the dashboards and draws its */
.tb-header-actions #notif-bell > button { --text-secondary: var(--tb-ink-2); }

.tb-menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1.5px solid var(--tb-ink);
  border-radius: 10px;
  background: transparent;
  color: var(--tb-ink);
  cursor: pointer;
}
.tb-menu-btn svg { display: block; width: 22px; height: 22px; }
.tb-menu-btn .tb-x,
.tb-menu-btn[aria-expanded="true"] .tb-bars { display: none; }
.tb-menu-btn[aria-expanded="true"] .tb-x { display: block; }

@media (min-width: 1280px) {
  .tb-header-row { max-width: 1320px; }
  .tb-nav { display: flex; }
  .tb-menu-btn { display: none; }
}
@media (max-width: 767px) {
  .tb-logo img { height: 32px; }
  .tb-logo .tb-logo-lockup { display: none; }
  .tb-logo .tb-logo-mark { display: block; }
  /* Log in moves into the menu and the footer; the primary action stays. */
  .tb-header-actions .tb-btn-ghost { display: none; }
}
/* v4's smallest-phone rule: the primary action and the menu keep their place. */
@media (max-width: 380px) {
  .tb-header-actions .tb-btn-sm { padding-left: 12px; padding-right: 12px; font-size: 14px; }
}

/* Header offset */
.tb-header-offset { display: block; height: 12px; }
.tb-header-offset:focus { outline: none; }
@media (max-width: 768px) {
  .tb-header-offset { height: 16px; }
}
@media (max-width: 767px) {
  .tb-header-offset { height: 4px; }
}

/* In-flow header (M4') */
.tb-site-header[data-flow] { position: sticky; }
.tb-site-header[data-flow] ~ .tb-header-offset { height: 0; }

/* --- Mobile menu: a disclosure panel docked under the header -------------- */
.tb-mobile-menu {
  position: fixed;
  /* + 1px: the header's own hairline sits below its --tb-header-h box. */
  top: calc(var(--tb-header-h) + 1px);
  left: 0;
  right: 0;
  z-index: 99;
  max-height: calc(100vh - var(--tb-header-h) - 1px);
  max-height: calc(100dvh - var(--tb-header-h) - 1px);
  overflow-y: auto;
  padding: 8px 0 20px;
  background: var(--tb-paper);
  border-bottom: 1px solid var(--tb-line);
  box-shadow: 0 18px 36px rgba(11, 11, 11, 0.14);
  font-family: var(--font-sans);
}
.tb-mobile-menu[hidden] { display: none; }
.tb-mobile-menu > a,
.tb-mobile-menu > a:hover { color: var(--tb-ink); }
.tb-mobile-menu > a {
  display: block;
  padding: 14px var(--tb-gutter);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.25;
  text-decoration: none;
}
.tb-mobile-menu > a:hover { background: var(--tb-tint); }
/* M5a (spec v4 §4.1): the current page is marked in the panel too (aria-current
 * from nav.html) with the same 2 px bolt rule the inline links carry. */
.tb-mobile-menu > a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-color: var(--tb-bolt);
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}
.tb-mobile-menu .tb-cta-row { display: grid; gap: 10px; padding: 12px var(--tb-gutter) 0; }
@media (min-width: 1100px) {
  .tb-mobile-menu { display: none !important; }
}
/* No script: the panel can never open, so its links are drawn in the flow under
 * the header and the button that could not work is hidden. */
@media (max-width: 1099px) {
  html:not(.js) .tb-mobile-menu[hidden] {
    display: block;
    position: static;
    max-height: none;
    margin-top: calc(var(--tb-header-h) + 1px);
    box-shadow: none;
  }
  html:not(.js) .tb-menu-btn { display: none; }
  /* An in-flow header already sits above the panel. */
  html:not(.js) .tb-site-header[data-flow] ~ .tb-mobile-menu[hidden] { margin-top: 0; }
}

/* --- Buttons: yellow = editors & clippers, black = projects --------------- */
.tb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 54px;
  padding: 0 26px;
  border: 1.5px solid transparent;
  border-radius: 10px;
  font: 700 17px/1 var(--font-sans);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--motion-fast) var(--tb-ease),
              border-color var(--motion-fast) var(--tb-ease),
              color var(--motion-fast) var(--tb-ease),
              transform var(--motion-fast) var(--tb-ease);
}
.tb-btn:active { transform: scale(0.98); }
.tb-btn-yellow,
.tb-btn-yellow:hover { color: var(--tb-on-bolt); }
.tb-btn-yellow { background: var(--tb-bolt); }
.tb-btn-yellow:hover { background: var(--tb-bolt-hi); }
.tb-btn-black,
.tb-btn-black:hover { color: #fff; }
.tb-btn-black { background: var(--tb-ink); }
.tb-btn-black:hover { background: #262626; }
.tb-btn-outline,
.tb-btn-outline:hover { color: var(--tb-ink); }
.tb-btn-outline { background: transparent; border-color: var(--tb-ink); }
.tb-btn-outline:hover { background: var(--tb-tint); }
.tb-btn-ghost,
.tb-btn-ghost:hover { color: var(--tb-ink); }
.tb-btn-ghost {
  padding: 0 12px;
  background: transparent;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.tb-btn-sm { min-height: 46px; padding: 0 18px; font-size: 15px; }
.tb-btn-lg { min-height: 60px; padding: 0 30px; font-size: 18px; }
.tb-btn[aria-disabled="true"] { opacity: .6; cursor: progress; }
.tb-btn .tb-bolt {
  flex: none;
  width: 18px;
  height: 18px;
  transition: transform var(--motion-fast) var(--tb-ease);
}
@media (hover: hover) {
  .tb-btn:hover .tb-bolt { transform: translate(1px, -1px); }
}

/* --- Focus: 3 px ink ring on white (v2 §3), yellow inside dark panels ------ */
.tb-site-header :focus-visible,
.tb-mobile-menu :focus-visible,
footer.landing-footer :focus-visible {
  outline: 3px solid var(--tb-ink);
  outline-offset: 3px;
  border-radius: 4px;
}
.tb-site-header #notif-panel :focus-visible { outline-color: var(--tb-bolt); }

/* --- Footer ---------------------------------------------------------------- */
footer.landing-footer {
  position: relative;
  z-index: 1;
  padding: 40px 0 36px;
  border-top: 1px solid var(--tb-line);
  background: var(--tb-paper);
  color: var(--tb-ink-2);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
}
footer.landing-footer .tb-footer-inner {
  max-width: var(--tb-container);
  margin: 0 auto;
  padding: 0 var(--tb-gutter);
}
footer.landing-footer .tb-footer-grid { display: grid; gap: 24px; }
@media (min-width: 768px) {
  footer.landing-footer .tb-footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; }
}
footer.landing-footer .tb-footer-brand img { display: block; height: 30px; width: auto; margin: 0 0 12px; }
footer.landing-footer .tb-footer-brand p { max-width: 36ch; margin: 0; }
footer.landing-footer .footer-col { display: grid; gap: 6px; align-content: start; }
footer.landing-footer .footer-col-label {
  margin: 0 0 4px;
  color: var(--tb-ink);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
footer.landing-footer a,
footer.landing-footer .footer-col a {
  display: inline-block;
  min-height: 24px;
  padding: 3px 0;
  color: var(--tb-ink-2);
  font-size: 15px;
  text-decoration: none;
}
footer.landing-footer a:hover,
footer.landing-footer .footer-col a:hover { color: var(--tb-ink); text-decoration: underline; }
footer.landing-footer .tb-footer-legal {
  margin: 28px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--tb-line);
  color: var(--tb-ink-3);
  font-size: 14px;
}
/* M4': v4's one-line footer on /join. */
footer.landing-footer .tb-footer-legal.tb-footer-legal--slim { margin: 0; padding-top: 0; border-top: 0; }

/* --- Print: the page, without the site chrome ------------------------------
 * legal_base.html hid `#main-nav` in print; the header now wraps that element,
 * so the whole chrome is hidden here to keep the printed documents clean. */
@media print {
  .tb-skip,
  .tb-site-header,
  .tb-mobile-menu { display: none !important; }
}
