/* ============================================================
   TITANS — components.css
   All primitives: buttons, cards, badges, inputs, tabs,
   modals/slideovers, toasts, KPI, tables, video cards, etc.
   ============================================================ */

/* ============================================================
   Brand mark + wordmark
   ============================================================ */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-ui);
  font-weight: 700;
  letter-spacing: -0.025em;
  font-size: 16px;
  color: var(--text);
}
.brand:hover .brand-mark { transform: scale(1.06); }
.brand:hover .brand-mark::after { animation: pulse-ring 2s var(--ease) infinite; }

.brand-mark {
  width: 24px; height: 24px; border-radius: 6px;
  background: var(--accent); color: var(--accent-text);
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-ui); font-weight: 800; font-size: 14px;
  letter-spacing: -0.04em; line-height: 1;
  position: relative; flex-shrink: 0;
  transition: transform var(--t-base) var(--ease);
}
.brand-mark::after {
  content: ''; position: absolute; inset: 0; border-radius: 6px; pointer-events: none;
}
.brand-admin-pill {
  font-family: var(--font-mono); font-size: 9px; font-weight: 600;
  letter-spacing: 0.1em; padding: 2px 6px; border-radius: 3px;
  background: var(--accent-soft); color: var(--accent);
}

/* ============================================================
   Button
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 14px; border-radius: var(--r-2);
  font-family: var(--font-ui); font-size: 13px; font-weight: 500;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast), transform var(--t-fast);
  position: relative;
}
.btn:hover { background: var(--card-hover); }
.btn:active { transform: scale(0.98); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; pointer-events: none; }
.btn svg { width: 14px; height: 14px; flex-shrink: 0; }

/* sizes */
.btn-xs { height: 24px; padding: 0 8px; font-size: 11px; gap: 4px; border-radius: var(--r-1); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12px; }
.btn-md { height: 36px; padding: 0 14px; }
.btn-lg { height: 44px; padding: 0 18px; font-size: 14px; }

/* variants */
.btn-primary {
  background: var(--accent); color: var(--accent-text); font-weight: 600;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), 0 0 0 0 var(--accent-glow);
  transition: background var(--t-fast), box-shadow var(--t-base);
}
.btn-primary:hover { background: var(--accent-hover); box-shadow: inset 0 1px 0 rgba(255,255,255,0.18), 0 4px 24px var(--accent-glow); }
.btn-primary:active { background: var(--accent-deep); }

.btn-secondary {
  background: transparent; color: var(--text); border-color: var(--line);
}
.btn-secondary:hover { background: var(--card); border-color: var(--line); }

.btn-ghost {
  background: transparent; color: var(--text-dim);
}
.btn-ghost:hover { background: var(--card); color: var(--text); }

.btn-danger {
  background: var(--bad-soft); color: var(--bad); border-color: transparent;
}
.btn-danger:hover { background: rgba(255,94,87,0.18); }

.btn-link {
  background: transparent; color: var(--accent); padding: 0; height: auto; border: 0;
}
.btn-link:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 3px; }

.btn-icon { width: 36px; padding: 0; }
.btn-icon.btn-sm { width: 30px; }
.btn-icon.btn-xs { width: 24px; }

/* discord oauth */
.btn-discord {
  background: #5865F2; color: white; font-weight: 600;
}
.btn-discord:hover { background: #4752D3; }

/* loading */
.btn-loading { pointer-events: none; }
.btn-loading > * { opacity: 0; }
.btn-loading::after {
  content: ''; position: absolute; width: 14px; height: 14px;
  border: 1.5px solid currentColor; border-top-color: transparent;
  border-radius: 50%; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   Card
   ============================================================ */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  padding: 16px;
}
.card-tight { padding: 12px; }
.card-loose { padding: 24px; }

.card-elevate {
  transition: transform var(--t-base) var(--ease), border-color var(--t-base) var(--ease), background var(--t-base) var(--ease);
}
.card-elevate:hover { transform: translateY(-1px); border-color: var(--accent-soft); }

.card-interactive {
  cursor: pointer;
  transition: transform var(--t-base) var(--ease), border-color var(--t-base) var(--ease), background var(--t-base) var(--ease);
}
.card-interactive:hover { transform: translateY(-1px); border-color: var(--accent); background: var(--card-hover); }

/* ============================================================
   Badge
   ============================================================ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  height: 20px; padding: 0 8px; border-radius: 10px;
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase;
  white-space: nowrap;
  flex-shrink: 0; max-width: 100%; overflow: hidden;
}
.badge-xs { height: 16px; padding: 0 5px; font-size: 9px; letter-spacing: 0.02em; }
.badge-md { height: 24px; padding: 0 10px; font-size: 11px; }

.badge-accent  { background: var(--accent-soft); color: var(--accent); }
.badge-good    { background: var(--good-soft);   color: var(--good); }
.badge-warn    { background: var(--warn-soft);   color: var(--warn); }
.badge-bad     { background: var(--bad-soft);    color: var(--bad); }
.badge-info    { background: var(--info-soft);   color: var(--info); }
.badge-neutral { background: var(--card-hover);  color: var(--text-dim); }
.badge-new     { background: rgba(255,255,255,0.06); color: var(--text-dim); letter-spacing: 0.04em; }

.badge-solid.badge-accent { background: var(--accent); color: var(--accent-text); }
.badge-solid.badge-bad    { background: var(--bad);    color: #fff; }
.badge-solid.badge-good   { background: var(--good);   color: #06140d; }

/* trending pulse */
.badge-trending {
  background: var(--accent-soft); color: var(--accent);
  position: relative; overflow: hidden;
}
.badge-trending::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, var(--accent-glow), transparent);
  animation: shimmer-bar 2.4s linear infinite;
  background-size: 200% 100%;
}

/* live dot */
.live-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--bad);
  animation: pulse-red 1.5s ease-out infinite;
  flex-shrink: 0;
}
.live-dot-green { background: var(--good); animation: pulse-dot 1.6s ease-in-out infinite; }

/* ============================================================
   Input / Select / Textarea
   ============================================================ */
.input, .select, .textarea {
  display: flex; align-items: center;
  height: 36px; width: 100%; padding: 0 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-2);
  color: var(--text); font-size: 13px;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--line); background: var(--card-hover); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); background: var(--card); outline: none; }
.input-mono { font-family: var(--font-mono); font-size: 12px; }
.input-error { border-color: var(--bad); }
.input-error:focus { border-color: var(--bad); }

.textarea { height: auto; padding: 10px 12px; line-height: 1.5; resize: vertical; min-height: 80px; }
.select { appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2384848f' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; }

.input-group { position: relative; }
.input-group .input { padding-left: 32px; }
.input-group .input-icon {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  width: 14px; height: 14px; color: var(--muted); pointer-events: none;
}
.input-group .input-suffix {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  color: var(--muted); font-family: var(--font-mono); font-size: 11px;
}

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 11px; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.field .help { font-size: 11px; color: var(--muted); }
.field .error { font-size: 11px; color: var(--bad); }

/* checkbox + radio */
.checkbox, .radio {
  appearance: none; width: 14px; height: 14px;
  border: 1px solid var(--line); background: var(--card);
  border-radius: 3px; cursor: pointer; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all var(--t-fast);
}
.radio { border-radius: 50%; }
.checkbox:hover, .radio:hover { border-color: var(--accent); }
.checkbox:checked, .radio:checked { background: var(--accent); border-color: var(--accent); }
.checkbox:checked::after {
  content: ''; width: 8px; height: 8px;
  background: url("data:image/svg+xml,%3Csvg width='10' height='10' viewBox='0 0 10 10' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2 5l2 2 4-4' stroke='%230a0a0f' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat;
}
.radio:checked::after { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--accent-text); }

/* toggle */
.toggle {
  appearance: none; width: 32px; height: 18px; border-radius: 9px;
  background: var(--line); border: 1px solid var(--line); cursor: pointer;
  position: relative; flex-shrink: 0;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.toggle::after {
  content: ''; position: absolute; top: 1px; left: 1px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--text); transition: transform var(--t-fast);
}
.toggle:checked { background: var(--accent); border-color: var(--accent); }
.toggle:checked::after { transform: translateX(14px); background: var(--accent-text); }

/* ============================================================
   Tabs
   ============================================================ */
.tabs {
  display: flex; align-items: center; gap: 0;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
}
.tab {
  position: relative;
  padding: 10px 14px;
  color: var(--muted); font-size: 13px; font-weight: 500;
  cursor: pointer; white-space: nowrap;
  transition: color var(--t-fast);
}
.tab:hover { color: var(--text-dim); }
.tab.is-active { color: var(--text); }
.tab.is-active::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -1px;
  height: 2px; background: var(--accent); border-radius: 1px 1px 0 0;
}
.tab-count {
  margin-left: 6px;
  font-family: var(--font-mono); font-size: 10px;
  padding: 1px 5px; border-radius: 3px;
  background: var(--card-hover); color: var(--muted);
}
.tab.is-active .tab-count { background: var(--accent-soft); color: var(--accent); }

/* pill tabs (mobile) */
.tabs-pill {
  display: inline-flex; gap: 2px; padding: 3px;
  background: var(--card); border: 1px solid var(--line); border-radius: 8px;
}
.tabs-pill .tab { padding: 6px 12px; border-radius: 5px; }
.tabs-pill .tab.is-active { background: var(--card-hover); color: var(--text); }
.tabs-pill .tab.is-active::after { display: none; }

/* ============================================================
   Chip / Filter chip
   ============================================================ */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 10px;
  background: rgba(255,255,255,0.06); border: 1px solid var(--line-soft); border-radius: 14px;
  font-family: var(--font-ui); font-size: 12px; color: var(--text-dim);
  transition: all var(--t-fast);
  cursor: pointer; white-space: nowrap;
}
.chip:hover { color: var(--text); border-color: var(--line); }
.chip.is-active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.chip svg { width: 12px; height: 12px; }
.chip-close {
  display: inline-flex; align-items: center; justify-content: center;
  width: 14px; height: 14px; border-radius: 50%; margin-left: 2px; margin-right: -4px;
  background: transparent; transition: background var(--t-fast);
}
.chip-close:hover { background: rgba(255,255,255,0.08); }

/* filter dropdown trigger */
.filter-chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 10px 0 12px;
  background: rgba(255,255,255,0.06); border: 1px solid var(--line-soft); border-radius: var(--r-2);
  font-family: var(--font-ui); font-size: 12px; color: var(--text-dim);
  cursor: pointer; white-space: nowrap;
  transition: all var(--t-fast);
}
.filter-chip:hover { background: var(--card-hover); color: var(--text); border-color: var(--line); }
.filter-chip.has-value,
.filter-chip.is-active { color: var(--accent); border-color: var(--accent-soft); background: var(--accent-soft); }
.filter-chip .label { color: var(--muted); }
.filter-chip svg { width: 10px; height: 10px; opacity: 0.7; }

/* ============================================================
   KPI card
   ============================================================ */
.kpi {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
}
.kpi-label {
  font-size: 10px; font-weight: 500; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted);
  display: flex; align-items: center; gap: 6px;
}
.kpi-value {
  margin-top: 6px;
  font-family: var(--font-ui); font-size: 28px; font-weight: 700;
  letter-spacing: -0.025em; line-height: 1.1; font-variant-numeric: tabular-nums;
}
.kpi-delta {
  margin-top: 6px;
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
}
.kpi-delta.up { color: var(--good); }
.kpi-delta.down { color: var(--bad); }
.kpi-delta.flat { color: var(--muted); }
.kpi-spark {
  position: absolute; bottom: 0; left: 0; right: 0; height: 28px;
  opacity: 0.6; pointer-events: none;
}

/* ============================================================
   Data table
   ============================================================ */
.dt-wrap { border: 1px solid var(--line); border-radius: var(--r-3); overflow: hidden; background: var(--card); }
.dt { width: 100%; border-collapse: collapse; font-size: 13px; }
.dt thead th {
  height: 32px; padding: 0 12px;
  background: var(--bg-soft); border-bottom: 1px solid var(--line);
  text-align: left; font-weight: 500; font-size: 11px;
  letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted);
  position: sticky; top: 0; z-index: 1; user-select: none;
}
.dt thead th.sortable { cursor: pointer; }
.dt thead th.sortable:hover { color: var(--text); }
.dt thead th.sortable::after {
  content: ''; display: inline-block; width: 8px; height: 8px; margin-left: 4px;
  background: url("data:image/svg+xml,%3Csvg width='8' height='8' viewBox='0 0 8 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2 3l2-2 2 2M2 5l2 2 2-2' stroke='%2384848f' stroke-width='1' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat;
  opacity: 0; transition: opacity var(--t-fast);
}
.dt thead th.sortable:hover::after { opacity: 1; }

.dt tbody td {
  height: var(--row-h);
  padding: 0 12px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
  color: var(--text-dim);
}
.dt tbody tr { transition: background var(--t-fast); }
.dt tbody tr:hover { background: var(--card-hover); }
.dt tbody tr.is-selected { background: var(--accent-soft); }
.dt tbody tr.is-selected td:first-child { box-shadow: inset 2px 0 0 var(--accent); }
.dt td.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--text); text-align: right; }
.dt td.handle { color: var(--text); font-weight: 500; }

/* ============================================================
   Video card (centerpiece)
   ============================================================ */
.vcard {
  display: flex; flex-direction: column; gap: 8px;
  cursor: pointer;
}
.vcard-thumb {
  position: relative; aspect-ratio: 9 / 16;
  border-radius: var(--r-3); overflow: hidden;
  border: 1px solid var(--line);
  background: var(--card);
  transition: transform var(--t-base) var(--ease), border-color var(--t-base) var(--ease);
}
.vcard:hover .vcard-thumb { transform: translateY(-2px); border-color: var(--accent); }
.vcard:active .vcard-thumb { transform: scale(0.995); }

.vcard-thumb-img {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
}
/* gradient thumbnail content */
.vcard-thumb-art {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, hsl(var(--niche-color, var(--niche-supplements)) / 0.95) 0%, hsl(var(--niche-color, var(--niche-supplements)) / 0.7) 60%, hsl(var(--niche-color, var(--niche-supplements)) / 0.4) 100%);
}
.vcard-thumb-art::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 20%, rgba(255,255,255,0.1), transparent 50%);
}
.vcard-thumb-art-text {
  font-family: var(--font-mono); font-size: 11px; font-weight: 500;
  letter-spacing: 0.05em; text-transform: uppercase;
  color: rgba(255,255,255,0.85);
  padding: 0 16px; text-align: center;
  position: relative; z-index: 1;
  text-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
.vcard-play {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(10,10,15,0.5); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255,255,255,0.15);
  opacity: 0; transition: opacity var(--t-base);
}
.vcard:hover .vcard-play { opacity: 1; }
.vcard-play svg { width: 14px; height: 14px; color: white; margin-left: 2px; }

.vcard-duration {
  position: absolute; bottom: 8px; right: 8px;
  font-family: var(--font-mono); font-size: 10px; font-weight: 500;
  padding: 2px 6px; border-radius: 3px;
  background: rgba(10,10,15,0.7); backdrop-filter: blur(4px);
  color: white;
}

.vcard-badges-top {
  position: absolute; top: 8px; left: 8px; right: 8px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 4px;
  z-index: 2; pointer-events: none;
}
.vcard-badges-top .badge-xs { font-size: 8px; padding: 0 5px; }
.vcard-bookmark {
  position: absolute; top: 8px; right: 8px; z-index: 3;
  width: 28px; height: 28px; border-radius: 6px;
  background: rgba(10,10,15,0.5); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  color: white; opacity: 0;
  transition: opacity var(--t-base), background var(--t-fast), transform var(--t-fast);
  border: 1px solid rgba(255,255,255,0.12);
}
.vcard:hover .vcard-bookmark { opacity: 1; }
.vcard-bookmark.is-saved { opacity: 1; color: var(--accent); }
.vcard-bookmark.is-saved svg { fill: currentColor; }
.vcard-bookmark:hover { background: rgba(10,10,15,0.75); }
.vcard-bookmark.bookmark-pop { animation: save-pop 280ms var(--ease); }

.vcard-stats {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 24px 10px 10px;
  background: linear-gradient(to top, rgba(10,10,15,0.92) 0%, rgba(10,10,15,0.6) 50%, transparent 100%);
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-mono); font-size: 10px; font-weight: 500;
  color: rgba(255,255,255,0.92);
  pointer-events: none;
}
.vcard-stats .stat { display: inline-flex; align-items: center; gap: 4px; }
.vcard-stats svg { width: 11px; height: 11px; }

.vcard-meta {
  display: flex; flex-direction: column; gap: 4px;
  padding: 0 2px;
}
.vcard-creator-row {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text);
}
.vcard-creator-row .verified { color: var(--info); width: 12px; height: 12px; }
.vcard-time { color: var(--muted); margin-left: auto; font-family: var(--font-mono); font-size: 10px; }
.vcard-niche-row {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--muted);
}
.vcard-price { font-family: var(--font-mono); color: var(--text-dim); font-weight: 500; }
.vcard-gmv {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 11px;
  color: var(--text);
}
.vcard-gmv .gmv-label { color: var(--muted); }
.vcard-gmv .gmv-value { font-weight: 600; font-variant-numeric: tabular-nums; }
.vcard-gmv .gmv-delta { color: var(--good); font-weight: 500; }
.vcard-gmv .gmv-delta.down { color: var(--bad); }

/* density variants */
.vgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}
.vgrid-cols-3 { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.vgrid-cols-5 { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.vgrid-cols-5 .vcard-meta { font-size: 11px; }
.vgrid-cols-5 .vcard-creator-row { font-size: 11px; }
.vgrid-cols-3 .vcard-meta { font-size: 13px; gap: 6px; }
.vgrid-cols-3 .vcard-creator-row { font-size: 13px; }

@media (max-width: 1024px) {
  .vgrid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}
@media (max-width: 640px) {
  .vgrid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .vgrid-cols-5, .vgrid-cols-3 { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   Avatar
   ============================================================ */
.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--font-ui); font-weight: 600; font-size: 13px;
  color: white; flex-shrink: 0; user-select: none;
  letter-spacing: -0.01em;
  position: relative;
  overflow: hidden;
}
.avatar-sm  { width: 28px; height: 28px; font-size: 11px; }
.avatar-xs  { width: 20px; height: 20px; font-size: 9px; }
.avatar-lg  { width: 56px; height: 56px; font-size: 18px; }
.avatar-xl  { width: 64px; height: 64px; font-size: 20px; }
.avatar-xxl { width: 120px; height: 120px; font-size: 36px; }
.avatar-verified::after {
  content: ''; position: absolute; right: -2px; bottom: -2px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--info) url("data:image/svg+xml,%3Csvg width='10' height='10' viewBox='0 0 10 10' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2 5l2 2 4-4' stroke='%23fff' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/12px no-repeat;
  border: 2px solid var(--bg);
}

/* ============================================================
   Creator card (compact)
   ============================================================ */
.ccard {
  display: flex; gap: 12px; padding: 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-3);
  cursor: pointer;
  transition: all var(--t-base) var(--ease);
}
.ccard:hover { border-color: var(--accent-soft); background: var(--card-hover); transform: translateY(-1px); }
.ccard-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.ccard-handle { font-size: 13px; font-weight: 500; color: var(--text); display: flex; align-items: center; gap: 4px; }
.ccard-stats { font-size: 11px; color: var(--muted); font-family: var(--font-mono); }
.ccard-meta { font-size: 11px; color: var(--text-dim); }
.ccard-gmv {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(255,255,255,0.06); color: var(--text);
  font-family: var(--font-mono); font-size: 10px; font-weight: 600;
  padding: 2px 6px; border-radius: 4px;
  margin-top: 2px; align-self: flex-start;
}

/* ============================================================
   Product card
   ============================================================ */
.pcard {
  display: flex; gap: 12px; padding: 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-3);
}
.pcard-img {
  width: 80px; height: 80px; border-radius: var(--r-2); flex-shrink: 0;
  background: var(--card-hover);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.pcard-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.pcard-title { font-size: 13px; font-weight: 500; color: var(--text); line-height: 1.3; }
.pcard-meta { font-size: 11px; color: var(--muted); font-family: var(--font-mono); }

/* ============================================================
   Live ticker (slim, app-only)
   ============================================================ */
.ticker {
  position: sticky; top: 0; z-index: 60;
  height: var(--ticker-h);
  background: var(--bg);
  border-bottom: 1px solid var(--line-soft);
  overflow: hidden;
  display: flex; align-items: center;
}
.ticker-track {
  display: flex; gap: 32px;
  white-space: nowrap;
  animation: scroll-ticker 60s linear infinite;
  padding-left: 24px;
  align-items: center;
  will-change: transform;
}
.ticker:hover .ticker-track,
.ticker-track:hover { animation-play-state: paused; }
.ticker-item {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono); font-size: 11px;
  color: var(--muted); letter-spacing: 0.01em;
}
.ticker-item .accent { color: var(--muted); font-weight: 500; }
.ticker-item .dot { display: none; }
.ticker-sep { color: var(--faint); flex-shrink: 0; }

/* ============================================================
   Scroll progress
   ============================================================ */
.scroll-progress {
  position: fixed; top: 0; left: 0; right: 0;
  height: 1px; background: transparent; z-index: 100;
  pointer-events: none;
}
.scroll-progress-bar {
  height: 100%; width: var(--progress, 0%);
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
  transition: width 80ms linear;
}

/* ============================================================
   Marketing nav
   ============================================================ */
.mkt-nav {
  position: sticky; top: 0; z-index: 50;
  height: var(--nav-h);
  background: rgba(10,10,15,0.78);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line-soft);
}
.mkt-nav-inner {
  display: flex; align-items: center; gap: 32px;
  height: 100%; max-width: var(--max-mkt); margin: 0 auto; padding: 0 24px;
}
.mkt-nav-links {
  display: flex; align-items: center; gap: 4px;
}
.mkt-nav-link {
  padding: 6px 12px; border-radius: var(--r-2);
  font-size: 13px; color: var(--text-dim); font-weight: 500;
  transition: color var(--t-fast), background var(--t-fast);
}
.mkt-nav-link:hover { color: var(--text); background: var(--card); }
.mkt-nav-link.is-active { color: var(--text); }
.mkt-nav-ctas { margin-left: auto; display: flex; align-items: center; gap: 8px; }

@media (max-width: 768px) {
  .mkt-nav-links { display: none; }
}

/* ============================================================
   App shell: top nav + sidebar
   ============================================================ */
.app-shell { display: flex; min-height: 100vh; }
.app-sidebar {
  width: var(--sidebar-w);
  background: var(--bg);
  border-right: 1px solid var(--line-soft);
  padding: 12px 8px 16px;
  display: flex; flex-direction: column; gap: 4px;
  flex-shrink: 0;
  position: sticky; top: var(--ticker-h);
  height: calc(100vh - var(--ticker-h));
  overflow-y: auto;
}
.app-sidebar-section {
  padding: 12px 8px 6px;
  font-size: 10px; font-weight: 600; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted);
}
.app-sidebar-item {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  height: 32px; padding: 0 10px;
  border-radius: var(--r-2);
  font-size: 13px; color: var(--text-dim);
  transition: all var(--t-fast);
  cursor: pointer;
}
.app-sidebar-item:hover { background: var(--card); color: var(--text); }
.app-sidebar-item.is-active { background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.app-sidebar-item.is-active::before {
  content: ''; position: absolute; left: 0; top: 6px; bottom: 6px; width: 2px;
  background: var(--accent); border-radius: 0 2px 2px 0;
}
.app-sidebar-item svg { width: 16px; height: 16px; flex-shrink: 0; }
.app-sidebar-item .count {
  margin-left: auto; font-family: var(--font-mono); font-size: 10px;
  color: var(--muted); padding: 1px 6px; border-radius: 3px;
  background: var(--card-hover);
}
.app-sidebar-item.is-active .count { background: var(--accent); color: var(--accent-text); }

.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.app-topnav {
  position: sticky; top: var(--ticker-h); z-index: 40;
  height: var(--app-nav-h);
  background: rgba(15,15,21,0.85);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-soft);
  display: flex; align-items: center; gap: 16px;
  padding: 0 24px;
}

.app-search {
  flex: 1; max-width: 480px;
  display: flex; align-items: center; gap: 8px;
  height: 32px; padding: 0 12px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-2);
  cursor: pointer; transition: all var(--t-fast);
  font-family: var(--font-mono); font-size: 12px; color: var(--muted);
}
.app-search > svg { width: 13px; height: 13px; flex-shrink: 0; }
.app-search:hover { background: var(--card-hover); border-color: var(--line); color: var(--text-dim); }
.app-search .kbd { margin-left: auto; }

.kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 3px;
  background: var(--card-hover); border: 1px solid var(--line); border-bottom-width: 2px;
  font-family: var(--font-mono); font-size: 10px; font-weight: 500; color: var(--muted);
  line-height: 1;
}

@media (max-width: 1024px) {
  .app-sidebar { width: 56px; padding: 12px 6px; }
  .app-sidebar-item span:not(.count) { display: none; }
  .app-sidebar-section { display: none; }
  .app-sidebar-item .count { display: none; }
  .app-sidebar .brand span:not(.brand-mark) { display: none; }
}
@media (max-width: 768px) {
  .app-sidebar { display: none; }
  .app-topnav { padding: 0 16px; }
}

/* ============================================================
   Modal / SlideOver
   ============================================================ */
.scrim {
  position: fixed; inset: 0; background: var(--overlay);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  z-index: 200;
  animation: fade-in 200ms var(--ease) both;
}

.modal {
  position: fixed; left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 80px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-4);
  z-index: 201;
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
  display: flex; flex-direction: column;
  animation: modal-in 200ms var(--ease) both;
}
.modal-sm { width: min(400px, calc(100vw - 32px)); }
.modal-lg { width: min(720px, calc(100vw - 32px)); }
.modal-xl { width: min(1040px, calc(100vw - 32px)); }

.modal-head, .so-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.modal-title { font-size: 15px; font-weight: 600; }
.modal-body, .so-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-foot, .so-foot {
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
  padding: 12px 20px; border-top: 1px solid var(--line); flex-shrink: 0;
}

.so {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(640px, 100vw);
  background: var(--bg-soft);
  border-left: 1px solid var(--line);
  z-index: 201;
  display: flex; flex-direction: column;
  animation: slide-in-right 240ms var(--ease) both;
  box-shadow: -24px 0 64px rgba(0,0,0,0.4);
}

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: var(--r-2);
  color: var(--muted);
  transition: all var(--t-fast);
}
.icon-btn:hover { background: var(--card-hover); color: var(--text); }
/* Default SVG size guards — prevent icons from rendering full-width when un-sized.
   Only applies to icons in chrome — explicit class/inline sizing overrides this. */
.btn > svg,
.icon-btn > svg,
.app-sidebar-item > svg,
.app-search > svg,
.tweaks-fab > svg,
.queue-icon > svg,
.feature-card-icon > svg,
.paywall-lock > svg,
.cmdk-item .icon > svg,
.mobile-tabbar-item > svg,
.input-group > svg,
.input-icon { width: 14px; height: 14px; flex-shrink: 0; }

.vcard-stats svg { width: 11px; height: 11px; }
.kpi-spark svg, svg.sparkline { width: 100%; height: 28px; }

.icon-btn svg { width: 14px; height: 14px; }

/* ============================================================
   Toast
   ============================================================ */
.toast-stack {
  position: fixed; bottom: 16px; right: 16px; z-index: 300;
  display: flex; flex-direction: column-reverse; gap: 8px;
  max-width: 360px;
  pointer-events: none;
}
.toast {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-3);
  padding: 10px 14px;
  display: flex; align-items: center; gap: 10px;
  font-size: 13px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.4);
  animation: slide-in-bottom 260ms var(--ease) both;
  pointer-events: auto;
}
.toast.good { border-color: var(--good-soft); }
.toast.good .toast-icon { color: var(--good); }
.toast.bad { border-color: var(--bad-soft); }
.toast.bad .toast-icon { color: var(--bad); }
.toast.warn { border-color: var(--warn-soft); }
.toast.warn .toast-icon { color: var(--warn); }
.toast.accent { border-color: var(--accent-soft); }
.toast.accent .toast-icon { color: var(--accent); }
.toast-icon { width: 16px; height: 16px; flex-shrink: 0; }
.toast.is-out { animation: fade-out 260ms var(--ease) forwards; }
@keyframes fade-out { to { opacity: 0; transform: translateY(8px); } }

/* ============================================================
   Tooltip
   ============================================================ */
[data-tt] { position: relative; }
[data-tt]::after {
  content: attr(data-tt);
  position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  padding: 4px 8px; border-radius: 4px;
  background: var(--text); color: var(--bg);
  font-family: var(--font-mono); font-size: 10px; font-weight: 500;
  white-space: nowrap; pointer-events: none;
  opacity: 0; transition: opacity var(--t-fast);
  z-index: 100;
}
[data-tt]:hover::after { opacity: 1; }

/* ============================================================
   Skeleton
   ============================================================ */
.skeleton {
  background: linear-gradient(90deg, var(--card) 0%, var(--card-hover) 30%, var(--card-hover) 50%, var(--card) 100%);
  background-size: 200% 100%;
  animation: shimmer-bar 1.4s linear infinite;
  border-radius: var(--r-2);
}
.skeleton-vcard { aspect-ratio: 9/16; border-radius: var(--r-3); }

/* ============================================================
   Empty state
   ============================================================ */
.empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 48px 24px; text-align: center; gap: 12px;
}
.empty-art {
  width: 96px; height: 96px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 8px;
  opacity: 0.7;
}
.empty-title { font-size: 14px; font-weight: 600; color: var(--text); }
.empty-sub { font-size: 12px; color: var(--muted); max-width: 320px; }

/* ============================================================
   Bottom tab bar (mobile)
   ============================================================ */
.mobile-tabbar {
  display: none;
  position: fixed; left: 0; right: 0; bottom: 0;
  height: 56px;
  background: var(--bg-soft);
  border-top: 1px solid var(--line);
  z-index: 50;
  align-items: stretch; padding-bottom: env(safe-area-inset-bottom, 0);
}
.mobile-tabbar-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; color: var(--muted); font-size: 10px;
  transition: color var(--t-fast); min-height: 44px;
}
.mobile-tabbar-item svg { width: 18px; height: 18px; }
.mobile-tabbar-item.is-active { color: var(--accent); }
.mobile-tabbar-item:active { background: var(--card-hover); }
@media (max-width: 768px) {
  .mobile-tabbar { display: flex; }
  body.has-tabbar { padding-bottom: 56px; }
}

/* ============================================================
   Tweaks panel
   ============================================================ */
.tweaks-fab {
  position: fixed; bottom: 16px; right: 16px; z-index: 150;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--card); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-dim);
  transition: all var(--t-base);
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.tweaks-fab:hover { background: var(--card-hover); color: var(--accent); transform: scale(1.04); }
.tweaks-fab svg { width: 16px; height: 16px; }

.tweaks-panel {
  position: fixed; bottom: 64px; right: 16px; z-index: 151;
  width: 280px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-3);
  padding: 14px;
  display: flex; flex-direction: column; gap: 12px;
  box-shadow: 0 16px 48px rgba(0,0,0,0.5);
  animation: fade-in-up 200ms var(--ease) both;
}
.tweaks-panel h3 {
  margin: 0; font-size: 11px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted);
}
.tweaks-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  font-size: 12px;
}
.tweaks-row > .label { color: var(--text-dim); }
.tweaks-seg {
  display: inline-flex; padding: 2px; background: var(--bg-soft);
  border: 1px solid var(--line); border-radius: var(--r-2);
}
.tweaks-seg button {
  padding: 4px 8px; font-size: 11px; color: var(--muted); border-radius: 3px;
  font-family: var(--font-mono);
  transition: all var(--t-fast);
}
.tweaks-seg button.is-active { background: var(--accent-soft); color: var(--accent); }
.tweaks-swatches {
  display: inline-flex; gap: 6px;
}
.tweaks-swatch {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--t-fast);
}
.tweaks-swatch:hover { transform: scale(1.1); }
.tweaks-swatch.is-active { border-color: var(--text); transform: scale(1.1); }

.tweaks-reset {
  border-top: 1px solid var(--line); padding-top: 10px;
  font-size: 11px; color: var(--muted); text-align: center;
}
.tweaks-reset:hover { color: var(--accent); }

/* ============================================================
   Command palette
   ============================================================ */
.cmdk {
  position: fixed; left: 50%; top: 80px;
  transform: translateX(-50%);
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 160px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-3);
  z-index: 201;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
  display: flex; flex-direction: column;
  animation: modal-in 160ms var(--ease) both;
  overflow: hidden;
}
.cmdk-input {
  height: 48px;
  border: 0; border-bottom: 1px solid var(--line);
  border-radius: 0; padding: 0 18px;
  background: transparent;
  font-family: var(--font-mono); font-size: 13px; color: var(--text);
}
.cmdk-input:focus { border-color: var(--line); background: transparent; outline: none; }
.cmdk-section {
  padding: 8px 8px 4px;
  font-size: 10px; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--muted);
}
.cmdk-list { overflow-y: auto; padding: 4px 4px 8px; }
.cmdk-item {
  display: flex; align-items: center; gap: 10px;
  height: 36px; padding: 0 12px;
  border-radius: var(--r-2);
  font-size: 13px; color: var(--text-dim);
  cursor: pointer;
}
.cmdk-item.is-focus, .cmdk-item:hover { background: var(--accent-soft); color: var(--accent); }
.cmdk-item .icon { width: 14px; height: 14px; flex-shrink: 0; opacity: 0.7; }
.cmdk-item .label { flex: 1; }
.cmdk-item .meta { font-size: 11px; color: var(--muted); font-family: var(--font-mono); }
.cmdk-item .hint { margin-left: auto; }
.cmdk-item.is-focus .meta { color: var(--accent); }

/* ============================================================
   Footer
   ============================================================ */
.footer {
  border-top: 1px solid var(--line-soft);
  padding: 56px 0 32px;
  background: var(--bg);
}
.footer-grid {
  display: grid; gap: 32px;
  grid-template-columns: 1.5fr repeat(4, 1fr);
}
.footer-col h4 {
  margin: 0 0 12px; font-size: 11px; font-weight: 600;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}
.footer-col a {
  display: block; padding: 4px 0;
  font-size: 13px; color: var(--text-dim);
  transition: color var(--t-fast);
}
.footer-col a:hover { color: var(--text); }
.footer-bottom {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-top: 48px; padding-top: 24px;
  border-top: 1px solid var(--line-soft);
  color: var(--muted); font-size: 12px;
}
@media (max-width: 900px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

/* ============================================================
   Misc helpers used across pages
   ============================================================ */
.divider { height: 1px; background: var(--line); }
.dot-sep { color: var(--faint); padding: 0 2px; }
.code {
  font-family: var(--font-mono); font-size: 11px;
  padding: 2px 6px; border-radius: 3px;
  background: var(--card-hover); color: var(--text-dim);
  border: 1px solid var(--line);
}
.glow-border { box-shadow: 0 0 0 1px var(--accent), 0 0 24px var(--accent-glow); }
.accent-glow-text { color: var(--accent); text-shadow: 0 0 24px var(--accent-glow); }


/* Ticker killed site-wide */
.ticker, #ticker { display: none !important; }
